Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

❗️ FlashRankRanker ranking is incorrect – it returns the documents in input order #39

Open
lsorber opened this issue Oct 7, 2024 · 0 comments

Comments

@lsorber
Copy link

lsorber commented Oct 7, 2024

The ranking produced by FlashRankRanker is incorrect. It returns the documents in input order.

This statement in flashrank_ranker.py1

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

should be:

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

Footnotes

  1. https://github.com/AnswerDotAI/rerankers/blob/c5b2c19e7a84fc4c4dd3f31dea934297ce4b7bb1/rerankers/models/flashrank_ranker.py#L48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant