diff --git a/rag/app/resume.py b/rag/app/resume.py index 080525375..da620cb38 100644 --- a/rag/app/resume.py +++ b/rag/app/resume.py @@ -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 {} diff --git a/rag/nlp/query.py b/rag/nlp/query.py index 11e3f502a..2d94a96c7 100644 --- a/rag/nlp/query.py +++ b/rag/nlp/query.py @@ -86,10 +86,10 @@ class FulltextQueryer: 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'