examples: add RAIL Score responsible AI custom task template#1203
Open
SumitVermakgp wants to merge 1 commit intohuggingface:mainfrom
Open
examples: add RAIL Score responsible AI custom task template#1203SumitVermakgp wants to merge 1 commit intohuggingface:mainfrom
SumitVermakgp wants to merge 1 commit intohuggingface:mainfrom
Conversation
Add a custom task that evaluates model outputs across 8 responsible AI dimensions (fairness, safety, reliability, transparency, privacy, accountability, inclusivity, user_impact) using the RAIL Score API. Uses MetricGrouping with SampleLevelComputation to return all 8 dimensions plus an overall score as separate named metrics.
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.
Summary
Add a custom task template that evaluates model outputs across 8 responsible AI dimensions using RAIL Score as a
MetricGroupingmetric.Changes
examples/custom_tasks_templates/custom_rail_score_task.py-- Complete self-contained file withRAILScoreComputation(SampleLevelComputation),MetricGroupingregistration, prompt function, and task configHow it works
RAILScoreComputationcalls the RAIL Score API on each generated responseMetricGroupingso all dimensions appear as separate columns in resultsdoc.specificmetadata for domain-specific scoringUsage
Testing
RAILScoreComputation.compute()with mockDocandModelResponseobjectsextend_enumregistration verifiedruffRelated