Anish13 commited on
Commit
30bd47a
·
verified ·
1 Parent(s): 434377c

Add README

Browse files
Files changed (1) hide show
  1. README.md +89 -22
README.md CHANGED
@@ -10,37 +10,74 @@ tags:
10
  - preference-learning
11
  - reward-modeling
12
  size_categories:
13
- - 10K<n<100K
14
  ---
15
 
16
- # Web Agent Graph Dataset
17
 
18
- This dataset contains web navigation tasks in graph format with single-step negatives for training reward models.
19
 
20
  ## Dataset Description
21
 
22
- - **Format**: JSON Lines (JSONL)
23
- - **Size**: ~18K entries from 2.8K tasks
24
  - **Domains**: GitLab, OpenStreetMap, Reddit, Shopping, Shopping Admin
25
 
26
  ## Data Format
27
 
28
- Each line in `graph_dataset.jsonl` is a JSON object with three main sections:
29
-
30
- ### graph_data
31
- Task metadata including domain, root_url, and goal description.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
- ### node_data
34
- Current state information with URL, accessibility tree observation, and screenshot path.
35
 
36
- ### step_data
37
- Action and outcome with:
38
- - `action`: The action taken
39
- - `obs`: Next state observation
40
- - `step_number`: Step index
41
- - `is_positive`: True for gold actions, False for negatives
42
- - `negative_type`: Classification (easy_negative, hard_negative, detour_negative)
43
- - `negative_reason`: Explanation for negative actions
44
 
45
  ## Usage
46
 
@@ -51,9 +88,39 @@ import json
51
  with open('graph_dataset.jsonl', 'r') as f:
52
  for line in f:
53
  entry = json.loads(line)
54
- goal = entry['graph_data']['goal']
55
- action = entry['step_data']['action']
56
- is_positive = entry['step_data']['is_positive']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  ```
58
 
59
  ## Statistics
 
10
  - preference-learning
11
  - reward-modeling
12
  size_categories:
13
+ - 1K<n<10K
14
  ---
15
 
16
+ # Web Agent Grouped Graph Dataset
17
 
18
+ This dataset contains web navigation tasks in grouped graph format with full history and candidate actions for training reward models.
19
 
20
  ## Dataset Description
21
 
22
+ - **Format**: JSON Lines (JSONL) - One entry per step with grouped candidates
23
+ - **Size**: ~2.8K step entries from 2.8K tasks
24
  - **Domains**: GitLab, OpenStreetMap, Reddit, Shopping, Shopping Admin
25
 
26
  ## Data Format
27
 
28
+ Each line in `graph_dataset.jsonl` represents a single step with all candidate actions grouped together:
29
+
30
+ ```json
31
+ {
32
+ "task_id": "...",
33
+ "goal": "Find product X and add to cart",
34
+ "domain": "shopping",
35
+ "step_index": 3,
36
+
37
+ "history": [
38
+ {"state_id": "S0", "screenshot": "...", "url": "...", "obs": "..."},
39
+ {"state_id": "S1", "screenshot": "...", "url": "...", "obs": "..."},
40
+ {"state_id": "S2", "screenshot": "...", "url": "...", "obs": "..."},
41
+ {"state_id": "S3", "screenshot": "...", "url": "...", "obs": "..."}
42
+ ],
43
+
44
+ "current_state": {
45
+ "state_id": "S3",
46
+ "screenshot": "path/to/current.png",
47
+ "url": "http://...",
48
+ "obs": "accessibility tree..."
49
+ },
50
+
51
+ "candidates": [
52
+ {
53
+ "label": "gold",
54
+ "action": "click('153')",
55
+ "next_state": "S4",
56
+ "next_screenshot": "path/to/next.png",
57
+ "next_url": "http://...",
58
+ "next_obs": "..."
59
+ },
60
+ {
61
+ "label": "negative",
62
+ "action": "click('88')",
63
+ "negative_type": "hard_negative",
64
+ "reason": "Leads to wrong page",
65
+ "next_state": "S_bad1",
66
+ "next_screenshot": "path/to/bad1.png",
67
+ "next_url": "http://...",
68
+ "next_obs": "..."
69
+ }
70
+ ]
71
+ }
72
+ ```
73
 
74
+ ## Key Features
 
75
 
76
+ - **Full History**: Complete trajectory up to current state
77
+ - **Grouped Candidates**: All possible actions (gold + negatives) from same state
78
+ - **Next-State Screenshots**: Screenshot paths for all candidate outcomes
79
+ - **Rich Metadata**: Task ID, domain, goal, step index
80
+ - **Negative Types**: Classification (easy_negative, hard_negative, detour_negative)
 
 
 
81
 
82
  ## Usage
83
 
 
88
  with open('graph_dataset.jsonl', 'r') as f:
89
  for line in f:
90
  entry = json.loads(line)
91
+
92
+ # Access task info
93
+ goal = entry['goal']
94
+ step_idx = entry['step_index']
95
+
96
+ # Access history
97
+ history = entry['history']
98
+ current_state = entry['current_state']
99
+
100
+ # Process candidates
101
+ for candidate in entry['candidates']:
102
+ if candidate['label'] == 'gold':
103
+ print(f"Gold action: {candidate['action']}")
104
+ else:
105
+ print(f"Negative: {candidate['action']} ({candidate['negative_type']})")
106
+ ```
107
+
108
+ ## Training Reward Models
109
+
110
+ This format is ideal for:
111
+ 1. **Preference Learning**: Compare gold vs negative actions from same state
112
+ 2. **Reward Modeling**: Predict which action leads to goal completion
113
+ 3. **Action Ranking**: Rank all candidates by predicted reward
114
+
115
+ Example:
116
+ ```python
117
+ # For each step entry
118
+ gold = [c for c in entry['candidates'] if c['label'] == 'gold'][0]
119
+ negatives = [c for c in entry['candidates'] if c['label'] == 'negative']
120
+
121
+ # Train model to rank gold higher than all negatives
122
+ reward_gold = model(entry['current_state'], gold)
123
+ rewards_neg = [model(entry['current_state'], neg) for neg in negatives]
124
  ```
125
 
126
  ## Statistics