Rashi script OCR, tested on 20 pages
43.9%
of Rashi letters wrong, Tesseract heb
Square letters pass, Rashi letters fail
| Reader | Rashi | Square |
|---|---|---|
| Tesseract heb | 43.9% | 0.2% |
| heb, tessdata_best | 43.9% | 0.4% |
| script/Hebrew | 48.7% | 0.1% |
| script/Hebrew, best | 46.8% | 0.0% |
| Our Actor's page code | 45.1% | 0.0% |
| Apple Vision | 100% | 100% |
Letters wrong: missed, extra or swapped letters per 100 true letters. The same words and the same scan noise. Only the letter shapes, and so the line breaks, change.
- Apple Vision on macOS 26.6 has no Hebrew. It found 0 Hebrew letters.
- This is a modern font, not old print. Worn type and show-through, I did not test.
It reads Rashi as square look-alikes
| Text | Genesis 2:2, first words |
|---|---|
| True | ויכל אלהים ביום השביעי |
| Tesseract heb | ויכל סכסיס כיוס ססכיעי |
| After the fine-tune | ווכ: אמהים ביום השביעי |
Many Rashi letters come out as another square letter. The most common swaps, Tesseract heb on 20 pages:
| True letter | Read as | Times |
|---|---|---|
| ה | ס | 1,166 |
| ב | כ | 803 |
| א | ס | 627 |
| ש | ס | 581 |
After the fine-tune, the top swap is י read as ו, 372 times.
A 3-minute fine-tune: 8.2% wrong
43.9% heb best, the start
8.2% after 2,000 iterations, 3 min
9.8% after 6,000 iterations, 6 min
I fine-tuned tessdata_best heb with tesstrain on 400 lines of Rashi on Genesis 21 to 40. No test page shares their text.
gmake training MODEL_NAME=heb_rashi START_MODEL=heb \
TESSDATA=tessdata LANG_TYPE=RTL MAX_ITERATIONS=2000
-
Put tessdata_best heb in
tessdata.LANG_TYPE=RTLalso needspip install python-bidi. Full setup: my train page, linked below. - It got worse at square letters: 0.4% to 2.6% wrong. Keep heb for square pages.
- More training did not help. In a first run, before a text fix, 6,000 iterations beat 2,000 by 1 point. Call it noise.
- The lines use the test font. For old print, cut your own.
Find the Rashi pages by confidence
53.3 to 59.9 Rashi pages
91.3 to 92.2 square pages
Our Actor gives each OCR page a meanConfidence, the
average word confidence from 0 to 100. On these 40 pages the two fonts
never met.
So read a mixed book with heb, sort the pages by that field, and send the low ones to a Rashi model or a person. I did not test pages with both scripts, or bad scans.
Hebrew scans in one call
Our Apify Actor, PDF to Markdown OCR, reads scanned PDFs and images with Tesseract. Set the language to Hebrew. It reads Rashi no better than Tesseract does.
- $0.006 per OCR page, plus $0.00005 a run at the default 1 GB.
- Runs bill to your Apify account. Files go to Apify's servers.
- I ran its page code, build 0.1.146, on this Mac, not on Apify.
What I tested, and what I did not
How I tested
- Text: the first 260 words of Rashi on Genesis 1 to 20 from Hebrew Wikisource (chapter 5 has 225). Points and cantillation removed.
- Fonts: Noto Rashi Hebrew and Noto Serif Hebrew, both OFL 1.1, at 12 pt on A4 at 300 dpi.
- Scan look: a turn under 0.6 degrees, blur, noise and JPEG quality 70, the same for both fonts of a page.
- Score: Hebrew letters only, final forms kept apart. Points, punctuation and spaces do not count.
- Tesseract 5.5.4 at psm 3, one thread, tessdata models 4.1.0. Apple Vision accurate, language detection on.
- Fine-tune: tesstrain 405346a, 400 lines of 7 words (it keeps 40 to check), the same scan look, 2 threads.
- Apple M5 Max, macOS 26.6, shared with another job.
Not tested
- Real old print, vowel points, or small type.
- Kraken, eScriptorium, Transkribus or a hosted Hebrew OCR.
- A fine-tuned model on pages in another Rashi font.
Sources
- Rashi on Genesis, Hebrew Wikisource
- Noto Rashi Hebrew, OFL 1.1
- tesstrain on GitHub, Apache-2.0
- We make the Apify Actor, not Tesseract.
Questions people ask
Can Tesseract read Rashi script?
Not with its stock Hebrew models, on my pages. heb, heb best and script/Hebrew got 43.9% to 48.7% of the letters wrong on my Rashi pages. A fine-tune of heb best on 400 Rashi lines cut it to 8.2%.
Does Apple Vision read Hebrew?
Not on macOS 26.6. Its text reader lists 30 languages, and Hebrew is not one. On 40 Hebrew pages it found 0 Hebrew letters.
What is Rashi script?
A semi-cursive Hebrew typeface. Printers used it for commentaries, and it is named after Rashi, whose commentary is often printed in it. It has the same 22 letters and 5 final forms as square Hebrew, in other shapes.
Related guides
- Tesseract Hebrew OCR: heb vs heb+eng on 30 real scans
- Train Tesseract on a new font: tesstrain fine-tune, tested
- Fraktur OCR with Tesseract: 6 models tested on old German
- Transcribe historical documents with OCR: 3 tools tested on 20 typed pages
- Kraken OCR on a scanned PDF: Mac setup and results, tested