ThisenEkanayake commited on
Commit
abc84df
·
verified ·
1 Parent(s): 119c90a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +173 -0
README.md CHANGED
@@ -1,3 +1,176 @@
1
  ---
 
 
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - si
4
  license: mit
5
+ size_categories:
6
+ - 100K<n<1M
7
+ task_categories:
8
+ - text-generation
9
+ pretty_name: UltraChat-Sinhala
10
+ source_datasets:
11
+ - HuggingFaceH4/ultrachat_200k
12
+ tags:
13
+ - sinhala
14
+ - machine-translation
15
+ - nllb
16
+ - instruction-tuning
17
+ - sft
18
+ configs:
19
+ - config_name: default
20
+ data_files:
21
+ - split: train_sft
22
+ path: data/train_sft.parquet
23
+ - split: test_sft
24
+ path: data/test_sft.parquet
25
+ - split: train_gen
26
+ path: data/train_gen.parquet
27
+ - split: test_gen
28
+ path: data/test_gen.parquet
29
+ dataset_info:
30
+ features:
31
+ - name: prompt
32
+ dtype: string
33
+ - name: prompt_id
34
+ dtype: string
35
+ - name: messages
36
+ list:
37
+ - name: content
38
+ dtype: string
39
+ - name: role
40
+ dtype: string
41
+ splits:
42
+ - name: train_sft
43
+ num_bytes: 3220638735
44
+ num_examples: 207831
45
+ - name: test_sft
46
+ num_bytes: 356835963
47
+ num_examples: 23106
48
+ - name: train_gen
49
+ num_bytes: 3112868195
50
+ num_examples: 255974
51
+ - name: test_gen
52
+ num_bytes: 342615462
53
+ num_examples: 28300
54
+ download_size: 1568756226
55
+ dataset_size: 7032958355
56
  ---
