Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix syn error. (#3953)

Kevin Hu927873bfa695
diff --git a/rag/app/resume.py b/rag/app/resume.py
index 0805253750..da620cb38b 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 11e3f502ae..2d94a96c7b 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'