Folio Newspaper Fraktur
Transcribe a cropped line of historical German newspaper print on a CPU. This 5.2 MB ONNX reader produces Unicode text, using ordinary s for both printed s forms. It scored 0.90% character error on 2,038 held-out Luxembourg lines and 8.52% on 813 lines from Austrian newspaper pages. The repository also includes a command for scans with existing PAGE XML line coordinates.

The example reads “Mantel umhüllt und hatte sanft, wie ein”. It comes from a BnL validation block. Sample provenance
Read a line
With Python 3.10 or later, download the runtime, the weights and an example. Once downloaded, recognition works offline.
python -m pip install huggingface_hub
hf download foliokestrel/folio-newspaper-fraktur model.onnx config.json folio_fraktur.py read_page.py requirements.txt examples/newspaper-line.png examples/newspaper-line.xml --local-dir folio-newspaper-fraktur
cd folio-newspaper-fraktur
python -m pip install -r requirements.txt
python folio_fraktur.py examples/newspaper-line.png
Provide one horizontal line per image. Include accents and descenders, and leave adjacent lines outside the crop. The command accepts multiple image paths. In Python, reuse one reader for all images to pay the model loading cost once.
from PIL import Image
from folio_fraktur import FrakturReader
read = FrakturReader()
with Image.open("examples/newspaper-line.png") as line:
print(read(line))
Read an annotated page
python read_page.py examples/newspaper-line.xml
python read_page.py page.xml --image original-scan.jpg > lines.jsonl
The first command runs on the included one-line example. On a real scan, the second command reads every existing PAGE TextLine in XML document order. Each JSON row contains the zero-based index, original line ID, crop rectangle in source pixels and recognized text. Rectangle coordinates are left and top inclusive, right and bottom exclusive. A line with missing or out-of-bounds coordinates gets its own error row. Use an image matching the dimensions in the XML. For unsegmented pages, supply your own line crops or PAGE layout first. On 13 Austrian pages, the tool read 4,813 annotated lines and reproduced both crop coordinates and predictions on all 813 scored lines. Workflow verification
Measured accuracy
Character error rate (CER) divides character insertions, deletions and substitutions by the number of reference characters. Lower is better. “Fold ſ” treats ſ and s as equivalent in both prediction and reference. Exact matches count complete lines after NFC and whitespace normalization, with ſ and s distinct.
| CPU reader | Luxembourg CER | Fold ſ | Exact / 2,038 | Austria CER | Fold ſ | Exact / 813 |
|---|---|---|---|---|---|---|
| Folio Newspaper Fraktur | 0.90% | 0.90% | 1,620 | 8.52% | 8.52% | 152 |
| Tesseract frak2021, Mannheim | 4.50% | 1.64% | 357 | 29.33% | 27.45% | 154 |
| Tesseract script/Fraktur, tessdata_fast | 8.89% | 6.48% | 117 | 31.73% | 29.94% | 71 |
| Folio Fraktur Line, book model | 22.67% | 20.09% | 24 | 36.17% | 34.31% | 12 |
The Luxembourg panel contains 110 reserved text blocks and 93,230 reference characters. Folio Newspaper Fraktur made 843 edits. The source establishes separation by text block. Newspaper titles and issues may recur across splits. On one line in block 0777, the reference contains only “ist.” while a full printed line is visible. It remains in the score. Inspect the scan · Luxembourg predictions
The external Austrian panel contains 33,507 reference characters on 13 NewsEye / READ validation pages. Page identifiers span 1864–1933. The newspaper model made 2,854 edits. Crops use bounding rectangles around source polygons, which can include neighboring print. The frak2021 training notes list AustrianNewspapers among its sources. Its overlap with these specific pages is unknown. Austrian predictions · Specialist predictions · frak2021 training notes
Training and use limits
Folio Kestrel fine-tuned the 1.29-million-parameter convolutional recurrent CTC reader on 9,137 Luxembourg newspaper lines from 516 blocks. We chose epoch 11 using 1,918 validation lines from 110 different blocks and froze the checkpoint before scoring either panel. On validation, PyTorch and the CPU ONNX export gave identical strings on all 1,918 lines. With two CPU threads, median inference time per decoded line was 11.5 ms on the Luxembourg test panel and 12.1 ms on the Austrian panel. These timings exclude model loading and image decoding. Training recipe and splits · Evaluation and baselines
The alphabet follows the Luxembourg transcription convention. For work that requires a distinct long ſ, the book reader can output it. Proofread unfamiliar typefaces, names, numbers and punctuation against the scan. These measurements cover printed lines with known coordinates. Handwriting, automatic layout detection and transcription quality by individual language were outside the evaluation.
Weights are licensed CC BY-SA 4.0 and the original code is Apache 2.0. The Luxembourg example is from the Bibliothèque nationale du Luxembourg. Austrian references are from Guenter Muehlberger and Guenter Hackl’s NewsEye / READ dataset, with scans from the Austrian National Library. Attribution and source licenses