File size: 3,967 Bytes
ad844e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-nc-4.0
---
# VisToolBench (Parquet, multi‑image) — 25 single‑turn + 25 multi‑turn

**Short description.** This dataset package contains a **50‑item** subset formatted for the Hugging Face Dataset Viewer with **embedded images** and **clean, minimal fields**. It includes:

- **25 single‑turn** items (each with exactly **1** embedded image),
- **25 multi‑turn** items (each with **one or more** embedded images).

Images are stored as an **array** of 🤗 `datasets.Image` objects in the `images` column, so they render directly in the viewer (no local paths).

---

## Dataset Summary

- **Source files**: two JSON inputs (single‑turn and multi‑turn) sharing a compatible schema (`task_id`, `turncase`, `prompt_category`, `eval_focus`, `prompt`, `rubrics`, etc.).
- **Sampling & balance**: selects **25 single** + **25 multi**, **balanced equally** across the top‑K categories of `--balance_on` (default: `prompt_category`, K=5 → 5 per category per split).
- **Images**: local paths from the JSON are **opened and embedded** into the Parquet as PIL images via the 🤗 `datasets.Image` feature. **No local file paths** are stored in the Parquet.
- **Rubrics**: the `rubrics` column is an **array**. Single‑turn rows contain **one** rubric object (JSON‑encoded string). Multi‑turn rows can contain **multiple** rubric entries (JSON‑encoded strings), typically collected from `turns` if available.
- **Turn type**: use `turncase` (`"single-turn"` or `"multi-turn"`) to distinguish types. No separate `split` or taxonomy columns are included.

---

## Data Fields

| Field | Type | Description |
|---|---|---|
| `id` | `string` | Unique identifier (`task_id`). |
| `turncase` | `string` | `"single-turn"` or `"multi-turn"`. |
| `prompt_category` | `string` | Coarse topic/domain label. |
| `eval_focus` | `string` | Evaluation sub‑category / capability focus. |
| `prompt` | `string` | The user prompt (top‑level for single‑turn; multi‑turn prompts live in `turns` but this field carries the main/initial prompt when present). |
| `images` | `Sequence(Image())` | **Array of embedded images**. Single‑turn items have 1; multi‑turn may have 1+. |
| `rubrics` | `Sequence(string)` | **Array of JSON‑encoded rubric entries**. Single‑turn: exactly 1; multi‑turn: 1+. |

> **No local file paths** are stored in the Parquet. Images are fully embedded for HF viewer compatibility.

---

## Data Instances

**Single‑turn** (1 image, 1 rubric entry):
```jsonc
{
  "id": "7f24b...",
  "turncase": "single-turn",
  "prompt_category": "engineering",
  "eval_focus": "region_switch_qa",
  "prompt": "Count the rebar and compute the area...",
  "images": [ "<Image bytes embedded>" ],
  "rubrics": [ "{ \"criteria\": {\"count_correct\": true, ...} }" ]
}
```

**Multi‑turn** (multiple images, multiple rubric entries):
```jsonc
{
  "id": "a1c89...",
  "turncase": "multi-turn",
  "prompt_category": "finance",
  "eval_focus": "hybrid_tool_reasoning",
  "prompt": "Summarize the option chain from the provided screenshots...",
  "images": [ "<Image1>", "<Image2>", "<Image3>" ],
  "rubrics": [
    "{ \"turn\": 1, \"criteria\": { ... } }",
    "{ \"turn\": 3, \"criteria\": { ... } }"
  ]
}
```

---

## Example Usage

### Load and preview

```python
from datasets import load_dataset
import json

ds = load_dataset("parquet", data_files={"all": "hf_parquet_out/vistoolbench_50.parquet"})["all"]
print(ds)

# Show images for the first row
row = ds[0]
print("turncase:", row["turncase"], "num_images:", len(row["images"]))
display(row["images"][0])  # PIL.Image

# Parse rubrics (array of JSON strings)
rubrics = [json.loads(x) for x in row["rubrics"]]
print(rubrics[0])
```

### Filtering by type or category

```python
single = ds.filter(lambda r: r["turncase"] == "single-turn")
multi  = ds.filter(lambda r: r["turncase"] == "multi-turn")
eng    = ds.filter(lambda r: r["prompt_category"] == "engineering")
```