Introducing DiacNet-1.1: Multilingual Diacritic Restoration for 10 Languages

Overview
Diacritics-such as accents, tone marks, and special characters-are essential for clarity, pronunciation, and meaning in many languages. Yet, they are often stripped away in digital text due to technical limitations, user input habits, or data processing errors. This loss can lead to ambiguity, mispronunciation, and even miscommunication.
Today, we’re excited to introduce DiacNet-1.1, a state-of-the-art model designed to restore diacritics to text across 10 languages in a single, unified system. Developed by olaverse, DiacNet-1.1 is fine-tuned from Google’s ByT5-base (580M parameters) and trained on 7 million sentences of commercially licensed text. Whether you’re working with Yorùbá, Vietnamese, Polish, or Spanish, DiacNet-1.1 can help you recover the nuances of written language with remarkable accuracy.
Supported Languages
DiacNet-1.1 supports the following 10 languages:
- Yorùbá (
<yor>) - Igbo (
<ibo>) - Hausa (
<hau>) - Vietnamese (
<vie>) - Polish (
<pol>) - Turkish (
<tur>) - Portuguese (
<por>) - Spanish (
<spa>) - French (
<fra>) - Italian (
<ita>)
You can also use the <auto> tag to let the model infer the language automatically, with minimal impact on accuracy.
How It Works
DiacNet-1.1 is a sequence-to-sequence model that takes stripped text (text without diacritics) and predicts the fully diacritized version. The model is trained on a diverse corpus of web and encyclopedic text, ensuring robustness across different domains.
Example Usage
Here’s how you can use DiacNet-1.1 in just a few lines of Python:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load the model and tokenizer
tok = AutoTokenizer.from_pretrained("olaverse/diacnet-1.1")
model = AutoModelForSeq2SeqLM.from_pretrained("olaverse/diacnet-1.1")
# Restore diacritics to Yorùbá text
text = "<yor> se eranko naa si gbo o?"
inputs = tok(text, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=512)
print(tok.decode(out[0], skip_special_tokens=True))
# Output: ṣé ẹranko náà sì gbọ́ ọ?
Language Tagging
Prefix your input text with the appropriate language tag to guide the model:
# Vietnamese
text = "<vie> Toi khong biet tieng Viet"
# Output: Tôi không biết tiếng Việt
# Polish
text = "<pol> Lodz jest piekna"
# Output: Łódź jest piękna
# Auto-detect language
text = "<auto> El nino esta en la casa"
# Output: El niño está en la casa
Performance
DiacNet-1.1 was evaluated on diacbench, a benchmark of 1,000 held-out sentences per language, sourced independently from the training corpus. The model was tested using the following metrics:
- DER (Diacritic Error Rate): Errors restricted to diacritic-eligible characters.
- WER (Word Error Rate): Measures errors at the word level.
- CER (Character Error Rate): Measures errors at the character level.
- Exact Match: Percentage of sentences restored perfectly.
Benchmark Results
| Language | DER | WER | CER | Exact Match |
|---|---|---|---|---|
| Italian | 0.0002 | 0.10% | 0.04% | 99.3% |
| Portuguese | 0.0031 | 1.39% | 0.23% | 88.0% |
| French | 0.0053 | 0.77% | 0.18% | 94.7% |
| Polish | 0.0058 | 2.65% | 0.33% | 85.3% |
| Turkish | 0.0068 | 1.50% | 0.35% | 91.7% |
| Spanish | 0.0081 | 2.06% | 0.35% | 83.0% |
| Vietnamese | 0.0460 | 11.98% | 3.06% | 36.0% |
| Igbo | 0.0508 | 4.78% | 1.29% | 41.0% |
| Hausa | 0.0593 | 2.53% | 0.51% | 59.7% |
| Yorùbá | 0.2006 | 42.18% | 14.50% | 0.3% |
Note: The lower exact-match scores for Vietnamese and Yorùbá reflect the high density of diacritic marks in these languages. Even a single error can cause the entire sentence to fail the exact-match metric. DER is the most meaningful metric for these languages.
Improvements Over DiacNet-1.0
DiacNet-1.1 represents a significant leap forward from its predecessor, DiacNet-1.0, with improvements across multiple languages:
| Language | DER (1.0 → 1.1) | WER (1.0 → 1.1) | Verdict |
|---|---|---|---|
| Vietnamese | 0.1264 → 0.0460 | 21.98% → 11.98% | 1.1, 2.7× better |
| Turkish | 0.0447 → 0.0068 | 19.20% → 1.50% | 1.1, 6.6× better |
| Polish | 0.0357 → 0.0058 | 15.12% → 2.65% | 1.1, 6.2× better |
| Italian | 0.0015 → 0.0002 | 0.66% → 0.10% | 1.1, 7.5× better |
| Portuguese | 0.0072 → 0.0031 | 1.80% → 1.39% | 1.1 better |
| Spanish | 0.0084 → 0.0081 | 2.19% → 2.06% | ~equal |
| French | 0.0038 → 0.0053 | 1.46% → 0.77% | Mixed |
| Igbo | 0.0359 → 0.0508 | 8.34% → 4.78% | Mixed |
| Hausa | 0.0383 → 0.0593 | 8.58% → 2.53% | Mixed |
| Yorùbá | 0.1554 → 0.2006 | 27.69% → 42.18% | 1.0 better |
Key Observations
- Major Gains: DiacNet-1.1 achieves 2.7× to 7.5× better performance on Vietnamese, Turkish, Polish, and Italian.
- Mixed Results: For French, Igbo, and Hausa, the model shows trade-offs between DER and WER. For example, while DER increased slightly for Hausa, WER improved dramatically (8.58% → 2.53%), and exact-match scores jumped from 0% to 59.7%.
- Yorùbá Challenge: The model’s performance on Yorùbá regressed due to the lower quality of diacritic annotations in the larger training corpus. DiacNet-1.0 was trained on ~2,000 high-quality Yorùbá passages, while DiacNet-1.1’s corpus, though much larger, had a lower diacritic density. This highlights a critical trade-off: more data isn’t always better if annotation quality suffers.
Priority for Next Release: Improving Yorùbá, Igbo, and Hausa performance by incorporating higher-quality annotated data.
Comparison with General-Purpose LLMs
We benchmarked DiacNet-1.1 against Claude Sonnet 4.5 and GPT-4o-mini on the same diacbench dataset. The results reveal interesting trade-offs between accuracy and reliability:
Diacritic Error Rate (DER)


