解锁多语言洞察力:使用 Python、LangChain 和 Vector Database 翻译数据集

news2024/11/24 10:01:05

作者:来自 Elastic Jessica Garson

将数据集从一种语言翻译成另一种语言可能是一种强大的工具。你可以深入了解以前可能无法获得的数据集,例如检测新的模式或趋势。使用 LangChain,你可以获取数据集并将其翻译成你选择的语言。翻译数据集后,你可以使用 Elastic 的向量数据库来获取见解。

这篇博文将引导你了解如何使用 Pandas 将数据加载到 DataFrame 中,使用 LangChain 将数据从一种语言翻译成另一种语言,将翻译后的数据加载到 Elasticsearch 中,并使用 Elastic 的向量数据库功能了解有关数据集的更多信息。此示例的完整代码可在 Search Labs GitHub 存储库中找到。

设置

为你的 OpenAI API 密钥配置环境变量

首先,你需要为你的 OpenAI API 密钥配置环境变量,你可以在 OpenAI 开发者门户的 API 密钥页面上找到该变量。你需要此 API 密钥才能使用 LangChain。你可以在 LangChain 快速入门指南中找到有关入门的更多信息。

Mac/Unix:

export OPENAI_API_KEY="your_api_key"

Windows:

setx OPENAI_API_KEY "your_api_key"

设置 Elasticsearch

此演示使用 Elasticsearch 8.15 版,但你可以使用任何高于 8.0 的 Elasticsearch 版本。如果你是新手,请查看我们的 Elasticsearch 快速入门以及有关 LangChain 与 Elasticsearch 集成的文档。

Python 版本

使用的 Python 版本是 Python 3.12.1,但你可以使用任何高于 3.9 的 Python 版本。

安装所需的软件包

你将使用的软件包如下:

  • Jupyter Notebooks 用于以交互方式处理数据集。
  • nest_asyncio 用于异步执行以处理数据集。
  • pandas 用于数据操作和清理所用数据集。
  • 要集成自然语言处理功能,你将使用 LangChain 库。
  • 要使用 Elasticsearch,你将使用 Elasticsearch Python Client 连接到 Elasticsearch。
  • langchain-elasticsearch 包允许 LangChain 和 Elasticsearch 之间进行额外的交互。
  • 你需要安装 TikToken 包,该包用于将文本分解为可管理的部分,以便有效地进行进一步处理。
  • datasets 包将允许你轻松使用来自 Hugging Face 的数据集。

你可以在终端中运行以下命令来安装此博客文章所需的软件包。

pip install jupyter pandas langchain nest_asyncio langchain-elasticsearch langchain-openai tiktoken elasticsearch datasets

数据集

使用的数据集是西班牙语新闻文章的集合,称为 DACSA 语料库。以下是数据集的示例:

你需要通过 Hugging Face 进行身份验证才能使用此数据集。你首先需要创建一个 token。当你在第一步安装 datasets 包时,huggingface-cli 已安装。

完成后,你可以从命令行登录,如下所示:

huggingface-cli login

如果你还没有 token,系统将提示你从命令行界面创建一个。

加载 Jupyter Notebook

你需要加载 Jupyter Notebook 以交互方式处理数据。为此,你可以在终端中运行以下命令。

jupyter notebook

在右上角,你可以选择 “New” 来创建一个新的 Jupyter Notebook。

将数据集的一列从西班牙语翻译成英语

本节中的代码将首先将数据集中的数据加载到 Pandas DataFrame 中,并创建仅包含 25 条记录的数据集子集。数据集准备就绪后,你可以设置一个角色,让你的模型充当翻译器,并创建一个事件循环,将数据集的一列从西班牙语翻译成英语。

正在使用的子集只有 25 条记录,以避免达到 OpenAI 的速率限制。如果你使用的是较大的数据集,则可能需要使用批量加载。

导入包

在 Jupyter Notebook 中,你首先需要导入以下包,包括 asyncio(允许你使用异步函数)和 openai(用于处理来自 OpenAI 的模型)。

import pandas as pd
import asyncio
from langchain_core.documents import Document
import openai
import nest_asyncio
from langchain.text_splitter import CharacterTextSplitter

此外,你还需要导入以下包,其中还包括 getpass(用于保证你的机密安全和 functools,这将有助于创建事件循环来翻译你的数据集)。

from langchain_elasticsearch import ElasticsearchStore
from langchain_openai import OpenAIEmbeddings
import elasticsearch
import getpass
from functools import partial
from datasets import load_dataset

在此代码示例中,你将创建一个事件循环,这将允许你使用 nest_asyncio 一次转换数据集的多个行。事件循环是 asyncio 的核心构造,它们在线程内运行并将执行线程内的所有任务。在创建事件循环之前,你首先需要运行以下代码行。

nest_asyncio.apply()

加载数据集

你可以创建一个名为 ds 的变量,该变量会加载西班牙语的 ELiRF/dacsa 数据集。稍后,你将在这篇博文中翻译此数据集。此数据集包含加泰罗尼亚语和西班牙语的文章,但对于这篇博文,你将仅使用西班牙语的记录。

ds = load_dataset("ELiRF/dacsa", "spanish", token=True)
ds

输出将显示可用的不同数据集、每个数据集有哪些列以及有多少行。

DatasetDict({
    train: Dataset({
        features: ['id', 'summary', 'article'],
        num_rows: 1802919
    })
    validation: Dataset({
        features: ['id', 'summary', 'article'],
        num_rows: 104052
    })
    test.i: Dataset({
        features: ['id', 'summary', 'article'],
        num_rows: 104052
    })
    test.ni: Dataset({
        features: ['id', 'summary', 'article'],
        num_rows: 109626
    })
})

现在数据已加载,你可以将其转换为 Pandas DataFrame,以便于使用。由于此数据集包含近 2000 行,因此你可以创建数据集样本,使其更小,以适合本博文。

def parse_data(ds):
    df = ds['train'].to_pandas()
    return df.sample(n=25)

你现在可以查看数据集的前 5 行,以确保所有内容都已正确加载。

subset_df.head()

输出应如下所示:

从一种语言翻译成另一种语言

你需要创建一个异步函数来创建事件循环,以便无缝地翻译数据。由于你将使用 GPT-4o,因此你需要设置一个角色来告诉你的模型充当翻译,另一个角色指示将你的数据从西班牙语翻译成英语。你将翻译数据集中两个指定列的数据,并将包含翻译数据的新列添加回原始数据集。

async def translate_text(text):
    document = Document(page_content=text)
    loop = asyncio.get_event_loop()
    response = await loop.run_in_executor(
        None,
        partial(
            openai.chat.completions.create,
            model="gpt-4o",
            messages=[
                {"role": "system", "content": "You are a translator."},
                {"role": "user", "content": f"Translate the following text to English: {document.page_content}"}
            ]
        )
    )
    translated_text = response.choices[0].message.content.strip()
    return translated_text

async def translate_dataframe(df, column_name1, column_name2):
    tasks_column1 = [translate_text(text) for text in df[column_name1]]
    tasks_column2 = [translate_text(text) for text in df[column_name2]]

    translated_texts1 = await asyncio.gather(*tasks_column1)
    translated_texts2 = await asyncio.gather(*tasks_column2)

    df['translated_' + column_name1] = translated_texts1
    df['translated_' + column_name2] = translated_texts2

    return df

最后,你可以运行事件循环并翻译数据集的指定列。此数据集现在将具有标题为 “translated_summary” 和 “translated_article” 的列,其中包含已加载的摘要和文章的翻译。

loop = asyncio.get_event_loop()
loop.run_until_complete(translate_dataframe(subset_df, 'summary', 'article'))

为了确认你的数据已被翻译,你可以再次运行 head.() 方法。

subset_df.head()

现在你将看到一个名为 translated_summary 的新列,其中包含摘要的翻译,另一个名为 translated_article 的列包含文章从西班牙语到英语的翻译。

将翻译后的文章加载到向量数据库中并进行搜索

向量数据库可让你快速找到类似的数据。它存储向量嵌入,这是一种向量数据表示,可将单词、句子和其他数据转换为数字,以捕捉其含义和关系。在本节中,你将学习如何将数据加载到 Elasticsearch 向量数据库中,并对新翻译的数据集执行搜索。

向 Elasticsearch 进行身份验证

现在,你可以使用 Elasticsearch Python 客户端与 Elasticsearch 建立安全连接。你需要传入 Elasticsearch 主机和端口以及 API 密钥。

