Tesseract and Hebrew: heb alone beats heb+eng
92%
of Hebrew letters right with -l heb
One flag: 0% to 91.6%
Proofread pages from 10 scanned Hebrew books, printed 1872 to 1934:
| Model | Letters right | Words right |
|---|---|---|
-l eng, the default |
0.0% | 0.0% |
-l heb+eng |
83.0% | 66.6% |
-l heb |
91.6% | 72.5% |
0 of 27 Hebrew letters in eng's model
20 of 30 pages 90% right or better with heb
The 27 letters are the 22 plus the 5 final forms. A word counts only when every letter in it is right.
heb+eng was worse on all 30 pages
You might add eng in case a page has English on it. These pages hold 6 Latin letters in all.
6,162 Latin letters heb+eng printed
0 Latin letters heb printed
With eng loaded, Tesseract read bits of Hebrew print as English. For pages in Hebrew only, leave eng out.
Its top slip: ד as ר
The letters heb swapped most often on these pages:
| Printed | heb read | Times |
|---|---|---|
| ד | ר | 410 |
| ב | כ | 220 |
| י | ו | 194 |
| מ | ט | 174 |
| ה | ח | 137 |
142 of the 182 ד in one 1923 book came out as ר. Its ד has a small, round corner.
Install heb, then pass -l heb
-
Debian or Ubuntu:
sudo apt install tesseract-ocr-heb -
macOS:
brew install tesseract-lang, all languages - Check:
tesseract --list-langsshows heb
This writes page.txt, in reading order:
tesseract page.png page -l heb
In Python:
import pytesseract
print(pytesseract.image_to_string("page.png", lang="heb"))
tessdata_best barely helps
Each against plain heb, which took 0.7 seconds a page:
| Setting | Letters right | Sec a page |
|---|---|---|
| heb from tessdata_best | 92.0% | 0.9 |
| script/Hebrew, for all Hebrew-alphabet languages | 88.8% | 0.8 |
-l eng+heb |
82.9% | 1.8 |
The best model read fewer letters than plain heb on 10 of 30 pages.
How I tested it
- Pages: he.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, up to 4 pages a book. Pages with notes, poems or tables were skipped.
- Each page is plain print with 1,000 or more Hebrew letters. Pointed pages (vowel points on more than 2% of the letters) and Yiddish stayed out.
- Each page passed a check that a model in no row above (script/Hebrew from tessdata_best) finds 80% of the wiki's letters on the scan. So the wiki text is the text on the scan.
- 30 pages, 45,385 letters, from 10 books.
- The wiki has few scanned books with clean proofread pages, so 7 books gave 3 or 4 pages each. Two books have no date.
- Each scan is the wiki's page image: 16 at 1,920 px, 9 at 1,280 px, 5 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 Hebrew option
Our Apify Actor reads scans with Tesseract too, but its Language input has no Hebrew. It starts at English. On these 30 scans, live build 0.1.44:
0.0% of Hebrew letters right, left at English
0.0% with Arabic, its one right-to-left input
For Hebrew scans, use plain Tesseract with
-l heb.
What I did not test
- Pages that mix Hebrew and English.
- Vowel points, Rashi script, Yiddish, and books printed after 1934.
- Phone photos, faxes, and scans under 960 px wide.
- Other right-to-left text. Arabic has its own test.
- 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 Hebrew?
Yes, with the heb model. On 30 proofread scans it read 91.6% of the letters right. A word counts only when every letter is right: 72.5% of words.
Does Tesseract print Hebrew backwards?
No. With -l heb the text came out in reading order, right to left. Flip each line, and only 13.3% of the letters match.
Is tessdata_best better for Hebrew?
A little. heb from tessdata_best read 92.0% of the letters, against 91.6% for the fast model, and took 0.9 seconds a page against 0.7.