feat(scorers): support multiple python_scorer_* entries in run YAML - #528
Open
saurabh-net wants to merge 10 commits into
Open
feat(scorers): support multiple python_scorer_* entries in run YAML#528saurabh-net wants to merge 10 commits into
saurabh-net wants to merge 10 commits into
Conversation
- Enable key prefix matching for any key under starting with . - Ensure comparator name matches YAML key for clean metric aggregation in , , and . - Add unit tests for multiple python scorers and aggregation in .
saurabh-net
requested review from
IsmailMehdi,
helloeve and
prernakakkar-google
as code owners
July 27, 2026 23:17
…c_scorer prefix in analyzer
…_scorer_name helper
saurabh-net
marked this pull request as draft
July 27, 2026 23:37
saurabh-net
marked this pull request as ready for review
July 29, 2026 16:25
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.
Motivation
In evaluation workflows, users often need to evaluate model outputs against multiple distinct Python evaluators (e.g. execution accuracy, code style, compliance, or custom domain judges) within a single evaluation run configuration YAML.
Previously:
score.pyonly checked for exact keyif key == "python_scorer":.python_scorer:in YAML only preserved the last entry.python_scorer_accuracyorpython_scorer_stylewere skipped byscore.py.Implementation Summary
evalbench/scorers/score.pyto match any dictionary key underscorers:starting withpython_scorer(if key.startswith("python_scorer"):).custom_nameFallback Resolution: Retained fullcustom_nameresolution logic inscore.py(scorer_name->script_pathbasename ->keyfallback).evalbench/reporting/analyzer.py(analyze_one_metric) to resolvecomparator_nameusing the same fallback rules asscore.py. This guarantees thatdf["comparator"]matchescomparator_namecleanly regardless of whetherscorer_name, script basename, orkeyis used for comparator naming.scorer_configbefore passing toPythonScorerto prevent in-place mutation of input dictionaries.docs/configs/run-config.mdanddocs/gemini_cli_agent_testing.mdwith YAML usage examples for single and multiple Python scorers.Testing & Verification Context
1. Automated Unit Tests
pythonscorer_test.py:./.venv/bin/python -m unittest evalbench/test/pythonscorer_test.pycustom_nameresolution, andanalyzer.pysummary metric aggregation.hybrid_xa_judge_test.py:./.venv/bin/python -m unittest evalbench/test/hybrid_xa_judge_test.pyevalbench/scorers/judges/hybrid_xa_judge.pyanddatasets/bird/example_hybrid_run_config.yamlremain 100% backward-compatible.2. Manual Integration Testing
scorer_accuracy.pyreturning 100.0% andscorer_style.pyreturning 85.0%) and configured a test YAML containing both underscorers:(python_scorer_accuracyandpython_scorer_style).evalbench/evalbench.pyCLI:python evalbench/evalbench.py --experiment_config=/tmp/evalbench_noop_test_run.yamlevalbench.pyexecuted all pipeline stages (DB Setup -> Prompts -> SQLGen -> SQLExec -> Scoring -> Analyzer -> CSV Exports). Both Python scorers ran natively, logged individual scores, and were recorded inscores.csvandsummary.csv.