Skip to content

feat(eval): add validator config and combined metrics to eval outputs - #159

Open
PritamSGB wants to merge 4 commits into
ProjectTech4DevAI:mainfrom
PritamSGB:feat/eval-combined-metrics-config
Open

PritamSGB wants to merge 4 commits into
ProjectTech4DevAI:mainfrom
PritamSGB:feat/eval-combined-metrics-config

Conversation

@PritamSGB

Copy link
Copy Markdown

Summary

  • Adds a shared build_validator_config() helper in app/evaluation/common/helper.py and applies it across all evaluation scripts, so every metrics.json records the validator config it was produced with
  • Adds combined binary metrics to the PII eval output (combined_metrics), alongside the existing per-entity metrics
  • Includes validator config in the gender assumption bias metrics output

Test plan

  • python3 -m app.evaluation.pii.run — confirm metrics.json contains config and combined_metrics
  • python3 -m app.evaluation.gender_assumption_bias.run — confirm config block present
  • python3 -m app.evaluation.lexical_slur.run, ban_list, topic_relevance — confirm config present and metrics otherwise unchanged

🤖 Generated with Claude Code

PritamSGB and others added 4 commits September 23, 2026 19:07
…val output

Surfaces overall precision/recall/f1/accuracy (not just per-entity) and the
PIIRemover config (entity types, threshold, NLP engine, model, on_fail) used
for the run, so metrics.json is self-describing for external readers.
Clarifies that this is PII's overall detection-level score alongside
entity_metrics, distinct from the shared compute_binary_metrics() helper
used as the sole metric in other eval scripts.
…s output

Mirrors the pii_remover eval script, which already records the config used
(entity types, threshold, etc.) alongside the metrics for reproducibility.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…valuations

Introduces build_validator_config() in common/helper.py, which reads on_fail
from validator.on_fail_descriptor (set by every guardrails Validator base
class) and normalizes any extra constructor params passed in (enums -> their
.value). PII and gender_assumption_bias now use it instead of hand-rolled
dicts, and ban_list, lexical_slur, topic_relevance, and toxicity gain a
config block in their metrics.json for the first time.
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: ProjectTech4DevAI/kaapi-guardrails/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e1ea5c20-ce7f-4c11-b13c-7e1d42e74268

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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