Tesseract and Dutch: nld fixes a third of eng's wrong words
95%
of Dutch words right with -l nld
One flag: 92.2% to 94.7% of words
Proofread pages from 15 scanned Dutch books, printed 1789 to 1921:
| Model | Words right | Letters right |
|---|---|---|
-l eng, the default |
92.2% | 98.3% |
-l nld |
94.7% | 98.8% |
681 words wrong with eng
460 words wrong with nld
Dutch is mostly plain a to z, so eng reads the letters. Only 55 of the 43,636 letters here carry a mark. nld was trained on Dutch, so more words come out whole.
What eng does to Dutch words
Real words from these scans. Each time, nld read it right:
| Printed | eng read | Times |
|---|---|---|
| een | cen | 10 |
| en | on | 6 |
| uit | uif | 6 |
| eene | cene | 5 |
| van | yan | 5 |
nld got fewer words wrong than eng on 25 of the 30 pages, and more on 3.
Old print: the long s reads as f
Three books here, printed 1789, 1811 and 1855, use the long s (ſ), which looks like an f. The wiki text writes it as s. Words right:
| Pages | eng | nld |
|---|---|---|
| 24 pages without it | 96.2% | 98.3% |
| 6 pages with the long s | 71.0% | 76.0% |
On those pages, nld printed f for 80 of the 228 letters s. Every model here did it 59 times or more.
Install nld, then pass -l nld
-
Debian or Ubuntu:
sudo apt install tesseract-ocr-nld -
macOS:
brew install tesseract-lang, all languages - Check:
tesseract --list-langsshows nld
This writes page.txt:
tesseract page.png page -l nld
In Python:
import pytesseract
print(pytesseract.image_to_string("page.png", lang="nld"))
Adding eng helps Dutch a little
Each against plain nld, which took 0.8 seconds a page:
| Setting | Words right | Sec a page |
|---|---|---|
-l nld+eng |
95.2% | 1.1 |
-l eng+nld |
95.2% | 1.1 |
| nld from tessdata_best | 94.7% | 1.0 |
| script/Latin, for all Latin-alphabet languages | 92.6% | 1.2 |
nld+eng got fewer words wrong than nld on 16 pages, and more on 2. For
the last few words, pass -l nld+eng.
How I tested it
- Pages: nl.wikisource scans whose text was proofread (level 3) or also checked by a second person (level 4). Books picked by a seeded shuffle, not by me, 2 pages a book. Pages with notes, poems or tables were skipped.
- Each page has 1,000 or more letters, and common Dutch words make up 20% or more of its words. So French, German and Latin pages stayed out.
- Each page passed a check that a model in no row above (eng from tessdata_best) finds 80% of the wiki's letters on the scan, marks aside. So the wiki text is the text on the scan.
- 30 pages, 43,636 letters, 8,729 words.
- Dates come from the wiki's page for each book.
- Each scan is the wiki's page image: 18 at 1,920 px, 6 at 1,280 px, 6 at 960 px, never wider than the scan itself.
- Running heads and page numbers cost nothing.
- Tesseract 5.5.4, one thread. Models from tessdata_fast 4.1.0, the files Homebrew installs, and tessdata_best 4.1.0.
Our Actor has no Dutch option
Our Apify Actor reads scans with Tesseract too, but its Language input has no Dutch. It starts at English. On these 30 scans, live build 0.1.44:
90.0% of words right, left at English
94.7% with plain Tesseract and -l nld
English was its best input. One two-column page cost it half of that
page's letters. For Dutch scans, use plain Tesseract with
-l nld.
What I did not test
- Phone photos, faxes, and scans under 960 px wide.
- Books printed after 1921.
- Gothic type. See the Fraktur test.
- Handwriting. See this test.
- Other languages. German, French and Czech have their own tests.
- Windows and Linux. One Mac.
Sources
Two ways to skip the work
Run it yourself. Our Apify Actor turns scanned PDFs into Markdown, tables included.
Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. First page free.
Questions people ask
Does Tesseract read Dutch?
Yes, with the nld model. On 30 proofread scans it read 98.8% of the letters and 94.7% of the words right.
Is eng good enough for Dutch?
For letters, nearly: eng read 98.3% of them. For words, nld is better: eng got 681 words wrong here, nld 460.
Why does Tesseract read old Dutch s as f?
Old Dutch print uses the long s (ſ), which looks like an f. On 6 pages printed 1789 to 1855, nld printed f for 80 of the 228 letters s.