Open Source · Research

Tesseract's Hebrew, fine-tuned for real documents.

Tesseract is the OCR engine inside OCRmyPDF, Paperless-ngx and countless scripts. Its Hebrew models were trained in 2017 on clean, computer-rendered text, and it shows on scans, invoices and old print. We fine-tuned Google's own models on damaged synthetic documents and are releasing the result as one drop-in file, under Apache 2.0.

4.7% → 1.4%
Errors on real document lines
4.5% → 1.6%
The same, lines with numbers
3×
Fewer errors than Ubuntu's Hebrew model
In short
What it is
heb_rivok: a Tesseract 5 model file for printed Hebrew, with English and digits in the same model. Copy it into Tesseract's folder and use -l heb_rivok. No new software.
Accuracy
On 403 lines cut from real Hebrew documents, Ubuntu's standard Hebrew model gets 4.7% of characters wrong and heb_rivok 1.4%; on lines with numbers, 4.5% and 1.6%. It also beats the Google model it was fine-tuned from on every test, including two public benchmarks. Full comparison below.
Also
heb_rivok_lite: the same recipe applied to Tesseract's standard Hebrew model. Smaller and about three times faster per line; use it with +eng.
Licence
Apache-2.0, commercial use included, like the Google models it is built on.
Not for
Handwriting, Rashi script or cantillation marks. For single lines that mix Hebrew and English, see the limits.
01 — See the difference

The same page, read by each model

Each example is one page, read as a whole by Ubuntu's standard Hebrew model and by heb_rivok, with Tesseract's default settings. Two are real book pages, printed in 1872 and 1922. Two use text we wrote, set in fonts the model never saw in training and damaged the way paper gets damaged.

We chose these pages to show the errors heb_rivok fixes, and each one opens with the lines it reads better. Show all lines shows the rest, including the ones it gets wrong. Across all seven documents we wrote, not only the two shown, Ubuntu's model got 4.5% of characters wrong and heb_rivok 1.0%.

A bank letter, faxed: the whole page Whole page ↗
Ubuntu heb6.7%
heb_rivok1.4%

Characters read wrong, whole page. Of its 10 lines, heb_rivok reads 5 better, 2 worse and 3 the same.

