GLiNER2-PII is a fine-tune of the
GLiNER2 model (205M parameters) for detecting and masking personally identifiable information across
42 entity types and
7 languages.
Trained entirely on a constraint-driven synthetic corpus of 4,910 annotated texts, it achieves the
highest span-level F1 (0.477) on the
SPY benchmark among four compared systems — including OpenAI Privacy Filter, NVIDIA GLiNER-PII, and urchade/gliner_multi_pii-v1.
1from gliner2 import GLiNER2
2
3model = GLiNER2.from_pretrained("fastino/gliner2-privacy-filter-PII-multi")
4
5text = "Email john.smith@acme.com or call +1 415 555 0199."
6labels = ["email", "phone_number", "person"]
7
8result = model.extract_entities(
9 text,
10 labels,
11 threshold=0.5,
12 include_confidence=True,
13 include_spans=True,
14)
15
16print(result)
Evaluated on the
SPY benchmark (Savkin et al., 2025) with exact-match span-level metrics:
1def redact(text, labels, threshold=0.5):
2 model = GLiNER2.from_pretrained("fastino/gliner2-pii-v1")
3 result = model.extract_entities(
4 text, labels, threshold=threshold,
5 include_spans=True,
6 )
7 entities = result.get("entities", {})
8 spans = []
9 for label, values in entities.items():
10 for value in values:
11 start = text.find(value)
12 if start != -1:
13 spans.append((start, start + len(value), label))
14
15 spans.sort(key=lambda s: s[0], reverse=True)
16 redacted = text
17 for start, end, label in spans:
18 redacted = redacted[:start] + f"[{label.upper()}]" + redacted[end:]
19 return redacted
20
21
22text = "Please contact Maria Jensen at maria.jensen@example.dk or +45 20 12 34 56."
23labels = ["person", "email", "phone_number"]
24print(redact(text, labels))
25# "Please contact [PERSON] at [EMAIL] or [PHONE_NUMBER]."
1@misc{fastino2026gliner2pii,
2 title = {GLiNER2-PII: Multilingual PII Extraction via Synthetic Fine-Tuning},
3 author = {{Fastino AI Team}},
4 year = {2026},
5 url = {https://huggingface.co/fastino/gliner2-pii-v1}
6}
1@misc{zaratiana2026gliner2piimultilingualmodelpersonally,
2 title={GLiNER2-PII: A Multilingual Model for Personally Identifiable Information Extraction},
3 author={Urchade Zaratiana and Ash Lewis and George Hurn-Maloney},
4 year={2026},
5 eprint={2605.09973},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2605.09973},
9}
10
11@inproceedings{zaratiana-etal-2025-gliner2,
12 title = {GLiNER2: Schema-Driven Multi-Task Learning for Structured Information Extraction},
13 author = {Zaratiana, Urchade and Pasternak, Gil and Boyd, Oliver and Hurn-Maloney, George and Lewis, Ash},
14 booktitle = {Proceedings of EMNLP 2025: System Demonstrations},
15 year = {2025}
16}
17
18@inproceedings{zaratiana-etal-2024-gliner,
19 title = {GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformer},
20 author = {Zaratiana, Urchade and Tomeh, Nadi and Holat, Pierre and Charnois, Thierry},
21 booktitle = {Proceedings of NAACL 2024},
22 year = {2024}
23}
24
25@misc{atreja2026pioneeragent,
26 title = {Pioneer Agent: Continual Improvement of Small Language Models in Production},
27 author = {Atreja, Dhruv and White, Julia and Nayak, Nikhil and Zhang, Kelton and Princis, Henrijs and Hurn-Maloney, George and Lewis, Ash and Zaratiana, Urchade},
28 year = {2026},
29 url = {https://arxiv.org/abs/2604.09791}
30}