CoolFace
Modelpublic

VytautoDidziojoUniversitetas/NUS-LT-PII-xlm-roberta-large

sourceHugging Faceopenrailupdated 5mo agoView on Hugging Face
0likes254downloads
Model Card

NUS Lithuanian PII Detection Model

A model that detects personal information (PII) in Lithuanian text — names, addresses, ID codes, phone numbers, dates, health information, and other categories of sensitive data. Use it to mark or remove PII before publishing court decisions and administrative documents, processing medical or research records, or sending text to external AI assistants and translation services.

The model is the inference backend of the NUS PII validator tool — a local, GDPR-friendly web application for de-identifying Lithuanian text and validating NER models.

Model Details

  • —Base model: FacebookAI/xlm-roberta-large (~560M parameters)
  • —Architecture: transformer encoder fine-tuned for token classification
  • —Language: Lithuanian
  • —Task: named-entity recognition for PII / GDPR-relevant entities
  • —Output: 24 entity types (16 general + 8 sensitive — see Label set below)

Training Data

Trained on `VytautoDidziojoUniversitetas/NUS-LT-PII-corpus` — Lithuanian text from administrative, scientific, and media domains annotated for 24 PII / GDPR special-category entity types. See the dataset card for source breakdown, distribution, and limitations.

Uses

Intended uses:

  • —De-identifying Lithuanian text before publishing — court decisions, administrative documents, public records.
  • —Pre-processing medical or research records that contain personal data before sharing or analysis.
  • —Pre-processing text before sending it to external AI assistants or translation services that should not see PII.
  • —Compliance workflows under GDPR for Lithuanian-language data.
  • —Research on Lithuanian NER, cross-domain transfer, and rare-entity (sensitive GDPR category) detection.

Out of scope:

  • —Languages other than Lithuanian — output is undefined.
  • —General-purpose NER beyond the 24 PII / GDPR categories listed below.
  • —Stand-alone anonymization — see Risks and limitations.

Label set

LabelMeaning
PERPerson names
LOCLocations and addresses
ORGOrganizations
ID_PERPersonal ID codes (Lithuanian 11-digit national asmens kodas)
ID_MISCOther identifiers (passport, document numbers, etc.)
NUM_PHONEPhone numbers
NUM_CARVehicle license plates
MISCEmail addresses and miscellaneous identifiers
OCCOccupations
EDUEducation
AGEAge
DATEDates
TIMETimes
DURATIONDurations
VALUENumeric amounts and quantities
NATNationality
HEALTHHealth information (diagnoses, conditions, treatments)
RELReligion
POLPolitical views
ETHEthnic origin
MARMarital status (single, married, divorced, etc.)
FAMFamily relations (mentions of relatives)
GENDERGender
SEXSexual orientation

How to use

For de-identification, use the NUS PII validator — a local web app that bundles this model with the boundary post-processing rules and a Lithuanian UI.

If you only need the raw weights:

python
from transformers import pipeline

ner = pipeline(
    "token-classification",
    model="VytautoDidziojoUniversitetas/NUS-LT-PII-xlm-roberta-large",
    aggregation_strategy="first",
)

text = "Jonas Petraitis gyvena Vilniuje, telefonas +370 612 34567."
for ent in ner(text):
    print(ent["entity_group"], "→", ent["word"])

Training Details

Training code: Faculty-of-Informatics-VDU/nus-lt-pii-model-training

Data splits (from `VytautoDidziojoUniversitetas/NUS-LT-PII-corpus`): the corpus ships with a train split (administraciniai, mokslinis, ziniasklaida) and a held-out validacija test split.

  • —Hyperparameter search: train carved into 90/10 train/val; selection by val F1.
  • —Final training: the 10% val portion is folded back into train — the model is trained on the full train split (no early stopping).
  • —Test evaluation: the held-out validacija split — untouched during HP search and final training.

Hyperparameter search: Optuna with TPE sampler (multivariate), no pruning; 22 completed trials. Selection by validation F1 with best checkpoint loading. Search space:

ParameterRange
Learning ratelog-uniform [1e-5, 1e-4]
Weight decayuniform [0.05, 0.30]
Warmup ratiouniform [0.0, 0.15]
Epochs{5, 8, 10}
LR scheduler{linear, cosine}
Gradient accumulation steps{1, 2, 4}
Label smoothing{0.0, 0.05, 0.1}

Final hyperparameters (winner — trial 19, val F1 0.837):

