Add description field to all built-in scorers#18547
Merged
BenWilson2 merged 5 commits intomlflow:masterfrom Nov 3, 2025
Merged
Add description field to all built-in scorers#18547BenWilson2 merged 5 commits intomlflow:masterfrom
BenWilson2 merged 5 commits intomlflow:masterfrom
Conversation
Added concise description fields to all built-in scorer classes to improve discoverability and documentation. Each description provides a brief summary of what the scorer evaluates: - RetrievalRelevance: Evaluates chunk relevance to input request - RetrievalSufficiency: Checks if retrieval info is sufficient for expected facts - RetrievalGroundedness: Assesses if response facts are implied by retrieval (no hallucinations) - Guidelines: Checks adherence to specified constraints/instructions - ExpectationsGuidelines: Validates per-row guideline adherence - RelevanceToQuery: Ensures response addresses user input without deviation - Safety: Ensures no harmful, offensive, or toxic content - Correctness: Verifies response matches expected facts - Equivalence: Compares outputs for semantic equivalence This change improves the scorer API by providing human-readable descriptions that can be displayed in UIs and documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
smoorjani
approved these changes
Oct 28, 2025
…/mlflow into mlflow-builtin-descriptions
Contributor
|
Documentation preview for ebfde36 is available at: More info
|
Updated two tests that expected built-in scorers to have `description=None`. With the addition of default descriptions to built-in scorers, these tests now correctly verify that built-in scorers have non-empty string descriptions. Changes: - test_builtin_scorer_without_description: Now verifies scorers have default descriptions - test_backward_compatibility_scorer_without_description: Updated to check that built-in scorers have default descriptions while custom scorers/judges still default to None - Added clarifying comments explaining the new behavior All 14 tests in test_scorer_description.py now pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
BenWilson2
approved these changes
Nov 3, 2025
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.
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
N/A
What changes are proposed in this pull request?
This PR adds a
descriptionfield to all 9 built-in scorer classes in MLflow to improve discoverability and documentation. Each scorer now includes a concise, human-readable description that explains what it evaluates:How is this PR tested?
Ran the full test suite for builtin_scorers: 58 tests passed, 4 skipped. All existing tests continue to pass with no breaking changes.
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
Added description fields to all built-in scorers (RetrievalRelevance, RetrievalSufficiency, RetrievalGroundedness, Guidelines, ExpectationsGuidelines, RelevanceToQuery, Safety, Correctness, Equivalence) to improve discoverability and make the API more self-documenting.
What component(s), interfaces, languages, and integrations does this PR affect?
Components
How should the PR be classified in the release notes? Choose one:
Should this PR be included in the next patch release?
`Yes` should be selected for bug fixes, documentation updates, and other small changes. `No` should be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.