OCR for cropped lines and paragraphs in early Dutch books
This reader transcribes horizontal printed text from a supplied image region. It preserves case, punctuation and historical spelling and expands long s and common typographic ligatures. The ONNX checkpoint runs on CPU. The paragraph command detects lines and returns both the reading and the line boxes.
Read a line in your browser
Open the example or choose your own scan, select a printed line and transcribe it on your device. Check the reading against the original print, edit the text and download your transcription. Open the Dutch book reader
Start with a scanned PDF
Prepare numbered line crops from selected PDF leaves, then check their reading order against the scan. Use the offline editor to draw a box around a missed heading or remove text from a facing page. The paired proofreading sheet shows each crop beside the Folio and Dutch Tesseract readings and exports the lines you check. Try the three-page editor · PDF setup and example · Download the offline editor
Export the lines you checked as PAGE XML or a searchable PDF. The three-leaf example includes a corrected heading on the tilted page. The optional word-alignment tool places search highlights over individual printed words. PAGE XML export · Searchable PDF and example · Word-positioned highlights
Read a four-leaf selection from the 1806 constitution as a reflowable ebook. Each transcription links to its scan. Download the EPUB or build a reading edition
Try it locally
hf download foliokestrel/folio-dutch-book-ocr --include model.onnx --include config.json --include read_book.py --include 'examples/*' --local-dir book-reader
python -m pip install "https://huggingface.co/foliokestrel/folio-dutch-newspaper-ocr/resolve/a43fb4212eac0300d2dd48ac29b8d5da8a286dc0/python/folio_dutch_newspaper_ocr-0.1.0-py3-none-any.whl#sha256=3cac5d959510295061d62efac06f04dbfb3253665380840eec6be235f2800068"
python book-reader/read_book.py book-reader/examples/line.png
python book-reader/read_book.py --paragraph book-reader/examples/paragraph.png
The wheel supplies the CPU runtime, normalization and Dutch Tesseract layout model. The script loads the book checkpoint from the directory alongside it. Both commands work offline after installation. Replace the example with your own cropped region. For pages with multiple columns or marginal notes, locate each text region separately. Box coordinates are in pixels relative to the orientation-normalized paragraph image, with exclusive right and bottom edges. Source text and worked outputs
Check a reader on your book
Compare the original Folio model and Dutch Tesseract on pages you have transcribed. The offline report shows the scan beside both readings. On 46 checked lines from Multatuli’s 1879 edition, Tesseract made 56 character edits and Folio made 77. Folio made fewer edits on both earlier Dutch book panels. Compare your readers · 1879 scans, references and scores
Adapt the reader to one volume
Use the offline editor to save line crops and checked text, then train on CPU. With 32 corrected lines from the 1630 book, character edits fell from 1,527 to 1,104 on 24 separate pages. On the 1791 volume, edits fell from 366 to 280. Counting equivalent hyphens alike reduced the latter gain to six edits. Prepare corrections · Download the CPU kit · Training guide · 8, 16 and 32 corrected lines compared
Proofread a paragraph offline
Open the example HTML in the kit to inspect the scan, edit its transcription and export your corrections. On 58 fresh paragraphs from the two held-out titles, 418 of 661 low-confidence words selected for review were incorrect. A separate word alignment counted 257 reference-only tokens. Character alignment preserved every character for 133 of those tokens. Use the complete scan to distinguish missing text from punctuation and spacing differences. Download the review kit · Instructions and evaluation inputs · Scan audit of apparent omissions
Results on held-out titles
To score your own OCR against the same archive text, supply one transcript per region. The evaluator includes all 307 baseline readings and reports results by title. Offline scorer and prediction format
The book checkpoint made fewer character edits than the newspaper checkpoint on both held-out books, for both single lines and paragraphs. Across the 89 paragraphs it reduced edits from 2,250 to 2,036, but every paragraph still needed a correction. The 1630 title was harder for the book reader (1,524 edits in 12,595 characters, 12.10% CER) than the 1791 title (512 in 15,926, 3.21%). On the newspaper test the book checkpoint made six additional edits and returned four fewer exact lines. These results support a separate book checkpoint for similar print.
| Test material | Regions | Reference characters | Book model CER (exact) | Newspaper model CER (exact) | Dutch Tesseract CER (exact) |
|---|---|---|---|---|---|
| Book lines | 60 | 1,491 | 5.50% (32) | 6.30% (25) | 12.68% (8) |
| Book paragraphs | 89 | 28,521 | 7.14% (0) | 7.89% (0) | 11.82% (0) |
| Newspaper lines | 200 | 6,018 | 5.43% (85) | 5.33% (89) | 23.58% (28) |
The book test comprises 96 pages from two catalogue titles, one from 1630 and one from 1791. The original newspaper test comprises 200 lines from 38 pages and five titles. For book paragraphs, both Folio checkpoints used the same line detector and separation routine. Dutch Tesseract used single-block mode on the complete region. Single lines used single-line mode in Tesseract. Each reader saw identical source-region pixels. CER counts case-preserving insertions, deletions and substitutions relative to archive text. Exact matches require the entire normalized reading. Individual source references and readings · Per-title metrics
Where the training data came from
Folio Kestrel started from its Dutch newspaper recognizer. The adaptation mixed 1,798 distinct book line targets from three titles printed in 1789, 1791 and 1796 with 900 original newspaper training lines. Of the book targets, 247 have an archive polygon for a single printed line. The other 1,551 use the archive's paragraph text and estimated line boxes. One of the 2,698 targets had insufficient CTC frames. The vocabulary and image height of 40 pixels were retained. No seventeenth-century book contributed training lines.
Checkpoint selection gave equal weight to book single-line title-average CER, book paragraph title-average CER and pooled newspaper validation CER. Epoch 2 gave the lowest combined score. The checkpoint was frozen before test recognition. Training and validation packs were rebuilt from exported image parquet and checked against the exact PNGs used for fitting. Reproduction commands · Validation history · Selection record
The book scans and transcriptions come from the public-domain KB IMPACT collection. The weights and ONNX export retain the initializer's CC BY-SA 4.0 license. Python code is Apache 2.0. Attribution and licenses