anonymize_text
Remove personally identifiable information from text by replacing patient IDs, GPS coordinates, national IDs, emails, and phone numbers with anonymized placeholders. Returns anonymized text and replacement map.
Instructions
Scrub PII from text and return anonymized version + replacement map.
Replaces:
- Patient/case IDs → [PARTICIPANT_001]
- GPS coordinates → [GPS_001]
- Belgian national IDs → [NID_001]
- Email addresses → [EMAIL_001]
- Phone numbers → [PHONE_001]
- Name-like tokens (opt.) → [NAME_001]
Args:
content: Text to anonymize.
mode: 'full' — replace; 'preview' — mark without replacing.
replace_names: Also replace CAPITALIZED name-like tokens (heuristic).
Returns JSON with keys 'anonymized' (str) and 'replacements' (dict).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| mode | No | full | |
| replace_names | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |