Instructions to use cguzel/trspell-t5-efficient-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cguzel/trspell-t5-efficient-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cguzel/trspell-t5-efficient-small")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("cguzel/trspell-t5-efficient-small") model = AutoModelForSeq2SeqLM.from_pretrained("cguzel/trspell-t5-efficient-small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cguzel/trspell-t5-efficient-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cguzel/trspell-t5-efficient-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cguzel/trspell-t5-efficient-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cguzel/trspell-t5-efficient-small
- SGLang
How to use cguzel/trspell-t5-efficient-small with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cguzel/trspell-t5-efficient-small" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cguzel/trspell-t5-efficient-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cguzel/trspell-t5-efficient-small" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cguzel/trspell-t5-efficient-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cguzel/trspell-t5-efficient-small with Docker Model Runner:
docker model run hf.co/cguzel/trspell-t5-efficient-small
YAML Metadata Warning:The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
trspell-t5-efficient-small
A 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.
- Paper: https://doi.org/10.7717/peerj-cs.2889
- Code: https://github.com/cgturhan/trspell
- Dataset: https://huggingface.co/datasets/cguzel/NoisyWikiTr
Usage
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.
Model details
- Base model:
Turkish-NLP/t5-efficient-small-turkish, a T5-efficient model pre-trained on Turkish - Architecture: encoder-decoder, 32 encoder layers and 6 decoder layers, d_model 512, about 142M parameters
- Tokenizer: Turkish SentencePiece vocabulary (32k), which covers all Turkish letters (ı, ğ, ş, ç, ö, ü, İ)
- Task: sequence-to-sequence, noisy sentence → clean sentence
Training
- Data: NoisyWikiTr training split, 687k Turkish Wikipedia sentences with about 10% of tokens corrupted (deletion, insertion, transposition, substitution, vowel errors, common misspellings, word splits)
- Validation: NoisyWikiTr validation split (85k sentences)
Evaluation
NoisyWikiTr 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.
Limitations
- Trained and evaluated on synthetic errors; results on real typos may differ.
- Deletion errors are the hardest type for the model.
- Corrects spelling only, not grammar.
- Long inputs are truncated at 256 tokens; split long texts into sentences.
Citation
@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}
}
- Downloads last month
- -
Model tree for cguzel/trspell-t5-efficient-small
Base model
Turkish-NLP/t5-efficient-small-turkish