mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-10 16:59:01 +08:00
Removed the "USER:" in the question, reducing the accuracy of the search (#7852)
### What problem does this PR solve?     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>
This commit is contained in:
parent
ff0e82988f
commit
bc578e1e83
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user