File size: 5,366 Bytes
4d058f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-4.0
pretty_name: Chart Parsing Benchmark
language:
  - en
task_categories:
  - image-to-text
  - image-text-to-text
tags:
  - chart
  - chart-understanding
  - chart-to-table
  - structured-extraction
  - benchmark
  - leaderboard
size_categories:
  - 1K<n<10K
configs:
  - config_name: default
    data_files:
      - split: test
        path: data/test-*
---

# Chart Parsing Benchmark

**Chart image in, structured JSON out.** A fixed, test-only benchmark for turning a chart image into its
title, chart type, data table, encoding, axes, series, legend, and data labels. It holds
**2500 charts** and is the set behind the [leaderboard](https://huggingface.co/spaces/nutrientdocs/chart-parsing-leaderboard). Every entry sees the same charts and the same
prompt, and the reference scorer ships in this repository, so any result here can be reproduced.

- 🎯 **Model:** [`nutrientdocs/chart-parsing-vlm`](https://huggingface.co/nutrientdocs/chart-parsing-vlm)
- 🧪 **Try it:** [`nutrientdocs/chart-parsing-demo`](https://huggingface.co/spaces/nutrientdocs/chart-parsing-demo)
- 🏆 **Leaderboard:** [`nutrientdocs/chart-parsing-leaderboard`](https://huggingface.co/spaces/nutrientdocs/chart-parsing-leaderboard)

| chart type | charts |
| --- | --- |
| line | 552 |
| bar | 463 |
| pie | 249 |
| scatter | 235 |
| area | 224 |
| box | 171 |
| bubble | 164 |
| heatmap | 100 |
| histogram | 54 |
| treemap | 54 |
| combo | 51 |
| funnel | 49 |
| radar | 46 |
| violin | 33 |
| stem | 25 |
| step | 15 |
| candlestick | 15 |

## Task and prompt

Every entry on the leaderboard uses the same system prompt and instruction, shipped with the scorer. The
model returns one JSON object. The `target` column holds the reference JSON as a string.

## Metrics

The ranking metric is the **mean per-chart cell F1 at 3% tolerance** (`mean_f1_tol3`): each chart's data cells
are scored for precision, recall, and F1, and the per-chart F1 is averaged so every chart counts once,
whatever its table size. Cells are never pooled across charts.

A cell matches when its row identity (the first column plus every text column) and its column agree and
the value is close enough. Row order never matters. Tables with a single value column, or whose rows all
repeat one value, match on row identity alone. Three tolerance levels are reported side by side:

| metric | a value counts as correct when it is |
|---|---|
| `mean_f1` | strict: relative 1e-3 |
| `mean_f1_tol3` | exact (relative 1e-3) when the chart prints data labels, 3% in percentage points for share charts (pie, donut, 100%-stacked, treemap), otherwise 3% of the chart's value range. Histogram bin-edge columns are not scored; histograms are scored on the per-bin frequency |
| `mean_f1_tol5` | exact (relative 1e-3) when the chart prints data labels, 5% in percentage points for share charts (pie, donut, 100%-stacked, treemap), otherwise 5% of the chart's value range. Histogram bin-edge columns are not scored; histograms are scored on the per-bin frequency |

The 3% level is the ranking metric because it matches what a careful reader can recover from the pixels;
the strict level exposes models that copy printed labels well, and the 5% level shows how much is lost
to small estimation error. Also reported: table shape match, per-field accuracy (chart type, title, axis
labels, scales, legend, data labels, column types and roles), and set F1 for `encoding` and `series`.

## Scoring

```bash
python score.py --benchmark-repo nutrientdocs/chart-parsing-benchmark \
  --predictions preds.jsonl --out result.json --name my-model
```

`preds.jsonl` has one `{"id": ..., "text": ...}` line per chart, where `text` is the raw model output.
The scorer is self-contained and needs only `datasets`. Submit the resulting JSON with the model ID,
license, and runtime details for review. Entries on the leaderboard carry one of three labels:

| label | meaning |
|---|---|
| `commercial` | Nutrient model, weights under a commercial Nutrient license |
| `provider` | cloud model reached through its vendor API |
| `open` | open-weight model served locally with the benchmark prompt |

## Schema

```python
from datasets import load_dataset
benchmark = load_dataset("nutrientdocs/chart-parsing-benchmark", split="test")
```

| Field | Meaning |
|---|---|
| `id` | Stable chart identifier |
| `image` | RGB chart image |
| `chart_type`, `title` | Flat copies of target fields for filtering |
| `category` | Source label from ChartGen |
| `data_source` | Always `render` in this set |
| `target` | Reference JSON as a string |

## License and attribution

Charts derive from [SD122025/ChartGen-200K](https://huggingface.co/datasets/SD122025/ChartGen-200K),
released under CC BY 4.0. This benchmark keeps the same license. The Nutrient Chart Parsing model
evaluated on it is commercial; to evaluate or deploy it, [contact Nutrient](https://www.nutrient.io/contact-sales/).

## About the author

<a href="https://nutrient.io/">
  <img src="https://avatars2.githubusercontent.com/u/1527679?v=3&s=200" height="80" />
</a>

This project is maintained and funded by [Nutrient](https://nutrient.io/) - The deterministic document infrastructure enterprises run their highest-stakes workflows on: replayable output, clear exceptions, and full audit trails on the messy, regulated documents where AI alone breaks.