Skip to content

Commit

Permalink
fix: flashrank ordering (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
bclavie authored Nov 12, 2024
1 parent 69f09b7 commit 89c76f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rerankers/models/flashrank_ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ def rank(

ranked_results = [
Result(
document=docs[idx],
document=docs[result["id"]], # Returns reranked documents.
score=result["score"],
rank=idx + 1,
)
for idx, result in enumerate(flashrank_results)
]

return RankedResults(results=ranked_results, query=query, has_scores=True)

def score(self, query: str, doc: str) -> float:
Expand Down

0 comments on commit 89c76f2

Please sign in to comment.