Context Poliscopic ingests local government agendas and supporting documents, then extracts text and table structure so each claim in the newsletter can be traced back to a page. This note is about the extraction layer: how a page gets read, and what the reading is allowed to claim. Poliscopic project page.

A Mesa liquor-license report was missing a line. The gray issuer line,City of Mesa Tax & Licensing, was visible in the rendered page and in the 300-dpi image fed to OCR, but the extracted text did not contain it. The default configuration simply dropped it.

A different threshold setting recovered the line exactly. It also changed one business from CIRCLE K 5401 to CIRCLE K 5407. Same source bytes, same page, same OCR engine. One setting made the page look more complete and made the record less reliable.

That is the whole problem in one experiment, and it is why the extraction work is worth writing down. There is no single measure of whether a page was read correctly. There are specific claims, each of which can fail separately.

Two settings that are usually confused

Tesseract, the long-standing open-source OCR engine, exposes two knobs that both sound like "read the page better."

Page segmentation mode (PSM) tells the engine how to divide the image into blocks — a single uniform block of text, a single column, a sparse page of labels. Thresholding decides which pixels count as ink: the grayscale image is reduced to black and white using a cutoff, and that cutoff determines whether faint gray text survives. Otsu's method picks one global cutoff from the image histogram. Sauvola's method picks a local cutoff per region, which helps with uneven lighting.

The experiment varied one at a time on the same three-page document, one source page per derived PDF, local Tesseract 5.5.2, at most four OCR calls per experiment and a 180-second timeout per call. Failed and empty results were kept separate from recognized output.

Segmentation first: PSM 1, 3, 6, and 11 on page one. All four omitted the issuer line. PSM 6 also split and reordered the report title. PSM 11 lost the colons on the Series labels. Nothing here justified replacing the incumbent PSM 1.

Then thresholding, PSM 1 fixed, across all three pages:

Thresholding comparison, Mesa document 115909
CheckOtsuLeptonica OtsuSauvola
Page 1 issuer lineOmittedExact phrase recoveredExact phrase recovered
Page 1 report titleOrderedOrderedSplit and reordered
Page 1 business nameCIRCLE K 5401CIRCLE K 5401CIRCLE K 5407
Page 2 overlapping rowSERVES 10SGRHERYES 10SSERVES 10S
Page 3 serialized textBaselineByte-identicalByte-identical

The two methods that recover the faint line fail in different places. Leptonica Otsu is the better candidate; it keeps the title order and the identifier, and it mangles an already-overlapping source row differently rather than better. Sauvola recovers the line and then corrupts a license number and reorders the title. A conditional switch to Sauvola because it "found the missing text" would have traded a visible omission for an invisible error.

No method produced table-cell associations. Positioned words and flattened rows are not a table. The overlapping source row remained unresolved for every method instead of being silently corrected. There is no character-error-rate claim in this note, because the experiment did not measure one; it checked a small set of known failures on already-consumed data.

Experiment one: sometimes the PDF already has the answer

A different failure looked like an OCR problem and was not. Seven Phoenix liquor-license attachments share a table-heavy template. They are born-digital: the PDF contains real text, not a photograph of text. The retained text included every visible value, but each cell had been serialized vertically, so the relationships between columns — Description, Series, one-mile and half-mile distances — were effectively lost. The values were present; the table was not.

Running Poppler's layout-preserving mode on the same file recovered aligned rows and columns for all four tables, without OCR. Nothing was hallucinated, because nothing was recognized; the text was already there and only needed to be laid out.

The lesson is not "Poppler is better than Tesseract." It is that the cheapest correct extractor is the one that reads what the document actually contains. Sending a born-digital table through a recognizer invites errors that the source never had.

Experiment two: different models rescued different pages

Generative OCR models — vision-language models that transcribe a page image into structured text — were compared against the incumbent local cascade on a frozen ten-page workset drawn from seven real civic documents. One model was loaded at a time on a 24 GB Apple Silicon machine, both servers bound to loopback and stopped after measurement. Community quantizations were used, so this is a deployment test, not a claim about upstream full-precision behavior.

