CompositePIIDetector<T>
Models & Types · AiDotNet.Safety.Text
Combines multiple PII detection strategies into a unified detector with deduplication.
Inheritance: ModelBase<T, Vector<T>, Vector<T>> → SafetyModuleBase<T> → TextSafetyModuleBase<T> → CompositePIIDetector<T>
For Beginners
Different PII detection methods are good at finding different types of personal information. This module runs all of them and combines the results, removing duplicates so you get one clean list of all PII found.
How It Works
Runs multiple PII detectors (regex, NER, context-aware) and merges their results with span-level deduplication. When multiple detectors flag the same text region, the finding with the highest confidence is kept. This provides comprehensive coverage while avoiding duplicate alerts.
References:
- Hybrid multilingual PII detection (2025, arxiv:2510.07551)
- PRvL: LLMs for contextual PII redaction outperform rule-based NER (2025, arxiv:2508.05545)
Constructors
| Constructor | Summary |
|---|---|
CompositePIIDetector() |
Initializes a new composite PII detector with default sub-detectors. |
CompositePIIDetector(IReadOnlyCollection<PiiType> types) |
Initializes a composite over custom detectors. |
CompositePIIDetector(ITextSafetyModule<T>[] detectors) |
Initializes a composite over custom detectors. |
Properties
| Property | Summary |
|---|---|
string ModuleName { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<SafetyFinding> EvaluateText(string text) |