ParameterValue
Learning rate4.24e-5
Weight decay0.159
Warmup ratio0.099
Epochs10
LR scheduleCosine
Per-device batch size16
Gradient accumulation steps1
Effective batch size32 (16 × 1 × 2 GPUs)
Label smoothing0.0
OptimizerAdamW (PyTorch)
Max grad norm1.0
Precisionbf16

Final training: trained on the combined train + validation split (no early stopping) with the HP search winner. 5 random seeds trained independently; the median checkpoint is deployed (seed 256). Test F1 across seeds: 0.8706 ± 0.0037.

Compute: 2 × NVIDIA H100 NVL, ≈1 hour per final-training run (≈2 GPU-hours per seed).

Evaluation

Evaluated on the held-out `validacija` split (7148 entities) using seqeval-style entity-level metrics.

MetricScore
Overall F10.8720
Overall precision0.8601
Overall recall0.8842
Overall accuracy0.9643
Macro F10.7768
Macro precision0.7589
Macro recall0.8338

Per-label metrics

LabelF1PrecisionRecallSupport
PER0.9840.9880.9801386
LOC0.8340.8170.851820
ORG0.7970.7770.8171298
ID_PER1.0001.0001.0004
ID_MISC0.8030.8500.76167
NUM_PHONE0.9910.9811.00053
NUM_CAR1.0001.0001.0003
MISC0.9550.9550.95566
OCC0.8430.8430.843619
EDU0.5140.4190.66727
AGE0.6790.5810.81822
DATE0.7930.7770.810305
TIME0.8730.8440.904281
DURATION0.7410.7450.737285
VALUE0.9420.9400.9441488
HEALTH0.3290.2800.40035
REL0.5450.3751.0003
POL0.6670.5001.0002
ETH0.5380.4000.82417
NAT0.9350.9080.964275
MAR0.6671.0000.5006
FAM0.5950.5210.69436
GENDER0.6170.7140.54346
SEX1.0001.0001.0004

The [NUS PII validator](https://github.com/Faculty-of-Informatics-VDU/nus-lt-pii) tool uses character-span matching and reports strict micro/macro F1 0.854/0.770 (P 0.851/0.753, R 0.857/0.821), partial 0.886/0.793 (P 0.884/0.775, R 0.889/0.846), and boundary recall 0.876.

Risks and limitations

  • —Residual re-identification risk: the model detects and labels PII spans for downstream substitution-based masking. As with any PII pipeline, two residual risks remain: (1) detector misses — at ~88% recall some PII slips through; (2) information not covered by the label set — book or event titles, project names, distinctive phrasing, or unique combinations of non-PII facts can still identify individuals. In regulated contexts (GDPR, healthcare, legal) combine with human review as part of a layered pipeline.
  • —Lithuanian only: despite the multilingual XLM-RoBERTa base, this fine-tune is Lithuanian-specific; other languages and code-switched documents produce undefined output.
  • —Inherited corpus limitations: domain skew (~84% administrative text), cross-convention annotation choices, and class imbalance on rare and sensitive entities all carry over from the training corpus — see the dataset card's *Limitations and Bias* section. Per-class performance has high variance on small classes; see per-label F1 in Evaluation.

License

NewGenLTU OpenRAIL-D licence — the same licence used by the underlying training corpus. See the dataset's `LICENSE.txt` for the full terms and restrictions.

Acknowledgement

Funded by the European Union — NextGenerationEU. Naujos kartos Lietuva.

This project is funded by the Recovery and Resilience Facility under the Lithuanian "Naujos kartos Lietuva" plan and by the State Budget of the Republic of Lithuania.

Project: Nuasmeninimo tekstyno sukūrimas (NUS) — Project No. 02-100-K-0001.

Citation

Please cite the model as:

Vytautas Magnus University and Kaunas University of Technology. 2026. NUS Lithuanian PII Detection Model. Hugging Face. https://huggingface.co/VytautoDidziojoUniversitetas/NUS-LT-PII-xlm-roberta-large

BibTeX:

bibtex
@misc{nus_lt_pii_model_2026,
  author    = {{Vytautas Magnus University} and {Kaunas University of Technology}},
  title     = {NUS Lithuanian PII Detection Model},
  year      = {2026},
  publisher = {Hugging Face},
  url       = {https://huggingface.co/VytautoDidziojoUniversitetas/NUS-LT-PII-xlm-roberta-large},
  note      = {Developed under the New Generation Lithuania plan, project 02-100-K-0001.}
}