Ten-page comparison, seven source documents
ExtractorTimeRelativeResident memoryDiagnostic literalsTruncations
Incumbent cascade6.0–6.6 s1×n/a6/100
Jina OCR v1, Q8127.1 s21.1×5.8 GB8/101
HunyuanOCR, F16255.8 s38.5×3.2 GB8/100
olmOCR 2, Q5_K_M515.1 s85.6×8.2 GB9/100

The ten diagnostic literals are predeclared identifiers and phrases, not an accuracy score. They were chosen so that a specific omission would be visible, and the counts above should be read that way.

olmOCR 2 produced the best source-grounded result on this small set. On the low-contrast Mesa page it reconstructed the most accurate table of the three generative models, including the first row's 0.2 Miles value and the mileage disclaimer kept separate from the row. It terminated cleanly on every page, and its Apache-2.0 license does not block production use. It was also the slowest by a wide margin, at roughly 75 to 95 seconds for table pages and 8.2 GB resident.

HunyuanOCR was the most complete model on the rotated annexation diagram, where olmOCR dropped dimensions and a road label. Jina was fast on ordinary pages and grouped table rows well in HTML, then repeated a single parcel number 64 times on the diagram and ran to the 8,192-token ceiling. It also mis-associated the mileage disclaimer with the first table row, dropping that row's value.

All three invented plausible names for illegible signatures, and the names differed between models. That is the clearest possible demonstration that a confident transcription of an unreadable mark is not evidence. Signatures now get segmented out before generative OCR is considered at all.

Experiment three: routing, not replacement

The experiments did not produce a winner to swap in. They changed which pages get a second pass, and under what conditions.

The working cascade keeps usable native text as the first choice, uses classical OCR where the page is a scan, and routes a selected hard page to a generative model only when page diagnostics and a source-hash-bound human review manifest show that the incumbent result is unreliable. The candidate stays attached to the original page. It is stored as an immutable sidecar — a separate record beside the canonical text, not a replacement for it — and no downstream resolver consumes it automatically.

Gestures like "model says this is a table" are not trusted as routing signals. olmOCR classified one dense table page as not a table. A model's own description of its input is another generated claim.

A later pilot added a useful boundary case. Unlimited-OCR was fast and promising on dense tables, and it invented dates and produced severe numeric and form repetition. Raising precision from 4-bit to 6-bit did not improve diagnostic recall. Speed on the pages you tested is not evidence about the pages you did not.

What the record has to carry

Every extraction keeps a layout artifact with source and text hashes, tool versions, page accounting, word boxes, visual rows, table cells, and coordinate metadata. A reader that needs to verify a table cell can ask for the exact evidence that produced it and fail closed if the evidence is missing or ambiguous. Reprocessing does not overwrite older evidence.

Completeness is tracked separately from correctness. A nonempty extraction is not automatically complete, and a partial extraction stays marked partial. Changing retained text changes the evidence version, so an annotation stays bound to the exact text it was made against.

This is more machinery than a single newsletter needs. It is roughly the minimum for a record that someone might later use to challenge a government decision, where "the text was in the database" is not an answer to "where did that number come from."

What would change the answer

The current position is deliberately narrow. Native text is authoritative. Tesseract remains the default scanned-page path. Generative OCR is a selective, reviewed sidecar. Leptonica Otsu is a candidate for further low-contrast testing, not a new default.

What would move it: an independently transcribed set of low-contrast and ordinary pages, with identifier and qualifier regressions measured separately from prose readability; blank-page and repetition rejection tests; and a compute budget that shows whether a selective olmOCR queue fits a daily run. Until then, the honest claim is that the current cascade is cheaper and more predictable, and that at least one alternative reads some pages better while reading others worse.

Sources & notes

  1. Poliscopic
  2. Tesseract OCR documentation
  3. Poppler utilities
  4. olmOCR 2 model card