浏览代码

Fix: empty tag field issue. (#6103)

### What problem does this PR solve?

#6102

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.18.0
Kevin Hu 7 个月前
父节点
当前提交
e5a8b23684
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      rag/nlp/search.py

+ 2
- 0
rag/nlp/search.py 查看文件

@@ -258,6 +258,8 @@ class Dealer:
q_denor = np.sqrt(np.sum([s*s for t,s in query_rfea.items() if t != PAGERANK_FLD]))
for i in search_res.ids:
nor, denor = 0, 0
if not search_res.field[i].get(TAG_FLD):
continue
for t, sc in eval(search_res.field[i].get(TAG_FLD, "{}")).items():
if t in query_rfea:
nor += query_rfea[t] * sc

正在加载...
取消
保存