| System | Yorùbá | Igbo | Hausa | Vietnamese | Polish | Turkish | Portuguese | Spanish | French | Italian |
|---|---|---|---|---|---|---|---|---|---|---|
| Copy-Input (Floor) | 0.4358 | 0.1171 | 0.0236 | 0.3062 | 0.0915 | 0.1113 | 0.0476 | 0.0426 | 0.0471 | 0.0333 |
| DiacNet-1.0 | 0.1554 | 0.0359 | 0.0383 | 0.1264 | 0.0357 | 0.0447 | 0.0072 | 0.0084 | 0.0038 | 0.0015 |
| DiacNet-1.1 | 0.2006 | 0.0508 | 0.0593 | 0.0460 | 0.0058 | 0.0068 | 0.0031 | 0.0081 | 0.0053 | 0.0002 |
| Claude 4.5 (Strict) | 0.3353 | 0.2261 | 0.3509 | 0.0278 | 0.0343 | 0.0241 | 0.0172 | 0.0215 | 0.1171 | 0.0005 |
| Claude 4.5 (Fallback) | 0.1913 | 0.0427 | 0.0178 | 0.0107 | 0.0035 | 0.0019 | 0.0011 | 0.0040 | 0.0052 | 0.0005 |
| GPT-4o-mini (Strict) | 0.4607 | 0.5035 | 0.6368 | 0.0847 | 0.0430 | 0.0261 | 0.0280 | 0.0555 | 0.0341 | 0.0085 |
| GPT-4o-mini (Fallback) | 0.2811 | 0.1277 | 0.1432 | 0.0399 | 0.0070 | 0.0038 | 0.0024 | 0.0089 | 0.0023 | 0.0052 |
Key Takeaways
- Strict vs. Fallback Scoring:
- Strict scoring counts all errors, including cases where the LLM rewrites or translates the input.
- Fallback scoring assumes a pipeline that detects and skips rewritten outputs, focusing only on diacritic restoration.
- DiacNet-1.1 vs. Claude (Strict): DiacNet-1.1 outperforms Claude on 8 out of 10 languages when scored strictly.
- DiacNet-1.1 vs. Claude (Fallback): With fallback scoring, Claude outperforms DiacNet-1.1 on 9 out of 10 languages. This highlights that while LLMs can achieve higher accuracy on compliant outputs, they fail to return usable text on 20-35% of inputs (e.g., 34% of Hausa, 26% of Yorùbá, 21% of Igbo).
- Reliability: DiacNet-1.1 never rewrites or alters base characters in 94.7–100% of cases, depending on the language. In contrast, LLMs alter 20–50% of inputs, making them unreliable for large-scale processing.
Output Compliance

