Turkish KVKK classifier

turkish-kvkk-classifier is a multi-label model that tells you which kinds of personal data a Turkish text contains. It covers 24 categories: the 14 used in VERBİS, Turkey’s data controller registry, and the 10 special categories in Article 6 of KVKK, the Turkish data protection law. It takes about 22 ms per text on a desktop CPU.

Size
110M parameters
Base model
dbmdz/bert-base-turkish-cased (BERTurk)
Labels
24, multi-label
Result
0.878 micro-F1 on 987 held-out texts (v1.1)
CPU speed
about 22 ms per text
Licence
MIT
Updated

What it does

Input
hastanın böbrek yetmezliği ilerlemiş, eşi 0532 111 22 33'ten ulaşılabilir
Output
kimlik, iletisim, saglik (special category: yes)
Input
böbrek yetmezliği farkındalık haftası başladı
Output
no label

A category is marked only when the text holds that kind of information about a specific person, even an unnamed one such as “the patient” or “the customer”. General information, rules, announcements and statistics get no label. In the first example a patient’s kidney failure is health data. In the second, an awareness week for kidney failure is not about anyone.

The classifier is meant to sit in front of the masking model: classify the text, pick a masking policy, then mask.

Labels

The 24 labels and their F1 on the held-out set
Label Covers F1
General categories (VERBİS)
kimlik full name, national ID number (TCKN), birth details, age, gender, nationality, marital status, ID document numbers, signature 0.97
iletisim phone, email, postal address 0.97
lokasyon the person’s location, where they are or are going, route 0.74
ozluk an employee’s personnel record: service record, payroll, leave, discipline, social security (SGK) declaration 0.84
hukuki_islem lawsuit, debt enforcement, seizure, official notification, power of attorney, formal notice, mediation 0.89
musteri_islem order, invoice, subscription, request or complaint, policy or contract transaction 0.75
fiziksel_mekan_guvenligi building entry and exit, turnstile, visitor log, security camera 0.83
islem_guvenligi IP address, log, device ID, username, password or PIN, session record 0.83
risk_yonetimi credit score, risk score, suspicious transaction, blacklist, MASAK (Turkey’s financial crimes investigation board) 0.82
finans account, IBAN, card, balance, debt, income or salary, tax number, crypto 0.85
mesleki_deneyim workplace, profession, position, diploma, certificate, reference 0.80
pazarlama shopping habits, preferences, contact consent, survey answers, cookie or segment data 0.83
gorsel_isitsel the person’s photo, voice recording, video, call recording 0.79
arac licence plate, chassis number, engine number, registration document 0.96
Special categories (KVKK Article 6)
saglik illness, diagnosis, treatment, medication, disability, blood type, pregnancy 0.92
biyometrik fingerprint, face recognition, iris or retina, voiceprint 0.88
genetik genetic test, DNA, carrier status 0.79
cinsel_hayat sexual orientation, information about sexual life 0.86
ceza_mahkumiyeti past offences, criminal record, conviction, security measure 0.84
din_felsefi_inanc religion, sect, belief, religious practice 0.93
siyasi_dusunce party membership or preference, political opinion, taking part in a protest 0.85
irk_etnik race, ethnic origin 0.82
dernek_vakif_sendika membership of an association, foundation or trade union 0.89
kilik_kiyafet headscarf, choice of religious or cultural dress 0.91

Results

There are three test sets. The main one is an independent held-out set: 1,125 texts written without looking at the training data, then labelled a second time, blind. The 987 texts where both label sets agree exactly are the gold set (87.7% exact agreement, Cohen’s kappa per label between 0.84 and 1.00). The second is a hard set of 317 texts aimed at the weakest labels, written after this model was trained by authors who never saw the training templates; 63% are structured records such as forms, logs and CRM notes. The third is a template-disjoint test of 771 examples from 333 templates that were never used in training. On the 987-text gold set, turkish-kvkk-classifier v1.1 scores 0.878 micro-F1 and 0.863 macro-F1.

Scores of v1.1 on the three test sets
MetricHeld-out
987 texts
Hard set
317 texts
Disjoint test
771 examples
micro-F10.8780.9020.895
macro-F10.8630.8530.876
Special category present: precision0.9590.9260.956
Special category present: recall0.9130.8220.972
Exact match (all labels correct)0.7210.6560.733

Micro-F1 is F1 computed over all label decisions pooled together. Macro-F1 is the unweighted mean of the per-label F1 scores.

v1.1 (15 October 2026) keeps the v1 weights and only lowers the thresholds of some special-category labels, again tuned on the dev set only. v1 scored 0.874 micro-F1 and 0.884 special-category recall on the held-out set. I noticed the threshold rule while reading held-out results of an unpublished v2, so do not read the recall gain (0.884 to 0.913) as a fully independent measurement. The v1 thresholds stay available with revision="v1".

The held-out texts and both label passes were produced with a language model and checked automatically. They were not verified line by line by a person. Both labellings of the hard set were made with the same language model and guide, so its 99.1% agreement shows that the guide is applied consistently, not that two independent people agree.

Python quick start

