Skip to content

[Feature Request] Support for non-integer relevance labels #71

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

Open
davefernig opened this issue Jan 24, 2025 · 0 comments
Open

[Feature Request] Support for non-integer relevance labels #71

davefernig opened this issue Jan 24, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@davefernig
Copy link

I would like to be able to use real-valued labels, and compute DCG and NDCG metrics that respect the differences in labels that at less than 1. So for example:

  • A document with relevance label = 1 would have Burges gain of 2**1 - 1 = 1.0
  • But a document with relevance label = 1.9 would have Burges gain of 2**1.9 - 1 = 2.73

However, it seems like Ranx's Qrels object will cast my relevance labels to integers:

from ranx import Qrels

qrels_dict = {"q_1": {"d_11": 1.9}}
qrels = Qrels(qrels_dict)
print(qrels)

>>> {q_1: {d_11: 1}}

I believe this happens in the Qrels constructor here. A consequence of this is that I can't properly use real-valued labels. The relevance values will be truncated, and a lot of information will be lost.

Questions for the maintainers:

  1. Am I missing something? Is there a way to achieve what I want with Ranx?
  2. If not, what is required to make Ranx support this? Is this a big lift or a small one?
@davefernig davefernig added the enhancement New feature or request label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant