File size: 7,969 Bytes
f266e0a
 
 
 
 
 
 
 
 
4a62d87
f266e0a
b121c7b
f266e0a
3971fdd
f266e0a
40f241e
 
43c982f
 
3971fdd
f266e0a
3971fdd
f266e0a
3971fdd
f266e0a
3971fdd
f266e0a
3971fdd
f266e0a
3971fdd
f266e0a
3971fdd
f266e0a
3971fdd
f266e0a
3971fdd
9baf099
3971fdd
f266e0a
bfcf84f
f266e0a
43c982f
 
 
 
f266e0a
 
bfcf84f
 
 
 
b121c7b
f266e0a
57cd858
f266e0a
2213aba
 
9919528
 
57cd858
f266e0a
57cd858
f266e0a
57cd858
f266e0a
57cd858
f266e0a
57cd858
f266e0a
57cd858
f266e0a
57cd858
f266e0a
57cd858
f266e0a
57cd858
54ca062
57cd858
f266e0a
7ce6057
f266e0a
9919528
 
 
 
f266e0a
 
7ce6057
 
 
 
f266e0a
 
a2cdc02
f266e0a
4cf9879
 
149dbba
 
a2cdc02
f266e0a
a2cdc02
f266e0a
a2cdc02
f266e0a
a2cdc02
f266e0a
a2cdc02
f266e0a
a2cdc02
f266e0a
a2cdc02
f266e0a
a2cdc02
f266e0a
a2cdc02
ebcff28
a2cdc02
f266e0a
f238bba
f266e0a
149dbba
 
 
 
f266e0a
 
f238bba
 
 
 
b121c7b
f266e0a
b121c7b
 
b8210ff
 
427079c
 
b121c7b
f266e0a
b121c7b
f266e0a
b121c7b
f266e0a
b121c7b
f266e0a
b121c7b
f266e0a
b121c7b
f266e0a
b121c7b
f266e0a
b121c7b
f266e0a
b121c7b
cbc1b61
b121c7b
f266e0a
37cf9f1
f266e0a
427079c
 
 
 
f266e0a
 
37cf9f1
 
 
 
12179e7
 
 
 
 
 
 
 
4801fc6
 
 
 
12179e7
 
 
 
4801fc6
 
 
 
0f6bfd9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f266e0a
b121c7b
 
 
 
f266e0a
 
 
 
 
 
 
 
b121c7b
f266e0a
 
b121c7b
12179e7
 
 
 
0f6bfd9
 
 
 
f266e0a
 
 
 
 
 
 
 
 
 
000d34c
9c9f436
 
000d34c
e33a589
 
 
000d34c
9c9f436
 
e98b467
9c9f436
 
000d34c
9c9f436
000d34c
 
 
9c9f436
e98b467
e33a589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
---
language:
- en
license: apache-2.0
size_categories:
- 1K<n<10K
task_categories:
- question-answering
- visual-question-answering
pretty_name: Image2Structure - Latex
dataset_info:
- config_name: algorithm
  features:
  - name: structure
    dtype: string
  - name: text
    dtype: string
  - name: image
    dtype: image
  - name: download_url
    dtype: string
  - name: instance_name
    dtype: string
  - name: date
    dtype: string
  - name: additional_info
    dtype: string
  - name: date_scrapped
    dtype: string
  - name: file_filters
    dtype: string
  - name: compilation_info
    dtype: string
  - name: rendering_filters
    dtype: string
  - name: assets
    sequence: string
  - name: category
    dtype: string
  - name: uuid
    dtype: string
  - name: length
    dtype: string
  - name: difficulty
    dtype: string
  splits:
  - name: validation
    num_bytes: 35687268.0
    num_examples: 300
  download_size: 33800484
  dataset_size: 35687268.0
- config_name: equation
  features:
  - name: structure
    dtype: string
  - name: text
    dtype: string
  - name: image
    dtype: image
  - name: download_url
    dtype: string
  - name: instance_name
    dtype: string
  - name: date
    dtype: string
  - name: additional_info
    dtype: string
  - name: date_scrapped
    dtype: string
  - name: file_filters
    dtype: string
  - name: compilation_info
    dtype: string
  - name: rendering_filters
    dtype: string
  - name: assets
    sequence: string
  - name: category
    dtype: string
  - name: uuid
    dtype: string
  - name: length
    dtype: string
  - name: difficulty
    dtype: string
  splits:
  - name: validation
    num_bytes: 6048536.0
    num_examples: 300
  download_size: 4696512
  dataset_size: 6048536.0
- config_name: plot
  features:
  - name: structure
    dtype: string
  - name: text
    dtype: string
  - name: image
    dtype: image
  - name: download_url
    dtype: string
  - name: instance_name
    dtype: string
  - name: date
    dtype: string
  - name: additional_info
    dtype: string
  - name: date_scrapped
    dtype: string
  - name: file_filters
    dtype: string
  - name: compilation_info
    dtype: string
  - name: rendering_filters
    dtype: string
  - name: assets
    sequence: string
  - name: category
    dtype: string
  - name: uuid
    dtype: string
  - name: length
    dtype: string
  - name: difficulty
    dtype: string
  splits:
  - name: validation
    num_bytes: 12245318.0
    num_examples: 300
  download_size: 8209981
  dataset_size: 12245318.0