es_client = elasticsearch.Elasticsearch(
    getpass.getpass("Host: "),
    api_key=getpass.getpass("API Key: "),
)

创建索引

在将数据加载到向量数据库之前,你必须创建索引。首先,你将创建一个变量来命名你的索引。然后,检查是否存在索引。如果已经存在索引,它将删除你的索引并允许你创建一个新索引而不会出现错误。

index_name = "vs-post-data"

if es_client.indices.exists(index=index_name):
    es_client.indices.delete(index=index_name)
    print(f"Deleted existing index: {index_name}")

es_client.indices.create(index=index_name)
print(f"Created new index: {index_name}")

添加嵌入

嵌入利用机器学习模型将文本转换为数字,让你可以执行向量搜索。你还必须设置索引以用作向量数据库。

此时,你需要将嵌入变量设置为 OpenAI Embeddings。你还需要将使用的模型指定为 text-embedding-3-large。

embedding = OpenAIEmbeddings(model="text-embedding-3-large")
elastic_vector_search = ElasticsearchStore(
    index_name="vs-post-data",
    es_connection=es_client,
    embedding=embedding,
)

加载数据

此时,你需要将翻译后的数据加载到 Python 列表中,这样你就可以将数据加载到向量数据库中。你可以使用 LangChain 库将字符转换为文本,然后从那里将数据加载到向量数据库中。我之所以选择这种方法,是因为它能够通过将文本拆分成较小的块来处理长文档,有助于有效管理内存和处理能力,而且你可以控制文本的拆分方式。

translated_texts = subset_df['translated_articles'].tolist()
combined_text = "\n".join(translated_texts)
text_splitter = CharacterTextSplitter(chunk_size=5000, chunk_overlap=50)
docs = text_splitter.split_documents([Document(page_content=combined_text)])

elastic_vector_search.add_documents(docs)

执行搜索

你现在可以询问有关数据的问题,例如 “What happened in Spain?” 你现在可以从数据集中获得与你的问题类似的结果。

query = "What happened in Spain?"

results = elastic_vector_search.similarity_search(query)
results

你得到的输出应类似于以下内容:

[Document(page_content='Day 6 (Thursday): Cloudy in the Pyrenees, with partly cloudy conditions in other areas clearing up later. Precipitation is not ruled out in northern Huesca. Minimum temperatures will mostly remain unchanged; maximum temperatures will rise in Zaragoza and northeast Teruel, with no significant changes elsewhere. West winds light to moderate, shifting to moderate southeast winds.\nIf President Pedro Sánchez does not recognize interim president Juan Guaidó after the 8-day ultimatum given to Nicolás Maduro to call for elections, it could jeopardize Spanish investments in Venezuela that total more than 41 billion euros. Spain is the primary foreign investor in Venezuela, and both the capital of its most emblematic companies and the properties of Spanish residents could be lost if Maduro remains in power, similar to what happened with the Cuban revolution, where Spaniards could not recover their investments. Venezuelan financial economists Rosana Sosa García and Boris Ackerman published a report this Monday on the local digital portal La Patilla, warning of the dangers to Spanish investments in Venezuela if Pedro Sánchez does not recognize the newly proclaimed interim president of the country. The non-recognition of Guaidó as "interim president" of Venezuela represents "a potential danger" for Spain and the European Union as a whole. The analysts reminded that the recent inclusion of the Venezuelan crisis on the agenda of the United Nations Security Council gave the issue global significance. They pointed out that any commercial or financial transactions involving state assets or other operations with Maduro and his regime lack legitimacy from the time of interim president Guaidó\'s swearing-in on January 23.\n\nRosa Sosa, who resides in Spain, stated that Guaidó\'s swearing-in was "dismissed at first by the Spanish government led by Sánchez but was not ignored by significant countries like England." She cited the example of the Bank of England, which legally rejected the repatriation of 1.2 billion dollars in gold requested by Maduro, who has been usurping the presidency since January 10. The Spanish Ministry of Commerce estimates that there are about a hundred companies established in Venezuela, such as BBVA, Repsol, Acciona, and others, representing direct Spanish investments amounting to 21.313 billion euros by the end of 2015. Economist Sosa notes that the socialist government of Pedro Sánchez "is jeopardizing the heritage of companies that generate direct jobs inside and outside of Spain." It similarly endangers the assets of Spaniards (individuals) who have investments in Venezuela, not only due to the decrease in their value but also due to the paralysis caused by the legal vacuum in which everyone is currently immersed.\n\n"The biggest losers in the catastrophe facing Venezuela are not the IBEX companies; it\'s the ordinary citizens, and the assessment of these losses becomes more necessary," Sosa affirms. Spanish residents and their descendants in Venezuela have suffered enormous property losses that surpass the decline in investments of large companies. If the Spanish population in Venezuela is estimated at over 415,000 inhabitants and the average personal wealth is calculated at 50,000 euros, including real estate and homes, "the loss would therefore exceed 20 billion euros, coinciding with the decline in the value of large companies\' investments." This loss is reflected in the devaluation of their homes and real estate, and the complete depreciation of productive assets, the report adds.'),
 Document(page_content='The current situation in Venezuela presents "a completely impoverished population living in dire conditions, without medicine, without food, and perhaps with the worst public services in the Western world. Spaniards residing or owning properties in Venezuela are not exempt from this situation; in fact, they are one of the populations most affected by the crisis." The transition to democracy will be the only path for hundreds of thousands of Spaniards to recover their assets in Venezuela.\nThe longest lunar eclipse in a hundred years is a wonderful phenomenon that can be seen with the naked eye throughout Spain. The Moon rises in the sky tinged with vivid reddish and orange hues, which is why it is called the "Blood Moon" or "Fire Moon," as it passes through the shadow cast by the planet Earth. To witness the eclipse, simply look up at the sky and find the Moon. The lunar eclipse will last for more than three hours, during which the Moon will be at least partially covered by Earth\'s shadow. However, the most spectacular phase, the total phase, when the Moon is completely tinted red, will extend for one hour and almost 43 minutes, a record time that will not be surpassed this century. Generally, this can be observed in Spain starting from 9:00 PM at the earliest, although it is recommended to start watching from 10:00 PM, when the Moon will be visible in the sky. Until 11:00 PM, the Moon will appear reddened, and from that moment on, it will begin to emerge from the shadow zone and its disc will gradually regain its whitish brightness. Around midnight, the entire lunar disc will have its usual color. Interestingly, if the Moon appears red and not darker, it is due to a phenomenon known as Rayleigh scattering, by which the Earth\'s atmosphere scatters light and filters out blue and violet colors. Those who cannot enjoy the night sky today can follow it live from Namibia through the "Sky-live.tv" channel. Those who can go outside and want to enjoy the eclipse more deeply have a golden opportunity in Madrid. Starting at 10:00 PM, the Madrid Planetarium and La Caixa Foundation, in collaboration with the Madrid Astronomical Association (AAM), will offer a public observation session with telescopes on the planetarium\'s esplanade, with free access.'),
 Document(page_content='The shortage of funds is not the only problem humanitarian agencies face. Damascus has decided to deny visas to UN and NGO workers operating in the country, Ging confirmed on Monday. "We have pending visas for numerous international workers from Western countries —such as the United States, Canada, the United Kingdom, France, and one or two more countries— who are being denied visas because of their nationalities," explained the UN official. "This is something to which we strongly oppose, and we are working with the Syrian government to resolve it," he added.\n\nGing also warned of a possible food crisis in the country. Two UN agencies, the World Food Programme and the FAO —the Food and Agriculture Organization of the United Nations—, have estimated that the country\'s wheat harvest would decrease by 700,000 tons this year. Syria consumes between four and five million tons of wheat per year and has had to import grain for over six years to meet the needs of its citizens. "We must be prepared to address this," declared Ging. In June, the United Nations provided food rations to 500,000 people and hopes to increase this number to 850,000 this month.\nThe session has been anything but calm. It promised to be so in the morning. And not just calm, but also positive. The Spanish selective index even surpassed the 10,500-point level. This was likely helped by the Bank of Spain\'s announcement that Spain\'s GDP grew by 0.4% in the first quarter. Additionally, there was a debt auction conducted by the Treasury. Over three years, it sold 1,348 million euros with an average return of 1.022%, below the previous 1.331%. Over five years, it issued 1,570 million euros with an average return of 1.663%, below the previous 1.869%. Over ten years, it sold 2.6 billion euros with a return of 3.059%, lower than the previous 3.291%. However, it began to falter after twelve-thirty, which is when it dropped below 10,500 points. The decline continued especially after three in the afternoon when the indicator started drifting, eventually falling below 10,400 points and marking a daily low under 10,350 points. The cause of the declines: Ukraine. The Ukrainian government\'s activity against pro-Russians has reactivated, and meanwhile, the Russian government responded by announcing new maneuvers. From that minimum level, the indicator began a recovery, ending the day at 10,462 points, a revaluation of 0.36%. In the end, what was supposed to be a calm and positive session turned into a quite volatile day. The Spanish selective index performed worse than Italy\'s Ftse Mib and France’s Cac 40, which gained 0.66% and 0.64% respectively, but better than Germany\'s Dax, which only rose by 0.05%. This occurred despite Germany publishing the Ifo index, which measures confidence in the German economy. It rose from 110.7 to 111.2 points, when experts expected it to settle at 110.5 points. Additionally, it increased due to better expectations: in that chapter, the indicator rose from 106.4 to 107.3 points, compared to the 105.8 points that analysts expected. In the evaluation of the current situation, it rose from 115.2 to 115.3 points, when experts expected it to be 115.7 points. Only one index ended in the red: Lisbon\'s PSI-20, which fell by 0.11%. \n\nBoost from the United States\nThe final recovery in Europe had to do with the behavior of the American stock market. There, indices, especially the Nasdaq, which gained around one percentage point, were celebrating the good results from Facebook and Apple and were moving upwards. Among the economic indicators of the day in the United States, the durable goods orders data was very good: they rose by 2.6% in March, above the 2% that analysts expected and higher than the 2.1% growth the previous month. Orders for durable goods excluding transportation rose by 2%, above the 0.6% that analysts expected. Excluding defense, they rose by 1.8%, below the 3% estimated by analysts. More durable goods orders indicate a boost to industrial production. The weekly unemployment data was somewhat worse, rising by 329,000 people, above the 310,000 expected by analysts. Additionally, the Kansas Fed\'s activity index fell from 22 to 12 points.'),
 Document(page_content='In the Spanish selective index, Sabadell led the gains with a revaluation of 2.78%. IAG followed, advancing by 1.64%. Técnicas Reunidas, FCC, and BBVA also advanced more than one percentage point. Among the major stocks, Santander and Telefónica also stood out, rising by 0.74% and 0.62% respectively. Inditex and Iberdrola rose around 0.35%. On the other hand, Gamesa was the worst performer, dropping by 2.12%. Following it were CaixaBank, Dia, Sacyr, Bankinter, and Jazztel, which fell by more than one percentage point. Bankia and Popular’s losses were close to 1%. In the Madrid General Stock Index, Amper led the gains with a revaluation of 5.26%. Following it was Codere, which also gained more than 5%. Barón de Ley and Liberbank gained more than three percentage points. In red, the worst performer was Inypsa, with a decline of 9.09%.\n\nSale of practically all bonds\nIn the debt market, the yield of all bonds rose. This means that yesterday, investors sold debt to buy stocks. The yield on the Spanish bond rose from 3.05% to 3.08%. The yield on the Italian bond rose from 3.09% to 3.12%. The yield on the German bond rose from 1.52% to 1.53%. With this behavior, Spain\'s risk premium barely increased from 153 to 155 basis points. Italy\'s risk premium rose from 157 to 159 basis points. In the currency market, the exchange rate between the euro and the dollar ended the day at 1.3824 units. In the commodities market, the Brent barrel rose by 1% to 110 dollars, while West Texas advanced by 0.48% to nearly 102 dollars. The price of gold advanced by 0.30% due to new tensions arising in Ukraine, but it ended the day still below 1,300 dollars, at 1,288 dollars per ounce. \n\nMarket Information\n- Live quotes of the Ibex\n- Continuous market\n- International markets.\nThere are at least 15 kilometers between the parish of the Central University of Venezuela (UCV) and the Eastern Cemetery in Caracas, where the march will take place on foot this Wednesday to transfer the body of councilman Fernando Albán, who was allegedly "murdered" and thrown from the 10th floor of the Sebin tower, the political police, according to opposition parties’ denunciations. The funeral march was called to begin at 11 am, local time, from the university parish to the Eastern Cemetery of La Guairita. The burial has become an act of protest and unity for the opposition to express the anger felt by the people of Caracas over the death of councilman Albán.\n\nFernando Albán, 56, was a councilman for the Libertador municipality of Caracas representing the Primero Justicia party. He was known for being a devout Catholic, which contradicts the official version that he committed suicide after being detained at the Simón Bolívar airport on October 5 when he was returning from the United Nations in New York where he was presenting complaints about the systematic human rights violations in Venezuela. No one has believed the official version that Albán committed suicide from the 10th floor of the Sebin tower, located in Plaza Venezuela, also known as "The Tomb," where political prisoners are tortured.\n\nThe National Assembly held a plenary session on Tuesday in his memory, condemning the politician’s murder. During the parliamentary event, Deputy Juan Miguel Matheus denounced that Fernando Albán was tortured on Sunday night. "On Sunday night they tortured him, and they tortured him in three ways: mechanical asphyxiation with a bag over his face, submersion in a barrel of water, trying to drown him, and with electricity. And in that, he lost his life, in that he died."\n\nFormer governor of Miranda state, Henrique Capriles Radonski, during the funeral services for councilman Fernando Albán at the National Assembly (AN), assured that from his party Primero Justicia (PJ) "we do not buy the story that Fernando Albán would be capable of taking his own life." Capriles Radonski asserted that the worst thing that could happen to Venezuela is for hatred to reign in the country and for something to be constructed on top of that hatred. "If there is a weapon of mass destruction, it is hatred in a situation like this where we are overwhelmed; if there is something we can say at this moment, it is that we want justice and for a transparent investigation to be conducted," he affirmed. He indicated that Venezuela is living on the edge. "What do we want in Venezuela, to kill each other, where the Government paves the way for this country to end in a civil war. Is that the destiny of Venezuela? I wouldn’t want us to be, every day the government contributes to the ground so that things cannot be solved in the way the majority wants, which is a peaceful solution," he said, indicating that he does not believe Albán thought of taking his own life since he was a man of faith and principles.')]

