Downloads · 30 days
1.9K
76% of all-time downloads
erdemKocaogluu/byt5-small-tr-normalizer
byt5-small-tr-normalizer is a text generation model from erdemKocaogluu. Use it when you need the model to write or continue text. The card lists the license as cc-by-nc-sa-4.0.
A fine-tuned byT5-small model that rewrites informal, misspelled, or dialectal Turkish sentences into standard written Turkish.
Downloads · 30 days
1.9K
76% of all-time downloads
All-time downloads
2.5K
Public
Parameters
300M
1.2 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors1.2 GB · 100%
From the Hugging Face model README
A fine-tuned byT5-small model that rewrites informal, misspelled, or dialectal Turkish sentences into standard written Turkish.
Typical inputs are the kind of text people actually type in a hurry: dropped diacritics, missing letters, colloquial verb contractions, ASCII-only typing, and regional/dialectal spelling. The model rewrites these into a clean, standard-Turkish sentence while keeping the original meaning and word order.
sicil belgmi alcam -> Sicil belgimi alacağım
araç lsansı nasl alacaım -> araç lisansı nasıl alacağım
muhtara gitcem ne götüreyim -> Muhtara gideceğim ne götüreyim
google/byt5-smallnoisy Turkish -> standard Turkish)"düzelt: " before feeding it to the model (see usage below).from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_id = "erdemKocaogluu/byt5-small-tr-normalizer"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
text = "sicil belgmi alcam"
inputs = tokenizer("düzelt: " + text, return_tensors="pt")
output = model.generate(**inputs, max_length=384, num_beams=1)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Training pairs come from six public Turkish datasets that already provide noisy/clean sentence pairs (grammar correction, typo validation, text normalization — see Data sources below). No data was synthetically generated for this training run. Four sources are permissively licensed (MIT, Apache-2.0, or CC0-1.0); two are derived from Turkish Wikipedia and are licensed CC BY-SA 3.0 (attribution required — see below).
| Source | Author | Role | License |
|---|---|---|---|
| Turkish-OSCAR-GEC | asimokby | Main training corpus | MIT |
| Turkish-GPT-GEC | asimokby | LLM-generated correction pairs | MIT |
| turkish-text-normalization-1m | GoktugD | Large-scale text normalization pairs | CC0-1.0 |
| turkish_typo_validation | burakaytan | Typo-focused pairs, parsed separately | Apache-2.0 |
| trspell (NoisyWikiTr) | cgturhan | Wikipedia-derived noisy/clean pairs | CC BY-SA 3.0 (Wikipedia-derived) |
| noisy-sentences-dataset | radi-cho | Turkish subset of a multilingual noisy-sentence corpus | CC BY-SA 3.0 (Wikipedia-derived, per the source's own credits) |
Not every dataset that was evaluated made it into the final training mix — a diacritics-restoration dataset, for example, was tested but excluded after evaluation.
The MIT, Apache-2.0, and CC0-1.0 sources above are acknowledged here per their license terms; their original copyright notices and licenses remain with the linked repositories. The trspell (NoisyWikiTr) and noisy-sentences-dataset sources are built from Turkish Wikipedia text; that text is licensed CC BY-SA 3.0, so it is credited here accordingly: portions derived from Wikipedia contributors, licensed under CC BY-SA 3.0. This project does not redistribute the original dataset files — only sentence pairs derived from them were used to train the model.
Note on Turkish-OSCAR-GEC: this dataset is built on top of OSCAR, a Common Crawl–derived web text corpus. OSCAR's own documentation states that its maintainers "do not own any of the text from which these data has been extracted" and license only their own metadata/annotations (CC0). The "MIT" tag on Turkish-OSCAR-GEC is the uploader's own declaration and does not itself establish clear rights over the underlying crawled text. This is disclosed here so downstream users can make their own informed assessment; it reflects a broader, industry-wide open question around web-scraped training corpora rather than an issue specific to this dataset.
OSCAR's own terms note an exception for text-and-data-mining (TDM) and research use; the way this data was used here — extracting statistical spelling/grammar-correction patterns during training, not reproducing or redistributing OSCAR's source sentences — fits that framing. The model is also not a free-text generator: it transforms a sentence the user supplies, so its output is structurally anchored to that input rather than free to reproduce memorized training text, which limits (though does not eliminate) the risk of verbatim reproduction of training data.
During training, checkpoints were evaluated periodically on a held-out validation split and ranked with a combined selection score that balances two things: how well a checkpoint fixes noisy sentences, and how well it leaves already-correct sentences untouched (to discourage over-correction). The checkpoint used here is the highest-scoring one from that process, and its weights were verified by hash before being published.
Q_good = 1 - (0.6 * CER + 0.4 * WER) # how well it fixes noisy sentences
unchanged_rate = pred == source on clean sentences # how well it leaves correct text alone
selection_score = 0.7 * Q_good + 0.3 * unchanged_rate






| Test set | n | WER (model) | WER (copy) | CER (model) | CER (copy) | F1 | Over-correction |
|---|---|---|---|---|---|---|---|
| tweets | 1,742 | 0.161 | 0.336 | 0.034 | 0.071 | 0.667 | 0.6% |
| boun | 507 | 0.093 | 0.129 | 0.043 | 0.015 | 0.590 | 4.3% |
"copy" = do-nothing baseline (source passed through unchanged).
The model roughly halves the word error rate compared to a "do nothing" baseline on both sets, while rarely damaging text that was already correct. On boun, note that model CER is slightly higher than the copy baseline's CER even though WER improves substantially — WER and CER don't always move together, since a small number of larger character-level edits can outweigh many small word-level fixes.


Sources:
The tweets set was lightly cleaned before evaluation — social-media artifacts (@mentions, hashtags, emoji) were stripped from both source and reference, and rows the original dataset flagged as foreign-language or neologism were excluded.
These fine-tuned model weights are released under CC BY-NC-SA 4.0 (non-commercial use, attribution required, share-alike). Note this differs from the base model: google/byt5-small itself remains available under its own Apache 2.0 license. This license applies to how these fine-tuned weights are released; it is separate from the licenses of the training data sources listed above under Data sources, consistent with common practice for models trained on mixed-license corpora.