Datasets:
Add metadata and dataset card
Browse files- README.md +123 -0
- metadata.jsonl +0 -0
README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- de
|
| 4 |
+
- fr
|
| 5 |
+
- lb
|
| 6 |
+
license: other
|
| 7 |
+
task_categories:
|
| 8 |
+
- image-classification
|
| 9 |
+
tags:
|
| 10 |
+
- fraktur
|
| 11 |
+
- blackletter
|
| 12 |
+
- antiqua
|
| 13 |
+
- ocr
|
| 14 |
+
- historical-newspapers
|
| 15 |
+
- historical-documents
|
| 16 |
+
- impresso
|
| 17 |
+
- text-line
|
| 18 |
+
size_categories:
|
| 19 |
+
- 10K<n<100K
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# Fraktur/Other Text-Line — Training Dataset
|
| 23 |
+
|
| 24 |
+
A curated collection of scanned text-line images for the binary task of distinguishing **Fraktur** (blackletter / Gothic script) from **other** script (primarily Antiqua / Latin / Roman).
|
| 25 |
+
|
| 26 |
+
Developed for the [Impresso](https://impresso-project.ch/) digital humanities project.
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Dataset Details
|
| 31 |
+
|
| 32 |
+
| Property | Value |
|
| 33 |
+
| -------------- | ------------------------------------------------------------ |
|
| 34 |
+
| Task | Binary image classification |
|
| 35 |
+
| Classes | `fraktur`, `other` |
|
| 36 |
+
| Fraktur images | 13 165 |
|
| 37 |
+
| Other images | 19 194 |
|
| 38 |
+
| Total images | 32 359 |
|
| 39 |
+
| Image format | WebP (lossless), grayscale text-line crops |
|
| 40 |
+
| Typical size | variable width × ~60 px height |
|
| 41 |
+
| Languages | German, French, Luxembourgish |
|
| 42 |
+
| Source | Historical Swiss and Luxembourgish newspapers |
|
| 43 |
+
| Split | `train` (no pre-defined validation split — use random split) |
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
## Data Fields
|
| 48 |
+
|
| 49 |
+
| Field | Type | Description |
|
| 50 |
+
| ------------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 51 |
+
| `image` | `PIL.Image` | Grayscale text-line crop |
|
| 52 |
+
| `label` | `string` | `"fraktur"` or `"other"` |
|
| 53 |
+
| `file_name` | `string` | Repo-relative path (`data/train/{label}/{shard}/{filename}.webp`) — images are sharded into subdirectories of ≤5 000 files each to stay within HF's 10 000-files-per-directory Git limit; labels come from `metadata.jsonl`, not from directory names |
|
| 54 |
+
| `source_tag` | `string` | Original filename stem — partially encodes newspaper/date of origin where known; **not systematic** and should not be relied upon for analysis |
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
## Usage
|
| 59 |
+
|
| 60 |
+
> **Note**: images are stored in shard subdirectories (`data/train/{label}/0000/`, `0001/`, …) to work around HF's 10 000-files-per-directory Git limit. Labels are declared in `metadata.jsonl` — use the `datasets` library to load this dataset. `torchvision.datasets.ImageFolder` will not assign labels correctly from the directory structure alone.
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from datasets import load_dataset
|
| 64 |
+
|
| 65 |
+
ds = load_dataset("impresso-project/frakturline-dataset", split="train")
|
| 66 |
+
print(f"Total images: {len(ds)}")
|
| 67 |
+
print(ds[0])
|
| 68 |
+
# {"image": <PIL.Image>, "label": "fraktur", "file_name": "data/train/fraktur/...", "source_tag": "..."}
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
### Train a classifier
|
| 72 |
+
|
| 73 |
+
```python
|
| 74 |
+
from datasets import load_dataset
|
| 75 |
+
from collections import Counter
|
| 76 |
+
|
| 77 |
+
ds = load_dataset("impresso-project/frakturline-dataset", split="train")
|
| 78 |
+
|
| 79 |
+
# Class distribution
|
| 80 |
+
print(Counter(ds["label"]))
|
| 81 |
+
# Counter({'other': 19194, 'fraktur': 13165})
|
| 82 |
+
|
| 83 |
+
# Shuffle & split for training
|
| 84 |
+
ds = ds.shuffle(seed=42)
|
| 85 |
+
split = ds.train_test_split(test_size=0.1, seed=42)
|
| 86 |
+
train_ds, val_ds = split["train"], split["test"]
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## Data Provenance and Curation
|
| 92 |
+
|
| 93 |
+
Most of the source material was derived from the National Library of Luxembourg (BnL) OCR ground-truth release [`bnl-ground-truth-newspapers-before-1878.zip`](https://data.bnl.lu/wp-content/uploads/2021/07/bnl-ground-truth-newspapers-before-1878.zip). The BnL describes this release as **Public Domain / CC0** and characterises the Ground Truth Pack as containing ~33 000 transcribed text lines (~19 000 Antiqua, ~14 000 Fraktur). See also: [BnL Historical Newspapers](https://data.bnl.lu/data/historical-newspapers/).
|
| 94 |
+
|
| 95 |
+
For background on the BnL OCR workflow, see:
|
| 96 |
+
|
| 97 |
+
> Schneider, Pit, and Yves Maurer. _Rerunning OCR: A Machine Learning Approach to Quality Assessment and Enhancement Prediction_. _Journal of Data Mining & Digital Humanities_, 2022. [https://jdmdh.episciences.org/10239](https://jdmdh.episciences.org/10239)
|
| 98 |
+
|
| 99 |
+
The training set also includes additional lines from impresso corpus material curated by the dataset creators.
|
| 100 |
+
|
| 101 |
+
**This dataset is not identical to the original BnL release.** The upstream material was cleaned by removing lines that did not contain identifiable Fraktur or Antiqua characters and by excluding mixed-font cases (while retaining lines containing digits). Curation was performed iteratively: lines labeled as Fraktur but consistently predicted as Antiqua (or vice versa) were reviewed manually and removed where they were inconsistent with the dataset guidelines. The guidelines preserve only clear Fraktur / non-Fraktur distinctions.
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## Companion Resources
|
| 106 |
+
|
| 107 |
+
- **Held-out test set**: [impresso-project/frakturline-testset](https://huggingface.co/datasets/impresso-project/frakturline-testset) — 2 000 balanced images (1 000/class), **not** included in this training dataset
|
| 108 |
+
- **Trained model**: [impresso-project/frakturline-classification-cnn](https://huggingface.co/impresso-project/frakturline-classification-cnn)
|
| 109 |
+
|
| 110 |
+
---
|
| 111 |
+
|
| 112 |
+
## License
|
| 113 |
+
|
| 114 |
+
This dataset contains material from multiple sources with different rights statuses.
|
| 115 |
+
|
| 116 |
+
- Part of the source material derives from the National Library of Luxembourg (BnL) OCR ground-truth release [`bnl-ground-truth-newspapers-before-1878.zip`](https://data.bnl.lu/wp-content/uploads/2021/07/bnl-ground-truth-newspapers-before-1878.zip), which the BnL describes as **CC0 / Public Domain**.
|
| 117 |
+
- Additional original contributions made by the dataset creators in this release — including curation, selection, cleaning decisions, split construction, and documentation — are made available under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
|
| 118 |
+
|
| 119 |
+
Users should therefore distinguish between upstream source material, which remains available under its original terms, and original contributions in this release, which are provided under **CC BY 4.0**.
|
| 120 |
+
|
| 121 |
+
This dataset is intended primarily for **research and evaluation use**. Users remain responsible for assessing the rights status of any upstream source material, especially where historical newspaper provenance or copyright status is not fully documented across jurisdictions.
|
| 122 |
+
|
| 123 |
+
If you use this dataset, please cite the [Impresso project](https://impresso-project.ch/) and link to this repository.
|
metadata.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|