mengsay commited on
Commit
7a7ad8f
·
verified ·
1 Parent(s): 1065b9f

Initial private draft of the Samdei Type release

Browse files
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
NOTICE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Samdei Type Base
2
+ Copyright 2026 The Samdei Type Authors
3
+
4
+ Licensed under the Apache License, Version 2.0 (see LICENSE). This covers every file in this
5
+ repository: the model weights, the ONNX graphs, onnx/vocab.json, the channel model, rerank.json
6
+ and the language models.
7
+
8
+ Language models (lm/char5_nowiki.npz, lm/wordfull_nowiki.json.gz)
9
+ Character and word n-gram counts of Khmer text, built without Wikipedia, from:
10
+ - HPLT v2 (HPLT/HPLT2.0_cleaned, khm_Khmr): CC0 packaging; the Common Crawl Terms of Use
11
+ apply to the text.
12
+ - FineWeb-2 (HuggingFaceFW/fineweb-2, khm_Khmr): ODC-By 1.0; the Common Crawl Terms of Use
13
+ apply to the text.
14
+ - Asian Language Treebank (ALT), Khmer side: CC BY 4.0.
15
+ - Samdei Type chat sentences (samdei/samdei-type-resources): CC BY 4.0.
16
+
17
+ Training data
18
+ The model and the channel model were trained on samdei/samdei-type-pretraining-data and
19
+ samdei/samdei-type-finetuning-data (CC BY-SA 4.0); their cards list every source. Part of the
20
+ fine-tuning pairs were spelled with tables derived from the Chhunneng romanized Khmer
21
+ dataset, MIT License, Copyright (c) 2025 Chrea Chanchhunneng, and from Wikidata (CC0).
README.md ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - km
5
+ pipeline_tag: text2text-generation
6
+ tags:
7
+ - transliteration
8
+ - romanization
9
+ - romanized-khmer
10
+ - khmer
11
+ - character-level
12
+ - pytorch
13
+ - onnx
14
+ - int8
15
+ - safetensors
16
+ base_model: samdei/samdei-type-pretrained
17
+ base_model_relation: finetune
18
+ datasets:
19
+ - samdei/samdei-type-pretraining-data
20
+ - samdei/samdei-type-finetuning-data
21
+ metrics:
22
+ - cer
23
+ - exact_match
24
+ model-index:
25
+ - name: Samdei Type Base
26
+ results:
27
+ - task:
28
+ type: text2text-generation
29
+ name: Romanized Khmer to Khmer script
30
+ dataset:
31
+ type: samdei/samdei-type-bench
32
+ name: Samdei Type Bench
33
+ split: test
34
+ metrics:
35
+ - type: cer
36
+ value: 0.052
37
+ name: CER (beam 5, char LM + word LM + OOV + channel rerank, 8-word pieces)
38
+ - type: exact_match
39
+ value: 0.303
40
+ name: Exact match
41
+ ---
42
+
43
+ # Samdei Type Base
44
+
45
+ Samdei Type Base converts romanized Khmer, as people type it in chat, into Khmer script:
46
+
47
+ | Input | Output |
48
+ |---|---|
49
+ | `knhom jong tov phsar` | ខ្ញុំចង់ទៅផ្សារ |
50
+ | `ot mean wifi te` | អត់មាន wifi ទេ |
51
+
52
+ It is an 18.2M-parameter character-level Transformer encoder-decoder. It reranks its candidates with two Khmer LMs and a reverse channel model. Base is the most accurate open Samdei Type model, meant for desktop and server use. It comes as a PyTorch checkpoint and as int8 ONNX (18.2 MiB).
53
+
54
+ Samdei (សំដី, "what you say") is our team, and Samdei Type is the converter. The family has three models:
55
+
56
+ | Model | Parameters | Released as | Samdei Type Bench CER / exact |
57
+ |---|---|---|---|
58
+ | Samdei Type Mini | 7.1M | int8 ONNX + pruned word LM: [`samdei/samdei-type-mini`](https://huggingface.co/samdei/samdei-type-mini) | 0.058 / 24% |
59
+ | **Samdei Type Base** (this repo) | 18.2M | PyTorch + int8 ONNX + LMs + channel model | 0.052 / 30% |
60
+ | Samdei Type Prime | 18.2M | not released | 0.027 / 61% |
61
+
62
+ Samdei Type Prime is Base trained further on scenario-designed, LLM-drafted, human-audited data. It is not released.
63
+
64
+ The pretrained (stage-1) checkpoints of both sizes, for fine-tuning your own converter, are in [`samdei/samdei-type-pretrained`](https://huggingface.co/samdei/samdei-type-pretrained).
65
+
66
+ Paper: *Samdei Type: Separating What Is Written from How It Is Spelled for Romanized Khmer Transliteration* (`<paper-url>`). Code: `<code-repo-url>`.
67
+
68
+ ## Files
69
+
70
+ ```
71
+ config.json configuration and vocabularies (JSON)
72
+ model.safetensors 69.5 MiB weights (fp32)
73
+ onnx/encoder_kv.int8.onnx 11.3 MiB input characters -> cross-attention K/V of every decoder layer
74
+ onnx/decoder_step.int8.onnx 6.3 MiB one decoder step with a self-attention KV cache
75
+ onnx/vocab.json vocabularies and graph shapes
76
+ channel/config.json reverse channel model (Khmer -> romanized), 7.1M parameters, used in reranking
77
+ channel/model.safetensors 27.3 MiB its weights (fp32)
78
+ lm/char5_nowiki.npz 8.9 MiB hashed character 5-gram LM
79
+ lm/wordfull_nowiki.json.gz 12.2 MiB word bigram LM over khmercut words (counts, gzipped JSON)
80
+ rerank.json decoding and rerank settings used for every number below
81
+ ```
82
+
83
+ ## Intended use
84
+
85
+ - **Converting romanized Khmer chat into Khmer script** on a desktop or server, where tens of MB of LMs and a second model for reranking are affordable.
86
+ - **A starting point for fine-tuning:** the weights can be trained further with `scripts/train.py --init <downloaded folder>`.
87
+ - **Mixed text:** English words, numbers and brand names are copied through unchanged.
88
+
89
+ For a phone keyboard, use [Samdei Type Mini](https://huggingface.co/samdei/samdei-type-mini).
90
+
91
+ **Out of scope:**
92
+ - the reverse direction (Khmer → Latin);
93
+ - official romanization standards;
94
+ - any setting where the user cannot see and correct the output (see Limitations).
95
+
96
+ ## How to use
97
+
98
+ Install the `rkhmer` package from the code repository:
99
+
100
+ ```bash
101
+ pip install "rkhmer[deploy] @ git+<code-repo-url>"
102
+ ```
103
+
104
+ **PyTorch, with the full reranker (the setting of every number below):**
105
+
106
+ ```python
107
+ from huggingface_hub import snapshot_download
108
+ from rkhmer.evaluation import chunk_source, translate
109
+ from rkhmer.model import load
110
+ from rkhmer.rerank import Reranker, load_weights
111
+
112
+ d = snapshot_download("samdei/samdei-type-base")
113
+ model, sv, tv, _ = load(d, "cpu") # config.json + model.safetensors
114
+ rr = Reranker(load_weights(f"{d}/rerank.json"), charlm=f"{d}/lm/char5_nowiki.npz",
115
+ wordlm=f"{d}/lm/wordfull_nowiki.json.gz", channel=f"{d}/channel")
116
+
117
+ def convert(text: str) -> str:
118
+ pieces = chunk_source(text, 8) # at most 8 words per piece, break after punctuation
119
+ _, nbest = translate(model, sv, tv, pieces, "cpu", beam=5)
120
+ return " ".join(rr.rerank(p, hyps)[0][0] for p, hyps in zip(pieces, nbest))
121
+
122
+ print(convert("knhom jong tov phsar")) # ខ្ញុំចង់ទៅផ្សារ
123
+ ```
124
+
125
+ **Int8 ONNX** (no torch for the converter itself; the channel model still needs torch):
126
+
127
+ ```python
128
+ from rkhmer.onnx_infer import OnnxConverter
129
+ conv = OnnxConverter(f"{d}/onnx")
130
+ hyps = conv.beam("knhom jong tov phsar", k=5) # rerank with rr.rerank(...) as above
131
+ ```
132
+
133
+ **Decoding, as in the paper.**
134
+ - Beam search with k = 5.
135
+ - The input is cut into pieces of at most eight words, with a break after any punctuation mark. Each piece is decoded and reranked on its own, and the outputs are joined with a space.
136
+ - Each hypothesis y for input x is scored as `log P(y|x) + 0.3 · log P_char(y) + 0.3 · log P_word(y) − 1.0 · #OOV(y) + 0.3 · log P_ch(x|y)`. The weights were tuned on a closed development set, and `rerank.json` holds them.
137
+ - The channel term checks that a hypothesis explains all of the input. It keeps the LMs from replacing a rare word with a frequent one.
138
+
139
+ **No pickles.** The weights are safetensors, and the configuration, vocabularies and word LM are JSON; the char LM is plain numpy arrays. Nothing in this repository runs code when it is loaded. To get only the PyTorch weights: `rkhmer.model.load_pretrained("samdei/samdei-type-base")` (add `subfolder="channel"` for the channel model).
140
+
141
+ ## Model
142
+
143
+ | | Samdei Type Base | channel model |
144
+ |---|---|---|
145
+ | Direction | romanized → Khmer | Khmer → romanized |
146
+ | Architecture | pre-LN Transformer encoder-decoder, GELU, learned positions up to 256, untied output projection | same |
147
+ | d_model / heads | 384 / 6 | 256 / 4 |
148
+ | Encoder / decoder layers | 6 / 3 | 6 / 2 |
149
+ | FFN width | 1536 | 1024 |
150
+ | Parameters | 18,202,980 | 7,146,712 |
151
+ | Vocabulary | 216 input, 228 output symbols (incl. special tokens) | 228 input, 216 output |
152
+ | int8 ONNX | 18.2 MiB | – |
153
+
154
+ Int8 quantization does not change CER on Dev-Sentences with beam 5 and no LMs (0.007 in fp32 and in int8). The cached ONNX decoder reproduces full re-decoding exactly.
155
+
156
+ ## Training
157
+
158
+ Base was trained in three stages. Each stage started from the best checkpoint of the stage before and replayed its data.
159
+
160
+ | | Stage 1: pretraining | Stage 2: fine-tuning | Stage 3: adaptation |
161
+ |---|---|---|---|
162
+ | New data | rule-based persona generator applied to 1.41M web sentences, two seeds (6.29M pairs each), + the 2.4k LLM-written chat sentences spelled the same way, ×40 (189k pairs) | chat-heavy generator sample 630k; Gemma 4 romanizations of real sentences 18.3k ×4; pairs spelled with tables mined from the Chhunneng word list (70%) and Wikidata names (30%) 290k; chat-like abbreviated copies 140k + 16k ×2 | casual-register pairs 427k (spoken-register web sentences, stretched letters) |
163
+ | Replayed | – | – | the stage-2 mix |
164
+ | Total pairs | 12.8M | 1.16M | 1.59M |
165
+ | Steps (best checkpoint) | 60k (60k) | 6k (4k) | 3k (3k) |
166
+ | Peak lr, warmup | 7e-4, 3k | 2e-4, 300 | 1e-4, 100 |
167
+ | Wall clock | 4.9 h | about 31–36 min | about 10–12 min |
168
+
169
+ **Shared settings:**
170
+ - AdamW (β 0.9 / 0.98, weight decay 0.01), cosine decay to 5% of the peak, label smoothing 0.1;
171
+ - about 12k tokens per batch, bf16 autocast;
172
+ - one laptop GPU (Apple M5 Pro).
173
+
174
+ **Checkpoint selection:**
175
+ - Stages 1–2: the lowest mean greedy CER on Dev-Sentences and Akkhara-Preview. Akkhara-Preview is the 110-row public preview of Akkhara-Sing-Khmer; it was used for this selection only and never trained on.
176
+ - Stage 3: the lowest greedy CER on the first 400 messages of a closed development set.
177
+
178
+ **Channel model.** Trained from scratch in the reverse direction on stage-1 data: 25k steps, best checkpoint at 20k, lr 1e-3.
179
+
180
+ **Rerank LMs.** Built from HPLT v2, FineWeb-2, ALT and the LLM-written chat sentences. Leaving out Wikipedia (CC BY-SA) costs almost nothing.
181
+
182
+ **Data.** The exact training files are published:
183
+ - **Stage 1:** [`samdei/samdei-type-pretraining-data`](https://huggingface.co/datasets/samdei/samdei-type-pretraining-data), configs `generator_v1` and `llm_chat_sentences`. The pretrained checkpoint is `base/` in [`samdei/samdei-type-pretrained`](https://huggingface.co/samdei/samdei-type-pretrained).
184
+ - **Stages 2–3:** [`samdei/samdei-type-finetuning-data`](https://huggingface.co/datasets/samdei/samdei-type-finetuning-data). Base uses `mined_tables_chh_wd`.
185
+
186
+ Each repo's `recipes.json` gives the exact mix.
187
+ - **Khmer targets.** Always real text, except the 2,483 LLM-written chat sentences. The text comes from HPLT v2, FineWeb-2, Khmer Wikipedia and ALT.
188
+ - **Romanized inputs.** These come from:
189
+ - the persona generator, which uses Google's Khmer pronunciation lexicon;
190
+ - spelling tables mined from public word lists;
191
+ - Gemma 4 romanizations of real sentences;
192
+ - chat-like abbreviations.
193
+ - **Not used:** no evaluation set, and no data of other romanization systems (in particular, no Akkhara-Sing-Khmer data).
194
+
195
+ ## Evaluation
196
+
197
+ **Samdei Type Bench** ([`samdei/samdei-type-bench`](https://huggingface.co/datasets/samdei/samdei-type-bench)) has 2,155 everyday messages and words with human-checked Khmer. 192 of them were typed blind by native speakers. Inputs have a median of 81 characters.
198
+
199
+ - **Metric.** Character error rate (CER) after normalization (`khnormal`, spaces removed, lowercase, coeng-DA merged with coeng-TA, ឲ merged with ឱ) and exact match, on each item's main input and main target.
200
+ - **Same code for every system:** `rkhmer.evaluation.score`.
201
+
202
+ | System | Parameters | int8 size | CER | Exact |
203
+ |---|---|---|---|---|
204
+ | Samdei Type Mini | 7.1M | 7.6 MiB | 0.058 | 24% |
205
+ | **Samdei Type Base** | 18.2M | 18.2 MiB | **0.052** | **30%** |
206
+ | Samdei Type Prime (not released) | 18.2M | 18.2 MiB | 0.027 | 61% |
207
+ | Akkhara-mini, whole input | 17.8M | 17.6 MiB | 0.159 | 27% |
208
+ | Akkhara-mini, 6-word pieces | 17.8M | 17.6 MiB | 0.066 | 23% |
209
+ | AkaraAlpha, word by word | 0.08M | – | 0.281 | 2% |
210
+
211
+ - **Prime is partly in-domain.** Its training data shares the scenario design of most Samdei Type Bench items, so its lead is an upper bound.
212
+ - **Reranking.** Beam 5 alone gives 0.062 / 24%; the four rerank features together bring it to 0.052 / 30%.
213
+ - **Punctuation.** Without punctuation in the target and the output, Base's CER is 0.046.
214
+ - **Decode long messages in pieces.** Base was trained on short pieces (inputs of at most 132 characters, median 26). With beam 5 and no LMs, whole-input CER is 0.133 overall and 0.399 on inputs over 132 characters, against 0.062 and 0.070 in pieces.
215
+ - **Reference sets** (CER / exact): Dev-Sentences 0.004 / 96%, Chat-Words 0.077 / 84%, Dict-Words 0.246 / 41%, Casual-Synth 0.044 / 69%.
216
+ - **Speed.** One M5 Pro CPU thread, int8 ONNX, without reranking:
217
+ - greedy: 4.4 ms p50 / 9.1 ms p95 per input;
218
+ - beam 5: 9.3 / 19.1 ms.
219
+
220
+ ## Limitations
221
+
222
+ - **Synthetic training inputs.** Every romanized input Base has seen comes from rules, mined tables or an LLM; real typing appears only in the evaluation.
223
+ - **Homophones that need more context than a word bigram gives**, for example:
224
+ - ដើរ / ដែរ (`der`);
225
+ - ដឹក / ដែក / ដេក (`dek`);
226
+ - អាទិត្យ / អតីត (`atit`);
227
+ - បាទ / បាត់ at the end of a message.
228
+ - **Spoken-register words that share a spelling with a written word:** `nung` (ហ្នឹង in chat) can come out as និង ("and").
229
+ - **Loanwords typed in English** (`check` for ឆែក) are copied through as English.
230
+ - **Punctuation.** Base copies a Latin comma where Khmer uses a space, and never adds a final ។ that the input lacks.
231
+ - **Rare dictionary words without context**, many of them Pali-Sanskrit, remain hard (Dict-Words CER 0.246).
232
+ - **Web text.** The Khmer side comes mostly from web text and carries its topics and biases.
233
+
234
+ ## License and attribution
235
+
236
+ - **Everything in this repo** (weights, ONNX graphs, channel model, LMs, rerank settings): Apache-2.0. The full text is in `LICENSE`. `NOTICE` holds the attributions, and redistributions must keep it.
237
+ - **`lm/char5_nowiki.npz` and `lm/wordfull_nowiki.json.gz`:** n-gram counts built without Wikipedia, from:
238
+ - HPLT v2 (CC0 packaging; Common Crawl terms apply to the text);
239
+ - FineWeb-2 (ODC-By 1.0);
240
+ - ALT (CC BY 4.0);
241
+ - our LLM-written chat sentences (CC BY 4.0; written with Gemma 4, Apache-2.0).
242
+ - **Training data:** CC BY-SA 4.0; see the dataset cards. Its sources are:
243
+ - HPLT v2, FineWeb-2, Khmer Wikipedia (CC BY-SA) and ALT;
244
+ - Google's Khmer pronunciation lexicon (CC BY 4.0);
245
+ - the Chhunneng romanized Khmer dataset (MIT, © 2025 Chrea Chanchhunneng);
246
+ - Wikidata (CC0);
247
+ - Gemma 4 output (Apache-2.0).
248
+ - **Tools:** `khmercut` (Apache-2.0) and SIL `khnormal` (MIT).
249
+
250
+ ## Citation
251
+
252
+ ```bibtex
253
+ @misc{samdei-type-2026,
254
+ title = {Samdei Type: Separating What Is Written from How It Is Spelled for Romanized Khmer Transliteration},
255
+ author = {<authors>},
256
+ year = {2026},
257
+ url = {<paper-url>}
258
+ }
259
+ ```
260
+
261
+ Contact: `<contact>`
channel/config.json ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "samdei-type",
3
+ "format_version": 1,
4
+ "src_vocab": 228,
5
+ "tgt_vocab": 216,
6
+ "d_model": 256,
7
+ "nhead": 4,
8
+ "enc_layers": 6,
9
+ "dec_layers": 2,
10
+ "ff": 1024,
11
+ "dropout": 0.1,
12
+ "max_len": 256,
13
+ "vocab": {
14
+ "special_tokens": [
15
+ "<pad>",
16
+ "<s>",
17
+ "</s>",
18
+ "<unk>"
19
+ ],
20
+ "source": [
21
+ " ",
22
+ "!",
23
+ "\"",
24
+ "#",
25
+ "$",
26
+ "%",
27
+ "&",
28
+ "'",
29
+ "(",
30
+ ")",
31
+ "*",
32
+ "+",
33
+ ",",
34
+ "-",
35
+ ".",
36
+ "/",
37
+ "0",
38
+ "1",
39
+ "2",
40
+ "3",
41
+ "4",
42
+ "5",
43
+ "6",
44
+ "7",
45
+ "8",
46
+ "9",
47
+ ":",
48
+ ";",
49
+ "<",
50
+ "=",
51
+ ">",
52
+ "?",
53
+ "@",
54
+ "A",
55
+ "B",
56
+ "C",
57
+ "D",
58
+ "E",
59
+ "F",
60
+ "G",
61
+ "H",
62
+ "I",
63
+ "J",
64
+ "K",
65
+ "L",
66
+ "M",
67
+ "N",
68
+ "O",
69
+ "P",
70
+ "Q",
71
+ "R",
72
+ "S",
73
+ "T",
74
+ "U",
75
+ "V",
76
+ "W",
77
+ "X",
78
+ "Y",
79
+ "Z",
80
+ "[",
81
+ "]",
82
+ "^",
83
+ "_",
84
+ "a",
85
+ "b",
86
+ "c",
87
+ "d",
88
+ "e",
89
+ "f",
90
+ "g",
91
+ "h",
92
+ "i",
93
+ "j",
94
+ "k",
95
+ "l",
96
+ "m",
97
+ "n",
98
+ "o",
99
+ "p",
100
+ "q",
101
+ "r",
102
+ "s",
103
+ "t",
104
+ "u",
105
+ "v",
106
+ "w",
107
+ "x",
108
+ "y",
109
+ "z",
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
+ "ោ",
207
+ "ៅ",
208
+ "ំ",
209
+ "ះ",
210
+ "ៈ",
211
+ "៉",
212
+ "៊",
213
+ "់",
214
+ "៌",
215
+ "៍",
216
+ "៎",
217
+ "៏",
218
+ "័",
219
+ "៑",
220
+ "្",
221
+ "។",
222
+ "៕",
223
+ "៖",
224
+ "ៗ",
225
+ "៘",
226
+ "៛",
227
+ "‑",
228
+ "–",
229
+ "—",
230
+ "‘",
231
+ "’",
232
+ "“",
233
+ "”",
234
+ "•",
235
+ "…",
236
+ "‹",
237
+ "›",
238
+ "→",
239
+ "−",
240
+ "●",
241
+ "�",
242
+ "😀",
243
+ "😛",
244
+ "🙂"
245
+ ],
246
+ "target": [
247
+ " ",
248
+ "!",
249
+ "\"",
250
+ "#",
251
+ "$",
252
+ "%",
253
+ "&",
254
+ "'",
255
+ "(",
256
+ ")",
257
+ "*",
258
+ "+",
259
+ ",",
260
+ "-",
261
+ ".",
262
+ "/",
263
+ "0",
264
+ "1",
265
+ "2",
266
+ "3",
267
+ "4",
268
+ "5",
269
+ "6",
270
+ "7",
271
+ "8",
272
+ "9",
273
+ ":",
274
+ ";",
275
+ "<",
276
+ "=",
277
+ ">",
278
+ "?",
279
+ "@",
280
+ "A",
281
+ "B",
282
+ "C",
283
+ "D",
284
+ "E",
285
+ "F",
286
+ "G",
287
+ "H",
288
+ "I",
289
+ "J",
290
+ "K",
291
+ "L",
292
+ "M",
293
+ "N",
294
+ "O",
295
+ "P",
296
+ "Q",
297
+ "R",
298
+ "S",
299
+ "T",
300
+ "U",
301
+ "V",
302
+ "W",
303
+ "X",
304
+ "Y",
305
+ "Z",
306
+ "[",
307
+ "]",
308
+ "^",
309
+ "_",
310
+ "a",
311
+ "b",
312
+ "c",
313
+ "d",
314
+ "e",
315
+ "f",
316
+ "g",
317
+ "h",
318
+ "i",
319
+ "j",
320
+ "k",
321
+ "l",
322
+ "m",
323
+ "n",
324
+ "o",
325
+ "p",
326
+ "q",
327
+ "r",
328
+ "s",
329
+ "t",
330
+ "u",
331
+ "v",
332
+ "w",
333
+ "x",
334
+ "y",
335
+ "z",
336
+ "|",
337
+ "~",
338
+ "¡",
339
+ "«",
340
+ "®",
341
+ "°",
342
+ "·",
343
+ "»",
344
+ "×",
345
+ "à",
346
+ "á",
347
+ "ç",
348
+ "è",
349
+ "é",
350
+ "í",
351
+ "ǔ",
352
+ "ɓ",
353
+ "ə",
354
+ "ก",
355
+ "ท",
356
+ "น",
357
+ "ภ",
358
+ "ย",
359
+ "ร",
360
+ "ษ",
361
+ "า",
362
+ "ิ",
363
+ "เ",
364
+ "ไ",
365
+ "๒",
366
+ "๕",
367
+ "ລ",
368
+ "ວ",
369
+ "ສ",
370
+ "າ",
371
+ "ក",
372
+ "ខ",
373
+ "គ",
374
+ "ឃ",
375
+ "ង",
376
+ "ច",
377
+ "ឆ",
378
+ "ជ",
379
+ "ឈ",
380
+ "ញ",
381
+ "ដ",
382
+ "ឋ",
383
+ "ឌ",
384
+ "ណ",
385
+ "ត",
386
+ "ថ",
387
+ "ទ",
388
+ "ធ",
389
+ "ន",
390
+ "ប",
391
+ "ផ",
392
+ "ព",
393
+ "ភ",
394
+ "ម",
395
+ "យ",
396
+ "រ",
397
+ "ល",
398
+ "វ",
399
+ "ស",
400
+ "ហ",
401
+ "ឡ",
402
+ "អ",
403
+ "ឧ",
404
+ "ឫ",
405
+ "ឬ",
406
+ "ឯ",
407
+ "ឲ",
408
+ "ា",
409
+ "ិ",
410
+ "ី",
411
+ "ឹ",
412
+ "ឺ",
413
+ "ុ",
414
+ "ូ",
415
+ "ួ",
416
+ "ើ",
417
+ "ឿ",
418
+ "ៀ",
419
+ "េ",
420
+ "ែ",
421
+ "ៃ",
422
+ "ោ",
423
+ "ៅ",
424
+ "ំ",
425
+ "ះ",
426
+ "ៈ",
427
+ "៉",
428
+ "៊",
429
+ "់",
430
+ "៌",
431
+ "៍",
432
+ "៏",
433
+ "័",
434
+ "្",
435
+ "។",
436
+ "៕",
437
+ "៖",
438
+ "ៗ",
439
+ "៘",
440
+ "៛",
441
+ "‑",
442
+ "–",
443
+ "—",
444
+ "‘",
445
+ "’",
446
+ "“",
447
+ "”",
448
+ "•",
449
+ "…",
450
+ "‹",
451
+ "›",
452
+ "→",
453
+ "−",
454
+ "●",
455
+ "�",
456
+ "😀",
457
+ "😛",
458
+ "🙂"
459
+ ]
460
+ },
461
+ "training": {
462
+ "step": 20000
463
+ }
464
+ }
channel/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33ff4dc755cf97f9fbb7e07c46a23d63eb3fff3a10ab082e9a678cac22dfaf7c
3
+ size 28598808
config.json ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "samdei-type",
3
+ "format_version": 1,
4
+ "src_vocab": 216,
5
+ "tgt_vocab": 228,
6
+ "d_model": 384,
7
+ "nhead": 6,
8
+ "enc_layers": 6,
9
+ "dec_layers": 3,
10
+ "ff": 1536,
11
+ "dropout": 0.1,
12
+ "max_len": 256,
13
+ "vocab": {
14
+ "special_tokens": [
15
+ "<pad>",
16
+ "<s>",
17
+ "</s>",
18
+ "<unk>"
19
+ ],
20
+ "source": [
21
+ " ",
22
+ "!",
23
+ "\"",
24
+ "#",
25
+ "$",
26
+ "%",
27
+ "&",
28
+ "'",
29
+ "(",
30
+ ")",
31
+ "*",
32
+ "+",
33
+ ",",
34
+ "-",
35
+ ".",
36
+ "/",
37
+ "0",
38
+ "1",
39
+ "2",
40
+ "3",
41
+ "4",
42
+ "5",
43
+ "6",
44
+ "7",
45
+ "8",
46
+ "9",
47
+ ":",
48
+ ";",
49
+ "<",
50
+ "=",
51
+ ">",
52
+ "?",
53
+ "@",
54
+ "A",
55
+ "B",
56
+ "C",
57
+ "D",
58
+ "E",
59
+ "F",
60
+ "G",
61
+ "H",
62
+ "I",
63
+ "J",
64
+ "K",
65
+ "L",
66
+ "M",
67
+ "N",
68
+ "O",
69
+ "P",
70
+ "Q",
71
+ "R",
72
+ "S",
73
+ "T",
74
+ "U",
75
+ "V",
76
+ "W",
77
+ "X",
78
+ "Y",
79
+ "Z",
80
+ "[",
81
+ "]",
82
+ "^",
83
+ "_",
84
+ "a",
85
+ "b",
86
+ "c",
87
+ "d",
88
+ "e",
89
+ "f",
90
+ "g",
91
+ "h",
92
+ "i",
93
+ "j",
94
+ "k",
95
+ "l",
96
+ "m",
97
+ "n",
98
+ "o",
99
+ "p",
100
+ "q",
101
+ "r",
102
+ "s",
103
+ "t",
104
+ "u",
105
+ "v",
106
+ "w",
107
+ "x",
108
+ "y",
109
+ "z",
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
+ "៏",
207
+ "័",
208
+ "្",
209
+ "។",
210
+ "៕",
211
+ "៖",
212
+ "ៗ",
213
+ "៘",
214
+ "៛",
215
+ "‑",
216
+ "–",
217
+ "—",
218
+ "‘",
219
+ "’",
220
+ "“",
221
+ "”",
222
+ "•",
223
+ "…",
224
+ "‹",
225
+ "›",
226
+ "→",
227
+ "−",
228
+ "●",
229
+ "�",
230
+ "😀",
231
+ "😛",
232
+ "🙂"
233
+ ],
234
+ "target": [
235
+ " ",
236
+ "!",
237
+ "\"",
238
+ "#",
239
+ "$",
240
+ "%",
241
+ "&",
242
+ "'",
243
+ "(",
244
+ ")",
245
+ "*",
246
+ "+",
247
+ ",",
248
+ "-",
249
+ ".",
250
+ "/",
251
+ "0",
252
+ "1",
253
+ "2",
254
+ "3",
255
+ "4",
256
+ "5",
257
+ "6",
258
+ "7",
259
+ "8",
260
+ "9",
261
+ ":",
262
+ ";",
263
+ "<",
264
+ "=",
265
+ ">",
266
+ "?",
267
+ "@",
268
+ "A",
269
+ "B",
270
+ "C",
271
+ "D",
272
+ "E",
273
+ "F",
274
+ "G",
275
+ "H",
276
+ "I",
277
+ "J",
278
+ "K",
279
+ "L",
280
+ "M",
281
+ "N",
282
+ "O",
283
+ "P",
284
+ "Q",
285
+ "R",
286
+ "S",
287
+ "T",
288
+ "U",
289
+ "V",
290
+ "W",
291
+ "X",
292
+ "Y",
293
+ "Z",
294
+ "[",
295
+ "]",
296
+ "^",
297
+ "_",
298
+ "a",
299
+ "b",
300
+ "c",
301
+ "d",
302
+ "e",
303
+ "f",
304
+ "g",
305
+ "h",
306
+ "i",
307
+ "j",
308
+ "k",
309
+ "l",
310
+ "m",
311
+ "n",
312
+ "o",
313
+ "p",
314
+ "q",
315
+ "r",
316
+ "s",
317
+ "t",
318
+ "u",
319
+ "v",
320
+ "w",
321
+ "x",
322
+ "y",
323
+ "z",
324
+ "|",
325
+ "~",
326
+ "¡",
327
+ "«",
328
+ "®",
329
+ "°",
330
+ "·",
331
+ "»",
332
+ "×",
333
+ "à",
334
+ "á",
335
+ "ç",
336
+ "è",
337
+ "é",
338
+ "í",
339
+ "ǔ",
340
+ "ก",
341
+ "ท",
342
+ "น",
343
+ "ภ",
344
+ "ย",
345
+ "ร",
346
+ "ษ",
347
+ "า",
348
+ "ิ",
349
+ "เ",
350
+ "ไ",
351
+ "๒",
352
+ "๕",
353
+ "ລ",
354
+ "ວ",
355
+ "ສ",
356
+ "າ",
357
+ "ក",
358
+ "ខ",
359
+ "គ",
360
+ "ឃ",
361
+ "ង",
362
+ "ច",
363
+ "ឆ",
364
+ "ជ",
365
+ "ឈ",
366
+ "ញ",
367
+ "ដ",
368
+ "ឋ",
369
+ "ឌ",
370
+ "ឍ",
371
+ "ណ",
372
+ "ត",
373
+ "ថ",
374
+ "ទ",
375
+ "ធ",
376
+ "ន",
377
+ "ប",
378
+ "ផ",
379
+ "ព",
380
+ "ភ",
381
+ "ម",
382
+ "យ",
383
+ "រ",
384
+ "ល",
385
+ "វ",
386
+ "ឝ",
387
+ "ឞ",
388
+ "ស",
389
+ "ហ",
390
+ "ឡ",
391
+ "អ",
392
+ "ឥ",
393
+ "ឦ",
394
+ "ឧ",
395
+ "ឩ",
396
+ "ឪ",
397
+ "ឫ",
398
+ "ឬ",
399
+ "ឭ",
400
+ "ឮ",
401
+ "ឯ",
402
+ "ឰ",
403
+ "ឱ",
404
+ "ឲ",
405
+ "ឳ",
406
+ "ា",
407
+ "ិ",
408
+ "ី",
409
+ "ឹ",
410
+ "ឺ",
411
+ "ុ",
412
+ "ូ",
413
+ "ួ",
414
+ "ើ",
415
+ "ឿ",
416
+ "ៀ",
417
+ "េ",
418
+ "ែ",
419
+ "ៃ",
420
+ "ោ",
421
+ "ៅ",
422
+ "ំ",
423
+ "ះ",
424
+ "ៈ",
425
+ "៉",
426
+ "៊",
427
+ "់",
428
+ "៌",
429
+ "៍",
430
+ "៎",
431
+ "៏",
432
+ "័",
433
+ "៑",
434
+ "្",
435
+ "។",
436
+ "៕",
437
+ "៖",
438
+ "ៗ",
439
+ "៘",
440
+ "៛",
441
+ "‑",
442
+ "–",
443
+ "—",
444
+ "‘",
445
+ "’",
446
+ "“",
447
+ "”",
448
+ "•",
449
+ "…",
450
+ "‹",
451
+ "›",
452
+ "→",
453
+ "−",
454
+ "●",
455
+ "�",
456
+ "😀",
457
+ "😛",
458
+ "🙂"
459
+ ]
460
+ },
461
+ "training": {
462
+ "step": 3000
463
+ }
464
+ }
lm/char5_nowiki.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c370eee08a387291e80366c1178b13fd2682a77f321eb6369fe2709303345401
3
+ size 9329466
lm/wordfull_nowiki.json.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:809d7346405dde588caba876018e4acf3aea01f229116e2611419213e763e4f2
3
+ size 12791993
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c1d2e0d9cf12aabb304d8a725fd7ac5761e84a3f00dd7f4a3bf8847595740cc
3
+ size 72825832
onnx/decoder_step.int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0cffaf89e3c07f50c6ac37cef9c0b7c5a0371f90bede09a5aab52605061b4f2b
3
+ size 6604859
onnx/encoder_kv.int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8fb9ee15b4cc483a974ff1e048d5b24d4525053dfff6f88aefd76c3c26757e38
3
+ size 11899612
onnx/vocab.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"src_vocab": [" ", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "]", "^", "_", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "|", "~", "¡", "«", "®", "°", "·", "»", "×", "à", "á", "ç", "è", "é", "í", "ǔ", "ɓ", "ə", "ก", "ท", "น", "ภ", "ย", "ร", "ษ", "า", "ิ", "เ", "ไ", "๒", "๕", "ລ", "ວ", "ສ", "າ", "ក", "ខ", "គ", "ឃ", "ង", "ច", "ឆ", "ជ", "ឈ", "ញ", "ដ", "ឋ", "ឌ", "ណ", "ត", "ថ", "ទ", "ធ", "ន", "ប", "ផ", "ព", "ភ", "ម", "យ", "រ", "ល", "វ", "ស", "ហ", "ឡ", "អ", "ឧ", "ឫ", "ឬ", "ឯ", "ឲ", "ា", "ិ", "ី", "ឹ", "ឺ", "ុ", "ូ", "ួ", "ើ", "ឿ", "ៀ", "េ", "ែ", "ៃ", "ោ", "ៅ", "ំ", "ះ", "ៈ", "៉", "៊", "់", "៌", "៍", "៏", "័", "្", "។", "៕", "៖", "ៗ", "៘", "៛", "‑", "–", "—", "‘", "’", "“", "”", "•", "…", "‹", "›", "→", "−", "●", "�", "😀", "😛", "🙂"], "tgt_vocab": [" ", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "]", "^", "_", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "|", "~", "¡", "«", "®", "°", "·", "»", "×", "à", "á", "ç", "è", "é", "í", "ǔ", "ก", "ท", "น", "ภ", "ย", "ร", "ษ", "า", "ิ", "เ", "ไ", "๒", "๕", "ລ", "ວ", "ສ", "າ", "ក", "ខ", "គ", "ឃ", "ង", "ច", "ឆ", "ជ", "ឈ", "ញ", "ដ", "ឋ", "ឌ", "ឍ", "ណ", "ត", "ថ", "ទ", "ធ", "ន", "ប", "ផ", "ព", "ភ", "ម", "យ", "រ", "ល", "វ", "ឝ", "ឞ", "ស", "ហ", "ឡ", "អ", "ឥ", "ឦ", "ឧ", "ឩ", "ឪ", "ឫ", "ឬ", "ឭ", "ឮ", "ឯ", "ឰ", "ឱ", "ឲ", "ឳ", "ា", "ិ", "ី", "ឹ", "ឺ", "ុ", "ូ", "ួ", "ើ", "ឿ", "ៀ", "េ", "ែ", "ៃ", "ោ", "ៅ", "ំ", "ះ", "ៈ", "៉", "៊", "់", "៌", "៍", "៎", "៏", "័", "៑", "្", "។", "៕", "៖", "ៗ", "៘", "៛", "‑", "–", "—", "‘", "’", "“", "”", "•", "…", "‹", "›", "→", "−", "●", "�", "😀", "😛", "🙂"], "layers": 3, "heads": 6, "head_dim": 64, "bos": 1, "eos": 2, "max_src_len": 249}
rerank.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "Samdei Type Base",
3
+ "beam": 5,
4
+ "chunk_max_words": 8,
5
+ "chunk_rule": "rkhmer.evaluation.chunk_source: at most 8 words per piece, break after any punctuation mark; pieces are decoded and reranked on their own and joined with a space",
6
+ "rerank_weights": {"char": 0.3, "word": 0.3, "oov": 1.0, "channel": 0.3},
7
+ "score": "log P(y|x) + char*log P_char(y) + word*log P_word(y) - oov*#OOV(y) + channel*log P_ch(x|y)",
8
+ "char_lm": "lm/char5_nowiki.npz",
9
+ "word_lm": "lm/wordfull_nowiki.json.gz",
10
+ "channel_model": "channel/",
11
+ "max_input_chars": 249,
12
+ "weights_tuned_on": "closed development set, whole input, 2-fold cross-validated grid search; applied unchanged to 8-word pieces"
13
+ }