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

1018 篇文章 595 订阅
299 篇文章 27 订阅

作者:来自 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

为了能够使得上面的代码能够顺利运行,我们必须在链接 https://huggingface.co/datasets/ELiRF/dacsa 申请访问这个数据的权限,否则会议错误信息:

Cannot access gated repo for url https://huggingface.co/api/datasets/ELiRF/dacsa/paths-info/main. Access to dataset ELiRF/dacsa is restricted and you are not in the authorized list. Visit https://huggingface.co/datasets/ELiRF/dacsa to ask for access.

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

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

  • 18
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值