Akkhara-mini (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 β†’ αž’αŸŠαžΈαž“αž’αžΊαžŽαž·αž).

architecture

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

benchmark

  • 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 INGMUYLEANG/akkhara-byt5-small 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 = "INGMUYLEANG/akkhara-mini"
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 INGMUYLEANG/akkhara-sing-khmer (access on request).
  • Demo: INGMUYLEANG/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{akkhara2026mini,
  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/INGMUYLEANG/akkhara-mini}
}
Downloads last month
139
Safetensors
Model size
17.8M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train INGMUYLEANG/akkhara-mini

Space using INGMUYLEANG/akkhara-mini 1