File size: 12,533 Bytes
32e5300
 
 
 
4ababf1
32e5300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11d120e
008d2e0
9b59787
32e5300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b59787
 
32e5300
9b59787
32e5300
 
 
 
 
 
 
 
9b59787
 
 
32e5300
 
 
 
 
 
 
 
 
008d2e0
11d120e
008d2e0
 
 
32e5300
008d2e0
32e5300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
008d2e0
32e5300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
---

license: cc-by-sa-4.0
task_categories:
- token-classification
- translation
language:
- ar
- en
tags:
- code-switching
- arabic
- transliteration
- arabizi
- asr
- asr-post-processing
- dialectal-arabic
- speech-recognition
size_categories:
- 100K<n<1M
configs:
- config_name: default
  data_files:
  - split: train
    path: train.parquet
  - split: validation
    path: validation.parquet
  - split: test
    path: test.parquet
---


# ArabicDeXlit-Corpus

**Training data for undoing transliteration in Arabic ASR output.**

Arabic speech recognition systems handle code-switching badly. When a speaker says an English
word, the model writes it out in Arabic letters — *intern* becomes `انترن`, *AI* becomes `ايه اي`.
The transcript is phonetically sensible and practically unusable: you cannot search it, index it,
or hand it to an English NLP tool.

This corpus trains a model to repair that, **without touching text that is genuinely Arabic**.

| | |
|---|---|
| **Input** (`src`) | `كنت انترن في او اي اي و بعدها جالي اوفر` |
| **Output** (`tgt`) | `كنت intern في OIE و بعدها جالي offer` |
| **Pure Arabic in** | `أنا رايح البيت دلوقتي` |
| **Pure Arabic out** | `أنا رايح البيت دلوقتي` — unchanged |

- **500,346 examples** across **9 dialect labels**
- **29% pass-through rows** where the correct answer is *change nothing*
- **1,417,309 labelled spans**, tagged by category
- Zero train/test leakage, zero token/tag misalignment (both verified — see *Quality guarantees*)

---

## Quick start

```python

from datasets import load_dataset



ds = load_dataset("mohammedaly22/ArabicDeXlit-Corpus")

print(ds)

print(ds["train"][0])

```

Only the sentences that must be left untouched:

```python

passthrough = ds["train"].filter(lambda r: r["is_passthrough"])

```

Only a given dialect:

```python

levantine = ds["train"].filter(lambda r: r["dialect"] == "lev")

```

---

## Row format

```json

{

  "src": "أنا عندي ميتينج مهم",

  "tgt": "أنا عندي meeting مهم",

  "src_tokens": ["أنا", "عندي", "ميتينج", "مهم"],

  "tags": ["O", "O", "B-CS", "O"],

  "spans": [{"start": 2, "end": 3, "category": "CS", "target": "meeting"}],

  "dialect": "egy",

  "source": "sdaia",

  "is_passthrough": false,

  "num_spans": 1

}

```

| Field | Type | Meaning |
|---|---|---|
| `src` | `string` | The noisy ASR-style input — English rendered in Arabic letters. |
| `tgt` | `string` | The corrected output. |
| `src_tokens` | `list[string]` | `src` split on whitespace. |
| `tags` | `list[string]` | **One tag per token of `src`.** BIO scheme; `O` = copy verbatim. |
| `spans` | `list[struct]` | `start`, `end` (exclusive), `category`, `target` — token offsets into `src_tokens`. |
| `dialect` | `string` | Dialect code (see below). |
| `source` | `string` | `sdaia`, `gemini`, `monolingual`, or `sdaia-mono`. |
| `is_passthrough` | `bool` | True when every tag is `O`, i.e. `src == tgt`. |
| `num_spans` | `int32` | Convenience count of `spans`. |

### The tag scheme

`O` plus `B-`/`I-` for each of five categories, 11 tags in total.

`O` is the **identity tag**: a token tagged `O` is copied to the output byte for byte. A sentence
whose tags are all `O` is therefore returned completely unchanged. This is what makes the task
learnable as tagging rather than generation, and it is the property that lets a model built on this
data be safe to drop into a live pipeline.

### Span categories

The category is part of the label because the same characters convert differently depending on it —
`ايه اي` is `AI` as an acronym, but would be `eh ay` as an ordinary word.

