修复知识库搜索:移除'玩家'从停用词列表,解决'玩家权利'查询匹配错误

- 从auto_reply.py的_STOPWORDS集合中移除'玩家'
- 添加注释说明原因:Minecraft服务器场景中'玩家'是高频核心词
- 验证:查询'玩家有哪些权利?'现在正确返回'玩家权利'section
- Task #1732 和 #1733
This commit is contained in:
youpaishidifu
2026-09-16 16:40:23 +08:00
parent d62503baf4
commit 36f395c680
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -540,8 +540,10 @@ class KnowledgeBase:
# ⭐ 检测安装意图:查询包含"安装/怎么装/如何安装"等词
has_install_keyword = any(w in query_stripped for w in ('安装', '怎么装', '如何安装', '安装方法', '安装步骤', '安装教程'))
# ⭐ 过滤查询停用词:通用名词(服务器、玩家、游戏等)会导致TF-IDF虚高
# ⭐ 过滤查询停用词:通用名词(服务器、游戏等)会导致TF-IDF虚高
# 修复"服务器的公告"被player.md"运营方权利"压过index.md"近期公告"的问题
# ⭐ 注意:已从停用词移除"玩家"(2026-09-16修复),因为"Minecraft服务器玩家协议"
# 场景下"玩家"是核心词,如"玩家有哪些权利"应匹配"玩家权利"而非"版权归属"
from auto_reply import AutoReply
query_tokens_filtered = [t for t in tokens if t not in AutoReply._STOPWORDS]
if not query_tokens_filtered: