瀏覽代碼

refine using rerank model (#2553)

### What problem does this PR solve?

#2552

### Type of change

- [x] Performance Improvement
tags/v0.12.0
Kevin Hu 1 年之前
父節點
當前提交
ecf441c830
No account linked to committer's email address
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      rag/nlp/search.py

+ 1
- 1
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


Loading…
取消
儲存