Datasets:
Table HTML with Logical Reasoning
This dataset pairs rendered table images and source HTML with deterministic logical-structure reasoning labels. Version 2 contains 31,490 samples: 28,341 training samples and 3,149 test samples.
The data sources are:
- 21,200 PubTabNet-derived samples.
- 8,690 cropped synthetic medical-document tables from
medical-8forms_v1. - 1,600 cropped synthetic savings-form tables from
the-tiet-kiem_v3_1600_vr.
| Source | Train | Test | Total |
|---|---|---|---|
| PubTabNet | 19,080 | 2,120 | 21,200 |
medical-8forms_v1 |
7,821 | 869 | 8,690 |
the-tiet-kiem_v3_1600_vr |
1,440 | 160 | 1,600 |
| Total | 28,341 | 3,149 | 31,490 |
Each source assigns exactly 10% of its rows to the test split. The split is deterministic: PubTabNet retains rows from its existing test set, while synthetic test rows are selected by a stable hash of the sample ID. Synthetic crops use the annotated Table bounding boxes, scaled from the 1000 by 1000 annotation coordinate space to each source image's actual dimensions. The HTML label preserves the complete inner content of the corresponding table region.
The PubTabNet portion is distributed under CDLA-Permissive-1.0. The repository code is MIT licensed; users should verify the applicable terms for the synthetic document sources before redistribution.
Data Structure
Each row contains:
| Column | Type | Description |
|---|---|---|
id |
string | Stable sample identifier. |
images |
list[image] | One or more rendered images for the table. |
table_html |
string | Source table HTML corresponding to the images. |
reasoning |
string | JSON-encoded logical table reasoning label described below. |
num_rows |
int32 | Number of rows in the expanded logical grid, summed for multi-table regions. |
num_cols |
int32 | Maximum logical column count across tables in the region. |
num_cells |
int32 | Number of physical HTML cells, summed for multi-table regions. |
has_merged_cells |
bool | Whether any cell uses rowspan or colspan. |
validation_passed |
bool | Whether every structural validation check passed. |
num_images |
int32 | Number of images associated with the sample. |
reasoning is stored as a JSON string to preserve the complete label without forcing heterogeneous relation records into a fixed Arrow schema. Parse it with json.loads(row["reasoning"]). The decoded value is normally one reasoning object. A region containing multiple top-level tables uses an array of reasoning objects; one v2 sample has this form.
Reasoning Label
Each decoded reasoning object uses schema version logical_table_reasoning_v1.0 and contains:
schema_version: Version of the logical reasoning schema.sample_id: Identifier for the table within the source HTML file.table_shape: Expanded row and column counts, physical cell count, and merged-cell status.cells: Physical cells in HTML order. Each cell includes normalized text, HTML tag, section, inferred logical role, confidence, span, and its position in the expanded grid.logical_grid: Rectangular row-major grid whose entries referencecell_id. A merged cell therefore appears at every logical position it covers.nullmarks an uncovered position in malformed or incomplete source markup.relations: Structural links.left_ofandaboverepresent immediate logical neighbors;parent_header_ofconnects a spanning header to headers directly beneath it.reasoning_trace: Reproducible operations used to construct the label: declare the table, place each cell, link hierarchical headers, and validate the result.validation: Boolean structural checks for parseability, overlap, placement, spans, dimensions, and grid coverage.html_canonical: BeautifulSoup-normalized form of the source<table>element.requires_visual_enrichment: Whether the deterministic HTML-derived label requires additional visual annotation.
Cell ranges are zero-based and half-open. For example, row_start: 1, row_end: 3 means that the cell covers logical rows 1 and 2. The same convention applies to columns.
Validation Notes
The labels are generated deterministically from source HTML rather than model-generated prose. All 31,490 rows parse and produce 31,491 table reasoning records. Of these rows, 30,897 pass every structural validation check. The remaining 593 preserve imperfect source markup: 589 contain uncovered logical grid positions and 19 contain overlapping logical cells, with 15 rows exhibiting both conditions.
Usage
import json
from datasets import load_dataset
dataset = load_dataset("tungedng2710/table_html_with_reasoning")
sample = dataset["train"][0]
reasoning = json.loads(sample["reasoning"])
records = reasoning if isinstance(reasoning, list) else [reasoning]
print(records[0]["table_shape"])
print(records[0]["logical_grid"][0])
Generation
Table crops were generated with build_raw_table_dataset.py. Version 2 was assembled with build_table_html_reasoning_v2.py, and labels were generated with build_reasoning_from_html.py.
- Downloads last month
- 128