57
+
58
+ # Dataset Card for UltraChat-Sinhala
59
+
60
+ ## Dataset Description
61
+
62
+ UltraChat-Sinhala is a **Sinhala (සිංහල) machine translation of
63
+ [HuggingFaceH4/ultrachat_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k)**,
64
+ built to supervised-fine-tune Sinhala large language models. It preserves the
65
+ original dataset's structure, splits, and `prompt_id`s, so it is a drop-in
66
+ Sinhala counterpart to the English source.
67
+
68
+ The English dialogues were translated with
69
+ [NLLB-200-3.3B](https://huggingface.co/facebook/nllb-200-3.3B)
70
+ (`eng_Latn → sin_Sinh`) and then put through a Sinhala-specific cleaning
71
+ pipeline (conjunct/ZWJ repair, masking-leak repair, filtering). The dataset
72
+ contains **515,211 dialogues / ≈528M Sinhala tokens** (SinLLaMA tokenizer).
73
+
74
+ ## Dataset Creation
75
+
76
+ 1. **Translation.** Each dialogue turn was translated en→si with NLLB-200-3.3B
77
+ (greedy decoding). To respect the model's 512-token limit, turns were
78
+ sentence-segmented with the line layout preserved on reassembly. Spans that
79
+ must not be translated — fenced/inline code, URLs, e-mail addresses, HTML
80
+ tags, LaTeX/maths and markdown links — were masked before translation and
81
+ restored afterwards, so they pass through verbatim.
82
+
83
+ 2. **Sinhala conjunct (ZWJ) repair.** NLLB's SentencePiece normaliser strips the
84
+ Zero-Width Joiner (`U+200D`) from Sinhala conjunct clusters, emitting a space
85
+ instead (e.g. `ප් ර` for `ප්‍ර`). A lexicon-gated restorer — built from a
86
+ Sinhala corpus plus the tokenizer's vocabulary — re-inserts the joiner only
87
+ where attested. After repair, **~99.6–99.9% of dialogues carry conjunct
88
+ joiners**.
89
+
90
+ 3. **Masking-leak repair.** The placeholder used to mask the protected spans was
91
+ itself corrupted by SentencePiece (its rare brackets were stripped),
92
+ displacing each masked span to the end of its message with a stray digit left
93
+ behind. These were re-inserted in their correct positions by re-aligning each
94
+ message to its English source (≈83% reconstructed exactly in place; the rest
95
+ re-appended without any content loss).
96
+
97
+ 4. **Filtering.** Dialogues containing empty/whitespace-only turns were dropped
98
+ (a mid-conversation turn cannot be removed without breaking the
99
+ user/assistant alternation); `prompt_id`s were de-duplicated; and one
100
+ `prompt_id` shared between the SFT and GEN sets was removed for global
101
+ id-uniqueness.
102
+
103
+ 5. **Train/test split.** Membership is taken **verbatim from the original
104
+ ultrachat_200k split** by `prompt_id`, so the Sinhala split is identical to
105
+ the English source (≈10% test). It is **leak-checked**: no `prompt_id` and no
106
+ identical dialogue appears in both train and test, in either SFT or GEN.
107
+
108
+ ## Dataset Structure
109
+
110
+ Like the source, the dataset has four splits, suitable for:
111
+
112
+ * Supervised fine-tuning (`sft`).
113
+ * Generation ranking (`gen`) via techniques like rejection sampling or PPO.
114
+
115
+ | split | examples | tokens |
116
+ |:----------|---------:|------------------:|
117
+ | train_sft | 207,831 | 248,133,641 |
118
+ | test_sft | 23,106 | 27,467,232 |
119
+ | train_gen | 255,974 | 227,432,690 |
120
+ | test_gen | 28,300 | 25,035,938 |
121
+ | **total** | **515,211** | **528,069,501** |
122
+
123
+ Tokens are raw message-content tokens (the SinLLaMA tokenizer, vocab 139,336, has
124
+ no chat template; a real SFT run adds a small per-turn special-token overhead).
125
+
126
+ The dataset is stored in parquet (zstd), schema-identical to the source:
127
+
128
+ ```
129
+ {
130
+ "prompt": "ආහාර පිසීමේ ව්‍යාපාරයක් සඳහා වට්ටෝරු පොතක් නිර්මාණය කරන්න. ...",
131
+ "prompt_id": "7d86ffeefdea030c92138e0b964c304508bfebed4b23261c8a741630823e6f96",
132
+ "messages": [
133
+ {
134
+ "role": "user",
135
+ "content": "ආහාර පිසීමේ ව්‍යාපාරයක් සඳහා වට්ටෝරු පොතක් න��ර්මාණය කරන්න. ..."
136
+ },
137
+ {
138
+ "role": "assistant",
139
+ "content": "නම: රසවත් ආහාර පිසීමේ රහස්: රසවත් හා ලස්සන ආහාර පිසීමේ වට්ටෝරු පොත ..."
140
+ },
141
+ {
142
+ "role": "user",
143
+ "content": "ඔයා මේ වෙනකම් හදපු වට්ටෝරු පොත නම් නියමයි. ඔයාට පුලුවන්ද තව විස්තර එකතු කරන්න ..."
144
+ },
145
+ {
146
+ "role": "assistant",
147
+ "content": "..."
148
+ }
149
+ ]
150
+ }
151
+ ```
152
+
153
+ ## Quality and Limitations
154
+
155
+ Full-scan checks on the released data: **100% valid JSON**, correct
156
+ user/assistant alternation, no empty turns, no duplicate `prompt_id`s.
157
+ ~**0.017%** of turns remain in Latin script (overwhelmingly fenced code, which is
158
+ preserved by design), and ~**0.5%** of longer turns show NLLB repetition
159
+ artifacts.
160
+
161
+ This is **machine translation without human post-editing**. Expect:
162
+
163
+ - translationese and occasional mistranslation, especially on idioms, named
164
+ entities, and technical content;
165
+ - code, identifiers, URLs and maths intentionally left in their original form;
166
+ - a minority of turns with NLLB repetition loops (~0.5%);
167
+ - residual orthographic edge cases not covered by the conjunct lexicon.
168
+
169
+ It is intended for instruction-tuning and research, not as a gold-standard
170
+ reference translation.
171
+
172
+ ## Licensing
173
+
174
+ Released under the **MIT License**, following the source dataset
175
+ `HuggingFaceH4/ultrachat_200k`. The Sinhala text was produced by machine
176
+ translation with NLLB-200.