Instructions to use INGMUYLEANG/akkhara-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use INGMUYLEANG/akkhara-mini 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="INGMUYLEANG/akkhara-mini")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("INGMUYLEANG/akkhara-mini") model = AutoModelForSeq2SeqLM.from_pretrained("INGMUYLEANG/akkhara-mini", device_map="auto") - Notebooks
- Google Colab
- Kaggle
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 β α’ααΈαααΊαα·α).
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 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

