Loadingβ¦
Loadingβ¦
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}
}