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