你可以在此处找到此查询的完整输出。

由于你默认使用 kNN,如果你更改 k 的值(即要检索的全局最近邻居的数量),你将返回更多值。

k_results = elastic_vector_search.similarity_search(query, k=10)
k_results

输出应类似于以下内容:

[Document(page_content='Day 6 (Thursday): Cloudy in the Pyrenees, with partly cloudy conditions in other areas clearing up later. Precipitation is not ruled out in northern Huesca. Minimum temperatures will mostly remain unchanged; maximum temperatures will rise in Zaragoza and northeast Teruel, with no significant changes elsewhere. West winds light to moderate, shifting to moderate southeast winds.\nIf President Pedro Sánchez does not recognize interim president Juan Guaidó after the 8-day ultimatum given to Nicolás Maduro to call for elections, it could jeopardize Spanish investments in Venezuela that total more than 41 billion euros. Spain is the primary foreign investor in Venezuela, and both the capital of its most emblematic companies and the properties of Spanish residents could be lost if Maduro remains in power, similar to what happened with the Cuban revolution, where Spaniards could not recover their investments. Venezuelan financial economists Rosana Sosa García and Boris Ackerman published a report this Monday on the local digital portal La Patilla, warning of the dangers to Spanish investments in Venezuela if Pedro Sánchez does not recognize the newly proclaimed interim president of the country. The non-recognition of Guaidó as "interim president" of Venezuela represents "a potential danger" for Spain and the European Union as a whole. The analysts reminded that the recent inclusion of the Venezuelan crisis on the agenda of the United Nations Security Council gave the issue global significance. They pointed out that any commercial or financial transactions involving state assets or other operations with Maduro and his regime lack legitimacy from the time of interim president Guaidó\'s swearing-in on January 23.\n\nRosa Sosa, who resides in Spain, stated that Guaidó\'s swearing-in was "dismissed at first by the Spanish government led by Sánchez but was not ignored by significant countries like England." She cited the example of the Bank of England, which legally rejected the repatriation of 1.2 billion dollars in gold requested by Maduro, who has been usurping the presidency since January 10. The Spanish Ministry of Commerce estimates that there are about a hundred companies established in Venezuela, such as BBVA, Repsol, Acciona, and others, representing direct Spanish investments amounting to 21.313 billion euros by the end of 2015. Economist Sosa notes that the socialist government of Pedro Sánchez "is jeopardizing the heritage of companies that generate direct jobs inside and outside of Spain." It similarly endangers the assets of Spaniards (individuals) who have investments in Venezuela, not only due to the decrease in their value but also due to the paralysis caused by the legal vacuum in which everyone is currently immersed.\n\n"The biggest losers in the catastrophe facing Venezuela are not the IBEX companies; it\'s the ordinary citizens, and the assessment of these losses becomes more necessary," Sosa affirms. Spanish residents and their descendants in Venezuela have suffered enormous property losses that surpass the decline in investments of large companies. If the Spanish population in Venezuela is estimated at over 415,000 inhabitants and the average personal wealth is calculated at 50,000 euros, including real estate and homes, "the loss would therefore exceed 20 billion euros, coinciding with the decline in the value of large companies\' investments." This loss is reflected in the devaluation of their homes and real estate, and the complete depreciation of productive assets, the report adds.'),
 Document(page_content='The current situation in Venezuela presents "a completely impoverished population living in dire conditions, without medicine, without food, and perhaps with the worst public services in the Western world. Spaniards residing or owning properties in Venezuela are not exempt from this situation; in fact, they are one of the populations most affected by the crisis." The transition to democracy will be the only path for hundreds of thousands of Spaniards to recover their assets in Venezuela.\nThe longest lunar eclipse in a hundred years is a wonderful phenomenon that can be seen with the naked eye throughout Spain. The Moon rises in the sky tinged with vivid reddish and orange hues, which is why it is called the "Blood Moon" or "Fire Moon," as it passes through the shadow cast by the planet Earth. To witness the eclipse, simply look up at the sky and find the Moon. The lunar eclipse will last for more than three hours, during which the Moon will be at least partially covered by Earth\'s shadow. However, the most spectacular phase, the total phase, when the Moon is completely tinted red, will extend for one hour and almost 43 minutes, a record time that will not be surpassed this century. Generally, this can be observed in Spain starting from 9:00 PM at the earliest, although it is recommended to start watching from 10:00 PM, when the Moon will be visible in the sky. Until 11:00 PM, the Moon will appear reddened, and from that moment on, it will begin to emerge from the shadow zone and its disc will gradually regain its whitish brightness. Around midnight, the entire lunar disc will have its usual color. Interestingly, if the Moon appears red and not darker, it is due to a phenomenon known as Rayleigh scattering, by which the Earth\'s atmosphere scatters light and filters out blue and violet colors. Those who cannot enjoy the night sky today can follow it live from Namibia through the "Sky-live.tv" channel. Those who can go outside and want to enjoy the eclipse more deeply have a golden opportunity in Madrid. Starting at 10:00 PM, the Madrid Planetarium and La Caixa Foundation, in collaboration with the Madrid Astronomical Association (AAM), will offer a public observation session with telescopes on the planetarium\'s esplanade, with free access.'),
 Document(page_content='The shortage of funds is not the only problem humanitarian agencies face. Damascus has decided to deny visas to UN and NGO workers operating in the country, Ging confirmed on Monday. "We have pending visas for numerous international workers from Western countries —such as the United States, Canada, the United Kingdom, France, and one or two more countries— who are being denied visas because of their nationalities," explained the UN official. "This is something to which we strongly oppose, and we are working with the Syrian government to resolve it," he added.\n\nGing also warned of a possible food crisis in the country. Two UN agencies, the World Food Programme and the FAO —the Food and Agriculture Organization of the United Nations—, have estimated that the country\'s wheat harvest would decrease by 700,000 tons this year. Syria consumes between four and five million tons of wheat per year and has had to import grain for over six years to meet the needs of its citizens. "We must be prepared to address this," declared Ging. In June, the United Nations provided food rations to 500,000 people and hopes to increase this number to 850,000 this month.\nThe session has been anything but calm. It promised to be so in the morning. And not just calm, but also positive. The Spanish selective index even surpassed the 10,500-point level. This was likely helped by the Bank of Spain\'s announcement that Spain\'s GDP grew by 0.4% in the first quarter. Additionally, there was a debt auction conducted by the Treasury. Over three years, it sold 1,348 million euros with an average return of 1.022%, below the previous 1.331%. Over five years, it issued 1,570 million euros with an average return of 1.663%, below the previous 1.869%. Over ten years, it sold 2.6 billion euros with a return of 3.059%, lower than the previous 3.291%. However, it began to falter after twelve-thirty, which is when it dropped below 10,500 points. The decline continued especially after three in the afternoon when the indicator started drifting, eventually falling below 10,400 points and marking a daily low under 10,350 points. The cause of the declines: Ukraine. The Ukrainian government\'s activity against pro-Russians has reactivated, and meanwhile, the Russian government responded by announcing new maneuvers. From that minimum level, the indicator began a recovery, ending the day at 10,462 points, a revaluation of 0.36%. In the end, what was supposed to be a calm and positive session turned into a quite volatile day. The Spanish selective index performed worse than Italy\'s Ftse Mib and France’s Cac 40, which gained 0.66% and 0.64% respectively, but better than Germany\'s Dax, which only rose by 0.05%. This occurred despite Germany publishing the Ifo index, which measures confidence in the German economy. It rose from 110.7 to 111.2 points, when experts expected it to settle at 110.5 points. Additionally, it increased due to better expectations: in that chapter, the indicator rose from 106.4 to 107.3 points, compared to the 105.8 points that analysts expected. In the evaluation of the current situation, it rose from 115.2 to 115.3 points, when experts expected it to be 115.7 points. Only one index ended in the red: Lisbon\'s PSI-20, which fell by 0.11%. \n\nBoost from the United States\nThe final recovery in Europe had to do with the behavior of the American stock market. There, indices, especially the Nasdaq, which gained around one percentage point, were celebrating the good results from Facebook and Apple and were moving upwards. Among the economic indicators of the day in the United States, the durable goods orders data was very good: they rose by 2.6% in March, above the 2% that analysts expected and higher than the 2.1% growth the previous month. Orders for durable goods excluding transportation rose by 2%, above the 0.6% that analysts expected. Excluding defense, they rose by 1.8%, below the 3% estimated by analysts. More durable goods orders indicate a boost to industrial production. The weekly unemployment data was somewhat worse, rising by 329,000 people, above the 310,000 expected by analysts. Additionally, the Kansas Fed\'s activity index fell from 22 to 12 points.'),
 Document(page_content='In the Spanish selective index, Sabadell led the gains with a revaluation of 2.78%. IAG followed, advancing by 1.64%. Técnicas Reunidas, FCC, and BBVA also advanced more than one percentage point. Among the major stocks, Santander and Telefónica also stood out, rising by 0.74% and 0.62% respectively. Inditex and Iberdrola rose around 0.35%. On the other hand, Gamesa was the worst performer, dropping by 2.12%. Following it were CaixaBank, Dia, Sacyr, Bankinter, and Jazztel, which fell by more than one percentage point. Bankia and Popular’s losses were close to 1%. In the Madrid General Stock Index, Amper led the gains with a revaluation of 5.26%. Following it was Codere, which also gained more than 5%. Barón de Ley and Liberbank gained more than three percentage points. In red, the worst performer was Inypsa, with a decline of 9.09%.\n\nSale of practically all bonds\nIn the debt market, the yield of all bonds rose. This means that yesterday, investors sold debt to buy stocks. The yield on the Spanish bond rose from 3.05% to 3.08%. The yield on the Italian bond rose from 3.09% to 3.12%. The yield on the German bond rose from 1.52% to 1.53%. With this behavior, Spain\'s risk premium barely increased from 153 to 155 basis points. Italy\'s risk premium rose from 157 to 159 basis points. In the currency market, the exchange rate between the euro and the dollar ended the day at 1.3824 units. In the commodities market, the Brent barrel rose by 1% to 110 dollars, while West Texas advanced by 0.48% to nearly 102 dollars. The price of gold advanced by 0.30% due to new tensions arising in Ukraine, but it ended the day still below 1,300 dollars, at 1,288 dollars per ounce. \n\nMarket Information\n- Live quotes of the Ibex\n- Continuous market\n- International markets.\nThere are at least 15 kilometers between the parish of the Central University of Venezuela (UCV) and the Eastern Cemetery in Caracas, where the march will take place on foot this Wednesday to transfer the body of councilman Fernando Albán, who was allegedly "murdered" and thrown from the 10th floor of the Sebin tower, the political police, according to opposition parties’ denunciations. The funeral march was called to begin at 11 am, local time, from the university parish to the Eastern Cemetery of La Guairita. The burial has become an act of protest and unity for the opposition to express the anger felt by the people of Caracas over the death of councilman Albán.\n\nFernando Albán, 56, was a councilman for the Libertador municipality of Caracas representing the Primero Justicia party. He was known for being a devout Catholic, which contradicts the official version that he committed suicide after being detained at the Simón Bolívar airport on October 5 when he was returning from the United Nations in New York where he was presenting complaints about the systematic human rights violations in Venezuela. No one has believed the official version that Albán committed suicide from the 10th floor of the Sebin tower, located in Plaza Venezuela, also known as "The Tomb," where political prisoners are tortured.\n\nThe National Assembly held a plenary session on Tuesday in his memory, condemning the politician’s murder. During the parliamentary event, Deputy Juan Miguel Matheus denounced that Fernando Albán was tortured on Sunday night. "On Sunday night they tortured him, and they tortured him in three ways: mechanical asphyxiation with a bag over his face, submersion in a barrel of water, trying to drown him, and with electricity. And in that, he lost his life, in that he died."\n\nFormer governor of Miranda state, Henrique Capriles Radonski, during the funeral services for councilman Fernando Albán at the National Assembly (AN), assured that from his party Primero Justicia (PJ) "we do not buy the story that Fernando Albán would be capable of taking his own life." Capriles Radonski asserted that the worst thing that could happen to Venezuela is for hatred to reign in the country and for something to be constructed on top of that hatred. "If there is a weapon of mass destruction, it is hatred in a situation like this where we are overwhelmed; if there is something we can say at this moment, it is that we want justice and for a transparent investigation to be conducted," he affirmed. He indicated that Venezuela is living on the edge. "What do we want in Venezuela, to kill each other, where the Government paves the way for this country to end in a civil war. Is that the destiny of Venezuela? I wouldn’t want us to be, every day the government contributes to the ground so that things cannot be solved in the way the majority wants, which is a peaceful solution," he said, indicating that he does not believe Albán thought of taking his own life since he was a man of faith and principles.'),
 Document(page_content='The Huelva defense barely conceded any chances, and just when it seemed the score would not change, the winning goal for Recreativo arrived. Levante committed a lateral foul, which Álvaro Antón turned dangerous by delivering it to Ruymán\'s head for the definitive 1-0 in the 90th minute.\n\nLine-up:\n1 - Recreativo: Rubén; Araujo, Álvaro Vega, Menosse, Ruymán; Jesús Vázquez, Jorge Larena (Jorge Merino, m. 86), Álvaro Antón; Gallegos (Naranjo, m. 88), Ezequiel, and Arana (Joselu, m. 76).\n0 - Levante UD: Keylor Navas, Pedro López, Vyntra, Juanfran, Nikos; Camarasa, Simao Mate, Xumetra (David Barral, m. 65), Sergio Pinto (Diop, m. 88), El Zhar (Pedro Ríos, m. 55), and Nong.\n\nGoals: 1-0, m. 90: Ruymán.\n\nReferee: González González (Castilian-Leonese Committee). He booked Ezequiel and Merino for the hosts and Simao and Nong for the visitors. \n\nIncidents: Match corresponding to the Copa del Rey Round of 32, played at Nuevo Colombino in front of 1,068 spectators.\nThe State Meteorological Agency (Aemet) has activated a yellow alert for low temperatures for the early hours and mornings of Sunday and Monday in the Zaragozan Iberian System, the mountains of Albarracín and Jiloca in Teruel, and the central and southern areas of Huesca. According to the Meteorological Organization, the alert will be active between 2:00 AM and 10:00 AM on Sunday in the Iberian System and the mountains of Teruel, with temperatures reaching -4 and -6 degrees, respectively. This situation will repeat during the same time frame on the following Monday, with temperatures of -6 degrees in the Iberian System and the Mountains of Teruel, and -4 degrees in the central and southern areas of the province of Huesca.\nMADRID.- The alleged fixer of the Púnica corruption network, Alejandro De Pedro, carried out "reputation work" on social media for the former mayor of Madrid, Ana Botella (PP), which he obtained thanks to the mediation of former Labor Minister Eduardo Zaplana and former Mayor of Cartagena, José Antonio Alonso Conesa (PSOE). This is stated in a report by the Civil Guard, which is part of the \'Púnica case\' summary, revealing that the WhatsApp communications intercepted during the procedure show evidence of "the creation of reports on Ana Botella\'s presence on the internet." De Pedro\'s company, Madiva, was also responsible for "creating digital newspapers" in the Community of Madrid and the City\'s Council, some related to the city\'s districts, as well as "possible Google positioning."\n\nInvestigators suspect that the documents seized from the leaders of the Púnica corruption network reveal "a possible commercial relationship" between Madiva and the media agency Irismedia, which could have acted as the payer for these online reputation services. The report, prepared by the Central Operational Unit (UCO) of the Civil Guard on May 27, 2014, confirms that De Pedro carried out "reputation work on the network for authorities and elected officials, which created a debt in his favor," paid via "irregular procedures." These included "direct payments or invoicing through third-party companies awarded public contracts, including the cost of these reputation works in public contracts intended for other purposes," or direct benefits to De Pedro in "subsequent public contracting processes."\n\nSpecifically, De Pedro worked for the Community of Madrid, the Provincial Councils of León and Alicante, and the city councils of Valencia, Castellón de la Plana, Majadahonda and Coslada (Madrid), Gandía (Valencia), Denia, Benissa, and Villajoyosa (Alicante), and Cartagena (Murcia). In Madrid\'s case, the Civil Guard reports that De Pedro started working for the PP of Madrid in 2010 and 2011, "possibly through Francisco Granados," then the organization\'s Secretary-General. This allowed him to offer his services to "different city councils in the Community of Madrid as a result of the 2011 elections, continuing in some until the operation\'s exploitation date," in October 2014.'),
 Document(page_content='He was pursuing this ambition until he joined the Spanish-speaking pro-independence platform Súmate in 2013. Within two years, he rose from anonymity to the National Secretariat of the Catalan National Assembly and — reportedly with the blessing of Oriol Junqueras — headed the list for Barcelona of the Republican Left of Catalonia (Esquerra Republicana de Catalunya) in the December 20 elections. \n\nHis decade of experience as a recruiter seemed to give him the serious demeanor, languid tone, and gentlemanly posture that marked his debut in the Parliament — a style that didn\'t go unnoticed. His speech was described variously as "tabloid" and "low-cost sentimentalism," and marked his entry into the political star system as the deputy spokesperson for ERC in Congress.\n\n"Toni Comín recently called me a \'bullfighter.\' That\'s pretty accurate. I\'ve had many people over time tell me, \'When you\'re up there, try to speak for all of us.\' That\'s what I humbly try to do, and it\'s an honor. There’s no vanity or personal agenda. Tardà is generous, tremendously humane. He doesn’t know envy. He’s great. A star. I have to clarify this almost every time in interviews: I didn’t say \'I’m a charnego\'; I said, \'I\'m what you call charnego,\' which is a term used by the more reactionary unionists. Just search it on Twitter to see that it\'s used by people like Hermman Tertsch or Urdazi. That was my point, and that\'s why Ciudadanos got so upset. They know well that those calling us \'charnegos\' — and that’s putting it mildly — are the platforms supporting them.\n\nPedro Sánchez is a kind of Zapatero who leans to the right of Zapatero. In our meeting with him, we told him, \'Pedro, it would be great, especially for your PSC colleagues, if you referred to Catalonia as a nation.\' He refused. That places him on the right. Maybe that\'s why he\'s so comfortable with the pact with this new right-wing party, Ciudadanos. It\'s disappointing, but anyone who buys into the centrist or reformist discourse of Ciudadanos is mistaken. Just look at the records of the Parliament over the past nine years. C\'s is not the new democratic party they pretend to be. It’s the National Front. It’s a party that stands to the right of the PP on many issues.\n\nIt\'s part of normalcy in a democracy that such meetings occur. What’s surprising is that a meeting between two people who are many things should be news. The abnormality lies in the last four years, where no one has been talking to anyone. In the whirlwind of Madrid, you’re somewhat removed from the day-to-day of Catalan politics. I don\'t know if he knew or not. What I do know for sure is that the relationship between Puigdemont and Junqueras is tremendously good. That’s indisputable.\n\nI have no idea. If they did, I’m convinced Junqueras would convey what we’ve been saying from the start: we will not support those who call us coup plotters, as Rodríguez Ibarra recently called Joan Tardà, simply because we voted for something they don\'t like. We will never support those who deny the full sovereignty of the people of Catalonia. It’s a science fiction scenario. If Pedro Sánchez were to strike a deal with Podemos, calls from Susana Díaz, Felipe González, or Ms. Botín would be immediate. They would remind him that the party for order, the IBEX 35’s party, and the correct path is with Ciudadanos. It seems impossible, though it would be great for the PSOE to return to its left-wing roots.\n\nWe think it\'s positive for everyone to talk with everyone. What’s surprising is that Pablo Iglesias thinks that 27 MPs — those of Catalonia Sí que es Pot and the PSC in Parliament — should decide the future of Catalonia, when Junts pel Sí and the CUP have a parliamentary majority of 72 seats. It’s surprising that Iglesias tries to sell this narrative. The solution has been provided by the people with an absolute pro-independence majority, which is the only way forward.\n\nI was referring to the letter Minister Montoro sent to Junqueras; a crude letter with a veiled threat: Cut more, make your people suffer even more. We are very used to the Spanish State Government using institutions, even judicial halls, against the vote of the people. We know the Constitutional Court very well, presided over by a PP member. And we know Montoro perfectly well. It would be better if instead of sending threatening letters to the autonomous communities, the government stopped bailing out their banker friends, which has cost 100 billion euros. If Montoro\'s friends governed Catalonia, certain things would not have happened. For example, Catalonia would not have paid 1900 million euros in interest for something called FLA, which is outrageous and indecent, as it exploits public taxes for profit. I’m also convinced that the Constitutional Court would not act against the popular mandate if others were in power. Whether liked or not, even non-independentists would agree that the government uses institutions against Catalan institutions.'),
 Document(page_content='The show incorporated diverse musical influences, including reggae and rap with Junior, who added verses to a playful and irreverent version of "Mala" unlike the original. Sanz finally danced during "No es lo mismo," fulfilling his promise, and introduced the international musicians in his band from countries like the United States, Cameroon, the Dominican Republic, Spain, and Great Britain. "Thank you, Madrid! Whether it’s at Las Ventas or here, we don\'t change. This place makes you happy, and I’m not referring to the city as an institution but to the people living here," Sanz acknowledged.\n\nThe final part of the concert featured Sanz at the piano, performing a pasodoble by Cádiz composer Juan Carlos Aragón, and "Tú no tienes la culpa," another track from his latest album. The climax came with the appearance of Dani Martín, lead singer of El Canto del Loco, who joined Sanz for "Tu letra podré acariciar," one of Sanz\'s older songs. Sanz concluded with "A la primera persona," dedicating the song to the more than 15,000 fans who visited the paradise he created in Madrid.\nThe Local Police of Valencia have arrested a 30-year-old man for allegedly banging on his ex-partner\'s door and insulting her at four in the morning. The incident took place in the early hours of this Sunday in the Benimaclet neighborhood. The 092 emergency number received a report that a man was banging on a door, the municipal security force stated in a communiqué. The woman informed the officers that her ex-partner had been harassing her for several months and that on that day, he had come to her residence to try to enter and insult her. A neighbor corroborated her version, after which the officers verified that the door showed signs of damage. The alleged perpetrator was located and arrested that same night at his home before being taken to the Central Guard Inspection. The operation involved officers from the Coexistence and Safety Unit (UCOS).\nAluminum and iron are two of the most abundant elements on the surface of our planet. They are also the basic materials used to make cans, an almost immortal container whose essential properties do not deteriorate no matter how many times it is recycled, according to the Spanish Metal Packaging Association. They are also tough nuts to crack for nature: depending on their composition and thickness, a can may take more than 100 years to degrade outdoors. For this reason, they are used massively to protect almost anything: liquids, food, cleaning products, chemicals, paints, and even tennis balls.\n\nWHAT YOU NEED: A can. A candle. Pencil and punch. Wire. Pliers. Spray paint. Each Spaniard threw away an average of 13.2 kilos of plastic, cartons, and cans into the yellow container in 2016, according to data from Ecoembes. Metal containers reached a recovery rate of 84.8%, almost two points higher than the previous year. Before this container goes into the bin and from there begins its journey towards a new circulation, you can extend its useful life a little more. Here we show you how to carry out your own recycling and transform a can into four new objects.\nApproximately 112,000 Syrian refugees have registered at United Nations offices in Lebanon, Turkey, Jordan, and Iraq, according to Panos Moumtzis, the regional coordinator of UNHCR —the UN Refugee Agency. In the past three months, humanitarian agencies in these countries have recorded an average of more than 500 Syrian refugees per day. 75% of them are women and children, and the UN estimates that the number might reach 185,000 by the end of the year. The actual number of refugees is likely higher, as many fear registering with the UN, concerned it might compromise their chances of returning to Syria. The majority of them "are entirely dependent on humanitarian aid to survive," Moumtzis states. \n\nThe United Nations has managed to partially implement its humanitarian aid plan in Syria, but the daily deterioration of the situation means the needs of the population cannot be met, the international organization warned today. "People who two months ago were coping with an emergency situation can no longer manage now, and as the insecurity does not cease but increases, the needs grow exponentially," declared John Ging, the Director of Operations of the Office for the Coordination of Humanitarian Affairs, during a press conference in Geneva.\n\nThe UN estimates $193 million —157.4 million euros— in essential funds to assist the refugees, and $189 million —154.1 million euros— in necessary aid for the 1.5 million Syrians who need humanitarian assistance within the country. The agency has only 20% of that amount.'),
 Document(page_content='Capriles called for the opposition’s unity amid the tragedy. "We honestly need unity; I believe that in the face of the tragedy our country is experiencing, the internal differences we might have are secondary," he stated.\nEl Deportivo has reported that the Provincial Court of Valencia has upheld the appeal filed by the club from Coruña and has allowed it to participate in the ongoing case regarding the alleged fixing of the match between 99cx3 and Zaragoza during the 2010-11 season, in which the blanquiazules (white and blues) were relegated due to the result of that match. The Galician team explains that after the Court of Instruction in Valencia did not admit the club’s involvement in the criminal procedure, the appeal prepared by the Garrigues law firm has been successful and it "will allow [the club] to defend its rights and interests" in the case. Deportivo believes that "there are sufficient elements that make the club from Coruña the main aggrieved party by the events under scrutiny." The result of the match between 99cx3 and Zaragoza and Deportivo\'s defeat at Riazor against Valencia (0-2) on the last day of the 2010-11 season, led the blanquiazules to be relegated to the Segunda División that year. Deportivo would have stayed in the top tier that season if Zaragoza had not beaten (1-2) Levante in the Ciudad de Valencia.\nThe State Meteorological Agency (Aemet) announces for today, Sunday, in Aragón a mostly clear or clear sky with some afternoon cloud development in mountainous areas. Temperatures will see little change except for increases in the Iberian System. Variable light winds with a predominance of southeast winds, with moderate intervals in the afternoon in the eastern Ebro Valley. Temperatures in the provincial capitals will range between a low of 17 degrees and a high of 34 degrees in Huesca, 10 and 32 in Teruel, and 17 and 35 in Zaragoza. \n\nForecast for the upcoming days: The State Meteorological Agency (Aemet) announces for tomorrow, Monday, in Aragón partly cloudy skies, with cloudy development in the Pyrenees. Minimum temperatures will rise in Huesca and Teruel; maximum temperatures will remain largely unchanged. Variable light winds with moderate east component intervals in the afternoon in the eastern Ebro Valley. Temperatures in the provincial capitals will range between a low of 18 degrees and a high of 31 degrees in Huesca, 12 and 33 in Teruel, and 18 and 34 in Zaragoza.\n\nDay 4 (Tuesday): Partly cloudy or clear skies increasing to partly cloudy in the afternoon. In the northwest and other parts of the Pyrenees, afternoon precipitation is likely, generally light. Minimum temperatures will see little variation; maximum temperatures will rise in the eastern part of Huesca, the Zaragoza Riverbank, and northeast Teruel. No changes in other areas. Variable light winds shifting to moderate southwest winds in the Iberian System and light to moderate southeast winds in other areas.\n\nDay 5 (Wednesday): Partly cloudy skies becoming mostly clear. Rain in the northern third, which could possibly extend to other areas with low probability, tapering off by the end of the day. Temperatures will drop; maximum temperatures significantly so, especially in western Zaragoza where they may fall notably. Variable light winds at first, shifting to light to moderate west winds in the central hours and moderate northwest winds by the end of the day.'),
 Document(page_content='Spicer was responding to a message circulated among U.S. diplomats worldwide, which, according to some media outlets, has received more than 100 signatures before being sent to the State Department\'s so-called "dissent channel." This channel has been in place since the Vietnam War (1955-1975) to allow employees to express their disagreement with senior U.S. diplomatic officials without fear of retaliation, and documents filed there must receive an official response within 30 to 60 days.\n\nIn the message, diplomats expressed their opposition to the part of the executive order signed by Trump on Friday that bans citizens from Libya, Sudan, Somalia, Syria, Iraq, Yemen, and Iran from entering the country for 90 days. "This ban, which can only be lifted under conditions that countries will find difficult or impossible to meet, will not achieve its stated goal of protecting the American people from terrorist attacks by foreign nationals entering the United States," the document\'s signatories warned. "Moreover, this policy contravenes important American values like non-discrimination, fair play, and welcoming foreign visitors and immigrants," they added.\n\nActing State Department spokesman Mark Toner said today he was "aware" of that message and defended the need for agency employees to be able to register their disagreement with certain policies within the "dissent channel." "This is an important process that the acting Secretary of State (Thomas Shannon) and the State Department as a whole value and respect. It allows employees to express their differing views on a policy candidly and privately to the agency\'s leaders," Toner said in a statement.\n\nThe signatories of the document, which was published by several media outlets, warned that the ban will "immediately sour relations" with the seven affected countries and much of the Muslim world, which sees the prohibition as religion-motivated. "By alienating them, we lose access to the intelligence and resources we need to address the root causes of terrorism abroad before an attack occurs in our country," the diplomats argued, also expressing concern about a rise in "anti-American sentiment" globally. They also warned that the requirement imposed on countries to lift the ban—ensuring that each individual applying for a visa is who they claim to be and not a threat—is too "vague and nebulous" for those governments to be able or willing to comply.\nÁlvaro Cunqueiro, \'a Houdini of literature\'. / Archive. "Cunqueiro was a sort of Houdini who, through literature, sought to escape, like his character Fanto Fantini, from a world he didn\'t like, to other fantastic beings born from his frenzied and fruitful pen." This is how writer, journalist, and former Minister of Culture César Antonio Molina introduces his fellow countryman, as the prologue writer of the book \'Álvaro Cunqueiro. Of Saints and Miracles\'. This new installment in the Fundamental Work collection of the Fundación Banco Santander showcases over a hundred forgotten texts by the unique and great Galician narrator, brought to light by Galician philologist and professor Xosé Antonio López Silva. Among them are seven entirely secular and unpublished stories not included in any book or anthology, which Cunqueiro \'snuck\' into a Catholic magazine under the pseudonym Álvaro Labrada. The book offers a journey through the texts and hagiographic portrayals of a prolific and protean Álvaro Cunqueiro (Mondoñedo, 1911-Vigo, 1981). \n\nThe seven unpublished stories, with exotic settings, sometimes Chinese, sometimes Indian, were discovered in 2011 by the volume\'s anthologist, López Silva, who is committed to "recapturing the value of a writer with an inimitable style" and providing an overview of a theme "so relevant, distinctive, and enormously functional in Cunqueiro\'s work, which is hagiography." The stories, which went unnoticed by critics despite being crucial in Cunqueiro\'s trajectory, were written between 1945 and 1946, after the Franco regime stripped him of his journalist credentials in 1944. Xosé Antonio López Silva found them while analyzing other hagiographic texts. These saints, for the Lucense writer, were "magicians like Merlin," as César Antonio Molina explains in the prologue. "Cunqueiro uses the saints for his own inventions, without relying in the slightest on the official history of the Church and its truth," assures the former minister. "They are saints that the Catholic Church couldn\'t teach in its schools and seminaries, created by someone who isn\'t heretical but who commits marvelous excesses," Molina specifies.'),
 Document(page_content="No, we are stronger than ever. During the three months of negotiations for the Catalan government, we were called everything under the sun, and now they're back at it. There's a notable cover from El Periódico from that time headlined: 'At the Edge of the Precipice.' The other day it read: 'The Great Hope' with a photo of Sánchez and Iglesias. Back then, we were negotiating between political formations even more distant than those negotiating in the Spanish state now. CDC and the CUP have nothing in common. And it was done. The important thing is not to win against each other but to win a country. We must remember there’s an absolute parliamentary majority. And just like in other European countries, we must accept that deals are made, not minimal ones, but those reaching the last minute or with nuances. We must get used to it. I wish this happened in the Spanish Parliament where relatively distant political formations could agree for a goal that transcends them.\n\nWe have agreed on 18 months. But we always say the same: we are facing the biggest political challenge in southern Europe in a long time. We are starting a self-determination process — no more, no less — that requires time, patience, generosity… If it’s 18 months, fine, if it’s 20, also fine. What's clear is that we will do it.\n\nThe bitter controversy, as someone published the other day, was started by him. He dedicated an article to me — 'The Rufián Case' — portraying me almost as a Frankenstein. The irony is that exclusionary Spanish nationalists call exclusionary Catalan nationalists left-wing independents, like me. If you don’t like certain languages being spoken, certain symbols being reclaimed, or certain identities being voted on, you end up being the exclusionary nationalist. People like Mr. Pérez-Reverte are very upset because they don’t understand that people here vote differently, that the PP is a residual party, and that the PSOE is taking the same path. It is confusing, but it’s called democracy. If they insult us… that's on them. It reflects what Ciudadanos is. Félix de Azúa is one of their founders, a totem of C's. His comments, more than being misogynistic or right-wing, are classist. He doesn’t understand or like that people like Ada Colau, who has been a great civil and social rights activist, reach political institutions. They don’t like people like me either, with all humility. I studied Labor Relations and a master’s in Human Resources Management. For 10 years, I was the guy sitting on the other side of the table during job interviews. It’s true that I unloaded inflatable fair trucks and worked as a clerk for a while. But like many other people, I worked to pay for my studies. No, I’m not a 'compi-yogui,' nor do I share that fraternity with Panama.\nThe ordinance against street prostitution is back in the spotlight in Valencia. The Socialist spokesperson for the municipal group, Joan Calabuig, offered this morning at a public appearance to renegotiate with the PP (People’s Party) the regulation aimed at curbing this activity, which has been highly criticized in neighborhoods such as Velluters and La Punta. Calabuig stressed that the municipal groups must respond to the complaints from residents, which have increased this summer in the city center. To this end, he asked the City Council to study how the ordinance has worked in other cities, in addition to the draft approved by the Federation of Municipalities and Provinces a year ago. However, Calabuig emphasized, in response to questions from Z28v6, that the sanctions should be primarily directed at the clients and not the prostitutes, who are often victims of the mafias running this business. Moreover, he advocated for offering social solutions involving professionals, as well as urban improvements in these neighborhoods. During the last term, the ordinance was on the verge of being approved but was shelved due to a lack of consensus between the PP and the PSPV (the Socialist Party of the Valencian Community). In the Community, municipalities such as Alicante have been operating under it for some time.\nFrom Kafka's metamorphosis to the carnivorous ants in comic books, and including Kurt Neumann's *The Fly* (1958) and its depressing sequel by David Cronenberg (1986), which was more disgusting than scary, narrators of novels and films have been obsessed with insects for over a century. Insects are not only strikingly ugly but also tend to move in swarms, hordes, or plagues to torment the human species. This is a form of large-scale racism because insects are not hominids, primates, tetrapods, nor even deuterostomes; they are merely vulgar arthropods and hexapods. Their bad reputation, however, is largely due to a solid scientific reason: they bite and transmit serious diseases such as malaria, which infects 200 million people each year and kills, roughly speaking, about 400,000 children under five years old.")]

