知识卡片
候选数量在检索与回答层分别配置
Retriever的top_k决定送给下游多少文档,Reader的top_k控制返回多少答案。增加候选可能改善覆盖,也会增加噪声和成本;上下文长度与后续模型能力限制收益,不能把两层top_k看作同一件事。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
>>> result = pipe.run(query=question, ... params={"Reader": { ... "top_k": 1}, "Retriever": {"top_k": 5}}) >>> print_answers(result, details='minimum') 'Query: what is an embedding' 'Answers:' [ { 'answer': 'vectors that represent the meaning (semantics) of words', 'context': 'Word embeddings are vectors that represent the meaning ' '(semantics) of words.'}] Not bad! Note the context field, which gives you the full sentence that contains the answer. 10.3.11 Combining semantic
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》第10章《真实世界中的大语言模型》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-10.html)
- 结论依据:摘录中关于候选数量在检索与回答层分别配置的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:>>> result = pipe.run(query=question, ... params={"Reader": { ... "top_k": 1}, "Retriever": {"top_k": 5}}) >>> print_answers(result, details='minimum') 'Query: what is an embedding' 'Answers:' [ { 'answer': 'vectors that represent the meaning (semantics) of words', 'context': 'Word embeddings are vectors that represent the meaning ' '(semantics) of words.'}] Not bad! Note the context field, which gives you the full sentence that contains the answer. 10.3.11 Combining semantic