Datasets:
Task 1, 3, 4
Browse files- .openpiv2_tasks.py.swp +0 -0
- openpi_v2.py +21 -0
.openpiv2_tasks.py.swp
CHANGED
|
Binary files a/.openpiv2_tasks.py.swp and b/.openpiv2_tasks.py.swp differ
|
|
|
openpi_v2.py
CHANGED
|
@@ -236,6 +236,27 @@ class OpenpiV2(datasets.GeneratorBasedBuilder):
|
|
| 236 |
),
|
| 237 |
]
|
| 238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
def _generate_examples(self, filepath):
|
| 240 |
logger.info("generating examples from = %s", filepath)
|
| 241 |
|
|
|
|
| 236 |
),
|
| 237 |
]
|
| 238 |
|
| 239 |
+
|
| 240 |
+
def find_change(key, dataset):
|
| 241 |
+
res = []
|
| 242 |
+
|
| 243 |
+
for state in dataset:
|
| 244 |
+
flag = False
|
| 245 |
+
|
| 246 |
+
for step in state["answers"]:
|
| 247 |
+
if len(step) > 0:
|
| 248 |
+
flag = True
|
| 249 |
+
break
|
| 250 |
+
|
| 251 |
+
if flag:
|
| 252 |
+
list_key = state[key].split(" | ")
|
| 253 |
+
res.append([el for el in list_key])
|
| 254 |
+
|
| 255 |
+
return (res)
|
| 256 |
+
|
| 257 |
+
def
|
| 258 |
+
|
| 259 |
+
|
| 260 |
def _generate_examples(self, filepath):
|
| 261 |
logger.info("generating examples from = %s", filepath)
|
| 262 |
|