ModernBERT-TR PII recognition

ModernBERT-TR PII Recognition

A 150M-parameter Turkish token classifier with 25 KVKK-oriented entity types and 51 BIO labels.

Results

Our model scores 80.85 +/- 0.19% overlap micro-F2 on a 300-document test set. The released checkpoint scores 81.01%.

The quantized int8 version scores 71.90% overlap micro-F2.

Usage

from transformers import pipeline

detect = pipeline(
    "token-classification",
    model="ytu-ce-cosmos/modernbert-tr-pii-ner",
    aggregation_strategy="first",
)
detect("Ayşe Yılmaz'a ayse@example.com adresinden ulaşabilirsiniz.")

You can call the tokenizer with is_split_into_words=True to allow the tokenizer to split the sentence into words, and keep the first WordPiece label for each word.

Training

We finetune ytu-ce-cosmos/modernbert-tr-base on an 8,014-document mixture of Turkish web PDFs, anonymized high-court decisions, born-labeled synthetic documents, and OCR-degraded synthetic documents; the loader retained 7,763 training documents. Real-document labels came from up to a three-model panel. We use learning rate 2e-5, batch size 16, three epochs, cosine decay, 10% warmup, weight decay 0.01, normalized inverse-frequency weights raised to 0.3, and three seeds.

Standalone binaries are available in the encoderfile repo.

License

Apache-2.0.

Downloads last month
260
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ytu-ce-cosmos/modernbert-tr-pii-ner

Finetuned
(5)
this model
Finetunes
1 model

Space using ytu-ce-cosmos/modernbert-tr-pii-ner 1

Collection including ytu-ce-cosmos/modernbert-tr-pii-ner