Skip to main content

Nuqta OCR

Nuqta OCR

Accurate Arabic document OCR with faithful tashkeel, in two open models: Nuqta-OCR 4B (#1 on KITAB-Bench and Misraj-DocOCR among published results) and Nuqta-OCR 0.8B (best for its size: ahead of Gemini-2.0-Flash, level with or slightly ahead of Baseer, runs on phones).

  • Reads books, scans, official documents, tables, IDs and passports
  • Copies the tashkeel printed on the page and almost never adds any (0.08–0.16 invented marks per 100 letters)
  • Markdown output with HTML tables, in reading order
  • Runs on-premises on a single GPU: your documents never leave your network

Install

pip install "nuqta-ocr[vllm]"   # recommended: fast, batched (Linux + NVIDIA GPU)
pip install "nuqta-ocr[fast]"   # transformers + fast kernels (no vLLM needed)
pip install nuqta-ocr           # transformers only (slow on long pages)

Quick start

from nuqta import OCR

if __name__ == "__main__":          # required with the vLLM backend (it starts worker processes)
    ocr = OCR("nuqta-0.8b")              # or "nuqta-4b" (most accurate)

    print(ocr.read("page.jpg").text)                        # as written: tashkeel only where printed
    print(ocr.read("scan.pdf", mode="markdown").text)       # headings, lists, HTML tables; every page
    print(ocr.read("passport.jpg", mode="id").fields)       # MRZ fields + check digits

    results = ocr.read_many(["a.jpg", "b.png", "c.pdf"])    # batched with vLLM

Command line:

nuqta read page.jpg
nuqta read scan.pdf --mode markdown
nuqta read passport.jpg --mode id --json

Modes

mode output
as-written (default) the text exactly as printed, tashkeel only where it is printed
bare the text without any tashkeel
markdown headings, paragraphs, lists and tables (HTML) in reading order
id markdown reading + structured fields: passport / visa / ID-card MRZ with ICAO check digits; Egyptian national ID fields cross-checked against the national number

What the library does for you

  • Page rule: full pages are shown to the model at its training resolution (2.4 MP); word, line and card crops keep their size. Small page renders (e.g. 72-dpi PDF pages) otherwise lose letters.
  • Loop guard: if a page reading repeats itself, the page is re-read at its native size; any repetition left is trimmed (Page.looped tells you).
  • PDFs: every page rendered at 200 dpi.
  • ID checks: a failed check digit or an inconsistent national number is reported, never silently "fixed". Send those fields to a human.

Speed (0.8B, one 24 GB GPU)

vLLM transformers + [fast]
text line ~0.2 s ~1 s
book page ~3 s ~3.5 s
markdown document page ~3 s ~6 s

Results

KITAB-Bench CER ↓ Misraj-DocOCR MARS ↑
Nuqta-OCR 4B 0.106 82.8
Nuqta-OCR 0.8B 0.117 77.1
Previous best (Gemini-2.0-Flash / Baseer) 0.13 76.9

Recommended input size (what the library does). The 0.8B's lead over Baseer is within the benchmark's noise.

Full tables, confidence intervals and disclosures are in the model cards; the full benchmarks are KITAB-Bench and Misraj-DocOCR.

License

Code: Apache-2.0. Models: see their model cards.

Contributors

Salah AlHaismawi · Mohamed Saleh Tulib · Ahmed ElSayed Mohamed Ibrahim

Metadata

Release files for nuqta-ocr 0.1.0

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

Source distribution (sdist)

Source distribution for nuqta-ocr 0.1.0
File Size Uploaded Provenance Actions
nuqta_ocr-0.1.0.tar.gz 19.9 kB Without provenance Details for nuqta_ocr-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nuqta-ocr 0.1.0
File Interpreter ABI Platform Actions
nuqta_ocr-0.1.0-py3-none-any.whl Python 3 none any Details for nuqta_ocr-0.1.0-py3-none-any.whl

Total release size: 41.3 kB

Release files / nuqta_ocr-0.1.0.tar.gz

Download URL nuqta_ocr-0.1.0.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
831ee33e2082259a42381df7ee84e25ce0e6b2ab96c0cbe4fba508dd7ca893a6
BLAKE2b-256 checksum
How to use checksums
fa4d3e312fa1e83a4c30a09ada9a290b25b38957f7f8dac98e62b7027495b7a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / nuqta_ocr-0.1.0-py3-none-any.whl

Download URL nuqta_ocr-0.1.0-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b76f7007d5e07e6d27531ae872eee93dec012ddb4aad85961f4a2e2a7cadddba
BLAKE2b-256 checksum
How to use checksums
82bada6e90fadc2e68eb0f3002f7e854987873ac46cabc43a724c301877f24ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for nuqta-ocr 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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