Conversation
…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.
This was referenced Sep 23, 2026
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: ProjectTech4DevAI/kaapi-guardrails/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This branch has not been deployed
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
build_validator_config()helper inapp/evaluation/common/helper.pyand applies it across all evaluation scripts, so everymetrics.jsonrecords the validator config it was produced withcombined_metrics), alongside the existing per-entity metricsTest plan
python3 -m app.evaluation.pii.run— confirmmetrics.jsoncontainsconfigandcombined_metricspython3 -m app.evaluation.gender_assumption_bias.run— confirmconfigblock presentpython3 -m app.evaluation.lexical_slur.run,ban_list,topic_relevance— confirmconfigpresent and metrics otherwise unchanged🤖 Generated with Claude Code