Skip to content

examples: add RAIL Score responsible AI evaluation example#2591

Open
SumitVermakgp wants to merge 1 commit intoconfident-ai:mainfrom
SumitVermakgp:feat/rail-score-example
Open

examples: add RAIL Score responsible AI evaluation example#2591
SumitVermakgp wants to merge 1 commit intoconfident-ai:mainfrom
SumitVermakgp:feat/rail-score-example

Conversation

@SumitVermakgp
Copy link
Copy Markdown

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_breakdown for per-dimension scores
  • examples/rail-score-evaluation/example_evaluation.py -- Complete example showing basic, batch, deep mode, and selective dimension evaluation
  • examples/rail-score-evaluation/requirements.txt -- Dependencies
  • examples/rail-score-evaluation/README.md -- Setup and usage documentation

How it works

The metric calls the RAIL Score API via rail-score-sdk, normalizes scores from 0-10 to 0-1, and populates score_breakdown with all 8 dimension scores. Supports both basic (fast) and deep (with per-dimension explanations) modes, plus domain-specific evaluation contexts.

Testing

  • Tested with evaluate(), measure(), and a_measure() against the live RAIL Score API
  • All 8 dimension scores returned in score_breakdown
  • Threshold pass/fail, strict mode, and async mode verified
  • Formatted with black

Related

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.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

@SumitVermakgp is attempting to deploy a commit to the Confident AI Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant