Instructions to use muyleanging/Akkhara-ByT5-Small-Khmer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use muyleanging/Akkhara-ByT5-Small-Khmer with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="muyleanging/Akkhara-ByT5-Small-Khmer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("muyleanging/Akkhara-ByT5-Small-Khmer") model = AutoModelForSeq2SeqLM.from_pretrained("muyleanging/Akkhara-ByT5-Small-Khmer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Akkhara-ByT5-Small-Khmer (0.3B)
Akkhara converts Sing Khmer (Khmer typed with Latin letters, as in chat) into Khmer script and returns a ranked top-5 list, like a typing assistant (IME). This is the bigger, most accurate Akkhara model on formal text; the small akkhara-mini runs on phones.
| input | output (#1) |
|---|---|
nh jg tv sala rean |
αααα»αα αααα ααΆααΆααα |
sl oun nah |
αααα‘αΆααα’αΌαααΆαα |
sok sbay ot haha bro nv alov |
αα»ααααααΆαα’αα haha bro αα α₯α‘αΌα |
Benchmark
Both Akkhara models on the same tests (same beam search, 5 beams): a held-out test split
(7,821 sentences), 39 real chat sentences typed and labeled by a native speaker, 86 context tests
(the same chat word read from its neighbours, e.g. ng = αα·α / ααΉα / α αααΉα) and 7 glued-word tests.
| model | test top-1 | test top-5 | test CER | real chat top-1 / top-5 | context #1 / top-5 | glued |
|---|---|---|---|---|---|---|
| akkhara-mini (18M) | 57.9% | 76.6% | 4.55% | 87% / 95% | 81 / 99% | 7/7 |
| akkhara-byt5-small (300M) | 62.0% | 79.7% | 3.73% | 87% / 95% | 80 / 98% | 7/7 |
- Formal news-style text: this model is the most accurate (lowest CER).
- Real chat: both models get 85β87% of sentences right at #1 and 92β95% in the top-5, and 80β81 of 86 context words.
!in chat (jom! loy mesβ α α»α! α‘αΌααααααα), English chat words (send link,benchmark) and chat abbreviations (tmrβ ααα’αα,sryβ αα»αααα,btwβ αααααΆαααα) are handled.- CER = share of wrong letters (lower is better). Top-5 = the right sentence is among the 5 suggestions.
Use
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_id = "muyleanging/Akkhara-ByT5-Small-Khmer"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
texts = ["nh jg tv sala rean", "sl oun nah"]
inputs = tokenizer(texts, return_tensors="pt", padding=True)
outputs = model.generate(**inputs, num_beams=5, num_return_sequences=5, max_new_tokens=128)
candidates = tokenizer.batch_decode(outputs, skip_special_tokens=True)
for i, text in enumerate(texts):
print(text, "β", candidates[i * 5:(i + 1) * 5])
For live typing, cut long input into ~6-word chunks and cache finished chunks.
Model details
- Developed by: Ing Muyleang
- Model type: byte-level T5 encoderβdecoder (fine-tuned from google/byt5-small)
- Parameters: 299.6M Β· License: Apache-2.0
- Language: Khmer (km); English chat words in mixed input stay English
- Training data: Sing Khmer β Khmer pairs collected, generated, cleaned and checked by the author with AI tools (agy, Claude); see muyleanging/Akkhara-Sing-Khmer (access on request).
- Demo: muyleanging/Akkhara-Demo
- Keyboard app: github.com/MuyleangIng/akkhara-keyboard
Limits
- Trained mostly on synthetic pairs; the real-chat test set is small (39 sentences).
- Short abbreviations are ambiguous (
ng,mn,dl,bn); the right answer is often in the top-5. - It knows rude chat words (they occur in real chat).
Contact
Training details (hardware, time, settings) are not published. Questions: contact the author through the Hugging Face profile or GitHub.
Citation
@misc{ing2026akkhara,
author = {Ing, Muyleang},
title = {Akkhara: a byte-level Sing Khmer to Khmer script transliteration model},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/muyleanging/Akkhara-ByT5-Small-Khmer}
}
- Downloads last month
- 385
Model tree for muyleanging/Akkhara-ByT5-Small-Khmer
Base model
google/byt5-small
