The base model ships with 8 coarse PII categories (
private_person
,
private_email
, etc.). This model trades that coarse vocabulary for a
5× more granular one
—
first_name
,
last_name
,
medical_record_number
,
credit_debit_card
,
ssn
, and so on — matching what downstream redaction
and masking pipelines typically need.
Family at a glance.
Same architecture, three runtimes:
PyTorch (this repo)
— CPU + CUDA, anywhere transformers runs.
OpenMed gives you
extract_pii()
/
deidentify()
with built-in BIOES Viterbi
decoding, span refinement, and a Faker-backed obfuscation engine. Same call
on every host — Apple Silicon picks up MLX automatically; everywhere else uses
this PyTorch checkpoint.
pip install -U "openmed[hf]"
from openmed import extract_pii, deidentify
text = (
"Patient Sarah Johnson (DOB 03/15/1985), MRN 4872910, ""phone 415-555-0123, email [email protected]."
)
# Extract grouped entity spans
result = extract_pii(text, model_name="OpenMed/privacy-filter-nemotron")
for ent in result.entities:
print(f"{ent.label:30s}{ent.text!r} conf={ent.confidence:.2f}")
# De-identify with any of the supported methods
masked = deidentify(text, method="mask", model_name="OpenMed/privacy-filter-nemotron")
removed = deidentify(text, method="remove", model_name="OpenMed/privacy-filter-nemotron")
hashed = deidentify(text, method="hash", model_name="OpenMed/privacy-filter-nemotron")
# Faker-backed locale-aware obfuscation, deterministic with consistent=True+seed
fake = deidentify(
text,
method="replace",
model_name="OpenMed/privacy-filter-nemotron",
consistent=True,
seed=42,
)
print(fake.deidentified_text)
OpenMed/privacy-filter-nemotron-mlx*
model names also work in the same
extract_pii()
/
deidentify()
calls — on a non-Apple-Silicon host they
automatically fall back to
this PyTorch checkpoint
with a one-time
warning. So you can ship MLX names in code and still run on Linux/Windows.
The OpenMed wrapper passes
trust_remote_code=True
for you, runs the
model's own BIOES Viterbi decoder, and skips OpenMed's regex
smart-merging (the model already produces clean spans).
import torch
from transformers import AutoModelForTokenClassification, AutoTokenizer
model_id = "OpenMed/privacy-filter-nemotron"
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForTokenClassification.from_pretrained(
model_id, trust_remote_code=True, dtype=torch.bfloat16
).to("cuda")
model.eval()
text = "Patient Sarah Johnson (DOB 03/15/1985), MRN 4872910, phone 415-555-0123."
enc = tok(text, return_tensors="pt").to("cuda")
with torch.no_grad():
out = model(**enc).logits.argmax(-1).cpu()[0].tolist()
id2label = {int(k): v for k, v in model.config.id2label.items()}
tokens = tok.convert_ids_to_tokens(enc["input_ids"][0].cpu().tolist())
for t, l inzip(tokens, out):
if l != 0:
print(f"{t}\t{id2label[l]}")
For best results use Viterbi decoding (not argmax) — both
opf
and OpenMed
do this by default. If you're doing argmax with the HF transformers API, you'll
see slightly more boundary errors but still excellent label accuracy.
Performance
Evaluated with
opf eval --decode-mode viterbi --eval-mode typed --span-metrics-space char
on the 10K label-stratified held-out val from
nvidia/Nemotron-PII:test
.
Head initialization
:
opf
's default "copy-from-matching-base" head init.
Of the 221 new BIOES classes, 5 had exact matches in the base
(
O
,
B/I/E/S-account_number
); the other 216 were copied from
semantically-adjacent coarse rows and fine-tuned end-to-end.
Router
: base model has 128 MoE experts per layer with top-4 routing.
Routers were kept trainable during full fine-tuning; no collapse was
observed.
Limitations & intended use
English-only training data.
Nemotron-PII is predominantly English
with a 50/50 US/international locale split. Performance on non-English
text is not guaranteed.
occupation
,
language
,
gender
,
state
,
race_ethnicity
,
political_view
,
education_level
are fuzzier categories
than the
strict identifiers — F1 lands in 0.65–0.89 vs 0.95+ for formatted
identifiers. If your downstream only cares about strict PII, you can
ignore low-confidence predictions on these.
Synthetic training data.
Nemotron-PII is a synthesized dataset; real
clinical notes, legal documents, and web text may show different
surface forms. For high-stakes deployments, collect a domain-specific
eval set and re-calibrate thresholds.
Not a substitute for legal compliance review.
Use alongside a
governance layer (human review, deterministic regex pre-filters, etc.).
Credits & Acknowledgements
This model wouldn't exist without two open-source releases — sincere thanks
to both teams:
OpenAI
for
open-sourcing the Privacy Filter
(architecture, modeling code, and
opf
training/eval CLI). Everything in
this repo is a fine-tune on top of that release.
NVIDIA
for releasing the
Nemotron-PII dataset
with its 100K-row train split and 55 fine-grained PII labels.
Additional thanks to the
HuggingFace
team for the
transformers
/
huggingface_hub
ecosystem this model ships through.
License
Apache 2.0, same as the base model.
Citation
If you use this model, please cite
this model
, the organization behind
it (
OpenMed
), and the upstream base model + dataset:
@misc{openmed_privacy_filter_nemotron_2026,
author = {OpenMed},
title = {{OpenMed/privacy-filter-nemotron}: fine-grained PII extraction with 55 categories},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/OpenMed/privacy-filter-nemotron}}
}
@misc{openmed_2026,
author = {OpenMed},
title = {{OpenMed}: open models and resources for healthcare NLP},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/OpenMed}}
}
@misc{openai_privacy_filter_2025,
author = {OpenAI},
title = {{openai/privacy-filter}},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/openai/privacy-filter}}
}
@misc{nemotron_pii_2025,
author = {NVIDIA},
title = {{Nemotron-PII}},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/datasets/nvidia/Nemotron-PII}}
}
Runs of OpenMed privacy-filter-nemotron on huggingface.co
171.5K
Total runs
0
24-hour runs
35
3-day runs
64
7-day runs
745
30-day runs
More Information About privacy-filter-nemotron huggingface.co Model
privacy-filter-nemotron huggingface.co is an AI model on huggingface.co that provides privacy-filter-nemotron's model effect (), which can be used instantly with this OpenMed privacy-filter-nemotron model. huggingface.co supports a free trial of the privacy-filter-nemotron model, and also provides paid use of the privacy-filter-nemotron. Support call privacy-filter-nemotron model through api, including Node.js, Python, http.
privacy-filter-nemotron huggingface.co is an online trial and call api platform, which integrates privacy-filter-nemotron's modeling effects, including api services, and provides a free online trial of privacy-filter-nemotron, you can try privacy-filter-nemotron online for free by clicking the link below.
OpenMed privacy-filter-nemotron online free url in huggingface.co:
privacy-filter-nemotron is an open source model from GitHub that offers a free installation service, and any user can find privacy-filter-nemotron on GitHub to install. At the same time, huggingface.co provides the effect of privacy-filter-nemotron install, users can directly use privacy-filter-nemotron installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
privacy-filter-nemotron install url in huggingface.co: