Views
No views yet
xlm-roberta-base) fine-tuned for Named Entity Recognition (NER) to detect and mask Personally Identifiable Information (PII) in text across English, German, Italian, and French.1from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
2
3model_id = "Ar86Bat/multilang-pii-ner"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForTokenClassification.from_pretrained(model_id)
6
7nlp = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
8text = "John Doe was born on 12/12/1990 and lives in Berlin."
9results = nlp(text)
10print(results)AGE, BUILDINGNUM, CITY, DATE, EMAIL, GIVENNAME, STREET, TELEPHONENUM, TIMEEMAIL and DATE (F1 ≈ 0.999)DRIVERLICENSENUM (F1 ≈ 0.85), GENDER (F1 ≈ 0.83), PASSPORTNUM (F1 ≈ 0.88), SURNAME (F1 ≈ 0.85), SEX (F1 ≈ 0.84)model/ directory.num_train_epochs=2 # Total number of training epochsper_device_train_batch_size=32 # Batch size for trainingper_device_eval_batch_size=32 # Batch size for evaluation@misc{ar86bat_multilang_pii_ner_2025,
author = {Arif Hizlan},
title = {Multilingual PII NER},
year = {2025},
howpublished = {\\url{https://huggingface.co/Ar86Bat/multilang-pii-ner}}
}