Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docling_eval/evaluators/table_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TableEvaluation(UnitEvaluation):
table_id: int = -1
TEDS: float
is_complex: bool = False
structure_only_evaluation: bool = False

true_ncols: int = -1
pred_ncols: int = -1
Expand All @@ -42,6 +43,7 @@ class TableEvaluation(UnitEvaluation):

class DatasetTableEvaluation(DatasetEvaluation):
evaluations: List[TableEvaluation]
table_structure_evaluations: List[TableEvaluation]

TEDS: DatasetStatistics
TEDS_struct: DatasetStatistics
Expand Down Expand Up @@ -228,6 +230,7 @@ def __call__(
evaluated_samples=len(table_evaluations),
rejected_samples=rejected_samples,
evaluations=table_evaluations,
table_structure_evaluations=table_struct_evaluations,
TEDS=compute_stats(teds_all),
TEDS_struct=compute_stats(teds_struct),
TEDS_simple=compute_stats(teds_simple),
Expand Down Expand Up @@ -297,6 +300,7 @@ def _evaluate_tables_in_documents(
pred_ncols=pred_table.data.num_cols,
true_nrows=true_table.data.num_rows,
pred_nrows=pred_table.data.num_rows,
structure_only_evaluation=structure_only,
)
table_evaluations.append(table_evaluation)
except Exception:
Expand Down