fix(metrics): correct answer parsing and text scoring - #1649
Merged
Conversation
Parse connector-separated multi-select answers, including case-insensitive and/or variants. Average Rouge scores across all prediction/reference pairs and normalize ANLS distances with normalized string lengths.
git-jxj
marked this pull request as ready for review
August 27, 2026 09:38
…rsing # Conflicts: # evalscope/metrics/utils/rouge.py
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.
Summary
This PR fixes three scoring issues that can make correct model outputs receive incorrect or inconsistent evaluation results:
A and B,A/B, or case variants likeA AND Bwere truncated to the first label.Root Cause
The multi-choice parser stopped its label prefix at connector words and did not recognize slash or ideographic-comma separators. Connector normalization was also case-sensitive.
The Rouge helpers assigned every pair's metrics to the same result keys inside the scoring loop, so later pairs replaced earlier ones.
ANLS normalized whitespace and case before computing Levenshtein distance, but used the raw reference and prediction lengths as the denominator. Extra whitespace could therefore change the score without changing the normalized answer.
Changes
and/orconnectors case-insensitively when they occur between valid choice labels.B, not C.Reproduction
On the unmodified
mainbranch:After this change:
The multi-choice guard case remains unchanged:
Validation
Result:
All configured pre-commit checks also passed:
Scope
This change only affects multi-select answer extraction, per-sample Rouge aggregation, and ANLS length normalization. It does not change benchmark prompts, dataset loading, model generation, target labels, or unrelated metrics.