diff --git a/AGENTS.md b/AGENTS.md index 517ff54..ea3395a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -272,7 +272,7 @@ navigates rather than just fetching needs that guard. **A backend** — add `src/tetrak_ocr/backends/.py` exposing `SUPPORTED_EXTENSIONS` and `ocr_image`, guarding its import with `_IMPORT_OK`; register it in `registry.py`; add its extra to `pyproject.toml`; add a page -section to [`site/content/reference/engines.md`](site/content/reference/engines.md). The CLI needs no change. +section to [`site/content/ocr/reference/engines.md`](site/content/ocr/reference/engines.md). The CLI needs no change. `_IMPORT_OK` must answer "can this actually run", not "did the import statement succeed". `paddle-vl` imports its class from `paddleocr` and then @@ -390,7 +390,7 @@ What goes where: `docs/` is everything about *using* the package — installation, the command line and Python API guides, the tutorials, and the reference generated from the parser and the docstrings. The Hugo site is the research: the corpus, the engines as measured, routing, results and method, -and the articles. The site's `/reference/cli/` page is a stub that links to +and the articles. The site's `/ocr/reference/cli/` page is a stub that links to the guide; the generated API page it used to carry (`tools/generate_api_docs.py`) was retired in favour of Sphinx's, so the two could not drift. Build the Sphinx site locally with `pip install -e '.[apidocs]'` and diff --git a/docs/guide/backends.md b/docs/guide/backends.md index 3953434..cab5610 100644 --- a/docs/guide/backends.md +++ b/docs/guide/backends.md @@ -20,7 +20,7 @@ strategy built on top of them. The measurements behind every claim on this page are on [tetrak.dev](https://tetrak.dev/): the [engines -page](https://tetrak.dev/reference/engines/) for each backend's measured +page](https://tetrak.dev/ocr/reference/engines/) for each backend's measured strengths and failure cases, and the [research](https://tetrak.dev/research/) for the full benchmark and what it does and does not establish. Figures are deliberately not repeated here, where nothing would keep them current. diff --git a/docs/installation.md b/docs/installation.md index 4de6c8d..696da84 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -88,7 +88,7 @@ writing, GPL-3.0, with a commercial-use exception offered by their author. That does not affect Tetrak itself, since extras are optional dependencies resolved at install time and never vendored, but it does affect anyone redistributing a bundle that includes them. Check the current terms upstream; -licence terms change. See [licensing](https://tetrak.dev/reference/licensing/). +licence terms change. See [licensing](https://tetrak.dev/ocr/reference/licensing/). ``` ## Model weights diff --git a/docs/tutorials/armenian.md b/docs/tutorials/armenian.md index a5141a7..70ad3bf 100644 --- a/docs/tutorials/armenian.md +++ b/docs/tutorials/armenian.md @@ -9,7 +9,7 @@ has never seen the script, and Apple's Vision framework has no Armenian at all. `easyocr-hy` keeps EasyOCR's detector, which already finds Armenian text, and swaps in `tetrak_hy`, a recogniser trained for the script. Where it stands against the other Armenian engines, register by register, is on -[tetrak.dev](https://tetrak.dev/reference/engines/#armenian-with-our-own-recogniser). +[tetrak.dev](https://tetrak.dev/ocr/reference/engines/#armenian-with-our-own-recogniser). ## 1. Install the recogniser diff --git a/site/assets/js/app.js b/site/assets/js/app.js index 371a9d9..6847105 100644 --- a/site/assets/js/app.js +++ b/site/assets/js/app.js @@ -1,5 +1,5 @@ /** - * Tetrak OCR — the small amount of behaviour the site actually needs. + * Tetrak — the small amount of behaviour the site actually needs. * * Everything here genuinely requires the browser: a search UI, a theme the * reader chooses, and a clipboard. Everything else — the search index, the @@ -297,8 +297,56 @@ function initMenu() { }); } +// --- Nav dropdowns ----------------------------------------------------------- +// A menu entry with children (Products) renders as a link, a disclosure button +// and a list. The button is what opens the list, so the keyboard and a screen +// reader get the same menu as the mouse: no hover. Escape closes it and hands +// focus back to the button; a click elsewhere, or focus leaving the group, +// closes it too. Below the nav breakpoint the stylesheet shows the list +// permanently and hides the button, so nothing here runs on a phone. + +function initSubmenus() { + const groups = document.querySelectorAll("[data-submenu]"); + if (!groups.length) return; + + const setOpen = (group, open) => { + group.classList.toggle("is-open", open); + group.querySelector("[data-submenu-toggle]").setAttribute("aria-expanded", String(open)); + }; + + groups.forEach(group => { + const button = group.querySelector("[data-submenu-toggle]"); + if (!button) return; + + button.addEventListener("click", () => { + setOpen(group, !group.classList.contains("is-open")); + }); + + group.addEventListener("keydown", e => { + if (e.key === "Escape" && group.classList.contains("is-open")) { + e.preventDefault(); + setOpen(group, false); + button.focus(); + } + }); + + // relatedTarget is where focus is going; null means it left the document, + // which happens on a window blur and should not snap the menu shut. + group.addEventListener("focusout", e => { + if (e.relatedTarget && !group.contains(e.relatedTarget)) setOpen(group, false); + }); + }); + + document.addEventListener("click", e => { + groups.forEach(group => { + if (!group.contains(e.target)) setOpen(group, false); + }); + }); +} + initTheme(); initCopyButtons(); initSearch(); initLightbox(); initMenu(); +initSubmenus(); diff --git a/site/assets/scss/_app.scss b/site/assets/scss/_app.scss index e48ad7d..e1969f6 100644 --- a/site/assets/scss/_app.scss +++ b/site/assets/scss/_app.scss @@ -37,13 +37,6 @@ letter-spacing: -0.015em; } - &__version { - font-family: var(--font-mono); - font-size: 0.7rem; - color: var(--clay); - letter-spacing: 0.06em; - } - &__nav { display: flex; gap: 22px; @@ -62,14 +55,68 @@ } // The current page is marked by weight and colour rather than an - // underline, which would collide with the link hover treatment. - &[aria-current="page"] { + // underline, which would collide with the link hover treatment. A + // parent whose child is current gets the same mark, so Products reads + // as current on a product page. + &[aria-current] { color: var(--ink); font-weight: 600; } } } + // A menu entry with children: its link, the disclosure button beside it, + // and the list the button opens. On a wide screen the list drops below the + // masthead on the paper-2 ground with the one border colour the system + // has, which is the same treatment the phone menu gets; on a phone the + // list is part of the column (see the narrow-screen rules). + &__group { + position: relative; + display: flex; + align-items: center; + gap: 2px; + + &.is-open .masthead__submenu { + display: flex; + } + } + + &__disclosure { + appearance: none; + border: 0; + background: none; + padding: 4px 2px; + font: inherit; + font-size: 0.8rem; + line-height: 1; + color: var(--ink-soft); + cursor: pointer; + + &:hover, + &[aria-expanded="true"] { + color: var(--clay-deep); + } + } + + &__submenu { + display: none; + position: absolute; + top: calc(100% + 10px); + left: -14px; + flex-direction: column; + gap: 2px; + min-width: 15rem; + margin: 0; + padding: 10px 14px; + list-style: none; + background: var(--paper-2); + border: 1px solid var(--rule); + + li { + list-style: none; + } + } + &__tools { display: flex; align-items: center; @@ -240,14 +287,53 @@ } } +// --- Home -------------------------------------------------------------------- +// The latest articles, under the tiles and the services panel. The rows are +// the articles index's own; only the spacing around the block is new. +.home-articles { + margin-top: 3.5rem; + + &__foot { + margin-top: 1.6rem; + } +} + // --- Narrow screens ---------------------------------------------------------- // Below the prototype's 1000px breakpoint the nav and rail both go, leaving a -// single column. The burger reveals the nav. +// single column. The burger reveals the nav, with the products shown +// indented under their parent rather than behind a second disclosure. @media (width <= 1000px) { .masthead__nav { display: none; } + // Left-aligned as a column, so the products read as indented under their + // parent; centred, the group sat as a left-aligned block in a centred list. + .masthead__nav.is-open { + align-items: flex-start; + } + + .masthead__group { + flex-direction: column; + align-items: flex-start; + gap: 10px; + } + + .masthead__disclosure { + display: none; + } + + .masthead__submenu { + display: flex; + position: static; + min-width: 0; + padding: 0 0 0 18px; + border: 0; + border-left: 2px solid var(--clay); + background: none; + gap: 10px; + } + .page { grid-template-columns: minmax(0, 1fr); gap: 0; diff --git a/site/config/_default/hugo.toml b/site/config/_default/hugo.toml index 658e628..157713f 100644 --- a/site/config/_default/hugo.toml +++ b/site/config/_default/hugo.toml @@ -1,10 +1,13 @@ -# Tetrak OCR — Hugo configuration. +# Tetrak — Hugo configuration. # # Themeless: layouts/, assets/ and content/ live at the repository root, # following velostevie. There is one site here, so a theme directory would add # a layer of indirection without buying separation. -title = "Tetrak OCR" +# "Tetrak", not "Tetrak OCR", since October 2026 (brief 017): the site is the +# home of every Tetrak tool and of the services, and the OCR tool has its own +# page at /ocr/. The tool keeps its name wherever the tool is meant. +title = "Tetrak" baseURL = "https://tetrak.dev/" locale = "en-gb" defaultContentLanguage = "en" @@ -13,7 +16,7 @@ enableRobotsTXT = true enableInlineShortcodes = true # Hugo title-cases the titles it derives for list pages, which turned the tag -# `ocr` into a page headed "Ocr" and titled "Ocr · Tetrak OCR" in the browser +# `ocr` into a page headed "Ocr" and titled "Ocr · Tetrak" in the browser # tab. Tags are lowercase and hyphenated by convention here, and the term is the # tag -- capitalising it publishes a word the site does not use. The list pages # that want a proper title all have an _index.md that gives them one, including @@ -67,8 +70,13 @@ capitalizeListTitles = false tabWidth = 2 [params] - description = "Local-first OCR orchestration for archival material, and a benchmark comparing five OCR engines against a corpus of Los Angeles stage and picture-palace ephemera, c. 1910-1945." + description = "Tetrak makes archive collections readable and searchable, especially in scripts that mainstream software serves poorly: free, open-source tools for turning scans of old print into searchable text and for searching across scripts, and services for the collections that would rather we did the work." + # The repository behind this site: the OCR pipeline, its evaluation and the + # site itself. Used for the "Edit this page" links and the footer. repo = "https://github.com/scattercode/tetrak" + # The organisation, which the masthead links to since October 2026: the site + # describes several tools, each in its own repository under it. + org = "https://github.com/scattercode" # Plausible: privacy-friendly, no cookies, no consent banner needed. # diff --git a/site/config/_default/menus/menu.en.toml b/site/config/_default/menus/menu.en.toml index 5f278ca..2668250 100644 --- a/site/config/_default/menus/menu.en.toml +++ b/site/config/_default/menus/menu.en.toml @@ -1,47 +1,69 @@ -# Top navigation: the product page, the tutorial, the consolidated research -# section, the reference, and the page saying who is behind the tool. There was -# an Install entry until October 2026; installation now lives in the user guide -# on GitHub Pages, and /install/ is an alias of the tutorial, which opens with it. -# Restructured August 2026 -- the previous eight-entry nav spread the research -# story across four tabs (Engines, Results, Method, Why) while leaving the -# corpus, the tool comparison and auto-local routing out of the nav entirely. -# Those pages now live under /research/, whose landing page is the index the nav -# used to be. The count is deliberately not written down here: it was, and the -# first entry added afterwards left the header saying "five". - -[[main]] - name = "What it is" - pageRef = "/" +# Top navigation: Products (a dropdown of the three tools, whose own label is +# the overview page), Services, Research, Articles, and the page saying who is +# behind it all. +# +# Restructured October 2026 (brief 017). Until then the site was about one +# tool and the nav said so: "What it is" was the OCR pitch, and Tutorial and +# Reference sat in the top row. There are now three open-source tools and a +# service side, so the nav groups the tools under Products and the OCR page +# links to its own tutorial and reference, which moved under /ocr/ with it. +# Restructured before that in August 2026, when the previous eight-entry nav +# spread the research story across four tabs. The count is deliberately not +# written down here: it was, and the first entry added afterwards left the +# header saying "five". +# +# A child entry names its parent's identifier. The header partial renders a +# parent with children as a link plus a disclosure button; the phone menu +# shows the children indented under it. The parent must keep its pageRef so +# the overview is reachable without the dropdown. + +[[main]] + name = "Products" + identifier = "products" + pageRef = "/products" weight = 10 [[main]] - name = "Tutorial" - pageRef = "/tutorial" - weight = 30 + name = "Tetrak OCR" + parent = "products" + pageRef = "/ocr" + weight = 1 [[main]] - name = "Research" - pageRef = "/research" - weight = 40 + name = "Armenian text recognition" + parent = "products" + pageRef = "/armenian-ocr" + weight = 2 [[main]] - name = "Reference" - pageRef = "/reference/cli" - weight = 50 + name = "Transliteration" + parent = "products" + pageRef = "/translit" + weight = 3 -# Added August 2026. Not a research tab, which is what the restructure above was -# trimming: it is the one page that says who is behind the tool, and burying -# that in the footer is how an unfamiliar reader fails to find it. +# Beside Products rather than at the end: the split between the free tools +# and the paid work is the first thing a visitor should be able to see. [[main]] - name = "About" - pageRef = "/about" - weight = 60 + name = "Services" + pageRef = "/services" + weight = 20 + +[[main]] + name = "Research" + pageRef = "/research" + weight = 30 -# Added August 2026 with the articles section. It sits next to Research rather -# than next to Reference because it is the same kind of thing: writing about the -# problem and about the tool's progress, alongside the fixed evidence. Reference -# stays where it is, as the last stop for someone already using the tool. +# Added August 2026 with the articles section. It sits next to Research +# because it is the same kind of thing: writing about the problem and about +# the tools' progress, alongside the fixed evidence. [[main]] name = "Articles" pageRef = "/articles" - weight = 45 + weight = 40 + +# Added August 2026. The one page that says who is behind the work, and +# burying that in the footer is how an unfamiliar reader fails to find it. +[[main]] + name = "About" + pageRef = "/about" + weight = 50 diff --git a/site/content/_index.md b/site/content/_index.md index e2a1087..ef8fba3 100644 --- a/site/content/_index.md +++ b/site/content/_index.md @@ -1,134 +1,56 @@ --- -title: "Tetrak OCR" -heading: "Smart text recovery" -standfirst: "For the unruly archive, on your own machine." +title: "Tetrak" +heading: "Readable, searchable archives" +standfirst: "Tetrak makes archive collections readable and searchable, especially in scripts that mainstream software serves poorly." +description: "Tetrak publishes free, open-source tools that turn scans of old printed text into searchable text, starting with Armenian, and that make catalogues searchable across scripts; and works with collections teams on assessment, catalogue search sites and grant applications." --- -Historical archives do not arrive as tidy, uniform PDFs. A real collection is a -chaotic mix of linen postcards, dense multi-column trade journals, illustrated -theatre handbills and hand-lettered vaudeville posters. One-size-fits-all OCR -fails on this material because it assumes clean, high-contrast, linearly -structured print. +Much of the world's cultural history is looked after by small, independent +libraries and community archives. They often hit two problems at once: +off-the-shelf archive software can't read or search their scripts, and the +systems that can are priced for large institutions. -Tetrak OCR is a small, local-first tool that turns those scans into -full-text transcripts — text you can attach to the images in your catalogue or -digital asset management system, so that collections become searchable by -their contents, hard-to-read items gain a readable transcript, and screen -readers have a text alternative to work with. It inspects each document, runs -the viable local engines over it, scores their output without a reference -transcript, and sets aside anything too poor to trust. +We work on both. We publish free, open-source tools that turn scans of old +printed text into searchable text, starting with Armenian, and that make it +possible to search across scripts, so someone who types a name in Latin +letters finds the record written in Armenian, Georgian, Cyrillic or +Syriac. And we work with collections teams directly: assessing +what they hold, building and hosting search sites for their catalogues, and +helping with the technical side of grant applications. -{{< figure src="design/custodian-of-the-forgotten.webp" class="hero-figure" - alt="Tetrak OCR, scribe of the unruly archive. Four claims flow left to right. A magnifier picks over a heap of postcards, a theatre handbill, an open journal and torn newsprint: historical archives are inherently unruly, because postcards, handbills and journals lack the uniform structure standard OCR engines expect. Arrows fan into a rack of five geared bays labelled Tesseract, EasyOCR, PaddleOCR, Marker and Vision: routing beats picking a single engine, since the eligible local engines each read the file and the best transcript is kept. A server behind a padlocked shield: processing stays on your machine, with the Claude backend the one opt-in exception. The flow then splits into a folder marked CLEAN DATABASE and a bucket marked TRIAGE: a quality gate protects the archive, holding anything below the quality floor for a person to decide" - caption="The rack is an inventory of the local engines that ship, not a picture of what runs on any one file: `auto-local` fans out over the engines *eligible* for that file — four at most, two for a PDF. Vision is macOS-only and is not currently in that pool, though it measures as the strongest local engine on the corpus." >}} +## The tools -
- -- **One interface, multiple engines** - - Tesseract, EasyOCR, PaddleOCR, Marker, Apple Vision and Claude behind a - single call. Swap engines with a flag; nothing else in your pipeline - changes. - -- **`auto-local` picks for you** - - Runs every viable local engine on each file, scores the results with no - reference text, and keeps the best one. Per file, not per batch. Name a - single engine instead when throughput matters more. - -- **Everything stays on your machine** - - No cloud account, no API key, no material leaving the building. The one - cloud path — a vision-model escalation for pages nothing local can read — - is opt-in, per file, invoked by a person. - -- **It tells you when it failed** - - Anything below the quality floor goes to a `workspace/triage/` queue with a - manifest of what each engine produced. Bad transcripts do not enter your - archive looking like good ones. - -
- -## Two problems, one tool - -**No single OCR engine wins on mixed material.** Measured over a corpus of -Los Angeles stage and picture-palace ephemera (c. 1910–1945), five different -engines win across nine documents. There is no setting you can choose once -and be right: - -| Your archival material | Best local engine | Character similarity | Word recall | -| :--- | :--- | :---: | :---: | -| Printed captions and postcard reverses | `tesseract-auto` | 0.91 | 0.71 | -| Low-contrast, textured illustration fronts | `easyocr` | 0.87 | 0.71 | -| Illustrated newspaper advertising | `marker` | 0.75 | 0.88 | -| Multi-page souvenir programmes | `marker` | 0.66 | 0.93 | -| Dense small type on a playbill | `paddle` | 0.39 | 0.90 | -| Hand-lettered display type | `paddle` | 0.13 | 0.39 | -| **Mixed collections, unattended** | **`auto-local`** | **0.57** | **0.76** | - -Choosing per file rather than per batch is worth a real margin: `auto-local` -beats any single local engine on both metrics, entirely offline and free. -[The research](research/) walks through how that was measured, and -[the detail](research/in-depth/) has the full benchmark, the method and its -honest caveats. - -**Some material cannot go to a cloud service.** Donated collections often -arrive with promises attached — donor agreements, privacy constraints, -material about living people — and many institutions simply do not want -collection scans leaving the building, least of all into services that might -train on them. Tetrak OCR's answer is structural rather than contractual: -processing happens on your machine, nothing requires an account or a key, -and the one path that sends a file to an API exists only as a deliberate, -per-file decision by a person looking at the triage queue. - -## Who it is for - -Curators of special collections, regional and county archives, local history -societies, community archives, and museum collections rich in ephemera — the -institutions with the most unruly material and the least appetite for cloud -contracts. It runs on ordinary hardware; the reference environment is a -laptop. If your aim is publishing out-of-copyright material openly, the full -pipeline applies too, escalation included; if your collections carry -restrictions, everything useful happens without any material leaving your -machine. - -## Get it - -```bash -pip install "tetrak[all]" -tetrak-ocr batch --backend auto-local -``` - -The [tutorial](tutorial/) is the three-minute version; the -[user guide](https://scattercode.github.io/tetrak/) covers installation, the -optional extras, the command line and the Python API in full. - -## Where to go next +Free, open source, and yours to use without us.
-- **[Follow the tutorial](tutorial/)** +- **[Tetrak OCR]({{< relref "/ocr" >}})** - Install it, transcribe one image and batch a small folder, in three - steps. + Turns scans of old print into searchable text, on your own machine. It + runs several OCR (optical character recognition) engines over each file, + keeps the best reading, and sets aside anything it cannot trust for a + person to check. -- **[Read the user guide](https://scattercode.github.io/tetrak/)** +- **[Armenian text recognition]({{< relref "/armenian-ocr.md" >}})** - Installation and the optional extras, every command and flag, the Python - API, and tutorials that go further. + A recogniser we trained ourselves for printed Armenian, in both the + Eastern and the Western language and either spelling. Free to install on + its own, and the engine Tetrak OCR uses for Armenian pages. -- **[See the research](research/)** +- **[Transliteration and cross-script search]({{< relref "/translit.md" >}})** - Nine documents, five engines and what each one breaks, in five beats — - then the corpus, the method, the full benchmark, which tool to reach for, - and how each finding became a mechanism, including what the numbers do - not establish, and one retracted finding. + Works out which script a piece of text is in, writes it in Latin letters + by the library standards, and reduces every spelling of a name to one + form so that a single search finds them all. Armenian, Georgian, Russian + and Syriac. -- **[Reference](reference/cli/)** +
- The corpus, the engines as measured, routing and licensing, and where - the [user guide](https://scattercode.github.io/tetrak/) documents the - command line and the Python API. +## Services - +The tools are free and you can use them on your own. When you would rather +have us do the work, we build and host search sites over catalogues, with +searches that work across scripts and spellings; look at what a collection +holds and what would make it findable; write the technical side of grant +applications; and train collections teams on the tools. +[What we do for collections]({{< relref "/services.md" >}}). diff --git a/site/content/about.md b/site/content/about.md index c05d4b5..0d1b040 100644 --- a/site/content/about.md +++ b/site/content/about.md @@ -1,14 +1,21 @@ --- title: "About us" kicker: "The project" -standfirst: "Two of us build Tetrak: one from data engineering, one from collections. The tool sits where those two meet." -description: "Who builds Tetrak OCR — Stephen Masters on pipelines and engineering, and Yvette Mankerian on collections systems, taxonomy and metadata." +standfirst: "Two of us are behind Tetrak, the tools and the services: one from data engineering, one from collections. The work sits where those two meet." +description: "Who is behind Tetrak: Stephen Masters on engineering and pipelines, and Yvette Mankerian on collections, systems and metadata. The tools are open source; the services are how we work with collections directly." --- -That pairing is deliberate. The routing, the scoring and the triage queue are -pipeline problems — the kind that turn up wherever unreliable input has to be -made trustworthy. What counts as a usable transcript, and what a collection -needs in order to be findable, is not a pipeline problem at all. +Tetrak is the two of us. We publish [open-source tools]({{< relref "/products.md" >}}) +that turn scans of old print into searchable text and make catalogues +searchable across scripts, and we [work with collections teams]({{< relref "/services.md" >}}) +directly on assessment, search sites and grant applications. + +The pairing is deliberate. Reading a scan, scoring the result and routing +each file to the engine that handles it best are pipeline problems, the kind +that turn up wherever unreliable input has to be made trustworthy. What +counts as a usable transcript, how a catalogue is really kept, and what a +collection needs in order to be findable are not pipeline problems at all. +Stevie brings the first set; Yvette brings the second. {{< people >}} @@ -19,7 +26,7 @@ compliance systems in banking, to power trading and generation platforms for energy companies, to the commodities data platforms he builds today. That work has given him a specific kind of expertise: designing pipelines that take in unreliable input, clean and validate it, and route each piece to wherever it's -handled best — the same problem Tetrak solves for OCR. He works across the +handled best — the same problem Tetrak OCR solves for scanned archives. He works across the stack, from cloud architecture down to the code itself, mostly in Python and data engineering these days, with Java, Angular and React still in the toolkit. He's drawn to problems where messy signals (market data, sensor readings, diff --git a/site/content/armenian-ocr.md b/site/content/armenian-ocr.md new file mode 100644 index 0000000..222b589 --- /dev/null +++ b/site/content/armenian-ocr.md @@ -0,0 +1,118 @@ +--- +title: "Armenian text recognition" +kicker: "Open source" +standfirst: "A recogniser we trained ourselves for printed Armenian, published as a small library that adds the language to EasyOCR, with the model, the word list and the training data in the open." +description: "tetrak-easyocr-armenian: an open-source Armenian OCR model for EasyOCR, trained on proofread Armenian texts, reading Eastern and Western Armenian in either orthography. Weights on Hugging Face, Apache 2.0." +--- + +## What it is for + +Most OCR (optical character recognition) software reads Armenian badly or +not at all. The free engines either have no Armenian model, or have one +trained on so little that a page of a 1950s encyclopedia or a diaspora +newspaper comes back half wrong. A collection with Armenian books, pamphlets +and periodicals in it cannot be searched by its contents until something can +read them. + +This recogniser is our answer. It reads printed Armenian well enough to make +a scanned page findable, and it is free to install, free to fork and free to +retrain. + +## Who it is for + +Libraries, archives and community collections with Armenian-language +holdings; anyone building a digitisation workflow that has to handle +Armenian; and researchers who want a recogniser they can measure, retrain or +extend. If you already use [EasyOCR](https://github.com/JaidedAI/EasyOCR), +it is one `pip install` away. If you use +[Tetrak OCR]({{< relref "/ocr" >}}), it is already the engine behind the +`easyocr-hy` backend. + +## What it does today + +- **Reads printed Armenian** across the full alphabet, the և ligature, + Armenian punctuation, digits and the Latin letters that mixed pages carry. + Detection, finding the lines on the page, is EasyOCR's own; reading them + is what was missing. +- **Both the Eastern and the Western language, in either spelling.** The + training corpus runs from the Armenian Soviet Encyclopedia to literary + editions in both dialects, so it has seen the reformed orthography used in + Armenia and the classical one the diaspora kept. +- **Corrects itself with a word list.** An optional list of 1.1 million + Armenian word forms lets the model fix a word it misread by one letter, + when the right word was its own second choice. +- **Folds look-alike letters.** The model sometimes writes a Latin letter + for its Armenian twin; a helper puts the Armenian back without touching + the Latin text on the same page. +- **Ships with its provenance.** Every release carries a record of the data, + fonts, training settings and checksums that produced it, and the training + data itself is published. + +How well it reads is measured on held-out pages from eight kinds of printed +Armenian, against every other Armenian engine we can run. The numbers, and +the kinds of page it still trails on, are in the articles below and on the +[model card](https://huggingface.co/tetrak/easyocr-armenian); we do not copy +them into prose, where they would go stale. + +## What it does not do yet + +- **Handwriting.** It reads print. Manuscripts and handwritten letters are a + different model, not yet trained. +- **Layout.** It reads lines; it does not reconstruct columns, tables or + reading order. Tetrak OCR handles the ordering when the recogniser runs + inside it. +- **Other scripts.** Georgian and Syriac recognisers are where we would like + to go next; they do not exist yet. Our + [transliteration library]({{< relref "/translit.md" >}}) already handles + those scripts for search. +- **Perfect pages.** It is alpha software and some registers of print still + defeat it. The model card says which. + +## Get it + +```bash +pip install tetrak-easyocr-armenian +``` + +```python +import tetrak_hy + +reader = tetrak_hy.reader() # an easyocr.Reader, Armenian-ready +results = reader.readtext("scan.png") +``` + +Inside Tetrak OCR, `pip install "tetrak[armenian]"` installs the same model +as the `easyocr-hy` backend. The weights download on first use and are +checked against the release's checksum every time they load. + +| | | +|---|---| +| Code | [github.com/scattercode/tetrak-easyocr-armenian](https://github.com/scattercode/tetrak-easyocr-armenian) | +| Package | [tetrak-easyocr-armenian on PyPI](https://pypi.org/project/tetrak-easyocr-armenian/) | +| Model and word list | [tetrak/easyocr-armenian on Hugging Face](https://huggingface.co/tetrak/easyocr-armenian) | +| Training data | [tetrak/armenian-ocr-crops on Hugging Face](https://huggingface.co/datasets/tetrak/armenian-ocr-crops) | +| Trainer | [github.com/scattercode/tetrak-hy-trainer](https://github.com/scattercode/tetrak-hy-trainer), to retrain it or train a recogniser for another script | +| Licence | Apache 2.0 for the code and the model; the word list is CC BY-SA 4.0 because of its sources | + +## Articles about it + +The story of the model, newest first, with the measurements that go with +each step. + +- [Beating the baselines, starting with our own ruler]({{< relref "/articles/2026/10/2026-10-02-beating-the-baselines.md" >}}): + how v6 came to lead the other engines, and the metric mistake found on the + way. +- [When your training set has read your test set]({{< relref "/articles/2026/10/2026-10-06-when-your-training-set-has-read-your-test-set.md" >}}): + keeping the evaluation honest. +- [Telling classical from reformed Armenian by counting one letter]({{< relref "/articles/2026/10/2026-10-11-classical-or-reformed-armenian-by-one-letter.md" >}}): + the two spellings, and how to tell them apart. +- [The engine we had left out]({{< relref "/articles/2026/09/2026-09-24-the-engine-we-had-left-out.md" >}}) + and [The comparison we had been putting off]({{< relref "/articles/2026/09/2026-09-04-the-comparison-we-had-been-putting-off.md" >}}): + every Armenian engine we can run, measured on the same pages. +- [Built to be forked]({{< relref "/articles/2026/09/2026-09-04-built-to-be-forked.md" >}}): + how to pick up the trainer and the library. +- [The Armenian recogniser learns both dialects]({{< relref "/articles/2026/09/2026-09-03-armenian-recogniser-both-dialects.md" >}}) + and [Shipping the Armenian recogniser]({{< relref "/articles/2026/09/2026-09-01-shipping-the-armenian-recogniser.md" >}}): + the first versions, and what the language taught the model. +- [Armenian OCR: the engines, the numbers, and our first training run]({{< relref "/articles/2026/08/2026-08-30-armenian-ocr-measured.md" >}}): + where it started. diff --git a/site/content/articles/2026/09/2026-09-01-shipping-the-armenian-recogniser.md b/site/content/articles/2026/09/2026-09-01-shipping-the-armenian-recogniser.md index 1ef2c73..437332b 100644 --- a/site/content/articles/2026/09/2026-09-01-shipping-the-armenian-recogniser.md +++ b/site/content/articles/2026/09/2026-09-01-shipping-the-armenian-recogniser.md @@ -49,7 +49,7 @@ Three ways to use it, all Apache 2.0: Armenian, weights fetched and checksum-verified on first use. - `pip install "tetrak[armenian]"` — the `easyocr-hy` backend, which adds the two output-path steps described below and is what produced the - numbers here. See [the engines page]({{< relref "/reference/engines.md" >}}). + numbers here. See [the engines page]({{< relref "/ocr/reference/engines.md" >}}). - [`tetrak/easyocr-armenian`](https://huggingface.co/tetrak/easyocr-armenian) on Hugging Face — the weights themselves, with a provenance record naming the exact data that trained them, and a model card that keeps every diff --git a/site/content/articles/2026/09/2026-09-03-armenian-recogniser-both-dialects.md b/site/content/articles/2026/09/2026-09-03-armenian-recogniser-both-dialects.md index 4b1fea7..a992072 100644 --- a/site/content/articles/2026/09/2026-09-03-armenian-recogniser-both-dialects.md +++ b/site/content/articles/2026/09/2026-09-03-armenian-recogniser-both-dialects.md @@ -344,7 +344,7 @@ transcripts of such material are what the whole field lacks. The site's own benchmark table still shows the `easyocr-hy` backend with v3 weights; re-running the harness against v5 is queued behind the -release, and the [engines page]({{< relref "/reference/engines.md" >}}) +release, and the [engines page]({{< relref "/ocr/reference/engines.md" >}}) will pick the new numbers up from the harness rather than from this article. Brief 012's remaining stages are layout generality and the external-engine sweep across the register sets. The model, the diff --git a/site/content/articles/2026/10/2026-10-16-which-way-up.md b/site/content/articles/2026/10/2026-10-16-which-way-up.md index 1e12c41..649fa57 100644 --- a/site/content/articles/2026/10/2026-10-16-which-way-up.md +++ b/site/content/articles/2026/10/2026-10-16-which-way-up.md @@ -337,7 +337,7 @@ pinned page, and the pin is in the repository, with a comment saying why. That is the whole mechanism: two measurements, a majority, a report, and a place to write down what the measurements cannot know. It is the same shape as the auto-configuration in Tetrak's own -[Tesseract backend]({{< relref "/reference/engines.md#tesseract-and-auto-configuration" >}}), +[Tesseract backend]({{< relref "/ocr/reference/engines.md#tesseract-and-auto-configuration" >}}), which picks a contrast factor and a page segmentation mode from two statistics of the image, with thresholds fitted on data and checked by a test. A rule you can read is a rule you can check. diff --git a/site/content/articles/2026/10/2026-10-19-measuring-the-fold.md b/site/content/articles/2026/10/2026-10-19-measuring-the-fold.md index 04732ec..ab23137 100644 --- a/site/content/articles/2026/10/2026-10-19-measuring-the-fold.md +++ b/site/content/articles/2026/10/2026-10-19-measuring-the-fold.md @@ -276,7 +276,7 @@ One more thing the measure made plain, and it is a rule about releases rather than about tests. A fold key is stored. It sits in the index beside the record, and in -anything else built by folding: our name authority, a snapshot of +anything else built by folding: [our name authority]({{< relref "/services.md#catalogue-search" >}}), a snapshot of Wikidata keyed by the same fold, stores every name's key beside the name. When a release changes a key, every stored copy is wrong until it is rebuilt. So the library treats a moved key as a change to a public diff --git a/site/content/articles/2026/10/2026-10-28-searching-syriac.md b/site/content/articles/2026/10/2026-10-28-searching-syriac.md index 81f1c11..85c1734 100644 --- a/site/content/articles/2026/10/2026-10-28-searching-syriac.md +++ b/site/content/articles/2026/10/2026-10-28-searching-syriac.md @@ -241,7 +241,7 @@ fold but things a fold cannot do: the Syriac calls `ܐܘܪܗܝ`, *Urhay*; *Nisibis* is `ܢܨܝܒܝܢ`. *Bar Hebraeus* is the Latin form of *Bar ʿEbrāyā*, with an *h* the Syriac does not have and a Latin ending. No spelling rule turns one into the - other. That is a job for a name authority, which knows that two names + other. That is a job for [a name authority]({{< relref "/services.md#catalogue-search" >}}), which knows that two names belong to the same place or person, not for a fold. Our test index already has one for people: when it is built, each creator is looked up in a snapshot of Wikidata's names for the region, and the person's diff --git a/site/content/ocr/_index.md b/site/content/ocr/_index.md new file mode 100644 index 0000000..1285760 --- /dev/null +++ b/site/content/ocr/_index.md @@ -0,0 +1,171 @@ +--- +title: "Tetrak OCR" +kicker: "Open source" +standfirst: "Turns scans of unruly archive material into searchable text, on your own machine, choosing the best engine for each file and setting aside what it cannot read." +description: "Tetrak OCR: a local-first tool that runs several OCR engines over scans of archival material, keeps the best transcript of each file, and sends what it cannot trust to a person." +--- + +Historical archives do not arrive as tidy, uniform PDFs. A real collection is a +chaotic mix of linen postcards, dense multi-column trade journals, illustrated +theatre handbills and hand-lettered vaudeville posters. One-size-fits-all OCR +fails on this material because it assumes clean, high-contrast, linearly +structured print. + +Tetrak OCR is the first of [Tetrak's tools]({{< relref "/products.md" >}}): +a small, local-first program that turns those scans into +full-text transcripts — text you can attach to the images in your catalogue or +digital asset management system, so that collections become searchable by +their contents, hard-to-read items gain a readable transcript, and screen +readers have a text alternative to work with. It inspects each document, runs +the viable local engines over it, scores their output without a reference +transcript, and sets aside anything too poor to trust. + +{{< figure src="design/custodian-of-the-forgotten.webp" class="hero-figure" + alt="Tetrak OCR, scribe of the unruly archive. Four claims flow left to right. A magnifier picks over a heap of postcards, a theatre handbill, an open journal and torn newsprint: historical archives are inherently unruly, because postcards, handbills and journals lack the uniform structure standard OCR engines expect. Arrows fan into a rack of five geared bays labelled Tesseract, EasyOCR, PaddleOCR, Marker and Vision: routing beats picking a single engine, since the eligible local engines each read the file and the best transcript is kept. A server behind a padlocked shield: processing stays on your machine, with the Claude backend the one opt-in exception. The flow then splits into a folder marked CLEAN DATABASE and a bucket marked TRIAGE: a quality gate protects the archive, holding anything below the quality floor for a person to decide" + caption="The rack is an inventory of the local engines that ship, not a picture of what runs on any one file: `auto-local` fans out over the engines *eligible* for that file — four at most, two for a PDF. Vision is macOS-only and is not currently in that pool, though it measures as the strongest local engine on the corpus." >}} + +
+ +- **One interface, multiple engines** + + Tesseract, EasyOCR, PaddleOCR, Marker, Apple Vision and Claude behind a + single call. Swap engines with a flag; nothing else in your pipeline + changes. + +- **`auto-local` picks for you** + + Runs every viable local engine on each file, scores the results with no + reference text, and keeps the best one. Per file, not per batch. Name a + single engine instead when throughput matters more. + +- **Everything stays on your machine** + + No cloud account, no API key, no material leaving the building. The one + cloud path — a vision-model escalation for pages nothing local can read — + is opt-in, per file, invoked by a person. + +- **It tells you when it failed** + + Anything below the quality floor goes to a `workspace/triage/` queue with a + manifest of what each engine produced. Bad transcripts do not enter your + archive looking like good ones. + +
+ +## Two problems, one tool + +**No single OCR engine wins on mixed material.** Measured over a corpus of +Los Angeles stage and picture-palace ephemera (c. 1910–1945), five different +engines win across nine documents. There is no setting you can choose once +and be right: + +| Your archival material | Best local engine | Character similarity | Word recall | +| :--- | :--- | :---: | :---: | +| Printed captions and postcard reverses | `tesseract-auto` | 0.91 | 0.71 | +| Low-contrast, textured illustration fronts | `easyocr` | 0.87 | 0.71 | +| Illustrated newspaper advertising | `marker` | 0.75 | 0.88 | +| Multi-page souvenir programmes | `marker` | 0.66 | 0.93 | +| Dense small type on a playbill | `paddle` | 0.39 | 0.90 | +| Hand-lettered display type | `paddle` | 0.13 | 0.39 | +| **Mixed collections, unattended** | **`auto-local`** | **0.57** | **0.76** | + +Choosing per file rather than per batch is worth a real margin: `auto-local` +beats any single local engine on both metrics, entirely offline and free. +[The research]({{< relref "/research" >}}) walks through how that was measured, and +[the detail]({{< relref "/research/in-depth.md" >}}) has the full benchmark, the method and its +honest caveats. + +**Some material cannot go to a cloud service.** Donated collections often +arrive with promises attached — donor agreements, privacy constraints, +material about living people — and many institutions simply do not want +collection scans leaving the building, least of all into services that might +train on them. Tetrak OCR's answer is structural rather than contractual: +processing happens on your machine, nothing requires an account or a key, +and the one path that sends a file to an API exists only as a deliberate, +per-file decision by a person looking at the triage queue. + +## Who it is for + +Curators of special collections, regional and county archives, local history +societies, community archives, and museum collections rich in ephemera — the +institutions with the most unruly material and the least appetite for cloud +contracts. It runs on ordinary hardware; the reference environment is a +laptop. If your aim is publishing out-of-copyright material openly, the full +pipeline applies too, escalation included; if your collections carry +restrictions, everything useful happens without any material leaving your +machine. + +## Get it + +```bash +pip install "tetrak[all]" +tetrak-ocr batch --backend auto-local +``` + +The [tutorial]({{< relref "/ocr/tutorial.md" >}}) is the three-minute version; the +[user guide](https://scattercode.github.io/tetrak/) covers installation, the +optional extras, the command line and the Python API in full. + +## What it does not do yet + +- **Handwriting.** Every engine it routes between reads print. A + handwritten letter or a manuscript page goes to the triage queue, where a + person decides. +- **A reference-free score is a heuristic, not a measurement.** The quality + gate ranks what the engines produced; it cannot know what the page says. + The [research]({{< relref "/research/in-depth.md" >}}) sets out how well + that ranking agrees with human-checked transcripts, and where it does not. +- **Every engine reads every format.** PDFs reach Tesseract, Marker and the + cloud escalation; EasyOCR and PaddleOCR take images only, and the batch + pipeline skips the files an engine cannot open rather than failing on them. +- **Scripts beyond Latin and Armenian.** Tesseract and PaddleOCR bring their + own language packs; the recogniser we train ourselves is + [Armenian]({{< relref "/armenian-ocr.md" >}}) so far. + +## Use it with your catalogue + +A transcript is only useful once it sits beside the image in the system your +collection already lives in. [tetrak-omeka](https://github.com/scattercode/tetrak-omeka) +is a working demonstration with [Omeka S](https://omeka.org/s/): a local +instance, scripts that send its images through Tetrak OCR and put the +transcripts back, and tutorials that walk through doing the same with your +own material, with or without any code. + +## Articles about it + +- [What we will be writing about]({{< relref "/articles/2026/08/2026-08-29-what-we-will-be-writing-about.md" >}}): + why the tool exists and what the site measures. +- [The engine that made it up]({{< relref "/articles/2026/09/2026-09-24-the-engine-that-made-it-up.md" >}}): + two compact vision-language models tried as local engines, and the one + that invented words. +- [Which way up is the page?]({{< relref "/articles/2026/10/2026-10-16-which-way-up.md" >}}): + working out which scanned pages are on their side before reading them. + +## Where to go next + +
+ +- **[Follow the tutorial]({{< relref "/ocr/tutorial.md" >}})** + + Install it, transcribe one image and batch a small folder, in three + steps. + +- **[Read the user guide](https://scattercode.github.io/tetrak/)** + + Installation and the optional extras, every command and flag, the Python + API, and tutorials that go further. + +- **[See the research]({{< relref "/research" >}})** + + Nine documents, five engines and what each one breaks, in five beats — + then the corpus, the method, the full benchmark, which tool to reach for, + and how each finding became a mechanism, including what the numbers do + not establish, and one retracted finding. + +- **[Reference]({{< relref "/ocr/reference/cli.md" >}})** + + The corpus, the engines as measured, routing and licensing, and where + the [user guide](https://scattercode.github.io/tetrak/) documents the + command line and the Python API. + +
diff --git a/site/content/reference/_index.md b/site/content/ocr/reference/_index.md similarity index 85% rename from site/content/reference/_index.md rename to site/content/ocr/reference/_index.md index c9e0f7c..c54874d 100644 --- a/site/content/reference/_index.md +++ b/site/content/ocr/reference/_index.md @@ -1,9 +1,10 @@ --- title: "Reference" kicker: "Reference" +aliases: ["/reference/"] --- -The detail behind [the research](../research/in-depth/): the corpus itself, what each +The detail behind [the research]({{< relref "/research/in-depth.md" >}}): the corpus itself, what each engine does and does not do, how routing decides, and the command line. - **[The corpus](corpus/)** — nine items of Los Angeles stage and picture-palace diff --git a/site/content/reference/cli.md b/site/content/ocr/reference/cli.md similarity index 97% rename from site/content/reference/cli.md rename to site/content/ocr/reference/cli.md index 5dca6ce..8ee3764 100644 --- a/site/content/reference/cli.md +++ b/site/content/ocr/reference/cli.md @@ -1,7 +1,7 @@ --- title: "Command line and Python API" kicker: "Reference" -aliases: ["/batch/", "/reference/api/"] +aliases: ["/batch/", "/reference/api/", "/reference/cli/"] --- How to install and drive the package is documented in the diff --git a/site/content/reference/corpus.md b/site/content/ocr/reference/corpus.md similarity index 99% rename from site/content/reference/corpus.md rename to site/content/ocr/reference/corpus.md index 5fbf628..187100e 100644 --- a/site/content/reference/corpus.md +++ b/site/content/ocr/reference/corpus.md @@ -1,7 +1,7 @@ --- title: "The corpus" kicker: "Reference" -aliases: ["/evaluation/ocr/corpus/", "/research/corpus/"] +aliases: ["/evaluation/ocr/corpus/", "/research/corpus/", "/reference/corpus/"] --- Nine items on a single theme — **the Los Angeles stage and its picture diff --git a/site/content/reference/engines.md b/site/content/ocr/reference/engines.md similarity index 96% rename from site/content/reference/engines.md rename to site/content/ocr/reference/engines.md index 0163bba..83f7033 100644 --- a/site/content/reference/engines.md +++ b/site/content/ocr/reference/engines.md @@ -1,7 +1,7 @@ --- title: "The engines" kicker: "Reference" -aliases: ["/backends/", "/research/backends/"] +aliases: ["/backends/", "/research/backends/", "/reference/engines/"] --- Seven engines behind one interface, plus two strategies built on them. Every one @@ -22,7 +22,7 @@ rather than importing it directly. | `claude-haiku` | `[claude]` | ✓ | Not escalation: the smaller model, measured and found short | | `auto-local` | core | ✓ | Unattended mixed material; runs several and keeps the best | -See [choosing a tool](../research/in-depth/#choosing-a-tool-for-your-own-material) for which to use when, with the +See [choosing a tool]({{< relref "/research/in-depth.md#choosing-a-tool-for-your-own-material" >}}) for which to use when, with the measurements behind it. ## Tesseract, and auto-configuration @@ -45,7 +45,7 @@ They were hand-written until 27 September 2026, and they did not generalise: on the two TIFFs added after that fit, the gain vanished, and on one of them auto-configuration was *worse* than leaving Tesseract alone. The re-fit repaired both. See -[results](../research/in-depth/#re-fitting-them-and-what-it-cost). +[results]({{< relref "/research/in-depth.md#re-fitting-them-and-what-it-cost" >}}). The corpus doubled on 28 September and the bands were re-fitted on it, so four fixtures are held back again. Generalisation is still the weak point: @@ -77,7 +77,7 @@ the EasyOCR extra bought nothing. Adding it changed the measured outcome by nothing at all. EasyOCR wins the Carthay Circle front outright at 0.87, and still loses the selection there to a Tesseract transcript scoring 0.49, because the winner is ranked on quality -weighted by word count. See [results](../research/in-depth/#the-results). +weighted by word count. See [results]({{< relref "/research/in-depth.md#the-results" >}}). ## Armenian, with our own recogniser @@ -255,7 +255,7 @@ than anything else local. **Where it fails is reading order.** On the *Inside Facts* newsprint it recovers 0.88–0.90 of the words and scores 0.08–0.12 on character similarity — the widest gap between the two metrics anywhere in this benchmark, and the -same multi-column failure described in [the research](../research/in-depth/#the-metrics-disagree-and-that-is-the-point), +same multi-column failure described in [the research]({{< relref "/research/in-depth.md#the-metrics-disagree-and-that-is-the-point" >}}), in a more extreme form than Tesseract manages. Two limits worth knowing: @@ -279,7 +279,7 @@ word recall on the vaudeville poster, where the best local backend manages 0.39. Three caveats. It needs `ANTHROPIC_API_KEY` and it sends your images to an API, which rules it out for confidential material. Its benchmark scores are measured against ground truth it generated itself, so they are a ceiling reference rather -than a measurement — see [method](../research/in-depth/#the-weakness-at-the-centre-of-the-method). And unlike every local +than a measurement — see [method]({{< relref "/research/in-depth.md#the-weakness-at-the-centre-of-the-method" >}}). And unlike every local backend, it does not reproduce between runs: on the poster its character similarity has scored 0.73, 0.24 and 0.26 across three runs while word recall held at 0.96–0.98. It recovers the same words and orders them differently, which @@ -300,7 +300,7 @@ lithographer's imprint or a copyright line, and sometimes puts plausible wording in its place: a different lithographer's name, the wrong count of swords in a sideshow act. On clean print the two models are close. Where `claude-haiku` appears to beat `claude`, the difference is reading order, not -reading. The [benchmark](../research/in-depth/) has its column. +reading. The [benchmark]({{< relref "/research/in-depth.md" >}}) has its column. ## Multi-page TIFF @@ -442,4 +442,4 @@ accuracy. The one thing it uniquely offered was a single cheap engine *with* the quality gate. That is what `--quality-gate` is for. See -[results](../research/in-depth/#the-results) for the measurement that decided it. +[results]({{< relref "/research/in-depth.md#the-results" >}}) for the measurement that decided it. diff --git a/site/content/reference/licensing.md b/site/content/ocr/reference/licensing.md similarity index 84% rename from site/content/reference/licensing.md rename to site/content/ocr/reference/licensing.md index 4f848bd..473eb75 100644 --- a/site/content/reference/licensing.md +++ b/site/content/ocr/reference/licensing.md @@ -1,7 +1,7 @@ --- title: "Licensing" kicker: "Reference" -aliases: ["/licensing/"] +aliases: ["/licensing/", "/reference/licensing/"] ---