From ecf441c830162fd8ca8a7715faf8328d91c53cd7 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Tue, 24 Sep 2024 12:38:18 +0800 Subject: [PATCH] refine using rerank model (#2553) ### What problem does this PR solve? #2552 ### Type of change - [x] Performance Improvement --- rag/nlp/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/nlp/search.py b/rag/nlp/search.py index ea8340629..914b49c20 100644 --- a/rag/nlp/search.py +++ b/rag/nlp/search.py @@ -348,7 +348,7 @@ class Dealer: ins_tw.append(tks) tksim = self.qryr.token_similarity(keywords, ins_tw) - vtsim,_ = rerank_mdl.similarity(" ".join(keywords), [rmSpace(" ".join(tks)) for tks in ins_tw]) + vtsim,_ = rerank_mdl.similarity(query, [rmSpace(" ".join(tks)) for tks in ins_tw]) return tkweight*np.array(tksim) + vtweight*vtsim, tksim, vtsim