Named Entity Recognition for Turkish
View on GitHub →Problem
Turkish is a morphologically rich, agglutinative language — suffixes stack onto roots in ways that make token-level entity boundaries ambiguous. Off-the-shelf English NER models fail badly on Turkish text.
Approach
Fine-tuned bert-base-multilingual-cased on the WikiANN Turkish split, then evaluated against a small hand-annotated news corpus. Used Hugging Face transformers + datasets for the full pipeline.
Key decisions:
- Tokenisation: subword tokenisation with WordPiece creates multi-token words; labels were aligned using the first-subtoken strategy.
- Label smoothing: with only ~10k training examples, a small amount of label smoothing reduced overconfidence on rare entity types.
- Evaluation: entity-level (not token-level) F1 via
seqeval— the standard for NER.
Results
| Entity | Precision | Recall | F1 |
|---|---|---|---|
| PER | 0.91 | 0.89 | 0.90 |
| ORG | 0.83 | 0.81 | 0.82 |
| LOC | 0.88 | 0.86 | 0.87 |
Strong results given the dataset size. The main failure mode was ORG entities that shared surface forms with common nouns — a problem that would benefit from a gazetteer or larger domain-specific pretraining.
What I’d do differently
Train on the full mC4 Turkish slice rather than WikiANN alone. WikiANN entity distributions are biased toward geopolitical entities; news text has a much wider ORG variety.