arXiv는 물리학, 수학, 컴퓨터 과학, 정량 생물학, 정량 금융, 통계학, 전기 공학 및 시스템 과학, 경제학 분야의 200만 개 학술 논문을 위한 오픈 액세스 아카이브입니다.
이 노트북은 Arxiv.org에서 과학 논문을 검색하여 다운스트림에서 사용되는 Document 형식으로 가져오는 방법을 보여줍니다. 모든 ArxivRetriever 기능 및 구성에 대한 자세한 문서는 API reference를 참조하세요.

Integration details

Setup

개별 쿼리에서 자동화된 추적을 원하는 경우, 아래 주석을 해제하여 LangSmith API key를 설정할 수도 있습니다:
os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
os.environ["LANGSMITH_TRACING"] = "true"

Installation

이 retriever는 langchain-community 패키지에 있습니다. arxiv 의존성도 필요합니다:
pip install -qU langchain-community arxiv

Instantiation

ArxivRetriever 매개변수는 다음을 포함합니다:
  • 선택적 load_max_docs: 기본값=100. 다운로드할 문서 수를 제한하는 데 사용합니다. 100개의 문서를 모두 다운로드하는 데 시간이 걸리므로 실험에는 작은 숫자를 사용하세요. 현재 최대 300개로 제한되어 있습니다.
  • 선택적 load_all_available_meta: 기본값=False. 기본적으로 가장 중요한 필드만 다운로드됩니다: Published (문서가 게시/마지막 업데이트된 날짜), Title, Authors, Summary. True인 경우 다른 필드도 다운로드됩니다.
  • get_full_documents: boolean, 기본값 False. 문서의 전체 텍스트를 가져올지 여부를 결정합니다.
자세한 내용은 API reference를 참조하세요.
from langchain_community.retrievers import ArxivRetriever

retriever = ArxivRetriever(
    load_max_docs=2,
    get_ful_documents=True,
)

Usage

ArxivRetriever는 논문 식별자를 통한 검색을 지원합니다:
docs = retriever.invoke("1605.08386")
docs[0].metadata  # meta-information of the Document
{'Entry ID': 'http://arxiv.org/abs/1605.08386v1',
 'Published': datetime.date(2016, 5, 26),
 'Title': 'Heat-bath random walks with Markov bases',
 'Authors': 'Caprice Stanley, Tobias Windisch'}
docs[0].page_content[:400]  # a content of the Document
'Graphs on lattice points are studied whose edges come from a finite set of\nallowed moves of arbitrary length. We show that the diameter of these graphs on\nfibers of a fixed integer matrix can be bounded from above by a constant. We\nthen study the mixing behaviour of heat-bath random walks on these graphs. We\nalso state explicit conditions on the set of moves so that the heat-bath random\nwalk, a ge'
ArxivRetriever는 자연어 텍스트 기반 검색도 지원합니다:
docs = retriever.invoke("What is the ImageBind model?")
docs[0].metadata
{'Entry ID': 'http://arxiv.org/abs/2305.05665v2',
 'Published': datetime.date(2023, 5, 31),
 'Title': 'ImageBind: One Embedding Space To Bind Them All',
 'Authors': 'Rohit Girdhar, Alaaeldin El-Nouby, Zhuang Liu, Mannat Singh, Kalyan Vasudev Alwala, Armand Joulin, Ishan Misra'}

API reference

모든 ArxivRetriever 기능 및 구성에 대한 자세한 문서는 API reference를 참조하세요.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I