diff --git a/docling/models/base_ocr_model.py b/docling/models/base_ocr_model.py index 67ada340..75f36195 100644 --- a/docling/models/base_ocr_model.py +++ b/docling/models/base_ocr_model.py @@ -154,6 +154,15 @@ class BaseOcrModel(BasePageModel, BaseModelWithOptions): page.parsed_page.textline_cells = final_cells page.parsed_page.has_lines = len(final_cells) > 0 + # When force_full_page_ocr is used, word/char-level cells from PDF + # are also unreliable. Clear them so downstream components (e.g., table + # structure model) fall back to OCR-extracted textline cells. + if self.options.force_full_page_ocr: + page.parsed_page.word_cells = [] + page.parsed_page.char_cells = [] + page.parsed_page.has_words = False + page.parsed_page.has_chars = False + def _combine_cells( self, existing_cells: List[TextCell], ocr_cells: List[TextCell] ) -> List[TextCell]: