mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-02 15:32:30 +00:00
fix for KeyError in tableformer prediction
Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
parent
70d68b6164
commit
8f79e95e74
@ -210,11 +210,22 @@ class TableStructureModel(BasePageModel):
|
|||||||
table_cells.append(tc)
|
table_cells.append(tc)
|
||||||
|
|
||||||
# Retrieving cols/rows, after post processing:
|
# Retrieving cols/rows, after post processing:
|
||||||
|
num_rows = 0
|
||||||
|
num_cols = 0
|
||||||
|
otsl_seq = []
|
||||||
|
if "predict_details" in table_out:
|
||||||
|
if "num_rows" in table_out["predict_details"]:
|
||||||
num_rows = table_out["predict_details"]["num_rows"]
|
num_rows = table_out["predict_details"]["num_rows"]
|
||||||
|
if "num_cols" in table_out["predict_details"]:
|
||||||
num_cols = table_out["predict_details"]["num_cols"]
|
num_cols = table_out["predict_details"]["num_cols"]
|
||||||
otsl_seq = table_out["predict_details"]["prediction"][
|
if "prediction" in table_out["predict_details"]:
|
||||||
|
if (
|
||||||
"rs_seq"
|
"rs_seq"
|
||||||
]
|
in table_out["predict_details"]["prediction"]
|
||||||
|
):
|
||||||
|
otsl_seq = table_out["predict_details"][
|
||||||
|
"prediction"
|
||||||
|
]["rs_seq"]
|
||||||
|
|
||||||
tbl = Table(
|
tbl = Table(
|
||||||
otsl_seq=otsl_seq,
|
otsl_seq=otsl_seq,
|
||||||
|
Loading…
Reference in New Issue
Block a user