Kevin Hu
commited on
Commit
·
86cdc50
1
Parent(s):
afdf41f
Fix syn error. (#3953)
Browse files### What problem does this PR solve?
Close #3696
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- rag/app/resume.py +1 -1
- rag/nlp/query.py +2 -2
rag/app/resume.py
CHANGED
@@ -64,7 +64,7 @@ def remote_call(filename, binary):
|
|
64 |
resume = step_two.parse(resume)
|
65 |
return resume
|
66 |
except Exception:
|
67 |
-
logging.exception("Resume parser
|
68 |
return {}
|
69 |
|
70 |
|
|
|
64 |
resume = step_two.parse(resume)
|
65 |
return resume
|
66 |
except Exception:
|
67 |
+
logging.exception("Resume parser has not been supported yet!")
|
68 |
return {}
|
69 |
|
70 |
|
rag/nlp/query.py
CHANGED
@@ -86,10 +86,10 @@ class FulltextQueryer:
|
|
86 |
syn = self.syn.lookup(tk)
|
87 |
syn = rag_tokenizer.tokenize(" ".join(syn)).split()
|
88 |
keywords.extend(syn)
|
89 |
-
syn = ["\"{}\"^{:.4f}".format(s, w / 4.) for s in syn]
|
90 |
syns.append(" ".join(syn))
|
91 |
|
92 |
-
q = ["({}^{:.4f}".format(tk, w) + " {})".format(syn) for (tk, w), syn in zip(tks_w, syns) if tk]
|
93 |
for i in range(1, len(tks_w)):
|
94 |
q.append(
|
95 |
'"%s %s"^%.4f'
|
|
|
86 |
syn = self.syn.lookup(tk)
|
87 |
syn = rag_tokenizer.tokenize(" ".join(syn)).split()
|
88 |
keywords.extend(syn)
|
89 |
+
syn = ["\"{}\"^{:.4f}".format(s, w / 4.) for s in syn if s]
|
90 |
syns.append(" ".join(syn))
|
91 |
|
92 |
+
q = ["({}^{:.4f}".format(tk, w) + " {})".format(syn) for (tk, w), syn in zip(tks_w, syns) if tk and not re.match(r"[.^+\(\)-]", tk)]
|
93 |
for i in range(1, len(tks_w)):
|
94 |
q.append(
|
95 |
'"%s %s"^%.4f'
|