CheneyWong commited on
Commit
8d8bb5e
·
verified ·
1 Parent(s): c0d67ee

table_eval_paddleocr_vl/README.md

Browse files
Files changed (1) hide show
  1. table_eval_paddleocr_vl/README.md +198 -0
table_eval_paddleocr_vl/README.md ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ task_categories:
4
+ - image-to-text
5
+ language:
6
+ - eng
7
+ - zho
8
+ tags:
9
+ - table-recognition
10
+ - ocr
11
+ - otsl
12
+ - parquet
13
+ - evaluation
14
+ ---
15
+
16
+ # PaddleOCR-VL Table Recognition Evaluation Pack
17
+
18
+ Table-recognition evaluation data for PaddleOCR-VL, packaged as **32 self-contained
19
+ parquet shards** with images embedded inline.
20
+
21
+ Every table is stored twice — as **OTSL** and as **canonical HTML** — so it can be
22
+ scored against either dialect without re-deriving one.
23
+
24
+ ## Folders in this repo
25
+
26
+ | Folder | Rows | Images | Use it for |
27
+ |---|---|---|---|
28
+ | `table_eval_paddleocr_vl/` | 240,075 | 152,982 | **Default.** Blocklist already applied |
29
+ | `table_eval_paddleocr_vl_excluded_toolong/` | 3,830 | ~3,635 | The samples withheld from evaluation because their tables are too long |
30
+
31
+ ## Why this exists
32
+
33
+ The source of truth was 49 *cohort* JSONL files pointing at loose image files. Three
34
+ problems made that untenable:
35
+
36
+ 1. **Inodes.** `/autodl-fs/data` is capped at 200,000 inodes and ran at 97%. One file
37
+ per image is the root cause; sharding collapses 240,075 rows into 32 files.
38
+ 2. **Fragility.** 240,417 sample references pointed at `/tmp/povl_v5_*` and
39
+ `/dev/shm/*` — both volatile, wiped on every container restart. Images are now
40
+ embedded and snapshotted.
41
+ 3. **Duplicates.** 51,251 rows were the same sample appearing in more than one cohort.
42
+
43
+ ## Image recovery
44
+
45
+ 164,055 images were recovered by streaming the upstream archives — **100 % hit rate**,
46
+ no partial coverage:
47
+
48
+ | Source | Recovered | Time |
49
+ |---|---|---|
50
+ | PubTables-1M (`PubTables-1M_image_html_test.tar.gz`) | 93,656 / 93,656 | 15 s |
51
+ | SynthTabNet (`SynthTabNet_png_html.tar`) | 43,433 / 43,433 | 388 s |
52
+ | FinTabNet-OTSL (`test.zip`) | 10,197 / 10,197 | 2 s |
53
+ | PubTables-v2 (`PubTables-v2_image_html_test.tar.gz`) | 7,663 / 7,663 | 5 s |
54
+
55
+ `data/packs/` was *not* usable for this — it holds a 30,000-sample random subset of
56
+ PubTables-1M **train**, which has zero overlap with the test split the cohorts
57
+ reference.
58
+
59
+ 87,093 rows (36 %) still carry `has_image = false`. They are the degraded/derived sets
60
+ (`ooddeg`, `opdpool`, `val10k`, `deg`, `CXRender2`) that lived only in `/dev/shm`
61
+ with no surviving upstream archive. Their labels are intact and will work again once
62
+ the images are regenerated.
63
+
64
+ ## Blocklist — why this folder is already filtered
65
+
66
+ Samples whose tables are too long, or whose ground truth is unusable, are excluded at
67
+ **build time** rather than in the scoring script, so the exclusion is auditable:
68
+
69
+ | Rule | Count | Source |
70
+ |---|---|---|
71
+ | `table_too_long` | 2,271 dropped | `*_test_union_excluded_ids.jsonl` |
72
+ | `unusable_gt` | 2 | `sample_blocklist.json` |
73
+
74
+ Dropping is **not** silent. The withheld rows live in
75
+ `table_eval_paddleocr_vl_excluded_toolong/`, flagged with an `excluded_reason` column.
76
+
77
+ Note the id formats differ between the lists and the cohorts
78
+ (`FinTabNet_OTSL_test::X` vs `fintabnet::X`). `povl_v5/src/eval_blocklist.py` performs
79
+ the mapping; comparing the raw strings yields a false "no overlap".
80
+
81
+ ## Schema
82
+
83
+ | column | type | description |
84
+ |---|---|---|
85
+ | `sample_id` | string | Stable id, byte-identical to the source cohort JSONL |
86
+ | `cohort` | string | Primary cohort |
87
+ | `cohorts` | list\<string\> | **All** cohorts this row belongs to (post-dedupe) |
88
+ | `n_cohorts_merged` | int32 | `len(cohorts)`; > 1 means duplicates were merged |
89
+ | `dataset` | string | e.g. `PubTables-1M`, `SynthTabNet` |
90
+ | `origin` | string | `selfbuilt` / `ood` / `public` |
91
+ | `group` | string | `pub` / `ood` / `cx` |
92
+ | `image` | binary | Original encoded bytes, **never re-encoded** |
93
+ | `img_format` | string | `jpeg` / `png` |
94
+ | `has_image` | bool | `false` when the upstream image is gone |
95
+ | `img_w`, `img_h` | int32 | Columns, so eval never decodes to balance load |
96
+ | `megapixels` | float32 | `w*h/1e6` |
97
+ | `res_bucket` | string | `<0.5MP` / `0.5-1MP` / `1-2MP` / `2-4MP` / `>=4MP` |
98
+ | `gt_otsl` | string | OTSL in the model's six-token dialect |
99
+ | `gt_html` | string | Canonical HTML |
100
+ | `gt_format_native` | string | Which of the two is authoritative |
101
+ | `metrics` | list\<string\> | e.g. `["teds_s"]` when only structure matters |
102
+ | `n_rows`, `n_cols`, `n_cells` | int32 | R / C / N |
103
+ | `n_rowspan`, `n_colspan` | int32 | Cells with span > 1 |
104
+ | `max_rowspan`, `max_colspan` | int32 | Largest span in the table |
105
+ | `n_merge_cells` | int32 | M |
106
+ | `complexity` | string | `simple` / `medium` / `complex` |
107
+ | `tags` | list\<string\> | `long`, `wide`, `merge_dense`, … |
108
+ | `numeric_cell_frac` | float32 | Fraction of non-empty cells containing a digit |
109
+ | `has_numeric` | bool | `numeric_cell_frac >= 0.10` |
110
+ | `img_sha1` | string | Content hash of the image bytes |
111
+ | `gt_conflict` | bool | Same image carried a conflicting label |
112
+ | `otsl_legal` | bool | Passed `check_otsl_strict` |
113
+ | `otsl_roundtrip_ok` | bool | OTSL re-parses to the identical grid |
114
+
115
+ **Read `gt_format_native`, not `gt_otsl` blindly.** OTSL→HTML is lossy for tables with
116
+ uncovered holes: `cells_to_otsl` writes `<ecel>` at each hole and re-parsing counts
117
+ every one as its own cell, inflating N. `otsl_roundtrip_ok` flags the affected rows.
118
+
119
+ ## Deduplication
120
+
121
+ **Every row appears exactly once.** Rows are keyed by `sample_id` *and* by
122
+ `(img_sha1, gt_otsl)`; on collision the duplicate is dropped and its cohort appended to
123
+ the survivor's `cohorts` list. 291,917 references collapsed to 240,075 rows via 51,251
124
+ exact merges, without losing cohort membership information.
125
+
126
+ 591 rows hit the **conflict** path — the same image with two different labels. They are
127
+ flagged `gt_conflict=true` and recorded in `DEDUP_CONFLICTS.jsonl`. They cluster in
128
+ `ood_oodtrain`, where a multi-table newspaper page was never cropped to the individual
129
+ table, so one page image was paired with the GT of two unrelated tables. That is an
130
+ annotation defect in the source cohort, not a packaging artifact.
131
+
132
+ ## Distributions
133
+
134
+ ### Table geometry
135
+
136
+ | metric | min | p25 | p50 | p75 | p90 | p99 | max |
137
+ |---|---|---|---|---|---|---|---|
138
+ | Rows (R) | 1 | 7 | 12 | 20 | 32 | 49 | 132 |
139
+ | Columns (C) | 1 | 4 | 5 | 8 | 12 | 15 | 115 |
140
+ | Cells (N) | 1 | 30 | 62 | 119 | 182 | 345 | 5,060 |
141
+ | Cells with rowspan>1 | 0 | 0 | 0 | 2 | 5 | 16 | 355 |
142
+ | Cells with colspan>1 | 0 | 0 | 1 | 3 | 6 | 14 | 316 |
143
+ | Max rowspan | 1 | 1 | 1 | 2 | 4 | 10 | 99 |
144
+ | Max colspan | 1 | 1 | 2 | 4 | 6 | 11 | 51 |
145
+
146
+ ### Image geometry
147
+
148
+ | metric | min | p25 | p50 | p75 | p90 | p99 | max |
149
+ |---|---|---|---|---|---|---|---|
150
+ | Width (px) | 103 | 416 | 512 | 608 | 653 | 895 | 957 |
151
+ | Height (px) | 9 | 140 | 241 | 425 | 512 | 899 | 925 |
152
+ | Megapixels | 0.001 | 0.066 | 0.123 | 0.205 | 0.277 | 0.708 | 0.810 |
153
+
154
+ ### Categorical
155
+
156
+ | Origin | Count | Share |
157
+ |---|---|---|
158
+ | public | 190,034 (79.2%) | ood | 41,567 (17.3%) | selfbuilt | 8,474 (3.5%) |
159
+
160
+ | `has_numeric` | Count | Share |
161
+ |---|---|---|
162
+ | True | 225,748 (94.0%) | False | 14,327 (6.0%) |
163
+
164
+ | Resolution bucket | Count | Share |
165
+ |---|---|---|
166
+ | <0.5MP | 235,687 (98.2%) | 0.5-1MP | 4,388 (1.8%) |
167
+
168
+ | Complexity | Count | Share |
169
+ |---|---|---|
170
+ | medium | 100,153 (41.7%) | complex | 93,554 (39.0%) | simple | 46,368 (19.3%) |
171
+
172
+ | Native GT format | Count | Share |
173
+ |---|---|---|
174
+ | otsl | 218,601 (91.1%) | html | 21,474 (8.9%) |
175
+ ## Scoring
176
+
177
+ Predictions and ground truth are normalised to canonical HTML before TEDS, so a model
178
+ that answers in OTSL and one that answers in HTML are compared on equal terms.
179
+
180
+ ```python
181
+ import sys; sys.path.insert(0, "povl_v5/src")
182
+ import eval_mix
183
+ rows = eval_mix.load_from_packs("data/eval_packs_filtered")
184
+ ```
185
+
186
+ Or with the CLI:
187
+
188
+ ```bash
189
+ python povl_v5/src/eval_mix.py --model DIR --tag run1 \
190
+ --packs povl_v5/data/eval_packs_filtered --gpus 0 1 2 3
191
+ ```
192
+
193
+ Images resolve lazily per request through `eval_pack_reader.py`. Never call
194
+ `pq.read_table(shard).to_pylist()` on the inference path — it re-decodes an entire row
195
+ group per request and collapses under concurrency.
196
+
197
+ For the SPRINT-MUSTARD family the GT is deliberately all-empty `<td>`, so **only TEDS-S
198
+ is meaningful**; its TEDS column reads artificially low.