Repository navigation
Conversation
|
✅ DCO Check Passed Thanks @dobi02, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
…ub.com> I, dobi02 <88780600+dobi02@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 3666f65 Signed-off-by: dobi02 <88780600+dobi02@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@dobi02 can you please explain in more detail what you consider the desired behavior? I don't fully see it from this proposal. It appears to be working around a UnicodeDecodeError raised by docling-parse but how does it relate to full-page OCR? |
|
@cau-git @dolfim-ibm The connection to full-page OCR is the pipeline stage ordering and which text cells are authoritative:
This PR keeps the fallback deliberately narrow: it is enabled only when do_ocr is true and ocr_options.mode == OcrMode.FULL_PAGE. In every other OCR mode, the original exception is still raised because those modes may depend on native text cells. The empty SegmentedPdfPage is only used as the page geometry/container required by the OCR stage. Full-page OCR then populates its textline cells with the OCR result. The table-structure change is related for the same reason: after OCR, page.parsed_page is the pipeline’s current, OCR-updated page state. Calling page._backend.get_segmented_page() again would both retry the failing native decode and ignore the OCR-updated cells. I agree that docling-parse could also be made more tolerant of individual malformed text cells. I see that as a complementary upstream fix; the Docling-side fallback is where we can apply the mode-specific policy that native text failure is recoverable only for explicitly requested full-page OCR. I reproduced this with the PDF attached to #3887: the page image renders successfully, and after the fallback RapidOCR completes the conversion and produces OCR text. |
Summary
Testing
uv run pytest tests/test_page_preprocessing_model.py tests/test_threaded_pipeline.py -q(6 passed)uv run prek run --files docling/models/stages/page_preprocessing/page_preprocessing_model.py docling/models/stages/table_structure/table_structure_model.py docling/pipeline/standard_pdf_pipeline.py docling/pipeline/legacy_standard_pdf_pipeline.py tests/test_page_preprocessing_model.pysuccess, one page produced, and 190 characters of OCR outputFixes #3887