Guide · Personal data
Open-source PII redaction that follows your own policy
Updated 19 November 2026, by Jungroo AI Labs, the makers of ReDefiNER
ReDefiNER is a 0.8B model made by Jungroo AI Labs. It marks the spans of text that a plain-English rulebook defines and returns each with a type and a confidence. For personal data, a ready-made setup loads by name, and one command masks a text file. To change what gets masked, you edit the rulebook, not retrain the model. It is non-generative, so it never writes new text. It runs on a CPU or GPU, is English only and free under Apache 2.0, and was not trained on any personal-data dataset. We make ReDefiNER; this page uses our own published results.
30 seconds, with a voiceover: a made-up clinic note masked with the default rulebook, then by the clinic's own policy. Every mask in it is real output from the model. Try it in your browser.
Mask a file
pip install redefiner # writes notes.redacted.txt and notes.audit.json redefiner redact notes.txt
Real output from the PII setup page. The text:
Hi, this is Meera Nair from Brightwater Dental. Please send the invoice to meera.nair@brightwater.example and call me on 020 7946 0155 before Thursday.
Masked:
Hi, this is [PERSON] from [ORGANIZATION]. Please send the invoice to [EMAIL] and call me on [PHONE] before [DATE_TIME].
In Python, load the setup by name:
from redefiner import Tagger
tagger = Tagger.from_pretrained("jungroo-ai/redefiner-pii")
# PERSON and PHONE spans
tagger.extract("Call Meera Nair on 020 7946 0155.")
jungroo-ai/redefiner-pii is a setup page, not a second model: it holds two PII rulebooks and their settings, and the weights come from jungroo-ai/redefiner-0.8b. It needs package 1.0.9 or later (release notes).
Accuracy on the PII Masking Benchmark
Character-level F2 on the full test splits of the four English tasks of the PII Masking Benchmark (PIIMB). F2 counts missed personal data more heavily than text masked by mistake.
| Setup | Privy | Gretel | AI4Privacy EN | Nemotron-PII | Mean |
|---|---|---|---|---|---|
| ReDefiNER, default rulebook | 73.4 | 94.1 | 96.4 | 84.8 | 87.2 |
| ReDefiNER, a rulebook written for each dataset | 80.5 | 94.5 | 97.1 | 86.0 | 89.5 |
| NVIDIA gliner-PII | 71.4 | 92.0 | 94.5 | 77.2 | 83.8 |
| Fastino gliner2-privacy-filter-PII-multi | 64.6 | 93.6 | 91.4 | 85.4 | 83.7 |
| OpenAI Privacy Filter | 53.6 | 86.9 | 84.3 | 60.7 | 71.4 |
| Presidio (en_core_web_lg) | 51.8 | 75.8 | 73.4 | 72.9 | 68.5 |
The default row is the setting that ships. The second ReDefiNER row writes a rulebook for each dataset, so it is not a like-for-like comparison. Tables, method, rulebooks and a rerun script.
The default rulebook's 87.2 would place it 8th among the 36 models with published PIIMB results, on the mean of the four English tasks. The leaderboard itself averages six tasks, and we ran only the four English ones. Five of the seven models above it declare training on PIIMB source datasets; ReDefiNER was not trained on any personal-data dataset. On that mean it is ahead of OpenAI's Privacy Filter and Fastino's PII model.
Two rulebooks: mask broadly, or keep the text readable
pii.txt, the default. 20 types, broad, close to what PII datasets count as personal data, including dates, places and organisations.identifiers.txt. 10 types. It keeps dates, places, organisations and job titles readable. Run it with--none-bias 4;--min-confidence 0.35is advised.
The choice matters. On RedactionBench, 200 documents labelled under contextual integrity, identifiers.txt scores 0.520, which would be 11th of 45 on its leaderboard. The broader default scores 0.393, because RedactionBench counts masked dates, places and organisations as over-masking.
Redact by your own policy
The rulebook is plain English, so it can say whose data to mask, not only which kinds. To test this we built PolicyMask, an open benchmark of 10 plain-English redaction policies and 400 synthetic texts, with a scorer and 13 system setups. The systems tested were ReDefiNER, OpenAI Privacy Filter, Fastino GLiNER2-PII, GLiNER multi PII, Presidio and Liquid Policy-Linter.
ReDefiNER scored highest on the policies that depend on whose data it is: keeping support agents' names but masking customers', and the policies about clinicians, officials, children and an HR case. PolicyMask is a small synthetic test, so treat it as a sign, not proof; check a policy on your own documents.
Use it inside Microsoft Presidio
presidio-redefiner is an unofficial community plugin. It adds a Presidio recognizer that uses ReDefiNER, with the default PII rulebook or your own, and runs beside Presidio's own recognizers for emails, phone numbers, card numbers and other patterns. It is not part of Presidio and is not maintained or endorsed by the Presidio maintainers or by Microsoft.
pip install "presidio-redefiner[anonymizer]"
Setup and examples are in the plugin's README; the package is on PyPI.
Speed and memory
On an Apple M2 CPU, the first text with the PII rulebook took about 11 seconds, because the rulebook is read once and then cached. Later short texts take under a second. Peak memory is about 3 GB on CPU. It also runs on a GPU.
Limits
- Not the only safeguard. It misses some personal data and masks some text that is not personal. Check its output on your own documents, and do not use it as the only safeguard.
- English only.
- The default masks broadly. Dates, places and organisations are masked too; use
identifiers.txtwhen they must stay readable. - Benchmarks. The PIIMB results cover its four English tasks, and PolicyMask is small and synthetic.