如果需要,你可以查看此查询的完整输出。

你还可以将 num_candidates 字段调整为每个分片上的近似最近邻候选数。你可以查看我们关于此主题的博客文章以获取更多信息。如果你希望对此进行更多调整,你可能需要查看我们关于调整近似 KNN 搜索的文档。

结论

这只是你如何利用 Elastic 的向量数据库功能的开始。要了解更多可用功能,请务必查看我们关于该主题的资源。通过利用 LangChain 和 Elastic 的向量数据库功能,你可以从可能包含你不熟悉的语言的数据集中获取见解。在本文中,我们能够就文本中提到的特定位置提出问题,并收到翻译成英文的文本中的回复。要深入了解向量数据库功能,你可能需要查看我们的教程。此外,你还可以在 Search Labs 上找到有关使用多语言数据集的另一个教程,以及这篇引导你如何使用 Elastic 和 Mistral 构建多语言 RAG 的帖子。

此示例的完整代码可在 Search Labs GitHub 存储库中找到。如果你基于此博客构建了任何内容,或者如果你对我们的论坛和社区 Slack 频道有疑问,请告诉我们。

准备好自己尝试一下了吗?开始免费试用。

Elasticsearch 集成了 LangChain、Cohere 等工具。加入我们的 Beyond RAG Basics 网络研讨会,构建你的下一个 GenAI 应用程序!

