浏览代码

Removed the "USER:" in the question, reducing the accuracy of the search (#7852)

### What problem does this PR solve?

![85784793b4](https://github.com/user-attachments/assets/88748407-ea3d-445a-9dae-8f02cfdf78f3)

![77e59b94b6](https://github.com/user-attachments/assets/6531c691-a625-48c4-b05f-c64f8acd7c28)

![73e91d7211](https://github.com/user-attachments/assets/eb9d0bb2-4aac-40d8-8444-cdcbc0835568)

![45c8a52ecf](https://github.com/user-attachments/assets/d56162a4-8168-4e7f-a113-17ec258b9539)
user will be used as a common keyword to participate in the search,
which may lead to the recall of irrelevant content and reduce the search
accuracy.
If user appears frequently in your knowledge base, it may affect
relevance sorting and even recall some irrelevant FAQs or documents.


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [x] Performance Improvement
- [ ] Other (please describe):

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
tags/v0.19.1
Sol 5 个月前
父节点
当前提交
bc578e1e83
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1
    0
      agent/component/retrieval.py

+ 1
- 0
agent/component/retrieval.py 查看文件

@@ -96,6 +96,7 @@ class Retrieval(ComponentBase, ABC):
rerank_mdl = LLMBundle(kbs[0].tenant_id, LLMType.RERANK, self._param.rerank_id)

if kbs:
query = re.sub(r"^user[::\s]*", "", query, flags=re.IGNORECASE)
kbinfos = settings.retrievaler.retrieval(
query,
embd_mdl,

正在加载...
取消
保存