Analyze a single long document | ü¶úÔ∏èüîó Langchain






Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKQA over structured dataSQLRetrieval-augmented generation (RAG)RAG over codeUsing a RetrieverRemembering chat historyAnalyze a single long documentAgent with retrieval toolText splitting by headerRAG over in-memory documentsRAG using local modelsDynamically select from multiple retrieversRetrieving from multiple sourcesCiting retrieval sourcesRetrieve from vector stores directlyInteracting with APIsChatbotsExtractionSummarizationTaggingWeb scrapingSynthetic data generationGraph queryingRetrieval-augmented generation (RAG)Analyze a single long documentAnalyze a single long documentThe AnalyzeDocumentChain takes in a single document, splits it up, and then runs it through a CombineDocumentsChain.with open("../../state_of_the_union.txt") as f:    state_of_the_union = f.read()from langchain.llms import OpenAIfrom langchain.chains import AnalyzeDocumentChainllm = OpenAI(temperature=0)from langchain.chains.question_answering import load_qa_chainqa_chain = load_qa_chain(llm, chain_type="map_reduce")qa_document_chain = AnalyzeDocumentChain(combine_docs_chain=qa_chain)qa_document_chain.run(input_document=state_of_the_union, question="what did the president say about justice breyer?")    ' The president thanked Justice Breyer for his service.'PreviousRemembering chat historyNextAgent with retrieval toolCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
The AnalyzeDocumentChain takes in a single document, splits it up, and then runs it through a CombineDocumentsChain.
The AnalyzeDocumentChain takes in a single document, splits it up, and then runs it through a CombineDocumentsChain. ->: Analyze a single long document | ü¶úÔ∏èüîó Langchain






Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKQA over structured dataSQLRetrieval-augmented generation (RAG)RAG over codeUsing a RetrieverRemembering chat historyAnalyze a single long documentAgent with retrieval toolText splitting by headerRAG over in-memory documentsRAG using local modelsDynamically select from multiple retrieversRetrieving from multiple sourcesCiting retrieval sourcesRetrieve from vector stores directlyInteracting with APIsChatbotsExtractionSummarizationTaggingWeb scrapingSynthetic data generationGraph queryingRetrieval-augmented generation (RAG)Analyze a single long documentAnalyze a single long documentThe AnalyzeDocumentChain takes in a single document, splits it up, and then runs it through a CombineDocumentsChain.with open("../../state_of_the_union.txt") as f:    state_of_the_union = f.read()from langchain.llms import OpenAIfrom langchain.chains import AnalyzeDocumentChainllm = OpenAI(temperature=0)from langchain.chains.question_answering import load_qa_chainqa_chain = load_qa_chain(llm, chain_type="map_reduce")qa_document_chain = AnalyzeDocumentChain(combine_docs_chain=qa_chain)qa_document_chain.run(input_document=state_of_the_union, question="what did the president say about justice breyer?")    ' The president thanked Justice Breyer for his service.'PreviousRemembering chat historyNextAgent with retrieval toolCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.