Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,101 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: cc-by-nc-4.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
---
|
| 4 |
+
# VisToolBench (Parquet, multi‑image) — 25 single‑turn + 25 multi‑turn
|
| 5 |
+
|
| 6 |
+
**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:
|
| 7 |
+
|
| 8 |
+
- **25 single‑turn** items (each with exactly **1** embedded image),
|
| 9 |
+
- **25 multi‑turn** items (each with **one or more** embedded images).
|
| 10 |
+
|
| 11 |
+
Images are stored as an **array** of 🤗 `datasets.Image` objects in the `images` column, so they render directly in the viewer (no local paths).
|
| 12 |
+
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
## Dataset Summary
|
| 16 |
+
|
| 17 |
+
- **Source files**: two JSON inputs (single‑turn and multi‑turn) sharing a compatible schema (`task_id`, `turncase`, `prompt_category`, `eval_focus`, `prompt`, `rubrics`, etc.).
|
| 18 |
+
- **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).
|
| 19 |
+
- **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.
|
| 20 |
+
- **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.
|
| 21 |
+
- **Turn type**: use `turncase` (`"single-turn"` or `"multi-turn"`) to distinguish types. No separate `split` or taxonomy columns are included.
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
## Data Fields
|
| 26 |
+
|
| 27 |
+
| Field | Type | Description |
|
| 28 |
+
|---|---|---|
|
| 29 |
+
| `id` | `string` | Unique identifier (`task_id`). |
|
| 30 |
+
| `turncase` | `string` | `"single-turn"` or `"multi-turn"`. |
|
| 31 |
+
| `prompt_category` | `string` | Coarse topic/domain label. |
|
| 32 |
+
| `eval_focus` | `string` | Evaluation sub‑category / capability focus. |
|
| 33 |
+
| `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). |
|
| 34 |
+
| `images` | `Sequence(Image())` | **Array of embedded images**. Single‑turn items have 1; multi‑turn may have 1+. |
|
| 35 |
+
| `rubrics` | `Sequence(string)` | **Array of JSON‑encoded rubric entries**. Single‑turn: exactly 1; multi‑turn: 1+. |
|
| 36 |
+
|
| 37 |
+
> **No local file paths** are stored in the Parquet. Images are fully embedded for HF viewer compatibility.
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## Data Instances
|
| 42 |
+
|
| 43 |
+
**Single‑turn** (1 image, 1 rubric entry):
|
| 44 |
+
```jsonc
|
| 45 |
+
{
|
| 46 |
+
"id": "7f24b...",
|
| 47 |
+
"turncase": "single-turn",
|
| 48 |
+
"prompt_category": "engineering",
|
| 49 |
+
"eval_focus": "region_switch_qa",
|
| 50 |
+
"prompt": "Count the rebar and compute the area...",
|
| 51 |
+
"images": [ "<Image bytes embedded>" ],
|
| 52 |
+
"rubrics": [ "{ \"criteria\": {\"count_correct\": true, ...} }" ]
|
| 53 |
+
}
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
**Multi‑turn** (multiple images, multiple rubric entries):
|
| 57 |
+
```jsonc
|
| 58 |
+
{
|
| 59 |
+
"id": "a1c89...",
|
| 60 |
+
"turncase": "multi-turn",
|
| 61 |
+
"prompt_category": "finance",
|
| 62 |
+
"eval_focus": "hybrid_tool_reasoning",
|
| 63 |
+
"prompt": "Summarize the option chain from the provided screenshots...",
|
| 64 |
+
"images": [ "<Image1>", "<Image2>", "<Image3>" ],
|
| 65 |
+
"rubrics": [
|
| 66 |
+
"{ \"turn\": 1, \"criteria\": { ... } }",
|
| 67 |
+
"{ \"turn\": 3, \"criteria\": { ... } }"
|
| 68 |
+
]
|
| 69 |
+
}
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
---
|
| 73 |
+
|
| 74 |
+
## Example Usage
|
| 75 |
+
|
| 76 |
+
### Load and preview
|
| 77 |
+
|
| 78 |
+
```python
|
| 79 |
+
from datasets import load_dataset
|
| 80 |
+
import json
|
| 81 |
+
|
| 82 |
+
ds = load_dataset("parquet", data_files={"all": "hf_parquet_out/vistoolbench_50.parquet"})["all"]
|
| 83 |
+
print(ds)
|
| 84 |
+
|
| 85 |
+
# Show images for the first row
|
| 86 |
+
row = ds[0]
|
| 87 |
+
print("turncase:", row["turncase"], "num_images:", len(row["images"]))
|
| 88 |
+
display(row["images"][0]) # PIL.Image
|
| 89 |
+
|
| 90 |
+
# Parse rubrics (array of JSON strings)
|
| 91 |
+
rubrics = [json.loads(x) for x in row["rubrics"]]
|
| 92 |
+
print(rubrics[0])
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
### Filtering by type or category
|
| 96 |
+
|
| 97 |
+
```python
|
| 98 |
+
single = ds.filter(lambda r: r["turncase"] == "single-turn")
|
| 99 |
+
multi = ds.filter(lambda r: r["turncase"] == "multi-turn")
|
| 100 |
+
eng = ds.filter(lambda r: r["prompt_category"] == "engineering")
|
| 101 |
+
```
|