RegulusYin commited on
Commit
e40e024
·
verified ·
1 Parent(s): 3cc3cbf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +41 -7
README.md CHANGED
@@ -68,14 +68,48 @@ Each JSON sample (one file per scene) contains the following core fields:
68
 
69
  ## Usage
70
 
 
71
  ```python
72
- from datasets import load_dataset
73
 
74
- # Load full dataset
75
- ds = load_dataset("ESI-Bench/esi-bench")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
- # Or load a specific task category index
78
- import json, requests
79
- url = "https://huggingface.co/datasets/ESI-Bench/esi-bench/resolve/main/data/Action Sequencing.json"
80
- data = requests.get(url).json()
81
  ```
 
68
 
69
  ## Usage
70
 
71
+ ### Recommended: Batch Download (Official HF Method)
72
  ```python
73
+ from huggingface_hub import snapshot_download
74
 
75
+ snapshot_download(
76
+ repo_id="ESI-Bench/esi-bench",
77
+ repo_type="dataset",
78
+ local_dir="./esi-bench"
79
+ )
80
+ ```
81
+
82
+ ### Load a Specific Task Index
83
+ ```python
84
+ from huggingface_hub import hf_hub_download
85
+ import json
86
+
87
+ path = hf_hub_download(
88
+ repo_id="ESI-Bench/esi-bench",
89
+ filename="data/Action Sequencing.json",
90
+ repo_type="dataset"
91
+ )
92
+ with open(path) as f:
93
+ index = json.load(f)
94
+
95
+ # index["json_paths"] contains relative paths to all samples in this category
96
+ print(index["json_paths"][:5])
97
+ ```
98
+
99
+ ### Load a Single Sample
100
+ ```python
101
+ from huggingface_hub import hf_hub_download
102
+ import json
103
+
104
+ path = hf_hub_download(
105
+ repo_id="ESI-Bench/esi-bench",
106
+ filename="data/Action Sequencing/Action Order Inference/Beechwood_0_garden/kitchen_0/Beechwood_0_garden__kitchen_0.json",
107
+ repo_type="dataset"
108
+ )
109
+ with open(path) as f:
110
+ sample = json.load(f)
111
 
112
+ print(sample["task"]) # action_order_inference
113
+ print(sample["scene"]) # Beechwood_0_garden
114
+ print(sample["qa"]["question"])
 
115
  ```