logo
rerank
repo-copy-icon

copied

Browse Source

Update output

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 2 years ago
parent
commit
916f1f424d
  1. 4
      rerank.py

4
rerank.py

@ -14,5 +14,5 @@ class ReRank(NNOperator):
scores = self._model.predict([(query, doc) for doc in docs])
re_ids = sorted(range(len(scores)), key=lambda k: scores[k], reverse=True)
re_docs = [docs[i] for i in re_ids]
scores.sort(reverse=True)
return re_docs, scores
re_scores = [scores[i] for i in re_ids]
return re_docs, re_scores
Loading…
Cancel
Save