Skip to content
maribakuljPublic

About

OCR document pipeline comparison platform

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

987 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cinoc

CI Python License Coverage Metrics: deterministic

A reproducible benchmark for transcription pipelines — OCR, HTR, VLM, OCR→LLM — on heritage documents.

Transcribing a manuscript or a 19th‑century newspaper is now a pipeline: an OCR engine, a vision model, an LLM that corrects — and each can lower the error rate while inventing text. Cinoc runs competing pipelines over your corpus and its ground truth, and writes a self‑contained HTML report of metrics and significance tests. No LLM writes the report: every number is an auditable function of the inputs.

Cinoc report

A first report in two minutes

pip install "cinoc @ git+https://github.com/maribakulj/cinoc"   # `pip install cinoc` once 1.0 is on PyPI
cinoc demo --output report.html                                  # then open report.html

No engine, no key, no network after the install. That report is built from frozen outputs; your own pages are next.

The command line speaks French — its help, messages and progress lines; the reports exist in French and English: --lang en on cinoc demo, cinoc run and cinoc compare, ?lang=en in the web app.

A first real OCR, on your pages

Put your page images beside their transcriptions (page_001.png + page_001.gt.txt), zip them, and install the tesseract binary (apt install tesseract-ocr, brew install tesseract):

cinoc corpus import zip pages.zip --dest corpus          # writes corpus/corpus.yaml
cinoc run corpus/corpus.yaml --recipe ocr_simple --set ocr.lang=eng \
    -o report.html --json corpus/run.json                # Tesseract, scored, reported

ocr_simple is one of the recipes (cinoc list recipes): OCR then an LLM, a vision model reading the page, segment‑then‑read, three engines and a vote… Queue several and they are compared in one report. cinoc list engines says which engines your install can run, and why one cannot (an extra, a binary, a key).

To browse it in the web app — the same report served with its page images, a corpus library, and the composer to launch runs from the page:

pip install "cinoc[serve,images] @ git+https://github.com/maribakulj/cinoc"
cinoc serve --reports-dir corpus                         # http://127.0.0.1:8000

--reports-dir serves the RunResult JSON of that folder and reads its images against it: write --json beside the run config, as above. What you do in the page — corpora you upload, runs you launch, their history — is kept in a per‑user data folder (~/.local/share/cinoc on Linux, ~/Library/Application Support/cinoc on macOS, %LOCALAPPDATA%\cinoc on Windows; CINOC_DATA_DIR to choose another) and survives a restart; cinoc serve prints which one it uses.

A real result — partial

The reference campaign (campaigns/2026-11-26-reference/) compares OCR, segmentation, structured correction and vision models on two public corpora. Only its keyless half has run so far: Tesseract, and a 3‑billion‑parameter vision model run locally on CPU. Character error rate (CER, view texte) and word error rate, micro‑averaged, read from the committed RunResult:

corpus pipeline CER WER pages scored
37-GT-BNL (Luxembourg press, French + German Fraktur) E0 · tesseract 0.0584 0.2372 37/37
E1 · segmentation → tesseract 0.0639 0.2521 37/37
E5 · qwen2.5vl:3b (local) 0.0341 0.1559 37/37
Dresden Mscr.Dresd.K.80 (1665, German Kurrent hand) E0 · tesseract 0.7563 0.9987 10/10
E5 · qwen2.5vl:3b (local) 1.8614 2.4843 4/10

Read them as what they are: one unpublished run, no repetitions, a small local model — not a ranking. On the handwritten corpus Tesseract has no Kurrent model and the small VLM hallucinates (a CER above 1) or exceeds its 600 s limit on six pages. The complete figure — Mistral OCR, Mistral as corrector and as vision model, five repetitions each, then the published dataset that lets anyone re‑score it offline — comes with the next two steps of the campaign, which wait for the maintainer's key and agreement. Protocol, conventions, estimated cost and every other view: campaigns/2026-11-26-reference/README.md.

Three things people come to do

You have… You run
transcriptions from another tool (text or ALTO) precomputed reads page.<label>.txt, alto_source reads page.xml, beside each image — no engine guide
a corpus and several candidate engines cinoc run with recipes or a full YAML spec guide
ALTO to post‑correct inside its layout cinoc correct alto/ (extra [saknussemm]; --pipeline <p> for the ALTO of a Cinoc run; <page>.gt.txt beside it is the ground truth) guide

Each of these is run end to end on the installed wheel by CI (tests/installed/).

Commands

Command What it does
cinoc demo a demo report, no engine required
cinoc run run a spec or a queue of recipes; --check reads the plan without running it, --resume-dir keeps every step in a cache, --offline re‑scores the cache without calling any engine
cinoc correct structured post‑correction of existing ALTO, line by line
cinoc hybrid segment, then OCR each block, then one ALTO per page
cinoc compare compare two RunResult (deltas)
cinoc history one pipeline over time, or which pipelines regressed
cinoc corpus import (IIIF, Gallica, eScriptorium, HuggingFace, ZIP), search, standardize
cinoc list engines, models, profiles, prompts, recipes — what this install can do
cinoc archive seal a campaign into a BagIt archive, verify it (with its published root fingerprint), rescore it without any engine, reproduce it
cinoc serve the local web app (extra [serve])

Documentation

pip install -e ".[dev]" && make check-fast   # contributing: ruff + mypy + the whole suite

Screenshots

The benchmark composer — queue recipes, choose their bricks and settings, launch one compared run.

Cinoc benchmark composer

Layout & hybrid transcription — segment a page, then transcribe block by block.

Cinoc segmentation & hybrid transcription

The name

Cinoc is a nod to a character in the fiction of Georges Perec.

License

Apache‑2.0.

About

OCR document pipeline comparison platform

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages