File size: 13,147 Bytes
4bc856d
 
 
 
 
 
21137bf
4bc856d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7287796
4bc856d
 
 
 
 
 
 
 
 
 
 
d2dac46
4bc856d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d2dac46
4bc856d
 
 
 
 
 
 
 
 
d2dac46
 
4bc856d
 
 
 
d2dac46
4bc856d
 
 
 
 
 
d2dac46
4bc856d
 
 
 
 
 
1b9e036
4bc856d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21137bf
7287796
 
 
4bc856d
 
 
1b9e036
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
---
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<n<10M
multilinguality: monolingual
source_datasets:
- extended|HPLT/HPLT2.0_cleaned
- extended|HuggingFaceFW/fineweb-2
- extended|wikimedia/wikipedia
- extended  # + ALT (Asian Language Treebank, NICT), Chhunneng word list, Wikidata names
annotations_creators:
- machine-generated
language_creators:
- found
- machine-generated
configs:
- config_name: chat_mix
  default: true
  data_files:
  - split: train
    path: generator/ft_v2.parquet
- config_name: llm_romanized
  data_files:
  - split: train
    path: llm_romanized/train_gemrom2.parquet
- config_name: abbreviated
  data_files:
  - split: train
    path:
    - abbreviated/ft_v2_abbr3.parquet
    - abbreviated/train_gemrom2_abbr3.parquet
- config_name: mined_tables_chh
  data_files:
  - split: train
    path: mined_tables/ft_rules_chh.parquet
- config_name: mined_tables_chh_wd
  data_files:
  - split: train
    path: mined_tables/ft_rules_chhwd.parquet
- config_name: casual
  data_files:
  - split: train
    path: casual/ft_casual_noakk.parquet
- config_name: synthetic_heldout
  data_files:
  - split: validation
    path: validation/train_v2_s3.dev.parquet
---

# Samdei Type Fine-tuning Data

These are the exact **fine-tuning (stage 2)** and **adaptation (stage 3)** pairs of the Samdei Type romanized-Khmer → Khmer-script converters, [Samdei Type Mini](https://huggingface.co/samdei/samdei-type-mini) and [Samdei Type Base](https://huggingface.co/samdei/samdei-type-base).

Pretraining (stage 1, [`samdei/samdei-type-pretraining-data`](https://huggingface.co/datasets/samdei/samdei-type-pretraining-data)) teaches Khmer words and spelling from 6.5–12.8M generator pairs. These two short stages teach **how people actually type in chat**:
- **Stage 2:** looser LLM spellings, spelling habits mined from public word lists, and chat-like abbreviations.
- **Stage 3:** the spoken register and stretched letters.

Each stage is 3–6k steps (10–36 minutes on a laptop).

Every **Khmer target is real text**, except 2,483 chat sentences written by Gemma 4. Only the **romanized input** varies, by source.

Paper: [technical report](https://github.com/Samdei-Labs/samdei-type/blob/main/paper/samdei-type.pdf). Inference code: [github.com/Samdei-Labs/samdei-type](https://github.com/Samdei-Labs/samdei-type). Test set: [`samdei/samdei-type-bench`](https://huggingface.co/datasets/samdei/samdei-type-bench).

## Configs

The data is organized by kind, so each source of spelling noise can be used, inspected or left out on its own. Stages 2 and 3 share one dataset because stage 3 replays the whole stage-2 mix; the stage-3 data is the `casual` config.

| Config | Files (rows) | What it is | Stage | Used by |
|---|---|---|---|---|
| `chat_mix` (default) | `ft_v2` (629,878) | a chat-heavy sample of generator pairs: more LLM-written chat sentences and ALT, fewer web pieces; English chat words and place names inserted | 2, 3 | Mini, Base |
| `llm_romanized` | `train_gemrom2` (18,273) | Gemma 4 romanizations of 6,382 real sentences, 4 style prompts, ×3 copies with random casing | 2, 3 (×4 in the mix) | Mini, Base |
| `abbreviated` | `ft_v2_abbr3` (139,704), `train_gemrom2_abbr3` (16,302) | chat-like abbreviated copies of `chat_mix` and `llm_romanized` pairs; only the input changes (`tov` → `tv`, `bong` → `bg`) | 2, 3 (Gemma part ×2) | Mini, Base |
| `mined_tables_chh` | `ft_rules_chh` (289,820) | new pairs spelled with the table mined from the Chhunneng word list (dictionary-like scheme), alone or with mixed / lazy noise habits | 2, 3 | **Mini** |
| `mined_tables_chh_wd` | `ft_rules_chhwd` (289,647) | made the same way from the same sources, but spelled 70% with the Chhunneng table and 30% with the table mined from Wikidata names (official, name-style scheme) | 2, 3 | **Base** |
| `casual` | `ft_casual_noakk` (426,946) | 21.6k spoken-register web sentences, spelled by the generator with stretched letters (`tovvv`, `baaan`) | **3 only** | Mini, Base |
| `synthetic_heldout` | `train_v2_s3.dev` (12,232) | synthetic held-out pairs monitored during training (validation split) | – | – |

Mini and Base use the same data. The only difference is the mined-table file: Mini uses `mined_tables_chh`, Base `mined_tables_chh_wd`.

| Mix | Files, with repeats | Pairs |
|---|---|---|
| Stage 2, Base | `ft_v2` + `ft_v2_abbr3` + `train_gemrom2` ×4 + `train_gemrom2_abbr3` ×2 + `ft_rules_chhwd` | 1,164,925 |
| Stage 2, Mini | the same with `ft_rules_chh` | 1,165,098 |
| Stage 3 | the stage-2 mix of the model + `ft_casual_noakk` | 1,591,871 (Base), 1,592,044 (Mini) |

`recipes.json` gives the exact mix of each checkpoint (files in order, repeats, steps, learning rate, initialization), read from the training arguments stored in the checkpoints.

```
generator/      ft_v2.parquet
llm_romanized/  train_gemrom2.parquet
abbreviated/    ft_v2_abbr3.parquet  train_gemrom2_abbr3.parquet
mined_tables/   ft_rules_chh.parquet  ft_rules_chhwd.parquet
casual/         ft_casual_noakk.parquet
validation/     train_v2_s3.dev.parquet
recipes.json
```

## Columns

| Column | Content |
|---|---|
| `latin` | romanized input, as the model saw it |
| `khmer` | Khmer-script target, normalized with `khnormal`; English words, digits and brand names are copied from the input |
| `persona` | how the input was made (below) |
| `source` | where the Khmer target comes from: `hplt`, `fineweb2`, `wikipedia`, `alt` (a piece of a web sentence); `gemma` (a piece of an LLM-written chat sentence); `casual` (a piece of a spoken-register HPLT or FineWeb-2 sentence); `gazetteer`; `gemrom_<x>` (a whole sentence from `<x>`, 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).