原文:Dataset translation and insights with Python, LangChain & Elastic — Search Labs

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2125312.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

游戏出海迎新变局——海外游戏市场有哪些新趋势和新机遇?

游戏出海的热度越来越高,也面临着竞争加剧、门槛提升、成本增加的现实环境,游戏出海有哪些新变化和新趋势? 移动游戏出海的主要海外市场 在海外市场分布方面,美日韩仍然是我国移动游戏重要的海外市场,占据了中国出海…

mfc140u.dll丢失有啥方法能够进行修复?分享几种mfc140u.dll丢失的解决办法

你是否曾遇到过这样的情况:当你满怀期待地打开一个应用程序时,却被一个错误提示拦住了去路,提示信息中指出 mfc140u.dll 文件丢失。这个问题可能会让你感到困惑和无助,但是不要担心,本文将为你详细解读 mfc140u.dll 丢…

给孩子选台灯什么品牌好?看儿童护眼灯推荐测评挑选护眼台灯!

儿童的视力健康是每个家庭都非常关注的问题。当前,近视问题在全球范围内日益严重,尤其是在中国,近视率高企不下,并且呈现出年轻化、低龄化的趋势。随着课业负担的增加和电子产品的普及,儿童近视的问题变得更加突出。我…

超490万预订,华为三折叠屏手机凭什么卖爆?

