瀏覽代碼

make term similarity robust (#2212)

### What problem does this PR solve?


### Type of change

- [x] Performance Improvement
tags/v0.11.0
Kevin Hu 1 年之前
父節點
當前提交
5a2c542ce2
No account linked to committer's email address
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      rag/nlp/query.py

+ 1
- 2
rag/nlp/query.py 查看文件

@@ -106,10 +106,9 @@ class EsQueryer:
m) for m in sm]
sm = [EsQueryer.subSpecialChar(m) for m in sm if len(m) > 1]
sm = [m for m in sm if len(m) > 1]
if len(sm) < 2:
sm = []

keywords.append(re.sub(r"[ \\\"']+", "", tk))
keywords.extend(sm)
if len(keywords) >= 12: break

tk_syns = self.syn.lookup(tk)

Loading…
取消
儲存