Skip to content

Commit

Permalink
refine using rerank model (infiniflow#2553)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

infiniflow#2552

### Type of change

- [x] Performance Improvement
  • Loading branch information
KevinHuSh authored Sep 24, 2024
1 parent c06a098 commit f2a47c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rag/nlp/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def rerank_by_model(self, rerank_mdl, sres, query, tkweight=0.3,
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

Expand Down

0 comments on commit f2a47c0

Please sign in to comment.