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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
311
312
313
314
315
316
317
318
319
320
321
322
323
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
---
license: cc-by-4.0
task_categories:
- image-to-text
- text-generation
- visual-question-answering
language:
- sux
tags:
- cuneiform
- sumerian
- assyriology
- transliteration
- multimodal
- vlm
- ancient-languages
- unsloth
- qwen3-vl
size_categories:
- 100K<n<1M
dataset_info:
  features:
    - name: id
      dtype: string
    - name: period
      dtype: string
    - name: genre
      dtype: string
    - name: image_type
      dtype: string
    - name: data_type
      dtype: string
    - name: conversations
      dtype: string
    - name: image
      dtype: image
  splits:
    - name: train
      num_examples: 179799
    - name: validation
      num_examples: 10070
    - name: test
      num_examples: 10095
---

# SumTablets Merged Multimodal Dataset

A merged, deduplicated, quality-filtered training corpus combining cuneiform tablet text records with tablet photography and lineart, structured for vision-language model (VLM) fine-tuning.

**Target model:** Qwen3-VL-8B-Instruct via Unsloth Studio  
**Combined license:** CC-BY-4.0 (most restrictive of the two source licenses applies)

---

## Quick Start

### Load the dataset

```python
from datasets import load_dataset

ds = load_dataset("TRACCERR/Sumtablets_Merged")

print(ds)
# DatasetDict({
#     train:      Dataset({features: [...], num_rows: 179799}),
#     validation: Dataset({features: [...], num_rows: 10070}),
#     test:       Dataset({features: [...], num_rows: 10095})
# })
```

### Filter by training task type

The `data_type` column lets you select a specific training modality:

```python
# Multimodal only — image + glyph names -> transliteration (48,903 train rows)
multimodal = ds["train"].filter(lambda x: x["data_type"] == "multimodal")

# Text-only — glyph names -> transliteration (82,450 train rows)
text_only = ds["train"].filter(lambda x: x["data_type"] == "text_only")

# Vision-only — image alone -> transliteration (48,446 train rows)
vision_only = ds["train"].filter(lambda x: x["data_type"] == "vision_only")
```

### Parse a conversation

The `conversations` column is a JSON string. Parse it before use:

```python
import json

sample = ds["train"][0]

turns = json.loads(sample["conversations"])
# [
#   {"role": "system",    "content": "You are an expert Assyriologist...", "has_image": False},
#   {"role": "user",      "content": "Sign sequence:\nDIŠ LU2 ...",        "has_image": True},
#   {"role": "assistant", "content": "1(disz) lu2 ...",                     "has_image": False}
# ]

# The "has_image" field marks which turn the image is injected into.
# For text-only samples, all turns have has_image=False and sample["image"] is None.
```

### Handle null images

Text-only samples (`data_type == "text_only"`) have `image=None`. Always guard against this in training code:

```python
sample = ds["train"][0]

if sample["image"] is not None:
    img = sample["image"]          # PIL Image, ready to use
else:
    img = None                     # text-only sample — no image available
```

### Inspect a sample end-to-end

```python
import json

sample = ds["train"].filter(lambda x: x["data_type"] == "multimodal")[0]

print("Tablet ID:    ", sample["id"])
print("Period:       ", sample["period"])
print("Genre:        ", sample["genre"])
print("Image type:   ", sample["image_type"])
print("Image size:   ", sample["image"].size)      # e.g. (800, 600)

turns = json.loads(sample["conversations"])
for turn in turns:
    tag = "[+img]" if turn["has_image"] else ""
    print(f"[{turn['role']}]{tag}: {turn['content'][:80]}...")
```

---

## Contents

| File | Rows |
|---|---|
| `train.parquet` | 179,799 |
| `validation.parquet` | 10,070 |
| `test.parquet` | 10,095 |
| **Total** | **199,964** |

---

## Source Datasets

### Dataset A — SumTablets (Text)

