摘要链节点#
使用摘要链节点(Summarization Chain node)可以汇总多个文档的内容。
本页将介绍摘要链节点的参数配置,并提供更多相关资源链接。
节点参数#
在待汇总数据(Data to Summarize)中选择需要汇总的数据类型。所选数据类型将决定其他节点参数的显示。
- 使用节点输入(JSON)和使用节点输入(二进制):汇总从工作流传入该节点的数据。
- 可配置分块策略(Chunking Strategy):选择定义数据块大小的策略。
- 如果选择简单模式(Define Below),则可以设置每块字符数(Characters Per Chunk)和块重叠字符数(Chunk Overlap (Characters))。
- 选择高级模式(Advanced)可连接提供更多配置选项的分割器子节点。
- 可配置分块策略(Chunking Strategy):选择定义数据块大小的策略。
- 使用文档加载器(Use Document Loader):汇总由文档加载器子节点提供的数据。
节点选项#
可配置摘要生成方法和提示词。选择添加选项(Add Option) > 摘要方法和提示词(Summarization Method and Prompts)。
摘要方法(Summarization Method)中的选项:
- Map Reduce:推荐使用此方法。在LangChain文档中了解更多关于Map Reduce的信息。
- Refine:在LangChain文档中了解更多关于Refine的信息。
- Stuff:在LangChain文档中了解更多关于Stuff的信息。
可以自定义单个摘要提示词(Individual Summary Prompts)和最终组合提示词(Final Prompt to Combine)。节点中提供了示例。必须包含"{text}"
占位符。
模板与示例#
相关资源#
更多关于该服务的信息,请参考 LangChain 的摘要生成文档。
查看 n8n 的高级 AI 文档。
AI glossary#
- completion: Completions are the responses generated by a model like GPT.
- hallucinations: Hallucination in AI is when an LLM (large language model) mistakenly perceives patterns or objects that don't exist.
- vector database: A vector database stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.
- vector store: A vector store, or vector database, stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.