Skip to content

Commit 758f6dc

Browse files
authored
feat: Add Table structure evaluations for TEDS (#94)
* Add Table structure evaluations for TEDS Signed-off-by: Praveen Kumar Midde <[email protected]> * Rename the field to structure_only_evaluation Signed-off-by: Praveen Kumar Midde <[email protected]> * Review comment - new structure_only_evaluations in DatasetTableEvaluation Signed-off-by: Praveen Kumar Midde <[email protected]> * Rename field to 'table_structure_evaluations' Signed-off-by: Praveen Kumar Midde <[email protected]> --------- Signed-off-by: Praveen Kumar Midde <[email protected]>
1 parent 30bc01f commit 758f6dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docling_eval/evaluators/table_evaluator.py

Lines changed: 4 additions & 0 deletions
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+
structure_only_evaluation: bool = False
3536

3637
true_ncols: int = -1
3738
pred_ncols: int = -1
@@ -42,6 +43,7 @@ class TableEvaluation(UnitEvaluation):
4243

4344
class DatasetTableEvaluation(DatasetEvaluation):
4445
evaluations: List[TableEvaluation]
46+
table_structure_evaluations: List[TableEvaluation]
4547

4648
TEDS: DatasetStatistics
4749
TEDS_struct: DatasetStatistics
@@ -227,6 +229,7 @@ def __call__(
227229
evaluated_samples=len(table_evaluations),
228230
rejected_samples=rejected_samples,
229231
evaluations=table_evaluations,
232+
table_structure_evaluations=table_struct_evaluations,
230233
TEDS=compute_stats(teds_all),
231234
TEDS_struct=compute_stats(teds_struct),
232235
TEDS_simple=compute_stats(teds_simple),
@@ -295,6 +298,7 @@ def _evaluate_tables_in_documents(
295298
pred_ncols=pred_table.data.num_cols,
296299
true_nrows=true_table.data.num_rows,
297300
pred_nrows=pred_table.data.num_rows,
301+
structure_only_evaluation=structure_only,
298302
)
299303
table_evaluations.append(table_evaluation)
300304
except Exception:

0 commit comments

Comments
 (0)