Akkhara-Mini-Khmer-ONNX (18M)
Akkhara-mini converts Sing Khmer (Khmer typed with Latin letters, as in chat) into Khmer script with a ranked top-5 list, like a typing assistant (IME). It is small and fast, made for phones and keyboards, and runs fully offline in the Akkhara keyboard.
| input | output (#1) |
|---|---|
nh jg tv sala rean | ខ្ញុំចង់ទៅសាលារៀន |
b pg lvol ot torn tomne te o | បងកំពុងរវល់អត់ទាន់ទំនេរទេអូន |
send link mk b | send link មកបង |
sok sbay ot bro | សុខសប្បាយអត់ bro |
English chat words stay as typed (benchmark, laptop, deadline), with the Khmer loan
spelling in the top-5 when one exists (deadline → ដេតឡាញ, internet → អ៊ីនធឺណិត).

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) | 58.1% | 76.6% | 4.55% | 85% / 92% | 80 / 99% | 6/7 |
| akkhara-byt5-small (300M) | 62.0% | 79.7% | 3.73% | 87% / 95% | 80 / 98% | 7/7 |

- Real chat and context words: about as good as the big model (85–87% right at #1, 81 of 86 context words), while being 16× smaller.
- Chat abbreviations:
tmr→ ស្អែក,sry→ សុំទោស,gn→ រាត្រីសួស្តី,btw→ ម្យ៉ាងទៀត,wyd→ ធ្វើអីហ្នឹង. - Formal news-style text: the bigger muyleanging/Akkhara-ByT5-Small-Khmer is a little more accurate.
- 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-Mini-Khmer-ONNX"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
inputs = tokenizer(["nh jg tv sala rean"], return_tensors="pt")
out = model.generate(**inputs, num_beams=5, num_return_sequences=5, max_new_tokens=160)
print(tokenizer.batch_decode(out, skip_special_tokens=True))
# ['ខ្ញុំចង់ទៅសាលារៀន', ...]
# fastest (typing): greedy #1 only
out = model.generate(**inputs, num_beams=1, max_new_tokens=160)
For long text, cut it into ~6-word chunks and join the results.
ONNX (phones, web, other languages)
The onnx/ folder holds an ONNX Runtime export: encoder.onnx + decoder.onnx, or the 8-bit
encoder.int8.onnx + decoder.int8.onnx (18.5 MB, used in the keyboard), plus tokenizer.json
and abbreviations.tsv (46 abbreviations → full Khmer name: the keyboards show mptc as typed at #1
and ក្រសួងប្រៃសណីយ៍និងទូរគមនាគមន៍ at #2; a plain list, not learned by the model).
Run the encoder once per sentence, then the decoder once per Khmer letter (greedy or beam search).
On a recent Android phone the int8 model gives the #1 suggestion in about 10 ms.
Model details
- Developed by: Ing Muyleang
- Model type: T5-style encoder–decoder, character tokens (6 encoder + 3 decoder layers, d_model 384)
- Parameters: 17.8M · License: Apache-2.0
- Language: Khmer (km); English chat words in mixed input stay English
- Training data: 398k Sing Khmer → Khmer pairs (incl. 134 Cambodian ministry, university and bank names), 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 (APK): latest release
Limits
- Trained mostly on synthetic pairs; the real-chat test set is small (39 sentences).
- Short abbreviations stay ambiguous (
ng,yt,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{ing2026akkharamini,
author = {Ing, Muyleang},
title = {Akkhara-mini: a small character-level Sing Khmer to Khmer script transliteration model},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/muyleanging/Akkhara-Mini-Khmer-ONNX}
}