doc-router
PDF page router that uses Jev to identify pages needing OCR, extracts text pages locally, and merges the results in order.
PDF page router that uses Jev to identify pages needing OCR, extracts text pages locally, and merges the results in order.
The Rust Jev judge builds a state array of page evidence and a Noul question per page keyed by its page number. The returned probabilities decide which PDF pages need OCR; usable text pages are extracted locally.
Does this named page need to be re-read with OCR because its text is missing or does not faithfully represent the printed page? The key is generated from the page number.
For each page: number, clipped text (up to 2,000 characters), original text length and truncation flag, inspector reasons, table/column flags, and encoding issue flag.
The router extracts PDF page text and local quality indicators, and groups pages into bounded Jev request chunks.
One Noul question is created for each page in a chunk; responses are matched by page key rather than answer order.
Pages with usable text stay local; pages judged to need OCR go to the configured provider, and results are merged in page order.
It spends OCR calls only where the existing PDF text layer appears missing or misleading, with a recorded 155-page benchmark and a strict answer-key check to avoid silently routing pages incorrectly.