Kevin Hu
commited on
Commit
·
d007a79
1
Parent(s):
6807fac
fix synonym bug (#3506)
Browse files### What problem does this PR solve?
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- rag/nlp/synonym.py +1 -1
rag/nlp/synonym.py
CHANGED
@@ -68,7 +68,7 @@ class Dealer:
|
|
68 |
|
69 |
def lookup(self, tk):
|
70 |
if re.match(r"[a-z]+$", tk):
|
71 |
-
res = list(set([re.sub("_", " ", syn.name().split(".")[0]) for syn in wordnet.synsets(
|
72 |
return [t for t in res if t]
|
73 |
|
74 |
self.lookup_num += 1
|
|
|
68 |
|
69 |
def lookup(self, tk):
|
70 |
if re.match(r"[a-z]+$", tk):
|
71 |
+
res = list(set([re.sub("_", " ", syn.name().split(".")[0]) for syn in wordnet.synsets(tk)]) - set([tk]))
|
72 |
return [t for t in res if t]
|
73 |
|
74 |
self.lookup_num += 1
|