Datasets:

Tasks:
Other
Modalities:
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
Dask
License:
VictorSanh commited on
Commit
0b6cd18
1 Parent(s): a587173

fix split_name in data_dir url directory

Browse files
Files changed (1) hide show
  1. P3.py +14 -11
P3.py CHANGED
@@ -234,35 +234,38 @@ class P3(datasets.GeneratorBasedBuilder):
234
  data_dir = dl_manager.download_and_extract(_URLs)
235
  task_name = self.config.name
236
  if "train" in self.config.splits:
 
237
  split_generators.append(
238
  datasets.SplitGenerator(
239
  name=datasets.Split.TRAIN,
240
  gen_kwargs={
241
- "features_file": data_dir[task_name]["features_file"],
242
- "tfrecord": data_dir[task_name]["tfrecord"],
243
- "split": "train",
244
  }
245
  )
246
  )
247
  if "validation" in self.config.splits:
 
248
  split_generators.append(
249
  datasets.SplitGenerator(
250
  name=datasets.Split.VALIDATION,
251
  gen_kwargs={
252
- "features_file": data_dir[task_name]["features_file"],
253
- "tfrecord": data_dir[task_name]["tfrecord"],
254
- "split": "validation",
255
  }
256
  )
257
  )
258
  if "test" in self.config.splits:
 
259
  split_generators.append(
260
  datasets.SplitGenerator(
261
  name=datasets.Split.TEST,
262
  gen_kwargs={
263
- "features_file": data_dir[task_name]["features_file"],
264
- "tfrecord": data_dir[task_name]["tfrecord"],
265
- "split": "test",
266
  }
267
  )
268
  )
@@ -273,8 +276,8 @@ class P3(datasets.GeneratorBasedBuilder):
273
  datasets.SplitGenerator(
274
  name=datasets.Split(special_split_name),
275
  gen_kwargs={
276
- "features_file": data_dir[task_name]["features_file"],
277
- "tfrecord": data_dir[task_name]["tfrecord"],
278
  "split": special_split_name,
279
  }
280
  )
 
234
  data_dir = dl_manager.download_and_extract(_URLs)
235
  task_name = self.config.name
236
  if "train" in self.config.splits:
237
+ split_name = "train"
238
  split_generators.append(
239
  datasets.SplitGenerator(
240
  name=datasets.Split.TRAIN,
241
  gen_kwargs={
242
+ "features_file": data_dir[task_name][split_name]["features_file"],
243
+ "tfrecord": data_dir[task_name][split_name]["tfrecord"],
244
+ "split": split_name,
245
  }
246
  )
247
  )
248
  if "validation" in self.config.splits:
249
+ split_name = "validation"
250
  split_generators.append(
251
  datasets.SplitGenerator(
252
  name=datasets.Split.VALIDATION,
253
  gen_kwargs={
254
+ "features_file": data_dir[task_name][split_name]["features_file"],
255
+ "tfrecord": data_dir[task_name][split_name]["tfrecord"],
256
+ "split": split_name,
257
  }
258
  )
259
  )
260
  if "test" in self.config.splits:
261
+ split_name = "test"
262
  split_generators.append(
263
  datasets.SplitGenerator(
264
  name=datasets.Split.TEST,
265
  gen_kwargs={
266
+ "features_file": data_dir[task_name][split_name]["features_file"],
267
+ "tfrecord": data_dir[task_name][split_name]["tfrecord"],
268
+ "split": split_name,
269
  }
270
  )
271
  )
 
276
  datasets.SplitGenerator(
277
  name=datasets.Split(special_split_name),
278
  gen_kwargs={
279
+ "features_file": data_dir[task_name][special_split_name]["features_file"],
280
+ "tfrecord": data_dir[task_name][special_split_name]["tfrecord"],
281
  "split": special_split_name,
282
  }
283
  )