Skip to content

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

refine using rerank model (#2553)

Kevin Huecf441c83016
diff --git a/rag/nlp/search.py b/rag/nlp/search.py
index ea83406292..914b49c20c 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