Skip to content

Add ExactMatch Metric scorer PoC#961

Draft
SandyChapman wants to merge 2 commits into
schapman/feat/shared-metric-contractfrom
schapman/feat/exact-match-metric-poc
Draft

Add ExactMatch Metric scorer PoC#961
SandyChapman wants to merge 2 commits into
schapman/feat/shared-metric-contractfrom
schapman/feat/exact-match-metric-poc

Conversation

@SandyChapman
Copy link
Copy Markdown

Summary

  • add an undecorated ExactMatchMetric implementing the shared MetricInput -> MetricResult contract
  • add an ExactMatchScorer BYOB wrapper via the class-based scorer adapter
  • add an example benchmark covering preannotated scorer, inline class scorer, and configured metric instance modes

Validation

  • .venv/bin/ty check src/nemo_evaluator/metrics/exact_match.py src/nemo_evaluator/scorers.py src/nemo_evaluator/init.py src/nemo_evaluator/metrics/init.py tests/test_scoring/test_metric_contract.py tests/test_environments/test_custom_metric_contract.py tests/test_integration/test_eval_loop_integration.py
  • .venv/bin/pyright --pythonpath .venv/bin/python src/nemo_evaluator/metrics/exact_match.py src/nemo_evaluator/scorers.py src/nemo_evaluator/init.py src/nemo_evaluator/metrics/init.py tests/test_scoring/test_metric_contract.py tests/test_environments/test_custom_metric_contract.py tests/test_integration/test_eval_loop_integration.py
  • .venv/bin/ruff check CHANGELOG.md src/nemo_evaluator/metrics/exact_match.py src/nemo_evaluator/scorers.py src/nemo_evaluator/init.py src/nemo_evaluator/metrics/init.py tests/test_scoring/test_metric_contract.py tests/test_environments/test_custom_metric_contract.py tests/test_integration/test_eval_loop_integration.py examples/benchmarks/exact_match_metric_poc.py
  • .venv/bin/python -m pytest tests/test_scoring/test_metric_contract.py tests/test_environments/test_custom_metric_contract.py tests/test_integration/test_eval_loop_integration.py -v -m "not network"
  • executed examples.benchmarks.exact_match_metric_poc through run_evaluation; all three PoC modes returned rewards [1.0, 1.0] and pass@1 1.0

Expose MetricInput -> MetricResult types and adapt decorated scorers via to_metric() so Evaluator OSS scorers can share a runtime contract with platform integrations while preserving BYOB scorer compatibility.
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 4, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: c68f0a59-cf26-4b7c-be4d-85bf9e224f26

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch schapman/feat/exact-match-metric-poc

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the tests label May 4, 2026
@SandyChapman SandyChapman requested a review from wprazuch May 4, 2026 19:02
dataset=_dataset,
prompt="{question}",
target_field="answer",
)(scorer(ExactMatchMetric(reference="{{item.answer}}")))
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty much the same as #2 above, but shows annotating an instance rather than the type.

@SandyChapman SandyChapman force-pushed the schapman/feat/shared-metric-contract branch 2 times, most recently from 8e20f8e to 3ef469f Compare May 15, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant