Skip to main content

ArXiv

这篇笔记介绍了如何使用arxiv工具与代理程序。

首先,您需要安装arxiv python包。

%pip install --upgrade --quiet  arxiv
from langchain import hub
from langchain.agents import AgentExecutor, create_react_agent, load_tools
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(temperature=0.0)
tools = load_tools(["arxiv"],)
prompt = hub.pull("hwchase17/react")
agent = create_react_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
agent_executor.invoke(
{
"input": "What's the paper 1605.08386 about?",
}
)
> 进入新的 AgentExecutor 链...
我应该使用 arxiv 工具来搜索具有给定标识符的论文。
操作:arxiv
操作输入:1605.08386
发布日期:2016-05-26
标题:Heat-bath random walks with Markov bases
作者:Caprice Stanley, Tobias Windisch
摘要:研究了在格点上的图,其边来自任意长度的有限移动集。我们证明了这些图在固定整数矩阵的纤维上的直径可以被一个常数上界限制。然后我们研究了这些图上的热浴随机行走的混合行为。我们还陈述了关于移动集的明确条件,使得热浴随机行走(Glauber 动力学的一般化)在固定维度中是一个扩张器。论文“1605.08386”的标题是“Heat-bath random walks with Markov bases”,作者是Caprice Stanley和Tobias Windisch。它于2016年5月26日发表。该论文讨论了格点上的图,其边来自一个有限移动集。它探讨了这些图的直径以及热浴随机行走的混合行为。该论文还讨论了热浴随机行走在固定维度中成为扩张器的条件。
最终答案:论文“1605.08386”是关于具有马尔可夫基础的热浴随机行走。
> 链结束。
{'input': "What's the paper 1605.08386 about?",
'output': 'The paper "1605.08386" is about heat-bath random walks with Markov bases.'}

ArXiv API 包装器

该工具使用API Wrapper。下面,我们探讨一些它提供的功能。

from langchain_community.utilities import ArxivAPIWrapper

您可以使用 ArxivAPIWrapper 获取有关科学文章的信息。查询文本限制为300个字符。

ArxivAPIWrapper 返回这些文章字段:

  • 发布日期

  • 标题

  • 作者

  • 摘要

以下查询返回有关具有 arxiv ID“1605.08386”的一篇文章的信息。

arxiv = ArxivAPIWrapper()
docs = arxiv.run("1605.08386")
docs
'Published: 2016-05-26
Title: Heat-bath random walks with Markov bases
Authors: Caprice Stanley, Tobias Windisch
Summary: Graphs on lattice points are studied whose edges come from a finite set of
allowed moves of arbitrary length. We show that the diameter of these graphs on
fibers of a fixed integer matrix can be bounded from above by a constant. We
then study the mixing behaviour of heat-bath random walks on these graphs. We
also state explicit conditions on the set of moves so that the heat-bath random
walk, a generalization of the Glauber dynamics, is an expander in fixed
dimension.'

现在,我们想获取有关一位作者Caprice Stanley的信息。

此查询返回有关三篇文章的信息。默认情况下,查询仅返回三篇顶级文章的信息。

docs = arxiv.run("Caprice Stanley")
docs
'Published: 2017-10-10
Title: On Mixing Behavior of a Family of Random Walks Determined by a Linear Recurrence
Authors: Caprice Stanley, Seth Sullivant
Summary: We study random walks on the integers mod $G_n$ that are determined by an
integer sequence $\\{ G_n \\}_{n \\geq 1}$ generated by a linear recurrence
relation. Fourier analysis provides explicit formulas to compute the
eigenvalues of the transition matrices and we use this to bound the mixing time
of the random walks.
Published: 2016-05-26
Title: Heat-bath random walks with Markov bases
Authors: Caprice Stanley, Tobias Windisch
Summary: Graphs on lattice points are studied whose edges come from a finite set of
allowed moves of arbitrary length. We show that the diameter of these graphs on
fibers of a fixed integer matrix can be bounded from above by a constant. We
then study the mixing behaviour of heat-bath random walks on these graphs. We
also state explicit conditions on the set of moves so that the heat-bath random
walk, a generalization of the Glauber dynamics, is an expander in fixed
dimension.
Published: 2003-03-18
Title: Calculation of fluxes of charged particles and neutrinos from atmospheric showers
Authors: V. Plyaskin
Summary: The results on the fluxes of charged particles and neutrinos from a
3-dimensional (3D) simulation of atmospheric showers are presented. An
agreement of calculated fluxes with data on charged particles from the AMS and
CAPRICE detectors is demonstrated. Predictions on neutrino fluxes at different
experimental sites are compared with results from other calculations.'

现在,我们正在尝试查找有关不存在文章的信息。在这种情况下,响应是"未找到有效的Arxiv结果"。


Was this page helpful?


You can leave detailed feedback on GitHub.