From 916f1f424dfa460aca7ffcde1f91db23b6d89dd2 Mon Sep 17 00:00:00 2001 From: shiyu22 Date: Tue, 20 Jun 2023 16:28:25 +0800 Subject: [PATCH] Update output Signed-off-by: shiyu22 --- rerank.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rerank.py b/rerank.py index 2e3be93..e3ab5ec 100644 --- a/rerank.py +++ b/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 \ No newline at end of file + re_scores = [scores[i] for i in re_ids] + return re_docs, re_scores \ No newline at end of file