Instructions to use neondijital/neonredact-tr-web with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use neondijital/neonredact-tr-web with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('token-classification', 'neondijital/neonredact-tr-web');
NeonRedact-TR Web
Turkish PII detection that runs in the browser. 68 MB quantized ONNX, no server, no upload — the text never leaves the user's machine.
Live demo: neondijital.com/kisisel-veri-bul
Open PII models are trained on English and extended to a handful of other languages. Turkish is in none of them. This is the gap this model fills.
Usage
import { pipeline } from '@huggingface/transformers';
const nlp = await pipeline(
'token-classification',
'neondijital/neonredact-tr-web',
{ dtype: 'q8' }
);
const metin = "Müvekkilim Ayşe Öztürk'ün T.C. kimlik numarası 85592807206.";
const sonuc = await nlp(metin, { aggregation_strategy: 'simple' });
Returns BIO-tagged spans. Note that start and end may be absent depending
on the runtime version; if so, locate the returned word in the source text
yourself.
Labels
16 entity types, BIO scheme (33 tags including O).
| Label | Meaning |
|---|---|
KISI_ADI |
person name |
ADRES |
address, full or partial |
TC_KIMLIK |
Turkish national ID |
VERGI_NO |
tax identification number |
IBAN |
Turkish IBAN |
KART_NO |
payment card number |
CEP_TELEFON |
mobile phone |
SABIT_TELEFON |
landline |
EPOSTA |
email address |
PLAKA |
vehicle licence plate |
DOGUM_TARIHI |
date of birth |
KURUM_ADI |
organisation, court, hospital |
MESLEK |
occupation |
AKRABALIK |
kinship reference |
SAGLIK_DURUMU |
health condition |
TARAF_SIFATI |
party role (client, defendant, patient) |
Why Turkish needs its own model
Suffixes stay outside the span. Turkish attaches case endings to proper
nouns with an apostrophe. A model that swallows the suffix produces spans that
break redaction: replace Ayşe Öztürk'ün wholesale and the sentence loses its
grammar. This model returns Ayşe Öztürk and leaves 'ün alone. The same
holds for the pronominal buffer in institution names — Ege Üniversitesi out
of Ege Üniversitesi'nden.
Turkey-specific identifiers. T.C. national ID, tax number, Turkish IBAN and licence plates have no equivalent in EU-oriented datasets, so EU-oriented models do not look for them.
People named by role. In Turkish legal and clinical writing the subject is
often a role rather than a name — müvekkilim, davalı, hastam.
Files
| File | Size | Notes |
|---|---|---|
onnx/model.onnx |
270 MB | fp32, exact |
onnx/model_quantized.onnx |
68 MB | int8, the browser default (dtype: 'q8') |
Quantization agreement with the fp32 model, measured over 9,814 tokens of held-out data: 99.36% of token predictions identical.
Training
Fine-tuned from dbmdz/distilbert-base-turkish-cased on
neondijital/neonredact-tr
— 10,000 synthetic records, 36 document templates. Four epochs on a single T4,
about two minutes.
Subword tokens inherit their word's label (B- becoming I-), so multi-piece
identifiers come back whole rather than fragmented.
This architecture replaced an earlier GLiNER-based attempt. GLiNER was more flexible but 611 MB at its smallest, and its ONNX graph resisted quantization — int8 shifted the logits by 21.7 in testing. A plain token classifier is both an order of magnitude smaller and, on the held-out probes, more accurate: it detects bare landline numbers, which three rounds of GLiNER training never managed, and does not absorb inflectional suffixes into occupation spans.
The larger GLiNER model is still available at neondijital/neonredact-tr-model for server-side use.
Known limitations
- Trained on synthetic, template-generated text. Real documents are messier.
- No OCR noise, no layout artefacts, no dialectal spelling.
TARAF_SIFATIis the weakest label — it has the fewest training examples.- Occupation and health-condition vocabularies are limited, not exhaustive.
- Compound and hyphenated surnames are not covered.
Recommended use
Pair it with deterministic checks. Checksum-verifiable identifiers — T.C. ID, tax number, IBAN, card number — should be validated by their own algorithms, which are exact where a model only guesses. Use the model for what rules cannot reach: names, addresses, kinship, occupations, roles. The demo linked above runs both layers and lets the rule layer win on overlap.
Detection is not compliance. Removing direct identifiers does not make a document anonymous under KVKK or GDPR — a residual combination of attributes (birth year, district, occupation) can still single out one person. Keep a human in the loop before anything leaves the building.
Citation
@misc{neonredact_tr_web_2026,
title = {NeonRedact-TR Web: In-Browser Turkish PII Detection},
author = {Kömürcü, Aykan},
year = {2026},
url = {https://huggingface.co/neondijital/neonredact-tr-web}
}
Built by NeonDijital.
- Downloads last month
- 32
Model tree for neondijital/neonredact-tr-web
Base model
dbmdz/distilbert-base-turkish-cased