Add support for configurable chrF metric parameters in task YAML, fix… #3363
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
Adds support for configurable chrF metric parameters (e.g., char_order, word_order) in task YAML files, enabling
users to specify chrF++ and other chrF variants directly in their task configurations.
Problem
The chrF metric implementation in
lm_eval/api/metrics.pycallssacrebleu.corpus_chrf()with hardcoded defaultparameters (character order 6 and word order 0). This prevented users from configuring chrF++ (which uses word order
2) or other chrF variants through task YAML files.
Solution
metric_kwargsparameter tostderr_for_metric()function in lm_eval/api/metrics.pycalculate_aggregate_metric()inlm_eval/evaluator_utils.pyto passmetric_kwargsto stderr calculationchar_orderword_orderbetaremove_whitespaceeps_smoothingTesting
Tested with a chrF++ configuration (word_order=2) in a task YAML file:
Verified that both main aggregation and all bootstrap stderr iterations correctly use
word_order=2instead ofreverting to the default
word_order=0.#2256