load_summarize_chain
- Three ways to summarize or otherwise combine documents.
- Stuff : simply concatenates documents into a prompt
- Usually the simplest method
- When documents fit in context window
- Map-reduce : splits documents into batches, summarizes those, and then summarizes the summaries
- When documents does not fit in context window
- Refine: updates a rolling summary be iterating over the documents in a sequence.
- Stuff : simply concatenates documents into a prompt
from langchain.chains.summarize import load_summarize_chain