add_custom_recognizer
Define custom regex patterns to detect specific PII entities for enhanced data privacy protection in Microsoft Presidio.
Instructions
Add a custom PII recognizer with regex patterns.
Args:
name: Unique name for this recognizer
entity_type: The entity type this recognizer detects
patterns: List of pattern dicts with 'name', 'regex', and 'score' (0.0-1.0)
Example: [{"name": "weak", "regex": "\d{3}", "score": 0.3}]
context: Optional context words that increase confidence
supported_language: Language code (default: "en")
Returns:
JSON string confirming the recognizer was added
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| entity_type | Yes | ||
| patterns | Yes | ||
| context | No | ||
| supported_language | No | en |