Skip to content

Commit bf29960

Browse files
committed
Add Table structure evaluations for TEDS
Signed-off-by: Praveen Kumar Midde <praveen.midde@gmail.com>
1 parent 28d166d commit bf29960

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docling_eval/evaluators/table_evaluator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class TableEvaluation(UnitEvaluation):
3232
table_id: int = -1
3333
TEDS: float
3434
is_complex: bool = False
35+
is_structure_only: bool = False
3536

3637
true_ncols: int = -1
3738
pred_ncols: int = -1
@@ -227,7 +228,7 @@ def __call__(
227228
dataset_evaluation = DatasetTableEvaluation(
228229
evaluated_samples=len(table_evaluations),
229230
rejected_samples=rejected_samples,
230-
evaluations=table_evaluations,
231+
evaluations=table_evaluations + table_struct_evaluations,
231232
TEDS=compute_stats(teds_all),
232233
TEDS_struct=compute_stats(teds_struct),
233234
TEDS_simple=compute_stats(teds_simple),
@@ -297,6 +298,7 @@ def _evaluate_tables_in_documents(
297298
pred_ncols=pred_table.data.num_cols,
298299
true_nrows=true_table.data.num_rows,
299300
pred_nrows=pred_table.data.num_rows,
301+
is_structure_only=structure_only,
300302
)
301303
table_evaluations.append(table_evaluation)
302304
except Exception:

0 commit comments

Comments
 (0)