fix: fix ZeroDivisionError for cell_bbox.area() (#1636)

fix ZeroDivisionError for cell_bbox.area()

Signed-off-by: Saidgurbuz <said.gurbuz@epfl.ch>
This commit is contained in:
Said Gürbüz
2025-05-22 13:43:33 +02:00
committed by GitHub
parent 45265bf8b1
commit c2f595d283
4 changed files with 13 additions and 25 deletions

View File

@@ -60,7 +60,7 @@ class DoclingParsePageBackend(PdfPageBackend):
coord_origin=CoordOrigin.BOTTOMLEFT,
).to_top_left_origin(page_height=page_size.height * scale)
overlap_frac = cell_bbox.intersection_area_with(bbox) / cell_bbox.area()
overlap_frac = cell_bbox.intersection_over_self(bbox)
if overlap_frac > 0.5:
if len(text_piece) > 0: