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

Provide Scorers with the @k parameter from Settings #1259

Open
david-fisher opened this issue Mar 3, 2025 · 0 comments
Open

Provide Scorers with the @k parameter from Settings #1259

david-fisher opened this issue Mar 3, 2025 · 0 comments

Comments

@david-fisher
Copy link
Contributor

Is your feature request related to a problem? Please describe.
As a relevance engineer, I would like to evaluate my cases at a number of different values of k for any given metric. To do so, I currently need to define a new custom scorer for each value of k.

Describe the solution you'd like
Using either the Number of Results to Show value as k, or specifying a separate parameter, k, pass that value in the the scorers in the same fashion as qoption is passed in for individual queries.

This would allow implementing a single scorer for a metric, eg:

RR@k

const k = get_k()
let rank = 0;
eachDoc(function(doc, i) {
    if (rank === 0 && hasDocRating(i) && (docRating(i)) > 1) { // Make binary 0,1 are irrelevant, 2 and above is relevant.
        rank = i+1; // remember the rank of the first relevant document
     }
}, k);
const score = rank > 0 ? 1.0 / rank : 0.0;
setScore(score);

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