add region-based text extraction for hybrid OCR pipelines

Add `extract_text_in_regions_mem` that takes layout-detected bounding
boxes (top-left origin, PDF points) and returns text within each region
in reading order. Designed for pipelines where a layout model detects
regions and text-based pages can skip GPU OCR by extracting text from
the PDF structure directly.

Also add `classify_pdf_mem` for lightweight PDF type classification
returning 0-indexed pages_needing_ocr.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-04-02 02:35:05 -07:00
co-authored by Claude Opus 4.6
parent 4d52d7af52
commit 263ed0aa42
2 changed files with 226 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
//!
//! This module extracts text with position information for structure detection.
mod content_stream;
pub(crate) mod content_stream;
mod fonts;
mod layout;
mod links;