Text we wrote, set in Miriam CLM, a font the model never saw in training, sent through a simulated fax: half the vertical resolution, pure black and white.

  1. Line 1: בנק הדוגמה בע״מ, סניף 642, רח׳ יפו 97, ירושלים
    Ubuntu heb

    בנק הדוגמה בע"מ, סניף 642, רח׳י יפור 97, ירושלים

    2 errors
    heb_rivok

    בנק הדוגמה בע"מ, סניף 642, רח' יפו 97, ירושלים

    ✓
  2. Line 2: לכבוד: מר יוסף כהן
    Ubuntu heb

    לכבוד: מר יוסף כהן

    ✓
    heb_rivok

    לכבוד: מר יוסף כהן

    ✓
  3. Line 3: הנדון: עדכון פרטי חשבון מס׳ 99-642-0458321
    Ubuntu heb

    הנדון: עדכון פרטי חשבון מס‘ON 99-+642-0458321

    4 errors
    heb_rivok

    הנדון: עדכון פרטי חשבון מסם׳ 99-642-0458321

    1 error
  4. Line 4: יתרת החשבון ליום 31.10.2026 עומדת על 18,452.37 ₪.
    Ubuntu heb

    יתרת החשבון ליוםOV? 31.10.2026 עומדת על 18,452.37 ₪.

    4 errors
    heb_rivok

    יתרת החשבון ליום 31.10.2026 עומדת על 18,452.37 ₪.

    ✓
  5. Line 5: הלוואה מס׳ 7781-22 תיפרע ב־36 תשלומים של 1,240.00 ₪.
    Ubuntu heb

    הלוואה מס‘ON 7781-22 תיפרע ב-36 תשלומים של 1,2480.00 ₪.4

    6 errors
    heb_rivok

    הלוואה מס׳ 7781-22 תיפרע ב־36 תשלומים של 1,240.00 ₪.

    ✓
  6. Line 6: הריבית השנתית: פריים + 1.5% (סה״כ 7.5%).
    Ubuntu heb

    הריבית השנתית: פריים + 1.5% (סה"כ 7.5%).

    ✓
    heb_rivok

    הריבית השנתית: פריים + 1.5% (סה״"כ 7.5%)(.

    2 errors
  7. Line 7: לבירורים: 03-1234567, שלוחה 4, בימים א׳-ה׳ בין 08:30 ל־15:00.
    Ubuntu heb

    לבירורים: 035-12354567, שלוחה 48, בימים א'-ה' בין 08:30 ל־15:/00.77

    8 errors
    heb_rivok

    לבירורים: 03-1234567, שלוחה 4, בימים א׳״-ה׳ בין 08:30 ל־15:00.

    1 error
  8. Line 8: אנא שמרו מכתב זה לתיעוד.
    Ubuntu heb

    אנא שמרו מכתב זה לתיעוד.

    ✓
    heb_rivok

    אנא שמרו מכתב זה לתיעוד.,

    1 error
  9. Line 9: בכבוד רב,
    Ubuntu heb

    בכבוד רב,

    ✓
    heb_rivok

    בכבוד רב,

    ✓
  10. Line 10: מחלקת שירות לקוחות
    Ubuntu heb

    מחלקת שירות לקוחות

    ✓
    heb_rivok

    מחלקת שירות לקוחות

    ✓

wrong or extra missing typographic variant, not counted Spaces before punctuation are not counted either: old print sets one before every comma, modern transcriptions don't.

02 — The comparison

Against what you have, and against where it started

Almost everyone who runs Tesseract on Hebrew uses the same model: Google's small "fast" heb, the file Ubuntu, Debian and Homebrew install and the OCRmyPDF and Paperless-ngx Docker images include. So the first comparison is the file you have against the file you can download.

The file you have against the file you can download
TestUbuntu hebheb_rivok
403 lines from real documents, Hebrew only4.7%1.4%
The same, lines with numbers4.5%1.6%
GlotOCR-bench Hebrew, clean images (many with niqqud)21.2%18.5%
GlotOCR-bench Hebrew, "old document" images34.0%30.1%
HaZefira newspaper, 1874/1887: 4,013 lines17.5%9.9%
HaZefira: 34 pages, words found (higher is better)67.6%81.3%
HaZefira: 34 pages, words wrong or out of reading order47.9%32.3%
209 lines mixing Hebrew and English19.3%14.0%
Our seven example documents4.5%1.0%

But heb_rivok does not start from that model. It starts from Google's biggest Hebrew model, script/Hebrew, which also reads English, so part of the gain could simply be the bigger model. The second table isolates our training: the same network with the same starting weights, before and after fine-tuning, both in full precision.

Same network, before and after our fine-tuning
TestGoogle script/Hebrewheb_rivok (full precision)
403 lines from real documents, Hebrew only4.0%1.4%
The same, lines with numbers3.5%1.6%
GlotOCR-bench Hebrew, clean images (many with niqqud)20.7%18.0%
GlotOCR-bench Hebrew, "old document" images31.8%29.5%
HaZefira newspaper, 1874/1887: 4,013 lines14.3%9.9%
HaZefira: 34 pages, words found (higher is better)75.5%81.2%
209 lines mixing Hebrew and English16.4%14.2%

Character error rate unless marked: the share of characters read wrong, missed or added; lower is better. "Words found" is word F1 against the page's own text. Line tests use --psm 13, pages Tesseract's default. Ubuntu's heb runs with +eng on pages and mixed lines. The download is the int8 file, the same type as Ubuntu's; the full-precision file is in the release for anyone who wants to fine-tune further.

The same recipe on Tesseract's standard Hebrew model

Before moving to the bigger model, we fine-tuned Google's standard Hebrew model, tessdata_best heb. Its third round beats both stock Hebrew models on every test, so we are releasing it too, as heb_rivok_lite. It is smaller and faster, and needs +eng for English.

heb_rivok_lite against Ubuntu's heb and against tessdata_best heb, the model it was fine-tuned from
TestUbuntu hebtessdata_best hebheb_rivok_lite
403 lines from real documents, Hebrew only4.7%4.0%1.9%
The same, lines with numbers4.5%4.3%1.6%
GlotOCR-bench Hebrew, clean images (many with niqqud)21.2%24.6%20.6%
GlotOCR-bench Hebrew, "old document" images34.0%33.5%32.3%
HaZefira newspaper, 1874/1887: 4,013 lines17.5%17.7%14.1%
HaZefira: 34 pages, words found (higher is better)67.6%69.7%76.6%
About these numbers

GlotOCR-bench (LMU Munich) and HaZefira (Open University of Israel) are public: anyone can rerun them, and our scripts are in the repository. The other sets are ours. The 403 lines are cut from real documents whose owners did not agree to publication, so they stay private. None of the test images were used in training.

03 — How we made it

No real documents, only realistic damage

The model never saw a real document in training. Every training image is a line we generated: 60,000 of them, from Tesseract's own Hebrew training text and from lines we wrote to look like documents: prices in ₪, dates, phone numbers, abbreviations such as ש״ח and עו״ד, Hebrew with English terms, web addresses and citations.

Each line is drawn in one of 50 open fonts and then damaged the way paper gets damaged: blur, low resolution, noise, JPEG, speckles, binarisation, letterpress ink, a slight tilt, underlines, and slivers of the neighbouring lines. Tesseract's own training tool then continues training Google's model on those images. That is a fine-tune, not a new model, and it took about two and a half hours on an ordinary 4-core CPU.

The detail that mattered

Tesseract's training files store a line in the order it is drawn on the page, not the order it is read. For Hebrew with English or brackets inside, that order is easy to get subtly wrong, and the model faithfully learns the mistake. Our first round learned to flip brackets. Getting those labels right was half the work.

  1. Round 1: new characters

    Google's standard Hebrew model, taught maqaf ־, geresh ׳ and gershayim ״, which the stock models cannot output. Better on numbers, but the bracket labels were wrong.

  2. Round 2: realistic damage

    Labels fixed; neighbouring lines, underlines and old letterpress print added. Errors on real lines fell by more than half, but it got worse on text with niqqud (vowel marks): a filter had dropped most training lines that had them.

  3. Round 3: niqqud kept → heb_rivok_lite

    The lines with niqqud restored. Better than both stock Hebrew models on every test.

  4. Round 4: the bigger model → heb_rivok

    Started from Google's script/Hebrew, which already reads English, and added Hebrew lines with English inside. Best on every test.

04 — Limits

What it still gets wrong

Pages with more than one column: fixed in version 1.0.1

Tesseract decides whether a model reads right to left by counting its characters. heb_rivok knows the 52 English letters, and version 1.0 had only 33 Hebrew characters, so Tesseract laid its pages out left to right and read the left column of a page first. Version 1.0.1 adds 23 Hebrew characters the model never outputs. The network is unchanged and reads exactly the same text, and the columns now come out right to left. On 34 pages of a 19th-century newspaper, counting words in reading order, 32% are wrong or out of place, against 88% for version 1.0 and 48% for Ubuntu's heb. Still on 1.0? Download the new file, or use -l heb+heb_rivok.

Short lines that mix Hebrew and English

When Tesseract reads a line on its own (--psm 7 or 13), or a short line forms its own paragraph on a page (a heading, a table cell), it picks the line's direction by counting words, and a tie goes to left-to-right. A short Hebrew line holding as many English words as Hebrew ones then comes out with the English first, as in the line below. That is Tesseract's code, not the model: Google's own models do the same, and we have reported it upstream (tesseract#4680). Long paragraphs are not affected. On 209 real mixed lines the error rate is 14.2% as Tesseract orders the words and 4.9% with the same words put back in right-to-left order.

  1. הרצאה על Machine Learning
    Correct

    הרצאה על Machine Learning

    heb_rivok, one line

    הרצאה על Machine Learning הרצאה על

    paddleocr-hebrew

    הרצאה על Machine Learning

If your documents are full of such lines, try paddleocr-hebrew, our deep-learning Hebrew OCR. It assembles each line in Hebrew reading order: 3.6% on the same 209 lines. It is a heavier pipeline and much slower on a CPU: about 55 seconds per page against 6.4 for heb_rivok on a 4-core desktop. On an NVIDIA GPU it is fast. On old print the two are level (9.9% each on the HaZefira lines).

Everything else

  • Line crops: use --psm 13, not --psm 7. Tesseract's line finder throws away crops with an underline or with pieces of the neighbouring lines before the model sees them.
  • Niqqud (vowel marks): the 12 common marks are read; cantillation marks (טעמים) are not.
  • Not trained for: Rashi script, handwriting, decorative display fonts.
  • Speed: the bigger network costs time. About a quarter of a second per line against under a tenth for Ubuntu's heb; on whole pages 6.4 against 5.2 seconds. heb_rivok_lite runs at the standard model's speed.
05 — Get it

One file, no new software

What's in the release
FileUseSize
heb_rivok.traineddataHebrew + English + digits. Start here.5.7 MB
heb_rivok_lite.traineddataHebrew + digits, faster. Use with +eng.3.4 MB
tessdata_best/…Full-precision versions of both, for your own fine-tuning12.3 / 6.0 MB
# download, then compare with the SHA-256 on the release page
sha256sum heb_rivok.traineddata

# copy it next to Tesseract's other models
# (tesseract --list-langs prints the folder)
sudo cp heb_rivok.traineddata /usr/share/tesseract-ocr/5/tessdata/

tesseract page.png out -l heb_rivok
ocrmypdf -l heb_rivok scanned.pdf searchable.pdf

Version 1.0.1: pages with columns now come out right column first; the text it reads is unchanged from 1.0.

Apache-2.0. Built on Google's tessdata_best models and Tesseract's training text, both Apache-2.0. The training scripts and the full recipe are in the repository. Questions or collaboration: open an issue or write to [email protected].

06 — Questions

Common questions

Do I still need +eng?

Not with heb_rivok: English is in the model, and adding eng only slows it down. heb_rivok_lite is Hebrew only, so use -l heb_rivok_lite+eng when your documents contain English.

Which one should I use?

heb_rivok is the more accurate on every test. Choose heb_rivok_lite when speed matters more, for example when reading many single lines.

heb_rivok or paddleocr-hebrew?

heb_rivok if you already use Tesseract or OCRmyPDF and want one file that drops in. paddleocr-hebrew if you need mixed Hebrew and English lines in the right order, or receipts, and can afford a slower pipeline or have a GPU.