diff --git a/rag/app/resume.py b/rag/app/resume.py index 0805253750c..da620cb38be 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 11e3f502aed..2d94a96c7bf 100644 --- a/rag/nlp/query.py +++ b/rag/nlp/query.py @@ -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' diff --git a/web/src/components/edit-tag/index.tsx b/web/src/components/edit-tag/index.tsx index 1c9f0aee846..aac8143b400 100644 --- a/web/src/components/edit-tag/index.tsx +++ b/web/src/components/edit-tag/index.tsx @@ -37,8 +37,12 @@ const EditTag = ({ tags, setTags }: EditTagsProps) => { }; const handleInputConfirm = () => { - if (inputValue && tags?.indexOf(inputValue) === -1) { - setTags?.([...tags, inputValue]); + if (inputValue && tags) { + const newTags = inputValue + .split(';') + .map((tag) => tag.trim()) + .filter((tag) => tag && !tags.includes(tag)); + setTags?.([...tags, ...newTags]); } setInputVisible(false); setInputValue('');