clallier commited on
Commit
97cd772
ยท
verified ยท
1 Parent(s): 983cb36

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +76 -19
README.md CHANGED
@@ -108,6 +108,79 @@ Geometric spacing boundaries and physical placement constraints.
108
 
109
  ## ๐Ÿš€ How to Load and Explore the Dataset
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  Since the dataset is stored in standard Apache Parquet format, loading takes a single line of python code:
112
 
113
  ```python
@@ -131,25 +204,9 @@ val_df = tasks_df[tasks_df['is_val']]
131
  test_df = tasks_df[tasks_df['is_test']]
132
 
133
  print(f"Loaded {len(tasks_df)} irregular nesting tasks:")
134
- print(f" ๐ŸŸข Train instances : {len(train_df)}")
135
- print(f" ๐ŸŸก Validation instances : {len(val_df)}")
136
- print(f" ๐Ÿ”ด Test instances : {len(test_df)}")
137
- ```
138
-
139
- ### Loading Directly from Hugging Face Hub
140
-
141
- You can also download or stream these relational tables directly from the Hugging Face Hub using their specific dataset configuration names:
142
-
143
- ```python
144
- from datasets import load_dataset
145
-
146
- # Load individual tables using configuration subsets
147
- tasks_ds = load_dataset("clallier/nesting-tasks-2d", name="tasks")
148
- parts_ds = load_dataset("clallier/nesting-tasks-2d", name="parts")
149
- shapes_ds = load_dataset("clallier/nesting-tasks-2d", name="shapes")
150
- constraints_ds = load_dataset("clallier/nesting-tasks-2d", name="constraints")
151
-
152
- print(tasks_ds)
153
  ```
154
 
155
  ---
 
108
 
109
  ## ๐Ÿš€ How to Load and Explore the Dataset
110
 
111
+ ### ๐Ÿ” Exploring Directly on Hugging Face Data Studio / SQL Explorer
112
+
113
+ You can run SQL queries directly on your browser using DuckDB over the hosted Parquet tables:
114
+
115
+ * **Query the train dataset split from tasks table**
116
+ ```sql
117
+ SELECT
118
+ tasks_index,
119
+ duration,
120
+ efficiency,
121
+ sheet_width,
122
+ sheet_length,
123
+ sheet_type,
124
+ tasks_index,
125
+ FROM tasks
126
+ WHERE is_train = true
127
+ LIMIT 500;
128
+ ```
129
+
130
+ * **Query parts and shapes geometry for a specific task:**
131
+ ```sql
132
+ SELECT
133
+ p.tasks_index,
134
+ p.part_id,
135
+ p.shape_hash,
136
+ s.raw AS shape_vertices,
137
+ s.sizes AS vertex_sizes
138
+ FROM
139
+ parts p
140
+ JOIN
141
+ shapes s ON p.shape_hash = s.shape_hash
142
+ WHERE
143
+ p.tasks_index = 228
144
+ ORDER BY
145
+ p.part_id ASC;
146
+ ```
147
+
148
+ * **Query constraints parameters for a specific task:**
149
+ ```sql
150
+ SELECT
151
+ tasks_index,
152
+ type AS constraint_type,
153
+ parts_1,
154
+ parts_2,
155
+ y_min,
156
+ y_max,
157
+ r1_start,
158
+ r1_end,
159
+ is_frozen
160
+ FROM
161
+ constraints
162
+ WHERE
163
+ tasks_index = 228;
164
+ ```
165
+
166
+ ### ๐Ÿš€ Loading via the Hugging Face Datasets Library
167
+
168
+ You can also download or stream these relational tables directly from the Hugging Face Hub using their specific dataset configuration names:
169
+
170
+ ```python
171
+ from datasets import load_dataset
172
+
173
+ # Load individual tables using configuration subsets
174
+ tasks_ds = load_dataset("clallier/nesting-tasks-2d", name="tasks")
175
+ parts_ds = load_dataset("clallier/nesting-tasks-2d", name="parts")
176
+ shapes_ds = load_dataset("clallier/nesting-tasks-2d", name="shapes")
177
+ constraints_ds = load_dataset("clallier/nesting-tasks-2d", name="constraints")
178
+
179
+ print(tasks_ds)
180
+ ```
181
+
182
+ ### ๐Ÿš€ Loading via Pandas
183
+
184
  Since the dataset is stored in standard Apache Parquet format, loading takes a single line of python code:
185
 
186
  ```python
 
204
  test_df = tasks_df[tasks_df['is_test']]
205
 
206
  print(f"Loaded {len(tasks_df)} irregular nesting tasks:")
207
+ print(f" Train instances : {len(train_df)}")
208
+ print(f" Validation instances : {len(val_df)}")
209
+ print(f" Test instances : {len(test_df)}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  ```
211
 
212
  ---