Dutch newspaper line OCR
Read a cropped line from a seventeenth- through nineteenth-century newspaper printed in the Netherlands. The model accepts a grayscale or color image and returns searchable text with historical spelling, case and punctuation. It expands long s and several typographic ligatures. Supply one horizontal line, including short headings, advertisements or dates. Page segmentation is a separate step.
Install Dutch line and paragraph OCR
python -m pip install https://huggingface.co/foliokestrel/folio-dutch-newspaper-ocr/resolve/main/python/folio_dutch_newspaper_ocr-0.1.0-py3-none-any.whl
folio-dutch-line headline.png
folio-dutch-block paragraph.png --separate-lines
The wheel includes the CPU model and Dutch layout data. Both commands work offline after installation. For a multi-column scan, supply PAGE XML region polygons. Line boxes use original image coordinates. Installation and Python example · Paragraph examples and evaluation
Proofread a paragraph in a PAGE editor
Using the reader on early printed books
On 91 additional pages from 11 catalogue titles printed between 1630 and 1796, this newspaper reader made 191 character edits across 78 single lines (10.24% CER) and 2,381 across 112 paragraphs (4.90%). Dutch Tesseract made 328 and 3,139 edits on the same crops. Only one Folio paragraph matched the full archive reference. The downloadable comparison includes both readings and the original print for every region. Book scans, readings and reproducible scores
For newspaper proofreading, the review queue ranks paragraphs by disagreement between two OCR readings. Six repeated archive references affected its evaluation. The guide reports results with all references and with those six excluded. Review queue and source checks
Read the included example on CPU
hf download foliokestrel/folio-dutch-newspaper-ocr --local-dir dutch-reader
python -m pip install -r dutch-reader/requirements.txt
python dutch-reader/read_line.py dutch-reader/example.png
Pass one or more local filenames to the same command. The reader loads the model once and prints each transcription on its own line. On the included line the model reads Lenen afd Vecht where the archive has Loenen a/d Vecht. The example's archive transcription and model output are in example.json. For offline use, keep the full downloaded directory. The ONNX export accepts a single line of variable width. The repository also contains the frozen PyTorch weights in safetensors format and the network definition.
Results on unseen newspaper titles
All three readers saw the same 200 crops from 38 pages and five titles. References contain 6,018 characters. Dutch Tesseract was selected before the test by the lowest title-averaged validation character error rate of the two native candidates. Both native runs used single-line mode and 300 dpi.
| Reader | Character edits | Character error rate | Exact lines |
|---|---|---|---|
| Folio Dutch newspaper OCR | 321 | 5.33% | 89/200 |
| Tesseract Dutch | 1,419 | 23.58% | 28/200 |
| Tesseract Fraktur script | 1,536 | 25.52% | 33/200 |
The Folio reader made 3.65% character errors on 90 seventeenth-century lines, 9.42% on 54 eighteenth-century lines and 4.64% on 56 nineteenth-century lines. Exact-line accuracy across the test set was 44.5%. Review transcriptions that require exact spelling or punctuation. Title and century results describe this sample, which contains many headings, notices and short strings. Multi-line regions and full pages fall outside the evaluation. Per-title and per-century metrics · Line-level predictions
Training and selection
Folio Kestrel initialized the recognizer from its Swedish newspaper reader and added ten output classes found in the Dutch training transcriptions. The KB IMPACT training split contained 2,387 crops from 16 titles. Two rows had insufficient CTC time steps, leaving 2,385 usable training rows. The input height is 40 pixels. Training used AdamW at 0.00015, batch size up to 24 and seed 7321. Epoch 15 of 15 had the lowest mean title-level validation character error rate (6.28%). The choices were frozen before measuring the test set. Only five validation lines came from the eighteenth century. Training history · Frozen weights and selection record
The training guide includes commands to recreate the training inputs from the public crop dataset and rerun adaptation. The model weights and ONNX export use CC BY-SA 4.0. The Python code uses Apache 2.0. The KB scans and ground truth are public domain. Attribution and licenses