- config_name: table
  features:
  - name: structure
    dtype: string
  - name: text
    dtype: string
  - name: image
    dtype: image
  - name: download_url
    dtype: string
  - name: instance_name
    dtype: string
  - name: date
    dtype: string
  - name: additional_info
    dtype: string
  - name: date_scrapped
    dtype: string
  - name: file_filters
    dtype: string
  - name: compilation_info
    dtype: string
  - name: rendering_filters
    dtype: string
  - name: assets
    sequence: string
  - name: category
    dtype: string
  - name: uuid
    dtype: string
  - name: length
    dtype: string
  - name: difficulty
    dtype: string
  splits:
  - name: validation
    num_bytes: 30860645.0
    num_examples: 300
  download_size: 29140278
  dataset_size: 30860645.0
- config_name: wild
  features:
  - name: image
    dtype: image
  - name: additional_info
    dtype: string
  - name: assets
    sequence: string
  - name: category
    dtype: string
  - name: uuid
    dtype: string
  - name: difficulty
    dtype: string
  splits:
  - name: validation
    num_bytes: 163753.0
    num_examples: 2
  download_size: 157850
  dataset_size: 163753.0
- config_name: wild_legacy
  features:
  - name: image
    dtype: image
  - name: url
    dtype: string
  - name: instance_name
    dtype: string
  - name: date_scrapped
    dtype: string
  - name: uuid
    dtype: string
  - name: category
    dtype: string
  - name: additional_info
    dtype: string
  - name: assets
    sequence: string
  - name: difficulty
    dtype: string
  splits:
  - name: validation
    num_bytes: 497129.0
    num_examples: 50
  download_size: 496777
  dataset_size: 497129.0
configs:
- config_name: algorithm
  data_files:
  - split: validation
    path: algorithm/validation-*
- config_name: equation
  data_files:
  - split: validation
    path: equation/validation-*
- config_name: plot
  data_files:
  - split: validation
    path: plot/validation-*
- config_name: table
  data_files:
  - split: validation
    path: table/validation-*
- config_name: wild
  data_files:
  - split: validation
    path: wild/validation-*
- config_name: wild_legacy
  data_files:
  - split: validation
    path: wild_legacy/validation-*
tags:
- biology
- finance
- economics
- math
- physics
- computer_science
- electronics
- statistics
---

# Image2Struct - Latex
[Paper](TODO) | [Website](https://crfm.stanford.edu/helm/image2structure/latest/) | Datasets ([Webpages](https://huggingface.co/datasets/stanford-crfm/i2s-webpage), [Latex](https://huggingface.co/datasets/stanford-crfm/i2s-latex), [Music sheets](https://huggingface.co/datasets/stanford-crfm/i2s-musicsheet)) | [Leaderboard](https://crfm.stanford.edu/helm/image2structure/latest/#/leaderboard) | [HELM repo](https://github.com/stanford-crfm/helm) | [Image2Struct repo](https://github.com/stanford-crfm/image2structure)

**License:** [Apache License](http://www.apache.org/licenses/) Version 2.0, January 2004
                        

## Dataset description
Image2struct is a benchmark for evaluating vision-language models in practical tasks of extracting structured information from images.
This subdataset focuses on LaTeX code. The model is given an image of the expected output with the prompt:
```Please provide the LaTex code used to generate this image. Only generate the code relevant to what you see. Your code will be surrounded by all the imports necessary as well as the begin and end document delimiters.```

 The subjects were collected on ArXiv and are: eess, cs, stat, math, physics, econ, q-bio, q-fin.
 
 The dataset is divided into 5 categories. There are 4 categories that are collected automatically using the [Image2Struct repo](https://github.com/stanford-crfm/image2structure):
* equations
* tables
* algorithms
* code

The last category: **wild**, was collected by taking screenshots of equations in the Wikipedia page of "equation" and its related pages.

## Uses

To load the subset `equation` of the dataset to be sent to the model under evaluation in Python:

```python
import datasets
datasets.load_dataset("stanford-crfm/i2s-latex", "equation", split="validation")
```


To evaluate a model on Image2Latex (equation) using [HELM](https://github.com/stanford-crfm/helm/), run the following command-line commands:

```sh
pip install crfm-helm
helm-run --run-entries image2latex:subset=equation,model=vlm --models-to-run google/gemini-pro-vision --suite my-suite-i2s --max-eval-instances 10
```

You can also run the evaluation for only a specific `subset` and `difficulty`:
```sh
helm-run --run-entries image2latex:subset=equation,difficulty=hard,model=vlm --models-to-run google/gemini-pro-vision --suite my-suite-i2s --max-eval-instances 10
```

For more information on running Image2Struct using [HELM](https://github.com/stanford-crfm/helm/), refer to the [HELM documentation](https://crfm-helm.readthedocs.io/) and the article on [reproducing leaderboards](https://crfm-helm.readthedocs.io/en/latest/reproducing_leaderboards/).

## Citation

**BibTeX:**

```tex
@misc{roberts2024image2struct,
      title={Image2Struct: A Benchmark for Evaluating Vision-Language Models in Extracting Structured Information from Images}, 
      author={Josselin Somerville Roberts and Tony Lee and Chi Heem Wong and Michihiro Yasunaga and Yifan Mai and Percy Liang},
      year={2024},
      eprint={TBD},
      archivePrefix={arXiv},
      primaryClass={TBD}
}
```