“3nm制程芯片不是消费者买手机的核心理由?” 作者 | 魏 强 编辑 | 卢旭成 9月10日,华为手机在苹果秋季发布会(北京时间9月10日凌晨)之后紧跟着发布华为Mate XT非凡大师(以下简称非凡大师XT)三折叠屏手机,售价从19…

摩托车一键启动系统功能特点

摩托车一键启动的方法是:长按遥控钥匙上的启动按钮,即可启动摩托车发动机‌。这种配置通常需要安装,为骑行者带来了更为舒适的体验‌。 移动管家摩托车一键启动系统具有以下功能特点: ‌智能化‌:无需原车钥匙或原车…

2024年9月10日嵌入式学习

今日主要学习了缓冲帧。 Framebuffer(帧缓冲)是Linux系统为显示设备提供的一套应用程序接口,它将显存抽象为一种设备,允许上层应用程序在图形模式下直接进行显示缓冲区的读写操作。 原理:通过内存映射技术向显存空间…

学习pyqt5相关知识回顾

1. 模块 1.1 import导入 1) 模块:是一系列功能的集合体,模块名.功能名,就可以使用模块的功能 2) 首次导入模块,就会立即执行模块里面的内容 3) 当前名称空间会产生一个名字module,指向module.py产生的名称空间.我们可以使用module.name/函数名,来调用module.py里面的内容. …

