Loading…
Loading…
Turkish-NLP/t5-efficient-small-turkishA Turkish T5 model fine-tuned for Turkish spelling correction on NoisyWikiTr. It takes a sentence with spelling errors and generates the corrected sentence.
This is the T5-efficient-TRsmall model from Leveraging Large Language Models for Spelling Correction in Turkish (Ceren Güzel Turhan, PeerJ Computer Science 11:e2889, 2025), the best model in the paper on realistic noise.
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
repo = "cguzel/trspell-t5-efficient-small"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSeq2SeqLM.from_pretrained(repo)
text = "netekim kasım ve temmuz felaketleri bunun sadece acı iki örneğidir"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
output = model.generate(**inputs, num_beams=5, max_length=256, early_stopping=True)
print(tokenizer.decode(output[0], skip_special_tokens=True))
Input should be normalised like the training data: lowercase with Turkish rules (I → ı, İ → i), no digits, punctuation or apostrophes. No task prefix is used.
Turkish-NLP/t5-efficient-small-turkish,
a T5-efficient model pre-trained on TurkishNoisyWikiTr test set, accuracy / word correction rate (Table 5 of the paper):
| Model | Uniform noise | Realistic noise |
|---|---|---|
| T5-efficient-TRsmall (this model) | 0.7015 / 0.4185 | 0.9688 / 0.8129 |
| FLAN-T5-small | 0.7013 / 0.4192 | 0.7189 / 0.5483 |
| XLM-RoBERTa-base | 0.9286 / 0.4478 | 0.9421 / 0.5003 |
| JamSpell | 0.9606 / 0.8156 | 0.9500 / 0.6735 |
| Zemberek | 0.9173 / 0.6130 | 0.8770 / 0.4740 |
On the realistic test set with non-Turkish sentences removed, this model reaches 0.9664 accuracy, 0.8142 word correction and 0.9925 Levenshtein similarity.
@article{guzelturhan2025trspell,
title = {Leveraging large language models for spelling correction in Turkish},
author = {G{\"u}zel Turhan, Ceren},
journal = {PeerJ Computer Science},
volume = {11},
pages = {e2889},
year = {2025}
}