--- pretty_name: Samdei Type Pretraining Data license: cc-by-sa-4.0 language: - km task_categories: - translation tags: - transliteration - romanization - romanized-khmer - khmer - synthetic size_categories: - 10M` (a whole sentence from ``, romanized by Gemma 4) | ## How to load ```python from datasets import load_dataset ds = load_dataset("samdei/samdei-type-pretraining-data", "generator_v2", split="train") print(ds[0]) # {'latin': ..., 'khmer': ..., 'persona': ..., 'source': ...} ``` To rebuild a mix exactly, read `recipes.json` and concatenate its files in order, with repeats. ## How the pairs were made 1. **Khmer targets.** - 1.41M web sentences: HPLT v2 802k (3 of 13 shards of khm_Khmr), FineWeb-2 280k, Khmer Wikipedia 306k (20231101 dump) and the Khmer side of ALT 22k. - Each sentence is normalized with `khnormal`, split and deduplicated. - Lines with URLs or e-mail-like strings, and lines that are mostly Latin, are dropped. - Sentences that overlap an evaluation set are removed before any pair is made. - 2,483 chat sentences were written by Gemma 4 12B, run locally, across 50 chat domains and 4 registers. 2. **The persona generator:** 1. It cuts each sentence into pieces of 1–12 words (mostly 5–6) with `khmercut`. 2. It pronounces each word with Google's Khmer pronunciation lexicon (62k words, CC BY 4.0); rule-based G2P covers the rest. 3. It spells the piece in a sampled persona: formal 8%, careful 32%, mixed 40%, lazy 20%. Personas differ in spelling choices (`nh / ny / gn`, final consonants, vowels) and in how often they use a hand-written chat lexicon (`knhom`, `kyom` or `nh` for ខ្ញុំ). 4. It adds noise: glued or split words, dropped vowels, k/g and t/d swaps, mistyped keys. 3. **LLM romanizations.** Gemma 4 12B romanized real sentences "the way Cambodians type on Messenger", with 4 style prompts. The Khmer side stays the original sentence. **Test separation.** - Every sentence of every evaluation set, including Samdei Type Bench, is removed from the corpus and banned in the generator. - 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; romanizations follow our four personas and one LLM. - **Pieces, not messages.** Inputs are short (median 26 characters, at most 132). - **Web noise.** About 1.5% of HPLT lines are misordered text extracted from PDFs. - **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-pretraining-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 | | 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 are about 19% of `train_web_s1`, `train_web_s2` and `train_v2_s3`. **Changes to the source text.** The sentences were normalized with `khnormal`, filtered and deduplicated; the generator cut them into pieces of 1–12 words. 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-pretraining-data/discussions).