计算机网络 --- 【1】欢迎来到计算机网络/计算机网络基本概念/计算机网络、互连网、互联网的区别

目录 一、计算机网络学什么? 二、 什么是计算机网络?计算机网络、互联网(因特网,Internet)、互连网(internet)之间的区别? 2.1 计算机网络的定义 2.2 计算机网络与互连网的区别 2.3 互连网 三、总结部分 一、计算机网络学…

从品牌战略到品牌知名度:实现持续增长和客户忠诚度的关键。

每家公司都希望自家的品牌、产品或服务能在市场上首屈一指。当你问创始人和CEO们他们的愿景时,他们常常会告诉你,他们想要成为行业中的“ 第一”或者成为“ 行业领袖”。 作为市场营销人员,我们都希望我们所运营的品牌能做到这一点——成为第…

python获取双色球数据解析

先用python GET网页源码 这里我们用GET参考的双色球频道_往期回顾​​​​​​ 因为不同的网站源码不一样,主要讲解思路 soup BeautifulSoup(html, html.parser) 用BS解析后,使用 lottery_info soup.find_all(tr)#根据tr标签找到开奖所有的期号行 先找到所有的tr行,因为…

线性方程组求解——预处理Preconditioning介绍

为什么需要预处理? 工程中出现的大规模线性方程组往往是病态的, 对数值求解带来很大的困难: ▶ 使得迭代法(比如Krylov 子空间迭代法) 收敛变得非常缓慢 ▶ 对数值解的精度产生很大的影响(在有限精度计算情形下) 对于第一个问题, 当前的有效处理方法是预处理, 预处…

