Wprazuch/sdk reshape#923
Draft
wprazuch wants to merge 2 commits intowprazuch/sdk-onboarding-approach1from
Draft
Conversation
Mechanical rename to align with NEL's existing scoring/ module naming. NEL distinguishes 'metrics' (aggregation layer: confidence intervals, pass@k, paired tests) from 'scoring' (per-sample scoring primitives). SDK's old 'metrics/' contained scoring primitives, so this matches NEL convention. - src/nemo_evaluator/sdk/metrics/ -> src/nemo_evaluator/sdk/scoring/ - tests/test_sdk/metrics/ -> tests/test_sdk/scoring/ - Imports: nemo_evaluator.sdk.metrics.* -> nemo_evaluator.sdk.scoring.* No behavioral changes. All 148 tests still pass. Signed-off-by: Wojciech Prazuch <wprazuch@nvidia.com>
Adds NELScorerMixin in nemo_evaluator.sdk.scoring.base that provides
__call__(ScorerInput) -> dict. This bridges SDK's (item, sample) metric
API to NEL's (ScorerInput) scorer protocol so SDK metrics plug into
NEL's scoring pipeline without an external adapter layer.
All 10 concrete runtime metric classes now inherit the mixin:
- BLEUMetric, ROUGEMetric, F1Metric, ExactMatchMetric
- NumberCheckMetric, StringCheckMetric, ToolCallingMetric
- LLMJudgeMetric
- _RemoteMetricBase (and its subclasses RemoteMetric,
NemoAgentToolkitRemoteMetric)
Mapping performed by the mixin:
item = {'reference': scorer_input.target, **scorer_input.metadata}
sample = {'output_text': scorer_input.response, 'response': scorer_input.response}
score = self.metric(item, sample) # SDK's native call
return {'score': float(score), 'metric_type': self.type}
Users configure SDK metrics with templates that reference these item/
sample keys (e.g. reference='{{ reference }}'), then can use the
metric anywhere NEL accepts a scorer.
Tests: 3 new tests in tests/test_sdk/scoring/test_nel_scorer_mixin.py.
All 151 SDK tests pass.
Signed-off-by: Wojciech Prazuch <wprazuch@nvidia.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
No description provided.