Instructions to use generaldata/ApplePie with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use generaldata/ApplePie with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="generaldata/ApplePie")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("generaldata/ApplePie") model = AutoModelForTokenClassification.from_pretrained("generaldata/ApplePie", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ApplePie
Open PII detection model built for Europe. By The General Data Corporation.
ApplePie finds personal data in text across European languages: names, addresses, national ID numbers, IBANs, payment cards, phone numbers, emails, dates of birth, health and customer identifiers, licence plates and more. It recognises the real formats of European identifiers, including French NIR and SIRET, German Steuer-ID, Spanish DNI and NIE, Italian codice fiscale, Dutch BSN, Polish PESEL, Portuguese NIF, Belgian national numbers and IBANs.
On real European legal text in 21 languages, ApplePie reaches 0.846 F1, against 0.546 for the strongest open detector we measured.
Results
F1 on held-out test sets. Higher is better.
| Benchmark | What it is | ApplePie | NVIDIA GLiNER-PII | Microsoft Presidio | GLiNER multi-PII | Gretel GLiNER |
|---|---|---|---|---|---|---|
| MAPA | Real EU legal text, 21 languages | 0.846 | 0.546 | 0.166 | 0.490 | 0.296 |
| GD Europe | Business records, 9 EU countries | 0.997 | 0.876 | 0.605 | 0.853 | 0.525 |
| Nemotron-PII | NVIDIA, English | 0.975 | 0.830 | 0.713 | 0.749 | 0.448 |
| Gretel PII | Gretel, English | 0.997 | 0.905 | 0.721 | 0.840 | 0.826 |
| TAB | Court rulings, English | 0.719 | 0.709 | 0.739 | 0.594 | 0.418 |
Precision and recall for ApplePie:
| Benchmark | Recall | Precision | F1 |
|---|---|---|---|
| MAPA | 0.813 | 0.881 | 0.846 |
| GD Europe | 0.999 | 0.995 | 0.997 |
| Nemotron-PII | 0.966 | 0.984 | 0.975 |
| Gretel PII | 0.998 | 0.995 | 0.997 |
| TAB | 0.604 | 0.889 | 0.719 |
How these were measured
- Each system is scored on the first 1,000 documents of each test split (all 127 for TAB). A personal data span counts as found when at least half of its characters are covered. This is our own scoring rule, not each benchmark's official metric.
- Open models run at their default settings: GLiNER models at a 0.5 threshold, Presidio at 0.4. ApplePie runs at its default 0.5.
- ApplePie was trained on the training splits of MAPA, Nemotron-PII, Gretel and GD Europe, and scored only on their held-out test splits. That gives it a home advantage on those four, as NVIDIA's model has on Nemotron-PII. ApplePie never saw TAB.
- GD Europe is our own benchmark, generated by the same process as ApplePie's European training data, from separate templates. MAPA is the independent European test: real text, annotated by the EU-funded MAPA project.
- No setting was tuned on any test set.
Usage
from transformers import pipeline
pii = pipeline("token-classification", model="generaldata/ApplePie", aggregation_strategy="simple")
for found in pii("Bonjour, je suis Marie Dubois, née le 03/08/1980. Mon IBAN est FR76 3000 6000 0112 3456 7890 189."):
print(found["entity_group"], found["start"], found["end"], round(found["score"], 3))
Each result carries the label (entity_group), the character offsets (start, end), the matched text (word) and a confidence (score).
Texts longer than 512 tokens should be split into overlapping windows; the pipeline's stride argument does this.
Labels
ApplePie tags 20 kinds of personal data, in BIO format.
| Label | Covers |
|---|---|
person_name |
Full names, first names, surnames |
organization |
Companies and institutions |
street_address |
Street addresses and postcodes |
location |
Cities, regions, countries |
coordinate |
GPS coordinates |
date |
Dates and times |
date_of_birth |
Dates of birth |
email |
Email addresses |
phone_number |
Phone and fax numbers |
url |
Personal links and profiles |
user_name |
Logins and usernames |
card_number |
Payment card numbers and CVVs |
bank_account |
IBANs, account and routing numbers, SWIFT/BIC |
national_id |
National IDs, social security and tax numbers, passports, licences |
secret |
Passwords, PINs, API keys, cookies |
device_identifier |
IP and MAC addresses, device IDs |
customer_id |
Customer, contract and employee numbers |
health_id |
Medical record, health insurance and biometric identifiers |
vehicle_identifier |
Licence plates and VINs |
trait |
Age, gender, occupation, nationality and other personal attributes |
Training
- Base model: XLM-RoBERTa large, multilingual.
- Data:
- Nemotron-PII training split (NVIDIA)
- Gretel PII masking training split (Gretel)
- MAPA training split: EU legal text in 21 languages
- GD Europe, our own corpus of 17,950 business documents from France, Germany, Spain, Italy, the Netherlands, Portugal, Poland, Belgium, Ireland and the UK. The documents were written by an open model, Mistral Nemo, with placeholders for personal data. Each placeholder was then filled with values in that country's real format, so every label is exact and every identifier carries valid check digits.
- Setup: one epoch, learning rate 2e-5, batch size 16, sequence length 512, bf16, on one NVIDIA A100.
Limitations
- Detection is not anonymisation. Under the GDPR, pseudonymised data is still personal data; use ApplePie as one control among several, with human review for sensitive releases.
- Much of the European training data is synthetic. Real documents in unfamiliar layouts or domains may score lower than the benchmarks above.
- Context-dependent personal data, such as a rare job title that identifies one person, is harder to catch than structured identifiers. On TAB, a benchmark built around this, ApplePie is close to but below Presidio.
- Languages outside those listed above are untested.
License
ApplePie is © 2026 The General Data Corporation and released under Creative Commons Attribution-NonCommercial 4.0 (CC BY-NC 4.0).
- Non-commercial use (research, evaluation, personal projects) is free, with attribution: "ApplePie by The General Data Corporation".
- Commercial use requires a commercial licence from The General Data Corporation. Contact us at generaldata.io.
See LICENSE for the full terms and third-party notices.
Citation
@misc{applepie2026,
title = {ApplePie: PII detection built for Europe},
author = {Allani, Louai and {The General Data Corporation}},
year = {2026},
howpublished = {\url{https://huggingface.co/generaldata/ApplePie}}
}
Author
Louai Allani, The General Data Corporation.
- Downloads last month
- 9
Model tree for generaldata/ApplePie
Base model
FacebookAI/xlm-roberta-large