Skip to content

Commit

Permalink
Fix syn error. (infiniflow#3953)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Close infiniflow#3696
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored Dec 10, 2024
1 parent 5fe0791 commit 927873b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rag/app/resume.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def remote_call(filename, binary):
resume = step_two.parse(resume)
return resume
except Exception:
logging.exception("Resume parser error")
logging.exception("Resume parser has not been supported yet!")
return {}


Expand Down
4 changes: 2 additions & 2 deletions rag/nlp/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ def question(self, txt, tbl="qa", min_match:float=0.6):
syn = self.syn.lookup(tk)
syn = rag_tokenizer.tokenize(" ".join(syn)).split()
keywords.extend(syn)
syn = ["\"{}\"^{:.4f}".format(s, w / 4.) for s in syn]
syn = ["\"{}\"^{:.4f}".format(s, w / 4.) for s in syn if s]
syns.append(" ".join(syn))

q = ["({}^{:.4f}".format(tk, w) + " {})".format(syn) for (tk, w), syn in zip(tks_w, syns) if tk]
q = ["({}^{:.4f}".format(tk, w) + " {})".format(syn) for (tk, w), syn in zip(tks_w, syns) if tk and not re.match(r"[.^+\(\)-]", tk)]
for i in range(1, len(tks_w)):
q.append(
'"%s %s"^%.4f'
Expand Down

0 comments on commit 927873b

Please sign in to comment.