| System | Yorùbá | Igbo | Hausa | Vietnamese | Polish | Turkish | Portuguese | Spanish | French | Italian |
|---|---|---|---|---|---|---|---|---|---|---|
| DiacNet-1.1 | 100% | 96.3% | 94.7% | 99.3% | 100% | 99.7% | 100% | 99.7% | 99.7% | 100% |
| DiacNet-1.0 | 98.0% | 99.0% | 98.3% | 96.3% | 99.3% | 100% | 99.7% | 99.7% | 100% | 100% |
| Claude 4.5 | 74.3% | 79.3% | 65.7% | 97.7% | 96.7% | 98.0% | 97.7% | 98.3% | 88.3% | 100% |
| GPT-4o-mini | 68.0% | 57.3% | 49.3% | 93.7% | 96.0% | 94.7% | 97.7% | 97.3% | 96.7% | 99.7% |
Conclusion: If you need maximum accuracy on a few sentences and can tolerate retries, a frontier LLM like Claude may be the best choice. However, if you need to process millions of sentences reliably, deterministically, and offline, DiacNet-1.1 is the tool for the job.
Training Details
| Aspect | Description |
|---|---|
| Base Model | google/byt5-base (580M parameters, byte-level) |
| Data | 7.02M sentences from FineWeb-2 (ODC-By) and Wikipedia (CC BY-SA), filtered for diacritic density, NFC-normalised, and deduplicated. |
| Objective | Sequence-to-sequence: <lang> stripped text → fully diacritized text. |
| Augmentation | Partial stripping (30%), character noise (7%), <auto> tag (12%), optional gloss conditioning (~6%). |
| Precision | BF16, max 512 bytes. |
| Correction Pass | Continued training on high-density Yorùbá with 35% replay of other languages, learning rate 2e-5. |
Note: All training data is commercially licensed. No non-commercial sources (e.g., MENYO-20k, JW300) were used.
Limitations
While DiacNet-1.1 is a powerful tool, it has some limitations:
- Yorùbá Tone Marks: The model under-marks tones in Yorùbá due to under-annotated training data. Output should not be treated as publication-ready without review.
- Irreducible Errors: Stripping diacritics is lossy. For example, in Italian, both Viaggiò (3rd-person past) and Viaggio (1st-person present) reduce to Viaggio-no model (or human) can recover the original distinction.
- Proper Nouns: Names and places (e.g., Àlàmú vs. Àlámù) are unreliable due to insufficient context. Foreign names may also be over-nativized (e.g., Vietnamese Tom → Tôm).
- Gloss Conditioning: The model supports optional
[g: word=meaning]hints, but their effect on diacbench was neutral to slightly negative. This feature is documented but not recommended for general use. - Structural Guarantees: As a seq2seq model, DiacNet-1.1 can alter base characters. However, measured compliance on diacbench is 94.7–100%, so constrained decoding is advisable for high-stakes pipelines.
- Register Bias: The model was trained on web and encyclopedic text. Performance on conversational, poetic, or code-switched text is untested.
- Benchmark Limitations: The diacbench dataset contains a small number of defective reference sentences (~1%), which slightly caps measured scores.
Intended Use Cases
DiacNet-1.1 is ideal for:
✅ Restoring diacritics in scraped or user-typed text.
✅ Cleaning corpora for downstream NLP tasks.
✅ Assisting typing in languages where diacritics are commonly omitted.
DiacNet-1.1 is not designed for:
❌ Text generation.
❌ Translation.
❌ Spelling correction.
❌ General-purpose language modeling.
Best Practice: Use DiacNet-1.1 with human review for Yorùbá and any application where a wrong tone mark could change meaning.
Citation
If you use DiacNet-1.1 in your research or applications, please cite it as follows:
@misc{diacnet11,
author = {olaverse},
title = {diacnet-1.1: multilingual diacritic restoration},
year = {2026},
url = {https://huggingface.co/olaverse/diacnet-1.1}
}
DiacNet-1.1 is built on ByT5 (Xue et al.), FineWeb-2, and Wikipedia. Please attribute these sources per their respective licenses.
Try It Yourself
Ready to restore diacritics to your text? Head over to the DiacNet-1.1 Hugging Face page to explore the model, download it, and start using it in your projects!
Questions or feedback? Open an issue on the Hugging Face repository or reach out to the olaverse team.
Enjoyed this? Every model we write about is open weight and free to download.


