Multi-Language NER: Challenges in PII Detection
Updated for 2026
The Accuracy Gap
NER models trained on English reach 85–92% F1 on standard tests. Apply those same models to Arabic or Chinese text. Accuracy drops to 50–70%.
For PII work, that gap is a problem. A 70% hit rate means 30% of sensitive data goes unseen.
The causes are not bugs. They come from how writing systems differ.
Four Root Causes
1. Word Boundaries
English splits words with spaces. Tokenization is easy.
Chinese has no spaces at all.
"张伟住在北京"
→ Split first: ["张伟", "住在", "北京"]
A model cannot tag what it cannot find. Splitting must come before NER.
Arabic links letters within a word. Short vowels are left out. Text runs right to left.
"محمد يعيش في دبي"
→ No short vowels, right-to-left, linked letters
2. Morphology
English verbs change in a few ways. Arabic uses a root system. One root creates dozens of words.
كتب (k-t-b, "write")
→ كاتب (writer), كتاب (book), مكتبة (library)
NER must parse roots to find names in derived word forms.
3. Name Conventions
Latin names go First then Last. Names in RTL languages chain family links.
محمد بن عبد الله
(Muhammad son-of Abdullah)
Chinese names put the family name first. Most names are two or three characters long.
张伟 (Zhang Wei) — 2 chars
欧阳修 (Ouyang Xiu) — 3 chars
A model built on Western name patterns will miss these structures.
4. Text Direction
Some languages run right to left. When RTL text holds an English name, visual order and logical order split apart. This is called BiDi text. It requires careful parsing.
F1 Scores by Writing System
| Language | Writing System | F1 Range | Level |
|---|---|---|---|
| English | Latin | 85–92% | Low |
| German | Latin | 82–88% | Low |
| French | Latin | 80–87% | Low |
| Spanish | Latin | 81–86% | Low |
| Russian | Cyrillic | 75–83% | Medium |
| Arabic | Abjad | 55–75% | High |
| Chinese | Hanzi | 60–78% | High |
| Japanese | Mixed | 65–80% | High |
| Thai | Thai | 50–70% | Very High |
| Hindi | Devanagari | 60–75% | High |
Non-Latin systems and missing word gaps lower scores across the board.
Three-Tier Solution
We use three tiers to cover 48 languages and writing systems.
Tier 1: spaCy — 25 Languages
For languages with strong, tested models. This covers English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, and Greek.
Tier 2: Stanza — Complex Languages
Stanford Stanza handles Arabic, Chinese, Japanese, and Korean. It runs word splits and root analysis before NER.
Tier 3: XLM-RoBERTa — Low-Resource Languages
For languages with no dedicated models. Thai, Vietnamese, Hindi, Bengali, Hebrew, Turkish, and Farsi go here. It handles mixed-language text with no explicit flags needed.
RTL and BiDi
Right-to-left text needs extra steps beyond splitting.
Our pipeline:
- Normalizes text to logical order.
- Runs NER on that order.
- Maps entity positions back to visual order.
We strip attached prefixes before NER and add them back after.
"محمد" — name only
"لمحمد" — "to Muhammad" (prefix on)
Code-Switching
Real documents often mix languages in one line.
"El meeting con John es at 3pm"
"我今天跟John去shopping"
Our pipeline splits by language. It runs the right model on each part. Then it joins results with position mapping.
Internal Benchmarks
Results from internal tests on mixed-language data:
| Scenario | F1 |
|---|---|
| English only | 91% |
| German only | 88% |
| Arabic only | 79% |
| Chinese only | 81% |
| English-Arabic mix | 83% |
| English-Chinese mix | 84% |
| English-German mix | 89% |
Setup Notes
The desktop app auto-detects language per document. For mixed-language files, it processes each segment with the right model. No manual step is needed.
Set the language in the API when you know it:
{
"text": "محمد بن عبد الله",
"language": "ar"
}
Use auto-detect when you do not:
{
"text": "محمد بن عبد الله",
"language": "auto"
}
Custom patterns should cover locale-specific digits:
# Latin employee ID
EMP-[0-9]{6}
# Arabic employee ID (includes Arabic-Indic digits)
موظف-[٠-٩0-9]{6}
See the full entity list. For API setup, visit the API features page. Our GDPR compliance guide covers how detection gaps affect data protection law.
anonym.legal uses a three-tier NER stack — spaCy, Stanza, and XLM-RoBERTa — to cover 48 languages with consistent PII detection.