Update GT test files for pages

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
Christoph Auer
2024-09-25 15:54:55 +02:00
parent 48d8b7bf70
commit ad2bd714d4
10 changed files with 24 additions and 46 deletions

View File

@@ -62,7 +62,7 @@ _EMPTY_DOC = DsDocument(
)
_EMPTY_DOCLING_DOC = DoclingDocument(
description={}, file_info=FileInfo(document_hash="123xyz")
description={}, file_info=FileInfo(filename="dummy", document_hash="123xyz")
) # TODO: Stub

View File

@@ -4,6 +4,7 @@ from typing import Iterable, List
import numpy
from docling_core.types.experimental.base import BoundingBox
from docling_core.types.experimental.document import TableCell
from docling_core.types.experimental.labels import DocItemLabel
from docling_ibm_models.tableformer.data_management.tf_predictor import TFPredictor
from PIL import ImageDraw
@@ -74,7 +75,7 @@ class TableStructureModel:
],
)
for cluster in page.predictions.layout.clusters
if cluster.label == "Table"
if cluster.label == DocItemLabel.TABLE
]
if not len(in_tables):
yield page
@@ -138,7 +139,7 @@ class TableStructureModel:
id=table_cluster.id,
page_no=page.page_no,
cluster=table_cluster,
label="Table",
label=DocItemLabel.TABLE,
)
page.predictions.tablestructure.table_map[table_cluster.id] = tbl