| --- |
| license: other |
| license_name: mixed-source |
| language: |
| - sv |
| - de |
| tags: |
| - ocr |
| - historical |
| - fraktur |
| - swedish |
| pretty_name: Swedish Print OCR Training Data |
| --- |
| |
| # Swedish Print OCR — training and evaluation data |
|
|
| Training mixture and benchmarks for |
| [Ericu950/swedish-print-ocr-3b](https://huggingface.co/Ericu950/swedish-print-ocr-3b) (production) |
| and |
| [Ericu950/swedish-print-ocr-3b-benchmark](https://huggingface.co/Ericu950/swedish-print-ocr-3b-benchmark) |
| (held-out evaluation model). Each training row is a chat-format example: |
|
|
| ```json |
| {"messages": [{"role": "user", "content": "<image>Transkribera sidans brödtext normaliserat: ..."}, |
| {"role": "assistant", "content": "..."}], |
| "images": ["<absolute path on the training cluster>"]} |
| ``` |
|
|
| **Images are included** under `images/` as tar shards of roughly 10 GB each |
| (337,115 files, ~65 GB in total — every image referenced by the training, |
| validation and test JSONLs). Inside the tars, paths are relative to the |
| training project root: a JSONL row's absolute path |
| `/nobackup/proj/flash/dionysus/shared/litteraturbanken/OCR_modell/external/runeberg/img/x.png` |
| corresponds to the tar member `external/runeberg/img/x.png`. |
| `images/images_manifest.json` lists the shards and their file counts. Unpack |
| all shards into one directory and strip the prefix from the JSONL paths (or |
| point the prefix at your unpack directory) to train. |
|
|
| ## Files |
|
|
| | File | What it is | |
| |---|---| |
| | `train/train_allt.jsonl` | 419,999 examples — the production model's training mixture (held-out works included) | |
| | `train/train_rent.jsonl` | 398,356 examples — the evaluation model's training mixture (held-out works excluded; original had 398,310 rows, see below) | |
| | `val/train_allt_val.jsonl` | the 402-page validation set used during training (original file) | |
| | `val/valset_v2.jsonl` | work-disjoint validation pages (original file) | |
| | `test/testset_v2.jsonl` | the principal benchmark: 1,182 pages from 214 works, 1600–1999 (original file) | |
| | `test/wikisource_v3.jsonl` | the external benchmark: 542 proofread Swedish Wikisource pages (original file) | |
| | `held_out_works_v2.json` | the list of 338 held-out works defining the train/test split | |
| | `images/images_*.tar` | all 337,115 page/line images referenced above (~65 GB, see Images) | |
| | `train/train_blandat.jsonl` | page + line-crop augmentation mixture (598,356 rows; line rows reference a page image plus a polygon to crop) | |
| | `lines/radpar.jsonl` | 4,358,192 segment-to-ground-truth line pairs used to mine line training data | |
|
|
| ## Provenance: original vs. reconstructed |
|
|
| The evaluation and validation files are the **original files** used in the |
| study. The two training JSONLs are **deterministic reconstructions**: the exact |
| files were deleted in a disk-quota cleanup, then rebuilt with the same scripts, |
| seeds and source pools. The reconstruction machinery was verified byte-exact |
| against a surviving validation file, and `train_allt` matches every number in |
| the original build log (example counts per group, typeface census, language |
| distribution). One caveat is stated for honesty: the instruction line |
| optionally names the century of publication, and this is omitted at random from |
| one third of examples; the surviving evidence shows the random omission |
| pattern of the original files differed from the reconstruction's (same seed, |
| slightly different code path at the time). The example pool, transcriptions, |
| image assignments and mixture proportions are identical; which individual rows |
| omit the century line is not guaranteed to be. For `train_rent` the same drift |
| shifts which examples enter the 400,000-example sample: the reconstruction has |
| 398,356 rows against the original build log's 398,310 (a 0.012% difference), |
| while the cleaning filter itself reproduces the original exactly (154,862 pages |
| scored, 1,982 below threshold). |
|
|
| ## Sources |
|
|
| The mixture draws on: Litteraturbanken (normalised page transcriptions), |
| Projekt Runeberg (proofread pages), NewsEye Swedish newspapers (lines), |
| GT4HistOCR (German blackletter lines, diplomatic), a Swedish fraktur corpus |
| (lines, diplomatic), and Språkbanken regions. 34% Swedish roman print, 44% |
| Swedish blackletter, 22% German blackletter. Each source retains its own |
| licence; this compilation is distributed gated for research use. Consult the |
| individual source collections before any redistribution or commercial use. |
|
|