Skip to main content

tesseract-heb-rivok

heb_rivok and heb_rivok_lite are Tesseract 5 models for printed Hebrew, fine-tuned by Rivok Labs. This package installs them with pip and tells Tesseract where they are. You still need Tesseract itself (apt install tesseract-ocr, brew install tesseract, or the Windows installer).

pip install tesseract-heb-rivok
model for version
heb_rivok Hebrew documents with English words and numbers. English is in the model, so no +eng 1.0.1
heb_rivok_lite Hebrew only, at the speed of the standard heb model; add +eng for English 1.0

The files are the integer ("fast") models from the GitHub release. The float models for further fine-tuning are there too.

Use

python -m tesseract_heb_rivok prints the folder that holds the two models:

tesseract page.png out --tessdata-dir "$(python -m tesseract_heb_rivok)" -l heb_rivok

From Python with pytesseract:

import pytesseract
import tesseract_heb_rivok

text = pytesseract.image_to_string(
    "page.png", lang="heb_rivok",
    config=f'--tessdata-dir "{tesseract_heb_rivok.tessdata_dir()}"')

When Tesseract needs more than these two models. Some uses need Tesseract's own files as well: another language (-l heb_rivok_lite+eng), page rotation (osd) or output configs (hocr, pdf). OCRmyPDF and Docling need them too. For these, use the merged folder: --merged builds a folder in your cache that links these models and everything in your system's tessdata.

export TESSDATA_PREFIX="$(python -m tesseract_heb_rivok --merged)"
ocrmypdf -l heb_rivok scanned.pdf searchable.pdf
tesseract page.png out -l heb_rivok_lite+eng hocr

Docling, with its Tesseract command-line engine:

import os
import tesseract_heb_rivok
from docling.datamodel.pipeline_options import OcrMode, PdfPipelineOptions, TesseractCliOcrOptions

tessdata = tesseract_heb_rivok.merged_tessdata_dir()
os.environ["TESSDATA_PREFIX"] = tessdata          # Docling lists languages without --tessdata-dir
opts = PdfPipelineOptions()
opts.ocr_options = TesseractCliOcrOptions(lang=["heb_rivok"], path=tessdata, mode=OcrMode.FULL_PAGE)

python -m tesseract_heb_rivok --check verifies the files and that Tesseract loads them.

Results

Character error rate, lower is better; fast models, Tesseract 5.5.0.

test heb (Ubuntu/Debian) heb_rivok_lite heb_rivok
403 line crops from real Hebrew documents 4.7% 1.9% 1.4%
GlotOCR-bench Hebrew, clean images 21.2% 20.6% 18.5%
HaZefira newspaper, 4,013 line crops 17.5% 14.1% 9.9%

Method, more tests and the training recipe are in the model card. The 403 crops come from private documents; GlotOCR-bench and HaZefira are public, and the repository's eval/ scripts rerun those numbers.

Files

file SHA-256
heb_rivok.traineddata (5.7 MB) dd9ba506b4ec6e62119a1334949824137692eada686687e51ac10dbb2f7a3df8
heb_rivok_lite.traineddata (3.4 MB) a92584816adf5c9ae38afc255e3530477516318c21c2e711fd57b05535239360

Licence

Apache-2.0, like the tessdata_best models and langdata_lstm text they are built on.

Metadata

Release files for tesseract-heb-rivok 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tesseract-heb-rivok 1.0.1
File Size Uploaded Provenance Actions
tesseract_heb_rivok-1.0.1.tar.gz 4.1 MB Without provenance Details for tesseract_heb_rivok-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tesseract-heb-rivok 1.0.1
File Interpreter ABI Platform Actions
tesseract_heb_rivok-1.0.1-py3-none-any.whl Python 3 none any Details for tesseract_heb_rivok-1.0.1-py3-none-any.whl

Total release size: 8.2 MB

Release files / tesseract_heb_rivok-1.0.1.tar.gz

Download URL tesseract_heb_rivok-1.0.1.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
90639ccbb6ab5243efef53e84322d12fc49578bb9eff43e7323f8629e2b03352
BLAKE2b-256 checksum
How to use checksums
6be120e890faa71ad502aa063bbe70845b11076a76ee787463b20abbc877e871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / tesseract_heb_rivok-1.0.1-py3-none-any.whl

Download URL tesseract_heb_rivok-1.0.1-py3-none-any.whl
Size 4.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e739ae966f6a2b829b2340bfc2fc75a5acd43ad004227c098accd989d1f5ed0b
BLAKE2b-256 checksum
How to use checksums
2927149eb3ef4aa6abd10b9b8322b1701babc8294127596214f9e4b1c1556d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for tesseract-heb-rivok 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page