Hello,
My use case is extracting semantic content from PDFs for downstream chunking and RAG processing. I am currently evaluating Aspose.OCR for Python via .NET (aspose-ocr-python-net==26.5.0) and ran into layout detection issues on both a single-column technical guideline and a multi-column scientific paper PDF.
I tried the following approaches:
- PDF → DOCX conversion using multiple strategies. This produced many severe issues for my use case, and seems more focused on visual fidelity than semantic extraction.
api.recognize(input_data, settings)withDetectAreasMode.MULTICOLUMN, using the raw recognition outputs.- For text, this was mostly usable after I added my own reading-order correction, especially for multi-column pages.
- However, tables, formulas, figures/images, and other semantic elements were not extracted separately enough for my use case.
- Rerunning each page with
MULTICOLUMN,TABLE, andFORMULAmodes and then combining the results seems expensive and likely to introduce duplicate/conflicting output.
- I then tried
detect_document_layout()as a routing step: detect semantic regions first, then run the appropriate OCR method on each detected area and merge the results. This seemed like the most promising architecture, but I encountered repeated issues with the quality of the detected layout areas.
I am wondering whether there is a better recommended pipeline, additional configuration, preprocessing, model setup, or mitigation for this use case.
I attached a representative sample of problematic pages, along with bbox renderings and detection reports for each. Page numbers refer to the original document page numbers. I also attached the script used to generate the visualizations and reports.
DNV_5_pages.pdf:
- page 17 — list bbox is too narrow; part of the list content is outside the detected region
- page 28 — equation region is misclassified as paragraph/header; another equation/content area appears to be missing from layout detection
- page 38 — list bbox is too narrow; equation region is missed or misclassified as header
- page 40 — equation regions are missed or misclassified as header/image
- page 78 — figure is misclassified as table; equation regions are missed or misclassified as header/paragraph
Resnet_4_pages.pdf:
- page 1 — figure/image and its caption are detected as a single paragraph
- page 7 — table is detected as image; another content area appears to be missing
- page 8 — table is not detected as any semantic area; figure/image and its caption are detected as one image region
- page 11 — tables are detected as paragraphs
Minor paragraph/header/caption differences are not the main concern. The blocking issues are tables, equations, figures/images, missing regions, and bboxes that do not cover the full content, because I need to use detected regions as the routing layer for downstream extraction.
I would appreciate guidance on the following:
- Is
detect_document_layout()intended to distinguish paragraphs, lists, tables, equations, images/figures, captions, and headers reliably enough for downstream routing? - Is there a better-supported Aspose.OCR Python via .NET pipeline for extracting PDF content into separate semantic elements while preserving reading order as much as possible?
- Are there known limitations around reading order, semantic structure, element-level extraction, or layout detection for this type of document?
- If
detect_document_layout()is not intended for this use case, is there another Aspose API/product that would be more appropriate?
For preprocessing I used auto_skew and contrast_correction_filter. I also tried other settings during evaluation, and detect_defects did not report any defects.
Thanks,
Piotr
ocr_layout_topic.zip (4.8 MB)