Browse Source

make term similarity robust (#2212)

### What problem does this PR solve?


### Type of change

- [x] Performance Improvement
tags/v0.11.0
Kevin Hu 1 year ago
parent
commit
5a2c542ce2
No account linked to committer's email address
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      rag/nlp/query.py

+ 1
- 2
rag/nlp/query.py View File

@@ -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…
Cancel
Save