File size: 4,964 Bytes
028d4be
 
6d456ac
028d4be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d456ac
 
028d4be
 
6d456ac
028d4be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d456ac
028d4be
 
 
 
 
 
 
 
 
 
 
 
6d456ac
028d4be
 
6d456ac
 
 
 
 
 
 
028d4be
6d456ac
 
 
 
028d4be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d456ac
 
028d4be
 
 
 
6d456ac
028d4be
6d456ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
pretty_name: AmbiHTMLBench
license: mit
language:
  - en
  - zh
task_categories:
  - image-to-text
tags:
  - document-understanding
  - html
  - benchmark
size_categories:
  - 1K<n<10K
configs:
  - config_name: pages
    data_files:
      - split: test
        path: index/pages.jsonl
---

# AmbiHTMLBench

**Reconstruct document page images as executable HTML.**

[Code](https://github.com/theseus-labs-rsi/AmbiHTMLBench) | [Browse pages](https://ambihtmlbench.tech) | [Download ZIP](https://huggingface.co/datasets/Theseus-Lab/AmbiHTMLBench/resolve/main/archives/AmbiHTMLBench.zip?download=true)

AmbiHTMLBench evaluates content, structure, and visual fidelity in image-to-HTML
reconstruction. The benchmark covers institutional PDF documents, web-native
documentation, newspapers and magazines, and posters or design-heavy pages.

## What is included

| Material | This release |
|---|---:|
| Reference page images | 1,115 |
| Annotated blocks | 28,939 |
| Annotation version | GT v5 |
| Evaluation split | `test` |

Each page has an original image and a complete block-annotation JSON file.
Images retain their original bytes, resolution and format. The `test` split is
for evaluation; it is not a training split. This package contains reference
materials, not model predictions or judge records.

## Download and use

Download the [complete ZIP](https://huggingface.co/datasets/Theseus-Lab/AmbiHTMLBench/resolve/main/archives/AmbiHTMLBench.zip?download=true) and extract it, or fetch the repository:

```python
from huggingface_hub import snapshot_download

snapshot_download(repo_id="Theseus-Lab/AmbiHTMLBench", repo_type="dataset",
                  local_dir="AmbiHTMLBench", ignore_patterns=["archives/*"])
```

Read a page from the downloaded directory:

```python
import json
from pathlib import Path
from PIL import Image

root = Path("AmbiHTMLBench")
rows = [json.loads(line) for line in (root / "index/pages.jsonl").read_text(encoding="utf-8").splitlines()]
page_id = "0001"
page = next(row for row in rows if row["page_id"] == page_id)
image = Image.open(root / page["image_path"])
annotation = json.loads((root / page["annotation_path"]).read_text(encoding="utf-8"))
assert annotation["ID"] == int(page_id)
```

For the lightweight index only:

```python
from datasets import load_dataset

pages = load_dataset("Theseus-Lab/AmbiHTMLBench", "pages", split="test")
```

The viewer contains **one metadata row per page**. Full images and annotations
are in the linked page directories; loading the index does not download them.
Use a fixed Hub commit revision when reproducing an experiment.

## Dataset structure

```text
README.md
LICENSE
release.json
manifest.json
SHA256SUMS
index/pages.jsonl
pages/0001/image.<original-format>
pages/0001/annotation.json
...
annotations/AmbiHTMLBench_GT_v5_1115.json
archives/AmbiHTMLBench.zip
```

Index rows contain `page_id`, `path`, `image_path`, `annotation_path`,
`image_width`, `image_height`, `block_count`, and `annotation_version`.
All file paths are relative to the dataset repository root.

Page IDs are four-digit strings (`0001` through `1115` in the full release).
Each ID links the image and ground truth in `pages/<page_id>/`; the index
provides their exact local paths. The numeric `ID` in each annotation and in
the aggregate ground truth identifies the same page.

Each `annotation.json` contains `ID` and the complete original `contentList`.
Blocks contain semantic labels in `name`, text/table/formula
content in `remark`, and pixel coordinates in `left`, `top`, `width`, `height`
where present. Optional block fields and Unicode text are retained. The aggregate
GT file contains the same page annotations. Source image URL fields are omitted
from the index, annotations, manifest and ZIP. Images are loaded from downloaded
files using the ID-to-path mapping; no source URL lookup is needed or provided.

`SHA256SUMS` covers expanded files and the ZIP, excluding itself. `manifest.json`
records source and image identities and expanded-file digests, excluding itself
and the ZIP. The ZIP contains the expanded release and manifest, without the
outer ZIP or `SHA256SUMS`.

## Evaluation

Install and follow the [evaluation code](https://github.com/theseus-labs-rsi/AmbiHTMLBench).
Use the aggregate GT JSON and separately generated HTML predictions to measure
table, text and layout fidelity. For offline reference visualizations, resolve
each page's local image through the index. This GT v5 release is separate from
the frozen OLS5 subjective experiment's input snapshot.

## Materials and intended use

Reference pages include diverse layouts and multilingual text. Images are
included in the release and can be used offline after download.
The public annotations are evaluation references and should not be supplied as
inputs to models being evaluated. Exposure or training contamination can affect
comparisons.

## License

This dataset is released under the [MIT License](LICENSE).