| Category | Count | Input | Output |
|---|---|---|---|
| `CS` | 1,395,234 | `انترن` | `intern` |
| `ACRONYM` | 12,393 | `ايه اي` | `AI` |
| `EMAIL` | 4,370 | `احمد ات جيميل دوت كوم` | `ahmed@gmail.com` |
| `ENTITY` | 5,312 | `اورانج انوفيشن ايجيبت` | `Orange Innovation Egypt` |
| `NUMBER` | 0 | `تو زيرو تو فور` | `2024` |

---

## Splits

| Split | Rows | Pass-through | Spans |
|---|---|---|---|
| `train` | 450,338 | 130,321 (28.9%) | 1,275,872 |
| `validation` | 24,865 | 7,160 (28.8%) | 70,182 |
| `test` | 25,143 | 7,229 (28.8%) | 71,255 |

Splits are assigned by **hashing a normalised sentence key** rather than shuffling, so a rebuild
reproduces exactly the same test set — important if this corpus is to serve as a shared benchmark.

## Dialect coverage

| Code | Dialect | Rows |
|---|---|---|
| `unk` | Mixed / unlabelled (monolingual pass-through) | 142,599 |
| `msa` | Modern Standard Arabic | 114,741 |
| `egy` | Egyptian | 111,938 |
| `glf` | Gulf (Saudi/Emirati/Kuwaiti) | 109,522 |
| `lev` | Levantine (Syrian/Lebanese/Jordanian/Palestinian) | 7,823 |
| `mgr` | Maghrebi (Moroccan/Algerian/Tunisian) | 3,935 |
| `yem` | Yemeni | 3,566 |
| `irq` | Iraqi | 3,521 |
| `sdn` | Sudanese | 2,701 |

`unk` is monolingual Arabic contributing pass-through examples; it is dialectally mixed and is
labelled honestly rather than guessed at.

---

## How the data was built

### The core idea: invert the corpus

Parallel data for this task barely exists. But corpora of the **target** form — Arabic with English
correctly in Latin script — are plentiful. So the pipeline runs the problem backwards: given a
target sentence, it transliterates the English into Arabic letters to *manufacture* the noisy ASR
input.

```

target (have it)    كنت intern في Orange

        ↓ transliterate the English into Arabic script

source (make it)    كنت انترن في اورانج

        ↓ record where each rewrite landed

tags                O    B-CS   O   B-CS

```

This matters for correctness, not just convenience. Because spans are recorded **during**
generation rather than recovered afterwards by alignment, the labels cannot silently drift out of
sync with the text — the failure mode that quietly poisons hand-aligned corpora.

### The transliterator is deliberately stochastic

Real ASR is inconsistent. The same English word comes out differently depending on speaker,
accent and acoustics. So each call samples among plausible renderings:

| English | Sampled Arabic forms |
|---|---|
| `intern` | `انترن` · `انتيرن` · `انترين` |
| `meeting` | `ميتينج` · `ميتنج` · `ميتينغ` |
| `project` | `بروجكت` · `برجكت` · `بروجيكت` |

A model trained across several epochs therefore meets the variation it will actually face in
production, instead of one canonical spelling it could memorise.

The generator also models how things are *spoken*: acronyms letter by letter (`AI` → `ايه اي`),
emails symbol by symbol (`@` → `ات`, `.` → `دوت`), and digits as words (`2024` → `تو زيرو تو فور`).

### Sources

