Fix for the tables when using OCR

Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
Maksym Lysak 2025-03-29 09:33:54 +01:00
parent 124f921077
commit d3c10b24a4

View File

@ -229,6 +229,9 @@ class TableStructureModel(BasePageModel):
cell_unit=TextCellUnit.WORD, cell_unit=TextCellUnit.WORD,
bbox=table_cluster.bbox, bbox=table_cluster.bbox,
) )
if len(tcells) == 0:
# In case word-level cells yield empty
tcells = table_cluster.cells
else: else:
# Otherwise - we use normal (line/phrase) cells # Otherwise - we use normal (line/phrase) cells
tcells = table_cluster.cells tcells = table_cluster.cells