Pārlūkot izejas kodu

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 pirms 5 mēnešiem
vecāks
revīzija
bc578e1e83
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1
    0
      agent/component/retrieval.py

+ 1
- 0
agent/component/retrieval.py Parādīt failu

@@ -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,

Notiek ielāde…
Atcelt
Saglabāt