import json, torch
from huggingface_hub import hf_hub_download
from transformers import AutoModelForSequenceClassification, AutoTokenizer

MODEL = "halilneed/turkish-kvkk-classifier"
tok = AutoTokenizer.from_pretrained(MODEL)
model = AutoModelForSequenceClassification.from_pretrained(MODEL).eval()
thresholds = json.load(open(hf_hub_download(MODEL, "thresholds.json")))
SPECIAL = {"saglik", "biyometrik", "genetik", "cinsel_hayat", "ceza_mahkumiyeti", "din_felsefi_inanc",
        "siyasi_dusunce", "irk_etnik", "dernek_vakif_sendika", "kilik_kiyafet"}

def classify(text):
    with torch.inference_mode():
        p = torch.sigmoid(model(**tok(text, return_tensors="pt", truncation=True, max_length=320)).logits)[0]
    labels = [model.config.id2label[i] for i, v in enumerate(p.tolist()) if v >= thresholds[model.config.id2label[i]]]
    return labels, bool(set(labels) & SPECIAL)

print(classify("hastanın böbrek yetmezliği ilerlemiş, eşi 0532 111 22 33'ten ulaşılabilir"))

Per-label thresholds were tuned on the dev set and ship in thresholds.json. For the special categories the threshold never goes above 0.5, and among thresholds with the same dev F1 the lowest is chosen, which favours recall.

Measured speed: 22 ms per text at batch size one on an Intel i5-12400F with eight threads, for texts of 126 characters on average.

Training

  • Base model. dbmdz/bert-base-turkish-cased (BERTurk, 110M).
  • Method. Multi-label classification, sigmoid with binary cross-entropy, 5 epochs, learning rate 3e-5, bfloat16, up to 320 tokens.
  • Data. 36,000 synthetic examples from 3,276 templates. Most are the masking model’s templates: each PII slot maps to a category by a fixed rule, and each template is also marked for the categories its context adds. The rest are contextual sentences that contain no values. 21% of the examples are traps, texts that should get no label.
  • Split. Train, dev and test are separated by template hash.

Limitations

  • The training data is synthetic. Measure the model on your own organisation’s text before it goes into a critical pipeline.
  • The weakest labels are lokasyon (F1 0.74), musteri_islem (0.75) and gorsel_isitsel (0.79). All three are inferred from context and have no sharp boundary. genetik also scores 0.79.
  • For the question “is there special-category data here?” recall on the held-out set is 0.913, so roughly one such text in eleven is missed.
  • On the hard set it often misses sex-life information told implicitly, through a partner or a relationship rather than a stated orientation (recall 0.37), and criminal convictions buried in structured records (0.68).
  • The output is a category signal, not a legal assessment. The VERBİS inventory and KVKK compliance remain the user’s responsibility.

Questions about KVKK personal-data categories

Which personal-data categories does VERBİS use?

This model uses the 14 general categories of VERBİS, Turkey’s data controller registry: identity, contact, location, personnel, legal transaction, customer transaction, physical space security, transaction security, risk management, finance, professional experience, marketing, audio-visual records, and vehicle data, which VERBİS files under “other”. For the registry’s own list and the duty to register, see the KVKK authority.

What is special-category personal data under KVKK?

Article 6 of KVKK lists data on race, ethnic origin, political opinion, philosophical belief, religion, sect or other beliefs, appearance and dress, membership of associations, foundations or trade unions, health, sex life, criminal convictions and security measures, and biometric and genetic data. The model marks these with 10 labels.

Can a model find which KVKK categories a text contains?

Yes, as a signal. turkish-kvkk-classifier labels a Turkish text with any of 24 categories in about 22 ms on CPU. On 987 independent texts it scores 0.878 micro-F1. For “is there special-category data?” precision is 0.959 and recall 0.913, so about one such text in eleven is missed. Its weakest labels are location (0.74) and customer transaction (0.75).

Does the classifier replace a VERBİS inventory?

No. It tells you which categories a text probably contains. It does not decide whether processing is lawful, which legal basis applies or what must be registered. Use it to find where personal data sits, then let your legal team make the assessment. For legal and compliance teams starting with AI there is a Turkish-language kit with a data rule, task cards and a usage policy.

Which labels are weakest?

lokasyon, musteri_islem and gorsel_isitsel; implicit cinsel_hayat recall is 0.37 on the hard set.

Türkçe KVKK kategori sınıflandırıcısı

turkish-kvkk-classifier, Türkçe bir metinde hangi kişisel veri kategorilerinin bulunduğunu belirleyen çok etiketli bir sınıflandırıcıdır: 14 VERBİS kategorisi ve KVKK md. 6’daki 10 özel nitelikli veri kategorisi. Maskeleme modelinden önce çalıştırılır: metin önce sınıflandırılır, sonuca göre maskeleme politikası seçilir, ardından metin maskelenir.

Eğitim verisine bakılmadan yazılmış 987 metinlik bağımsız sette micro-F1 0.878, macro-F1 0.863’tür (v1.1). CPU’da metin başına yaklaşık 22 ms sürer. Çıktı yalnızca bir kategori tahminidir, hukuki nitelendirme değildir.