- **Source:** [`colesimmons/SumTablets`](https://huggingface.co/datasets/colesimmons/SumTablets)
- **License:** CC-BY-4.0
- **Authors:** Cole Simmons, Richard Diehl Martinez, Prof. Dan Jurafsky (Stanford NLP)
- **Presented at:** ML4AL Workshop, ACL 2024

| Split | Rows |
|---|---|
| Train | 82,452 |
| Validation | 4,577 |
| Test | 4,577 |
| **Total** | **91,606** |

**Schema:**

| Column | Type | Description |
|---|---|---|
| `id` | string (7 chars) | CDLI/ePSD2 tablet identifier. P-numbers (e.g. `P119622`) are physical tablets in the CDLI catalogue. Q-numbers are composite texts. |
| `period` | string (11 classes) | Historical period of the tablet |
| `genre` | string (9 classes) | Text category |
| `transliteration` | string | Latin-script rendering of the cuneiform signs, following standard Assyriological conventions |
| `glyph_names` | string | Space-separated sequence of cuneiform sign names in ASCII (e.g. `DIŠ LU2 ŠE`) |
| `glyphs` | string | Unicode cuneiform characters corresponding to the sign sequence |

**Upstream data provenance:** Transliterations were sourced from the [Electronic Pennsylvania Sumerian Dictionary (ePSD2)](https://oracc.museum.upenn.edu/epsd2/), which aggregates data from the [Cuneiform Digital Library Initiative (CDLI)](https://cdli.mpiwg-berlin.mpg.de/), the [Open Richly Annotated Cuneiform Corpus (Oracc)](https://oracc.museum.upenn.edu/), and the [Electronic Text Corpus of Sumerian Literature (ETCSL)](https://etcsl.orinst.ox.ac.uk/). These projects represent approximately thirty years of manual digitisation by Assyriologists worldwide.

---

### Dataset B — SumTablets Photos (Images)

- **Source:** [`colesimmons/SumTablets_Photos`](https://huggingface.co/datasets/colesimmons/SumTablets_Photos)
- **License:** Apache-2.0

| Split | Photo images | Lineart images | Combined (pre-dedup) |
|---|---|---|---|
| Train | 38,430 | 33,101 | 71,531 |
| Validation | 2,147 | 1,895 | 4,042 |
| Test | 2,165 | 1,895 | 4,060 |
| **Total** | **42,742** | **36,891** | **79,633** |

**Schema:**

| Column | Type | Description |
|---|---|---|
| `id` | string (7 chars) | Same CDLI/ePSD2 tablet identifier as Dataset A |
| `image` | image | PIL image of the physical tablet |
| `image_type` | string | `"photo"` (photographic image) or `"lineart"` (traced line drawing) |

**Image types explained:**
- **Photo:** Photographic image of the physical clay tablet. Includes lighting variation, surface damage, colour, and photographic noise.
- **Lineart:** Traced line drawing of the tablet's cuneiform impressions. Removes photographic noise; sign boundaries are cleaner and more consistent. Preferred for sign identification tasks.

---

## Merge Methodology

### Join Key

The two datasets were joined exclusively on the `id` field. Both datasets share the CDLI/ePSD2 tablet ID as a primary key. No other fields were used for matching.

### Deduplication

Dataset B contains both photo and lineart images for many tablets. Before joining, duplicate entries were resolved:

- **Priority: lineart over photo.** When a tablet has both image types, only the lineart entry is retained.
- **Rationale:** Lineart provides cleaner sign boundaries, less photographic noise, and a more consistent visual signal for training the vision encoder to identify cuneiform signs.
- After deduplication: 48,905 unique tablet IDs in train (down from 71,531 combined).

### Join Type and Unmatched Rows

An **inner join** was performed to produce the matched (multimodal) corpus — rows where both a text record and an image exist for the same tablet ID.

Dataset A contains more tablets than Dataset B. Tablets in Dataset A with no corresponding image were **retained** rather than discarded, and used to generate text-only training samples. These represent real tablets with verified transliterations.

| Split | Matched (has image) | Text-only (no image) |
|---|---|---|
| Train | 48,903 | 33,547 |
| Validation | 2,760 | 1,817 |
| Test | 2,767 | 1,810 |

### Quality Filter

Applied to matched rows only. A row was removed if any of the following were true:

1. `transliteration` was empty or whitespace-only
2. `glyph_names` was empty or whitespace-only
3. `image` was null after join
4. `id` was not exactly 7 characters
5. `transliteration` contained only structural markers (e.g. `<SURFACE>`) with no actual sign content

**Rows dropped:** 2 (train only). Text-only rows were exempt from this filter.

### Conversation Construction

Each row was transformed into the Unsloth/Qwen3-VL conversation format. Three training sample types were generated:

#### Type 1 — Multimodal (`data_type: "multimodal"`)
Generated for every matched row (image present).

- **Input:** tablet image + cuneiform sign name sequence
- **Output:** transliteration
- **Purpose:** Primary VLM training signal. Teaches the model to combine visual tablet content with sign sequence context to produce an accurate transliteration.

#### Type 2 — Text-only (`data_type: "text_only"`)
Generated for every row (matched and unmatched).

- **Input:** cuneiform sign name sequence only (no image)
- **Output:** transliteration
- **Purpose:** Reinforces the text pathway. Prevents the model from becoming over-reliant on visual input. Also doubles the training density for all text records regardless of image availability.

#### Type 3 — Vision-only (`data_type: "vision_only"`)
Generated for matched rows where `len(transliteration) > 50` characters.

- **Input:** tablet image only (no sign name hints)
- **Output:** transliteration
- **Purpose:** Forces the vision encoder to extract sign information directly from the image without textual scaffolding. The 50-character threshold limits this harder task to tablets with enough content to constitute a meaningful training signal.

### Shuffle

The training corpus was shuffled using `random.seed(42)` before saving. Without shuffling, sequence packing during training would group tablets from the same historical period into the same batches, producing period-biased gradient updates. The shuffle ensures mixed-period, mixed-genre, mixed-modality batches throughout training.

Validation and test splits were **not** shuffled (order is irrelevant for evaluation, and consistency aids debugging).

---

## Dataset Statistics

### Sample Counts by Type

| Split | Multimodal | Text-only | Vision-only | **Total** |
|---|---|---|---|---|
| Train | 48,903 (27.2%) | 82,450 (45.9%) | 48,446 (26.9%) | **179,799** |
| Validation | 2,760 (27.4%) | 4,577 (45.5%) | 2,733 (27.1%) | **10,070** |
| Test | 2,767 (27.4%) | 4,577 (45.3%) | 2,751 (27.3%) | **10,095** |
| **Total** | **54,430** | **91,604** | **53,930** | **199,964** |

### Image Type Distribution (Multimodal samples only)

| Split | Lineart | Photo |
|---|---|---|
| Train | 31,851 (65.1%) | 17,052 (34.9%) |
| Validation | 1,822 (66.0%) | 938 (34.0%) |
| Test | ~66% | ~34% |

### Period Distribution (Train, all sample types)

| Period | Samples | % |
|---|---|---|
| Ur III | 153,922 | 85.6% |
| Old Akkadian | 11,474 | 6.4% |
| Early Dynastic IIIb | 8,321 | 4.6% |
| Old Babylonian | 2,523 | 1.4% |
| Early Dynastic IIIa | 2,004 | 1.1% |
| Lagash II | ~1,000 | <1% |
| Early Dynastic I-II | ~150 | <1% |
| Unknown | ~150 | <1% |
| Neo-Assyrian | ~50 | <1% |
| Neo-Babylonian | ~30 | <1% |
| Middle Babylonian | ~20 | <1% |

**Note for historians:** The strong Ur III dominance (~85%) reflects the composition of the underlying ePSD2 corpus, which itself reflects the surviving archaeological record — the Ur III period (ca. 2112–2004 BCE) produced an exceptionally large volume of administrative clay tablets, many of which have been excavated and digitised. This dataset is therefore best suited for training on Ur III administrative cuneiform. Performance on minority periods (Neo-Assyrian, Neo-Babylonian, Middle Babylonian) will be limited by sample count.

### Genre Distribution (Train, all sample types)

| Genre | Samples | % |
|---|---|---|
| Administrative | 169,661 | 94.4% |
| Royal Inscription | 4,117 | 2.3% |
| Literary | 2,250 | 1.3% |
| Letter | 1,746 | 1.0% |
| Legal | 1,430 | 0.8% |
| Unknown | 373 | 0.2% |
| Lexical | 104 | <0.1% |
| Liturgy | 94 | <0.1% |
| Math/Science | 24 | <0.1% |

---

## Schema (Output Parquet Files)

| Column | Type | Description |
|---|---|---|
| `id` | string | CDLI/ePSD2 tablet identifier (7 chars) |
| `period` | string | Historical period (from Dataset A) |
| `genre` | string | Text genre (from Dataset A) |
| `image_type` | string | `"photo"`, `"lineart"`, or `null` for text-only samples |
| `data_type` | string | `"multimodal"`, `"text_only"`, or `"vision_only"` |
| `conversations` | string | JSON-serialised conversation in Unsloth/Qwen3-VL format (see below) |
| `image` | image | Tablet image (PIL-compatible), or `null` for text-only samples |

> **Important:** The `image` column is `null` for all `text_only` samples (82,450 train rows — 45.9% of the training set). Any training loop, collator, or data loader must handle `None` images explicitly. Passing a null image to a vision encoder will raise an error.

### Conversation Format

Conversations are stored as JSON strings. Each is a list of turn objects:

```json
[
  {"role": "system",    "content": "You are an expert Assyriologist...", "has_image": false},
  {"role": "user",      "content": "Sign sequence:\nDIŠ LU2 ŠE\n\nProvide the transliteration.", "has_image": true},
  {"role": "assistant", "content": "1(disz) lu2 sze",                                             "has_image": false}
]
```

| Field | Values | Description |
|---|---|---|
| `role` | `"system"`, `"user"`, `"assistant"` | Conversation turn role |
| `content` | string | Turn text content |
| `has_image` | `true` / `false` | Whether the tablet image is injected into this turn. Always `false` for text-only samples. |

**By data_type:**

| `data_type` | User turn content | `has_image` on user turn | `image` column |
|---|---|---|---|
| `multimodal` | image + sign sequence | `true` | PIL image |
| `text_only` | sign sequence only | `false` | `null` |
| `vision_only` | image only | `true` | PIL image |

---

## Important Preservation Notes for Historians

The following tokens appear in transliterations and are **preserved verbatim** in this dataset. They must not be filtered, replaced, or treated as errors:

| Token | Meaning |
|---|---|
| `<unk>` | Damaged, worn, or illegible sign — reading is uncertain or impossible |
| `<SURFACE>` | Structural marker indicating a new surface of the tablet (obverse, reverse, edge) |
| `<COLUMN>` | Structural marker indicating a new column of text |
| `<BLANK_SPACE>` | Intentional blank space in the original inscription |
| `<RULING>` | Horizontal ruling line drawn by the scribe to separate sections |
| Subscript numerals | Sign index disambiguators (e.g. `du₃`, `du₁₁`) — part of standard transliteration conventions |

These markers encode structural and palaeographic information about the physical tablet and are part of the training signal, not noise.

---

## Benefits for VLM Training

**1. Multimodal integration**
The source datasets are separate and cannot individually train a VLM. This dataset is the first merged, conversation-formatted combination of both, enabling end-to-end training on the full transliteration task.

**2. Three complementary training pathways**
Training on all three sample types simultaneously teaches the model to handle varying levels of input context gracefully — full multimodal input, text-only input, and vision-only input — rather than becoming brittle to any single modality.

**3. Conversation format pre-applied**
Samples are already formatted in Unsloth/Qwen3-VL conversation format. No preprocessing is required at training time.

**4. Deduplication by image quality**
By preferring lineart over photo where both exist, the training signal for sign identification is maximised. The model still sees photographic images (34.9% of multimodal samples) to generalise across image types.

**5. Shuffle prevents period bias**
The Ur III dominance means an unshuffled corpus would group similar administrative tablets into contiguous batches. The shuffle distributes minority periods, genres, and image types across the full training sequence.

**6. Text-only augmentation doubles text coverage**
Every matched tablet contributes both a multimodal and a text-only sample. This prevents the model from ignoring the text pathway and ensures the glyph-name-to-transliteration mapping is reinforced independently of visual input.

**7. Retained unmatched text rows**
The 33,547 train tablets with no corresponding image are not discarded. They represent real, verified historical records and contribute meaningful text-only training signal.

---

## Known Limitations

- **Ur III dominance (~85%):** The model will perform best on Ur III administrative tablets and may underperform on other periods. This reflects the composition of the underlying archaeological and digitisation record, not a flaw in the merge.
- **Administrative genre dominance (~94%):** Performance on literary, legal, and epistolary texts will be more limited due to lower sample counts.
- **Image coverage gap:** Only ~59% of text records (48,903 of 82,452 train rows) have a corresponding image. The remaining 41% are text-only.
- **Lineart sourcing:** Lineart images are traced drawings, not the original tablets. They are accurate representations of sign sequences but abstract away surface texture, colour, and physical damage beyond what is encoded in the `<unk>` token.
- **No cross-split tablet leakage check:** The train/validation/test split was inherited from the source datasets. Split integrity across the two source datasets has not been independently verified.

---

## Reproducibility

The merge was performed by `merge_pipeline.py`. The pipeline is fully deterministic given the same input files and Python environment:

- Shuffle seed: `random.seed(42)`
- Deduplication strategy: sort by `(id, image_type_priority)`, keep first
- Quality filter: deterministic rule-based (no sampling)

**Environment:**
```
Python       3.14.3
datasets     >= 2.14.0
pandas       (current)
pyarrow      (current)
Pillow       >= 9.0.0
```

---

## Citation

If you use this dataset, please cite the original source works:

**SumTablets (text):**
> Cole Simmons, Richard Diehl Martinez, Dan Jurafsky. *SumTablets: A Transliteration Dataset of Sumerian Tablets.* ML4AL Workshop, ACL 2024.

**Upstream data sources:** CDLI, Oracc, ePSD2, ETCSL — see acknowledgements in the original SumTablets dataset card.

**This merged dataset** was constructed from the above sources and is released under **CC-BY-4.0** (inherited from the SumTablets text dataset, the more restrictive of the two source licenses).