feat: Default Scorers#111
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive default scorer system for the dreadnode project, implementing various text-focused scoring functions for evaluating outputs. The changes simplify the Scorer API by removing tracer dependencies and add a new catch parameter for exception handling in scoring functions.
Key changes:
- Added extensive scoring functions for text evaluation (BLEU, similarity, sentiment, PII detection, etc.)
- Simplified Scorer constructor API by removing tracer dependency and adding catch parameter
- Introduced TaskInput class for dynamic input resolution during scoring
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| dreadnode/util.py | Added warn_at_user_stacklevel import and enhanced clean_str with max_length parameter |
| dreadnode/tracing/span.py | Updated type annotations for better type safety |
| dreadnode/task.py | Added TaskInput class, updated Scorer usage, and improved parameter formatting |
| dreadnode/scorers/ | Created comprehensive scorer module with similarity, sentiment, PII detection, and other scoring functions |
| dreadnode/metric.py | Removed tracer dependency from Scorer, added catch parameter for exception handling |
| docs/ | Added extensive documentation for new scorer functions and TaskInput class |
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.
feat: Default Scorers
Key Changes:
Changed:
Removed:
Generated Summary:
from_manymethod to span multiple lines.catchparameter in theScorerconstructor, allowing exceptions in the scorer function to be caught, leading to a 0 Metric return with error information.catchparameter, affecting how metrics are returned when exceptions occur.catchparameter, clarifying its purpose and usage.scorers.mdxwith extensive documentation for various scorer functions includingbleu,character_consistency, and others, enhancing developer understanding and usage of scoring functionalities.These modifications enhance the overall usability and error handling of the scoring system, making it more robust and easier to document.
This summary was generated with ❤️ by rigging