Hebrew printed-text recognition for Tesseract, fine-tuned from tessdata_best heb on real public-domain NLI scans with Project Ben-Yehuda text (HeOCR R6)
Year: 2026
Type: article
Abstract: HeOCR R6: Hebrew printed-text recognition for Tesseract R6 is a Tesseract language model (.traineddata) for printed modern Hebrew. HeOCR made it by fine-tuning Tesseract's own heb model from tessdata_best on 13,648 real scanned lines. The lines come from public-domain books in the National Library of Israel's "public domain, free use" collection. Each line is labelled with the Project Ben-Yehuda transcription of the same edition, never with OCR output. It is a small, measured improvement on stock Tesseract for printed Hebrew pages, not a new engine. On 38 real printed pages with human-adjudicated references it lowers the character error rate (CER) from 0.226 to 0.209. On the 10 hardest of those pages it gains nothing (see Evaluation). It is released on its own, with no link to HeOCR's kraken pipeline (R4d, A1, R3h). File heocr_r6.traineddata (trained as heb.traineddata), 3,628,595 bytes sha256 73eb18e03f8793dff9c03699db0845779f6b5db4897824bcd61787245ec66e10 Model type recognition (line-level LSTM, CTC); Tesseract does the page layout Format Tesseract 4/5 LSTM traineddata, LSTM only (--oem 1; no legacy engine). Trained and tested with Tesseract 5.5.3 Base model tessdata_best heb.traineddata at e12c65a (Apache-2.0), sha256 dbaa827aea6bc21215638447f17783a1004987c2d0bf5573d111fee397abdae5, fine-tuned (modified) by HeOCR Licence Apache-2.0, Copyright (c) 2026 HeOCR maintainers (see LICENSE and NOTICE) Training record r6_training_run.json (heocr_tesseract_training_run.v1) Code HeOCR/heocr-engine Uses OCR of printed Hebrew pages, books and periodicals in the square script, such as early-20th-century book type, without niqqud. Use it in place of Tesseract's heb. Line recognition of single printed Hebrew line images, for example lines found by another segmenter. A research baseline for Hebrew OCR on real scans. Out of scope Handwriting. R6 was trained on print only. Niqqud (vowel points) and cantillation. The training labels have none (see Training data). How R6 behaves on pointed text was not measured. Rashi script and other non-square Hebrew scripts, and medieval or other historical hands. Unsupervised transcription. Its CER on real pages is still about 0.21 (one character in five). Check the output. Documents that are not mainly Hebrew. No Latin text was in the training lines. How to get started with the model Install Tesseract 4 or 5 (tested with 5.5.3). Put heocr_r6.traineddata in a directory, say DIR, and pass that directory and the language name heocr_r6. Whole pages: page segmentation mode 3 (automatic layout, Tesseract's default). The page figures below use it. tesseract page.png out -l heocr_r6 --tessdata-dir DIR --psm 3 This writes out.txt, in logical (reading) order. Single line images: psm 13 (raw line). Do not use psm 7 on line crops. On crops that carry a sliver of the neighbouring line, psm 7 returns empty text, with stock heb and with R6 alike: this happened on 473 of 4,046 lines of one held-out book. tesseract line.png out -l heocr_r6 --tessdata-dir DIR --psm 13 Notes: - --tessdata-dir replaces Tesseract's data directory. Output formats other than plain text (tsv, hocr, pdf, alto) read their config files from DIR/configs. Link or copy the configs folder of your Tesseract installation into DIR, or put heocr_r6.traineddata in your installation's own tessdata directory and drop --tessdata-dir. - The language name is the file name without .traineddata. heocr_r6 follows tessdata's naming (chi_sim, deu_latf). It combines with other models in the usual way, for example -l heocr_r6+eng, which runs but was not evaluated. Training details Training data Lines: 13,648 real line images, the train split of HeOCR's bynli_lines_v1 line set (Ben-Yehuda × NLI). They were cut from NLI scans of five books, in which 99.9% of the lines come from three: NLI record Book Lines 990020308000205171 Yeshayahu Berashadsky (1871–1908), Ketavim Aharonim, Warsaw: Tushiya, 1910 6,076 990020495520205171 Shmuel Leib Citron (1860–1930), Me-Ahorei ha-Pargod, Vilna: Z. Matz, 1923–1925 6,052 990020522850205171 Shmuel Tchernowitz (1879–1929), Im Shahar, Jerusalem: Ha-Madpis, 1927 1,511 990019385920205171 Azriel Natan Frank (1863–1924), Sefer Agadot ha-Zohar, Warsaw: Ahiasaf, 1923–1924 8 990013538860205171 Yitzhak Katzenelson (1885–1944), Shirim, Lodz: Hovevei Shira, 1938 1 Scans: From the collections of the National Library of Israel / מאוסף הספרייה הלאומית. Each record's IIIF manifest carries NLI's "public domain, free use" licence. They were fetched from NLI's IIIF service. No Google-digitized "non-commercial use" scan was used. Text: the Project Ben-Yehuda public-domain transcription of the same edition (public domain dump, release 2026-03), placed on each scanned line by HeOCR's alignment tool (hocrgen F8f). Lines were kept only where the alignment scored at least 0.9 and its text agreed with Tesseract's reading of the line at a similarity of at least 0.7. Tesseract only located the lines and chose between candidate spans at a line's edges; no label is OCR output. Label normalisation: Unicode NFC, logical order. Niqqud removed; … written as ..., " as ", soft hyphens removed. The training labels contain no niqqud and no Latin letters; 90 of them contain digits. Pointed prints dropped: two fully pointed books (Mahamadim, Mandelkern) were left out. Shirim keeps one short line, with its niqqud removed. Edition spelling: Ben-Yehuda's text sometimes differs from the print (for example אתה for a printed אותה). Such variants are in the labels; Tchernowitz has the most, at 5.7% of words. All authors died more than 70 years ago, so the books are in the public domain in Israel. The four books printed before 1931 are also past the US term. Shirim (1938, one line) has no established US status. Selection lines (not trained on): 7,092 lines of two further NLI "public domain, free use" books, held out whole: Kadish Yehuda Silman (1880–1937), Sansinim, Tarbut, 1929 (990020250940205171, 3,046 lines), and Reuven Brainin (1862–1939), Avraham Mapu: Hayav u-Sfarav, Tushiya, 1928 (990018546440205171, 4,046 lines). Training procedure and hyperparameters Start: tessdata_best heb (e12c65a), its LSTM extracted with combine_tessdata. The network is the base's own, unchanged: [1,36,0,1Ct3,3,16Mp3,3Lfys48Lfx96Lrx96Lfx192O1c1]. Character set: the base's, plus the maqaf ־ and the en dash –. The output layer grew from 69 to 70 codes. The dictionary is the base's own word list, rebuilt with Tesseract's build files from langdata_lstm 07930fd (Apache-2.0). Truth order: each label is written in Tesseract's LSTM training order: the logical line reversed, punctuation not mirrored, digit runs kept left to right. Each line was converted to .lstmf with tesseract … --psm 13 lstm.train. Trainer: lstmtraining --continue_from the base, Tesseract 5.5.3, on CPU. Two arms of 100,000 iterations each (--target_error_rate 0.01): lrdef: the learning rate stored in the base, not set on the command line; lr1e4: --learning_rate 0.0001 --reset_learning_rate. Selection: the checkpoint with the lowest BCER (lstmeval) on the selection lines, over all 96 saved checkpoints of both arms. That is lrdef at iteration 54,500 (heb_0.603_16919_54500): BCER 2.03%, BWER 5.30%. On the same lines tessdata_best scores 11.45% / 23.34%. The best lr1e4 checkpoint scored 2.14% / 5.81%. Conversion: lstmtraining --stop_training to heb.traineddata, renamed heocr_r6.traineddata for release (same bytes). One training run. It is not deterministic, and the bytes are not reproducible. Evaluation Real pages Testing data: E2d4c, 38 real printed Hebrew pages from 14 Hebrew Wikisource Indexes, with human-adjudicated references (hocrgen manifest e2d4c_wikisource_printed_v7). They are a scored set under heocr-engine decision 0012: no training, tuning or checkpoint choice used them, R6 was scored on them once after selection, and their works are held out of training. Metric: CER and WER under hocrgen's primary.v1 normalisation (hocrgen d4a3414 evaluate-references), pooled over pages. Every engine reads whole pages with Tesseract 5.5.3, psm 3. Intervals: 95% paired bootstrap against stock Tesseract, resampling pages, then Wikisource Indexes (clusters); 2,000 resamples, seed 20261106. Engine CER, 38 pages WER, 38 pages CER, 10 pages WER, 10 pages Stock Tesseract heb (Homebrew) 0.226 0.473 0.384 0.588 tessdata_best heb (R6's base) 0.225 0.481 0.376 0.609 R6 0.209 0.407 0.383 0.585 R6 minus ΔCER, 38 pages (page; cluster) ΔCER, 10 pages (page; cluster) stock Tesseract −0.016 [−0.023, −0.010]; cl [−0.024, −0.005] −0.002 [−0.012, +0.012]; cl [−0.006, +0.002] tessdata_best −0.015 [−0.024, −0.007]; cl [−0.026, +0.001] +0.007 [−0.006, +0.018]; cl [−0.005, +0.019] On the 38 pages, R6 lowers CER by 0.016 and WER by 0.066 [−0.086, −0.046] against stock Tesseract. It improves 26 pages, leaves 2 unchanged and worsens 10. No gain on the hardest pages. The 10-page subset is the pages whose Wikisource Indexes fed none of HeOCR's glyph banks. Stock Tesseract's error is highest there, and R6 is level with it (0.383 against 0.384). Almost all of R6's training lines come from three books, which is the likely reason. Against its own base, the page interval excludes zero on the 38 pages, but the cluster interval just reaches it (+0.001). What is left is recognition, not reading order. An order-free character-bag error is 0.215 for R6 (stock: 0.238), about the same as its CER. R6 emits about 7% fewer characters than the references (stock: about 3%), so deletions are part of its error. Reference caveat: E2d4c is the human audit of the earlier E2d3d references. Some audit proposals came from places where Tesseract and another engine agreed with each other but not with the reference, so the corrections may lean slightly toward what Tesseract reads. That is why every comparison above is paired on the same reference
Authors: Palachy Affek, Shay, HeOCR maintainers
Language: English
Subfield: Computer Vision and Pattern Recognition
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7225753087
FWCI:
Cites:
Cited by:
Related to:
