Skip to content

Instantly share code, notes, and snippets.

@vhxs
Created August 12, 2023 17:35
Show Gist options
  • Save vhxs/ab17d4d0ec47610c2b4010afdc0486c6 to your computer and use it in GitHub Desktop.
Save vhxs/ab17d4d0ec47610c2b4010afdc0486c6 to your computer and use it in GitHub Desktop.
Using LangChain to ask about one of my papers.
from langchain.document_loaders import OnlinePDFLoader
from langchain.indexes import VectorstoreIndexCreator
loader = OnlinePDFLoader("https://arxiv.org/pdf/1606.06353.pdf")
documents = loader.load()
index = VectorstoreIndexCreator().from_documents(documents)
print(index.query("What are the main results of this paper?"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment