Datasets:
File size: 6,654 Bytes
119c90a abc84df 119c90a abc84df 119c90a abc84df | 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 | ---
language:
- si
license: mit
size_categories:
- 100K<n<1M
task_categories:
- text-generation
pretty_name: UltraChat-Sinhala
source_datasets:
- HuggingFaceH4/ultrachat_200k
tags:
- sinhala
- machine-translation
- nllb
- instruction-tuning
- sft
configs:
- config_name: default
data_files:
- split: train_sft
path: data/train_sft.parquet
- split: test_sft
path: data/test_sft.parquet
- split: train_gen
path: data/train_gen.parquet
- split: test_gen
path: data/test_gen.parquet
dataset_info:
features:
- name: prompt
dtype: string
- name: prompt_id
dtype: string
- name: messages
list:
- name: content
dtype: string
- name: role
dtype: string
splits:
- name: train_sft
num_bytes: 3220638735
num_examples: 207831
- name: test_sft
num_bytes: 356835963
num_examples: 23106
- name: train_gen
num_bytes: 3112868195
num_examples: 255974
- name: test_gen
num_bytes: 342615462
num_examples: 28300
download_size: 1568756226
dataset_size: 7032958355
---
# Dataset Card for UltraChat-Sinhala
## Dataset Description
UltraChat-Sinhala is a **Sinhala (සිංහල) machine translation of
[HuggingFaceH4/ultrachat_200k](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k)**,
built to supervised-fine-tune Sinhala large language models. It preserves the
original dataset's structure, splits, and `prompt_id`s, so it is a drop-in
Sinhala counterpart to the English source.
The English dialogues were translated with
[NLLB-200-3.3B](https://huggingface.co/facebook/nllb-200-3.3B)
(`eng_Latn → sin_Sinh`) and then put through a Sinhala-specific cleaning
pipeline (conjunct/ZWJ repair, masking-leak repair, filtering). The dataset
contains **515,211 dialogues / ≈528M Sinhala tokens** (SinLLaMA tokenizer).
## Dataset Creation
1. **Translation.** Each dialogue turn was translated en→si with NLLB-200-3.3B
(greedy decoding). To respect the model's 512-token limit, turns were
sentence-segmented with the line layout preserved on reassembly. Spans that
must not be translated — fenced/inline code, URLs, e-mail addresses, HTML
tags, LaTeX/maths and markdown links — were masked before translation and
restored afterwards, so they pass through verbatim.
2. **Sinhala conjunct (ZWJ) repair.** NLLB's SentencePiece normaliser strips the
Zero-Width Joiner (`U+200D`) from Sinhala conjunct clusters, emitting a space
instead (e.g. `ප් ර` for `ප්ර`). A lexicon-gated restorer — built from a
Sinhala corpus plus the tokenizer's vocabulary — re-inserts the joiner only
where attested. After repair, **~99.6–99.9% of dialogues carry conjunct
joiners**.
3. **Masking-leak repair.** The placeholder used to mask the protected spans was
itself corrupted by SentencePiece (its rare brackets were stripped),
displacing each masked span to the end of its message with a stray digit left
behind. These were re-inserted in their correct positions by re-aligning each
message to its English source (≈83% reconstructed exactly in place; the rest
re-appended without any content loss).
4. **Filtering.** Dialogues containing empty/whitespace-only turns were dropped
(a mid-conversation turn cannot be removed without breaking the
user/assistant alternation); `prompt_id`s were de-duplicated; and one
`prompt_id` shared between the SFT and GEN sets was removed for global
id-uniqueness.
5. **Train/test split.** Membership is taken **verbatim from the original
ultrachat_200k split** by `prompt_id`, so the Sinhala split is identical to
the English source (≈10% test). It is **leak-checked**: no `prompt_id` and no
identical dialogue appears in both train and test, in either SFT or GEN.
## Dataset Structure
Like the source, the dataset has four splits, suitable for:
* Supervised fine-tuning (`sft`).
* Generation ranking (`gen`) via techniques like rejection sampling or PPO.
| split | examples | tokens |
|:----------|---------:|------------------:|
| train_sft | 207,831 | 248,133,641 |
| test_sft | 23,106 | 27,467,232 |
| train_gen | 255,974 | 227,432,690 |
| test_gen | 28,300 | 25,035,938 |
| **total** | **515,211** | **528,069,501** |
Tokens are raw message-content tokens (the SinLLaMA tokenizer, vocab 139,336, has
no chat template; a real SFT run adds a small per-turn special-token overhead).
The dataset is stored in parquet (zstd), schema-identical to the source:
```
{
"prompt": "ආහාර පිසීමේ ව්යාපාරයක් සඳහා වට්ටෝරු පොතක් නිර්මාණය කරන්න. ...",
"prompt_id": "7d86ffeefdea030c92138e0b964c304508bfebed4b23261c8a741630823e6f96",
"messages": [
{
"role": "user",
"content": "ආහාර පිසීමේ ව්යාපාරයක් සඳහා වට්ටෝරු පොතක් නිර්මාණය කරන්න. ..."
},
{
"role": "assistant",
"content": "නම: රසවත් ආහාර පිසීමේ රහස්: රසවත් හා ලස්සන ආහාර පිසීමේ වට්ටෝරු පොත ..."
},
{
"role": "user",
"content": "ඔයා මේ වෙනකම් හදපු වට්ටෝරු පොත නම් නියමයි. ඔයාට පුලුවන්ද තව විස්තර එකතු කරන්න ..."
},
{
"role": "assistant",
"content": "..."
}
]
}
```
## Quality and Limitations
Full-scan checks on the released data: **100% valid JSON**, correct
user/assistant alternation, no empty turns, no duplicate `prompt_id`s.
~**0.017%** of turns remain in Latin script (overwhelmingly fenced code, which is
preserved by design), and ~**0.5%** of longer turns show NLLB repetition
artifacts.
This is **machine translation without human post-editing**. Expect:
- translationese and occasional mistranslation, especially on idioms, named
entities, and technical content;
- code, identifiers, URLs and maths intentionally left in their original form;
- a minority of turns with NLLB repetition loops (~0.5%);
- residual orthographic edge cases not covered by the conjunct lexicon.
It is intended for instruction-tuning and research, not as a gold-standard
reference translation.
## Licensing
Released under the **MIT License**, following the source dataset
`HuggingFaceH4/ultrachat_200k`. The Sinhala text was produced by machine
translation with NLLB-200. |