--- pretty_name: Samdei Type Fine-tuning Data license: cc-by-sa-4.0 language: - km task_categories: - translation tags: - transliteration - romanization - romanized-khmer - khmer - synthetic - chat size_categories: - 1M` (a whole sentence from ``, romanized by Gemma 4) | | `persona` | Meaning | |---|---| | `formal`, `careful`, `mixed`, `lazy` | the generator's typing personas, from standard spelling to heavy chat shortcuts and typos | | `place` | standalone place-name pair from our gazetteer | | `rules_chh`, `rules_chh+mixed`, `rules_chh+lazy` | Chhunneng-mined table, alone or with the noise habits of `mixed` / `lazy` | | `rules_wd`, `rules_wd+mixed` | Wikidata-mined table | | `…~stretch` | the persona also stretches letters inside the sentence (stage 3) | | `gemrom0`–`gemrom3` | Gemma 4 romanization with one of four style prompts | | `abbr` | abbreviated copy of another pair | ## How to load ```python from datasets import load_dataset casual = load_dataset("samdei/samdei-type-finetuning-data", "casual", split="train") abbr = load_dataset("samdei/samdei-type-finetuning-data", "abbreviated", split="train") ``` To rebuild a mix exactly, read `recipes.json` and concatenate its files in order, with repeats. Training starts from the stage-1 checkpoints, [`samdei/samdei-type-base-pretrained`](https://huggingface.co/samdei/samdei-type-base-pretrained) and [`samdei/samdei-type-mini-pretrained`](https://huggingface.co/samdei/samdei-type-mini-pretrained). ## How the pairs were made - **`chat_mix`.** The persona generator (second version) on a chat-heavy sample of sentences. The generator works in four steps: 1. it cuts sentences into pieces of 1–12 words; 2. it pronounces each word with Google's Khmer pronunciation lexicon; 3. it spells the piece in a persona (formal 8%, careful 32%, mixed 40%, lazy 20%); 4. it adds noise (glued or split words, dropped vowels, swaps, typos), English chat words and place names. - **`llm_romanized`.** Gemma 4 12B, run locally, romanized real sentences "the way Cambodians type on Messenger", 10 sentences per call. The Khmer side stays the original sentence, so the target is always correct, and Gemma's looser spelling acts as human-like noise on the input. 97% of the outputs passed our filters. - **`mined_tables_*`.** A rule miner learns per-slot spelling tables (onset, vowel, coda, glide, context) by Viterbi alignment and hard EM from public (Khmer word, romanization) lists: the Chhunneng word list (24.9k pairs, MIT) and 1.6k Wikidata person and place names (CC0). Words that are targets of a word-level evaluation set are removed first. The tables are in [`samdei/samdei-type-resources`](https://huggingface.co/datasets/samdei/samdei-type-resources). The pairs here are new sentences (HPLT, FineWeb-2, ALT, chat sentences) spelled with them. - **`abbreviated`.** - It covers 40% of `chat_mix` pairs and all `llm_romanized` pairs. - Operations: consonant skeleton (`bong` → `bg`), dropped vowels, first + last letter (`jong` → `jg`), dropped digraph h (`khlang` → `klang`), dropped cluster member. - Vowels are dropped only from one-syllable words among the 1,000 most frequent. - An abbreviation that the chat lexicon reserves for one word (`nh` for ខ្ញុំ) is never produced for another. - **`casual`.** 21.6k HPLT and FineWeb-2 sentences that contain one of 13 spoken-register words (ហ្នឹង, ចឹង, អី, តោះ, …) as a token; misordered PDF text is dropped. They are spelled with stretched letters by the generator (formal 5%, careful 25%, mixed 35%, lazy 15%, Chhunneng table with mixed habits 20%). No Akkhara-derived spelling rules are used. **Test separation.** - Every sentence of every evaluation set, including Samdei Type Bench and its chat context, is banned in the generator. - The rule miner never sees a test row or a word-level test target. - No Samdei Type Bench message equals a training target. The only shared strings are common single words. **Reproducibility.** These files are the exact pairs the released models were trained on, so training can be repeated without regenerating them. The data generator and the training code are not public; the released code ([github.com/Samdei-Labs/samdei-type](https://github.com/Samdei-Labs/samdei-type)) is for inference only. ## Limitations - **Synthetic inputs.** No row is real typing. Chat habits are covered only as far as our personas, two mined tables, one LLM and our abbreviation rules reach. - **Scheme bias of the mined tables.** The Chhunneng table follows a dictionary-like scheme and the Wikidata table an official name scheme; neither is chat spelling as such. - **Pieces, not messages.** Inputs are short (median 26 characters). - **Personal data.** Web text may contain names, phone numbers or other personal data of the original authors. Lines with URLs or e-mail-like strings were dropped, but no other personal-data filter was run. To have a row removed, open a discussion in the [Community tab](https://huggingface.co/datasets/samdei/samdei-type-finetuning-data/discussions). - **LLM text.** The Gemma-written chat sentences and romanizations can contain mistakes. ## License and attribution **CC BY-SA 4.0** ([license text](https://creativecommons.org/licenses/by-sa/4.0/)). The rows contain pieces of the source sentences, so the source licenses travel with them: Khmer Wikipedia's share-alike terms set the license of the whole set, and rows from the other sources also stay under their own terms below. | Source | Side | License | |---|---|---| | HPLT v2 (`HPLT/HPLT2.0_cleaned`, khm_Khmr) | Khmer | CC0 packaging; Common Crawl terms of use apply to the text | | FineWeb-2 (`HuggingFaceFW/fineweb-2`, khm_Khmr) | Khmer | ODC-By 1.0; Common Crawl terms of use apply to the text | | Khmer Wikipedia (`wikimedia/wikipedia`, 20231101.km) | Khmer | CC BY-SA 4.0 (share-alike) | | Asian Language Treebank (ALT), Khmer side | Khmer | CC BY 4.0 | | LLM-written chat sentences (ours, Gemma 4) | Khmer | CC BY 4.0 (Gemma 4: Apache-2.0) | | Gemma 4 romanizations (ours) | Latin | Apache-2.0 model output; Khmer side as its source | | Google Khmer pronunciation lexicon | Latin (generator) | CC BY 4.0 | | Chhunneng romanized Khmer dataset (© 2025 Chrea Chanchhunneng) | Latin (mined table) | MIT | | Wikidata names | Latin (mined table) | CC0 | | Chat lexicon, place names, English chat words (ours) | Latin (generator) | CC0 | Rows whose `source` is `wikipedia` or `gemrom_wikipedia` carry Wikipedia's share-alike terms. They occur only in `chat_mix`, `llm_romanized` and `abbreviated`; the `mined_tables_*` and `casual` configs contain none. The MIT notice of the Chhunneng dataset, which the `mined_tables_*` tables derive from, is included as `LICENSE-chhunneng.txt`. **Changes to the source text.** The sentences were normalized with `khnormal`, filtered and deduplicated; the generator cut them into pieces of 1–12 words (the `llm_romanized` rows keep whole sentences). Each Khmer target is paired with a romanization in the `latin` column (see "How the pairs were made"). ## Citation ```bibtex @misc{samdei-type-2026, title = {Samdei Type: Separating What Is Written from How It Is Spelled for Romanized Khmer Transliteration}, author = {Mengsay Loem}, year = {2026}, note = {Technical report}, url = {https://github.com/Samdei-Labs/samdei-type/blob/main/paper/samdei-type.pdf} } ``` Contact: open a discussion in this repository's [Community tab](https://huggingface.co/datasets/samdei/samdei-type-finetuning-data/discussions).