| Source | Contribution | License |
|---|---|---|
| [SDAIA ArE-CSTD](https://huggingface.co/datasets/SDAIANCAI/Ar-En-Code-Switching-Textual-Dataset) | 310,578 rows — MSA, Saudi, Egyptian | CC-BY-SA-4.0 |
| Gemini synthesis | 22,584 rows — the missing dialects and rare categories | generated for this corpus |
| Arabic Wikipedia + dialectal ASR transcripts | 144,710 rows — pass-through examples | CC-BY-SA |

**Why synthesis was necessary.** SDAIA covers three dialects and is almost entirely plain
word-level code-switching. Measured on 20K of its sentences: ~60,000 ordinary code-switch spans but
only **178 acronyms, 9 entities, and zero emails or numbers**. Generation was therefore aimed
narrowly at those gaps — the five uncovered dialects, and the acronym / email / number / entity
categories — rather than at bulk volume that SDAIA already supplies.

**Why external monolingual text was necessary.** SDAIA is ~99% code-switched by construction, so it
cannot supply the pass-through half of the task. Those rows come from Arabic Wikipedia and
dialectal ASR transcripts instead.

Crucially, they are **screened**: a "monolingual" sentence containing already-transliterated
English (`الميتينغ`, `الويكند`, `الشوبينج`) is rejected, because using it as a pass-through example
would teach a model to leave transliteration alone — the exact opposite of the task. The screen is
generated by running the project's own transliterator over a list of common loanwords, so it covers
spelling variants without anyone hand-enumerating them.

---

## Quality guarantees

Each of these was **verified on the released build**, not assumed:

| Check | Result |
|---|---|
| Family-key overlap, train ∩ test | **0** |
| Family-key overlap, train ∩ validation | **0** |
| Family-key overlap, validation ∩ test | **0** |
| Rows where `len(tags) != len(src_tokens)` | **0** |
| Tags outside the 11-tag schema | **0** |
| Pass-through rows where `src != tgt` | **0** |

**On leakage specifically.** SDAIA is LLM-generated and contains large families of near-identical
sentences (`اليوم عندي meeting مع ال team في المكتب` and dozens of small variants). A random split
scatters such a family across train and test and inflates every reported score. Here, splitting is
done on a *normalised* key — diacritics stripped, alef/ya/ta-marbuta variants folded, digits
collapsed — so an entire family lands in one split.

One subtle case is handled explicitly: SDAIA writes English *mall* as `مال`, which is also an
ordinary Arabic word, so two different targets can collapse to the same input string. Identical
inputs are pinned to a single split rather than being allowed to follow their differing targets.

---

## Intended uses

- **ASR post-processing** — the motivating use: repair code-switched transcripts in place.
- **Token classification** — detecting transliterated spans (`src_tokens` + `tags`).
- **Character-level transliteration** — Arabic script → Latin, using the `spans` field alone.
- **Evaluating pass-through safety** — `is_passthrough` isolates the rows a model must not alter.

### Limitations, stated plainly

- **`src` is synthetic.** Inputs are generated from a phonetic model of Arabic ASR errors, not
  transcribed from real ASR output. The generator was tuned against real examples and reproduces
  their characteristic forms, but a held-out set of genuine ASR transcripts is the right way to
  confirm any result from this corpus.
- **Dialect balance is uneven.** MSA, Egyptian and Gulf dominate, because that is what the free
  corpora cover; the five synthesised dialects are present in the low thousands each.
- **`ENTITY` and `NUMBER` are thin** relative to `CS`. If your application leans on them, generate
  more with the repository's synthesis script.
- **Some rows come from an LLM** (SDAIA is GPT-4-generated; the dialect top-up is Gemini-generated)
  and carry the register and topic biases that implies.

---

## License

**CC-BY-SA-4.0**, inherited from SDAIA ArE-CSTD's share-alike term. Derivatives must carry the same
licence.

[Casablanca](https://huggingface.co/datasets/UBC-NLP/Casablanca) is deliberately **excluded**. It is
an excellent multi-dialect corpus that annotates code-switched words in both scripts, but it is
licensed CC-BY-**NC-ND** — the no-derivatives term forbids republishing transliterated derivatives
of it. It remains suitable as a held-out evaluation set, cited rather than redistributed.

## Citation

```bibtex

@misc{arabicdexlit2026,

  title  = {ArabicDeXlit: Undoing Transliteration in Arabic ASR Code-Switching},

  author = {Mohammed Aly},

  year   = {2026},

  url    = {https://github.com/MohammedAly22/Arabic-DeXlit}

}

```

Please also cite the underlying corpus:

```bibtex

@inproceedings{ArECSTD2024,

  title     = {Leveraging LLM for Augmenting Textual Data in Code-Switching ASR: Arabic as an Example},

  author    = {Alharbi, Sadeen and Aloraini, Raghad and BinMuqbil, Reem and Ali, Ahmed and

               Bari, Saiful and Alowisheq, Areeb and Alonaizan, Yaser},

  year      = {2024},

  publisher = {NCAI-SDAIA}

}

```

## Links

- **Code & training** — <https://github.com/MohammedAly22/Arabic-DeXlit>
- **Model** — [`mohammedaly22/ArabicDeXlit-base`](https://huggingface.co/mohammedaly22/ArabicDeXlit-base)