Commit 10f2a66
test(pii): add comprehensive PII detection test suite and update e2e config
Add two comprehensive PII testing tools and update e2e configuration to use
LoRA PII model instead of broken ModernBERT model.
Changes:
1. Add 06-a-test-pii-direct.py - 37 comprehensive PII test cases
- Tests email, SSN, credit card, phone, person names, addresses, etc.
- Validates confidence scores and entity type accuracy
- Compares ModernBERT vs LoRA performance
2. Add pii-confidence-benchmark.py - 84-prompt benchmark tool
- Tests diverse PII patterns and formats
- Outputs detailed statistics (precision, recall, F1 score)
- Generates JSON results for analysis
- Measures processing time and confidence distribution
3. Update config/testing/config.e2e.yaml
- Change model_id to lora_pii_detector_bert-base-uncased_model
- Update pii_mapping_path to match LoRA model structure
- Required because ModernBERT model is incompatible with auto-detection code
Note: The old ModernBERT PII model lacks the hidden_act field required by
Traditional BERT classifier, causing fatal initialization errors.
Test Results with LoRA model:
- Overall: 88% accuracy (74/84 prompts)
- Precision: 95.5% (when detected, almost always correct)
- Recall: 90.0% (detects 90% of actual PII)
- F1 Score: 0.926
- All confidence scores: 0.9 (uniform, see caveat in vllm-project#647)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Signed-off-by: Yossi Ovadia <[email protected]>1 parent efe47a6 commit 10f2a66
File tree
3 files changed
+828
-3
lines changed- config/testing
- e2e-tests
3 files changed
+828
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments