Kevin Hu
commited on
Commit
·
6d3d3cb
1
Parent(s):
e2f0276
make term similarity robust (#2212)
Browse files### What problem does this PR solve?
### Type of change
- [x] Performance Improvement
- rag/nlp/query.py +1 -2
rag/nlp/query.py
CHANGED
@@ -106,10 +106,9 @@ class EsQueryer:
|
|
106 |
m) for m in sm]
|
107 |
sm = [EsQueryer.subSpecialChar(m) for m in sm if len(m) > 1]
|
108 |
sm = [m for m in sm if len(m) > 1]
|
109 |
-
if len(sm) < 2:
|
110 |
-
sm = []
|
111 |
|
112 |
keywords.append(re.sub(r"[ \\\"']+", "", tk))
|
|
|
113 |
if len(keywords) >= 12: break
|
114 |
|
115 |
tk_syns = self.syn.lookup(tk)
|
|
|
106 |
m) for m in sm]
|
107 |
sm = [EsQueryer.subSpecialChar(m) for m in sm if len(m) > 1]
|
108 |
sm = [m for m in sm if len(m) > 1]
|
|
|
|
|
109 |
|
110 |
keywords.append(re.sub(r"[ \\\"']+", "", tk))
|
111 |
+
keywords.extend(sm)
|
112 |
if len(keywords) >= 12: break
|
113 |
|
114 |
tk_syns = self.syn.lookup(tk)
|