-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from langchain.document_loaders import UnstructuredExcelLoader | ||
from langchain.chains.question_answering import load_qa_chain | ||
from langchain.chat_models import ChatOpenAI | ||
from langchain.indexes import VectorstoreIndexCreator | ||
from langchain.chains import RetrievalQA | ||
loader=UnstructuredExcelLoader("trending_football_players.xlsx") | ||
index=VectorstoreIndexCreator() | ||
doc=index.from_loaders([loader]) | ||
chain=RetrievalQA.from_chain_type(llm=ChatOpenAI(temperature=0,model="gpt-4"),chain_type="stuff",retriever=doc.vectorstore.as_retriever(),input_key="question") | ||
query="who has the lowest total stats" | ||
response=chain({"question":query}) | ||
print(response) |
Binary file not shown.