AIO不止有群晖,极空间虚拟机部署免费开源的『TrueNAS』

AIO不止有群晖,极空间虚拟机部署免费开源的『TrueNAS』 哈喽小伙伴们好,我是Stark-C~ 很多小伙伴在买到极空间的NAS之后,总要各种折腾,毕竟配置高,硬件强,折腾起来也确实得心应手,乐趣多多。 …

Android相关线程基础

线程基础 进程与线程 进程:可以被看做是程序的实体, 是系统进行资源分配和调度的基本单位. 线程:是操作系统调度的最小单元, 也叫轻量级进程 使用多线程的优点 可以减少程序的响应时间。如果某个操作很耗时, 能够避免陷入长时间的等待, 从而有着更好的交互性. 线程较之进…

Android V 广播注册和配置注意事项问题

现象 在Android V平台上,应用注册非Protected广播时,如果没有加导出flag会抛出异常导致进程crash。 E/AndroidRuntime: FATAL EXCEPTION: main java.lang.SecurityException: com.demo.myapplication: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORT…

【运维监控】Prometheus+grafana监控zookeeper运行情况

本示例通过zookeeper自带的监控信息暴露出来,然后将数据收集到prometheus中,最后通过grafana的dashboard导入模板进行可视化。本示例分为三个部分,即prometheus、grafana部署和最后的集成。说明:本示例中的部署环境没有要求&#…

BC173 牛牛逆序输出(c 语言)

1.// 描述 //牛牛在尝试把一个整数逆序地输出。 //输入描述: //输入一个正整数 n。保证个位数不是 0 //输出描述: //逆序输出这个正整数。 //2345 //5432 2.我们先输入n,然后我们进行取余,然后将余数存储起来在arr中,然后除10。…

用 Python 和 Tkinter 做游戏?5分钟打造Python贪吃蛇游戏

大家好!贪吃蛇游戏是一款经典的休闲游戏,相信大家都不陌生。 今天,我们将用 Python 的 Tkinter 库快速创建一个贪吃蛇游戏。你不需要成为一个编程专家,只需跟着本文的步骤走,你就可以亲手制作属于自己的贪吃蛇游戏&am…

TikTok Shop9.9大促爆单忙不过来?EasyBoss ERP给你全方位的助力!

又是一年9.9大促,想必大多数Shopee/TikTok本土卖家的店铺订单量都远超日常了吧? 图源:网络 爆单是件大好事,但背后却是店铺运营的一场硬仗。因为出单后,多店铺的订单处理、仓库发货、售后、数据分析等环节都有大量的工…

QEMU虚拟机

vmware中创建虚拟机 创建虚拟磁盘 qemu-img create -f qcow2 sda.qcow2 100G qemu-img create -f qcow2 sdb.qcow2 100G创建桥接口 brctl addbr br0 brctl addif br0 ens36 brctl stp br0 on ifconfig ens36 0 dhclient br0brctl addbr br1 brctl addif br1 ens37 brctl stp …

信息安全工程师(3)TCP/IP协议簇

前言 TCP/IP协议簇是Internet的基础,也是当今最流行的组网形式。它不仅仅指的是TCP和IP两个协议,而是由一系列协议组成的协议簇,这些协议共同支持着互联网上的数据传输和通信。以下是对TCP/IP协议簇的详细概述: 一、组成 TCP/IP协…