examples: add RAIL Score responsible AI evaluation example#2591
Open
SumitVermakgp wants to merge 1 commit intoconfident-ai:mainfrom
Open
examples: add RAIL Score responsible AI evaluation example#2591SumitVermakgp wants to merge 1 commit intoconfident-ai:mainfrom
SumitVermakgp wants to merge 1 commit intoconfident-ai:mainfrom
Conversation
Add a custom RAILScoreMetric(BaseMetric) that evaluates LLM outputs across 8 responsible AI dimensions (fairness, safety, reliability, transparency, privacy, accountability, inclusivity, user_impact) using the RAIL Score API. Includes a complete example script showing basic, batch, deep mode, and selective dimension evaluation patterns.
|
@SumitVermakgp is attempting to deploy a commit to the Confident AI Team on Vercel. A member of the Team first needs to authorize it. |
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 complete example showing how to use RAIL Score as a custom DeepEval metric for responsible AI evaluation across 8 dimensions (fairness, safety, reliability, transparency, privacy, accountability, inclusivity, user_impact).
Changes
examples/rail-score-evaluation/rail_score_metric.py--RAILScoreMetric(BaseMetric)class with sync/async support,score_breakdownfor per-dimension scoresexamples/rail-score-evaluation/example_evaluation.py-- Complete example showing basic, batch, deep mode, and selective dimension evaluationexamples/rail-score-evaluation/requirements.txt-- Dependenciesexamples/rail-score-evaluation/README.md-- Setup and usage documentationHow it works
The metric calls the RAIL Score API via rail-score-sdk, normalizes scores from 0-10 to 0-1, and populates
score_breakdownwith all 8 dimension scores. Supports bothbasic(fast) anddeep(with per-dimension explanations) modes, plus domain-specific evaluation contexts.Testing
evaluate(),measure(), anda_measure()against the live RAIL Score APIscore_breakdownblackRelated