Repository navigation
feat(metrics): add traditional IR metrics — NDCGScore, MRRScore, PrecisionAtK, RecallAtK - #2816
Open
shadowmodder wants to merge 1 commit into
Open
shadowmodder wants to merge 1 commit into
shadowmodder wants to merge 1 commit into
Conversation
Addresses vibrantlabsai#2028, contributes to vibrantlabsai#2315 Adds NDCGScore, MRRScore, PrecisionAtK, RecallAtK as SingleTurnMetric subclasses. These are deterministic, require no LLM, and operate on retrieved_context_ids / reference_context_ids from SingleTurnSample. All four follow the RougeScore pattern: dataclass, init() is a no-op, _single_turn_ascore() is pure Python.
|
✅ No documentation update needed — The four new IR metrics (NDCGScore, MRRScore, PrecisionAtK, RecallAtK) all include complete docstrings with usage examples, parameters, and required fields, so the auto-generated API reference is covered without manual doc edits. |
Author
|
Checking in on this one. It still merges cleanly. If traditional IR metrics like NDCG and MRR are not something you want in ragas, tell me and I will close it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #2028, contributes to the metrics refactor in #2315.
Summary
Adds four deterministic retrieval quality metrics that require no LLM:
NDCGScoreMRRScorePrecisionAtKRecallAtKAll four operate on
SingleTurnSample.retrieved_context_idsandreference_context_ids, which are already part of the schema.Usage
Design
Follows the
RougeScorepattern exactly:@dataclass,init()is a no-op,_single_turn_ascore()is pure Python with no external dependencies. All four are exported fromragas.metrics.References