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 → អ៊ីនធឺណិត).
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 |
tmr → ស្អែក, sry → សុំទោស, gn → រាត្រីសួស្តី, btw → ម្យ៉ាងទៀត, wyd → ធ្វើអីហ្នឹង.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.
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.
ng, yt, dl, bn); the right answer is often in the top-5.Training details (hardware, time, settings) are not published. Questions: contact the author through the Hugging Face profile or GitHub.
@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}
}
model.safetensors 71 MBonnx/encoder.onnx 43 MBonnx/decoder.onnx 29 MBonnx/encoder.int8.onnx 11 MBonnx/decoder.int8.onnx 8 MB