qanastek commited on
Commit
73100ed
1 Parent(s): b85d7e3

Add download_and_extract

Browse files
Files changed (2) hide show
  1. MASSIVE.py +4 -5
  2. test_MASSIVE.py +6 -4
MASSIVE.py CHANGED
@@ -308,14 +308,13 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
308
 
309
  def _split_generators(self, dl_manager):
310
 
311
- # Download the archive
312
- data_dir = dl_manager.download_and_extract(_URL)
313
 
314
  return [
315
  datasets.SplitGenerator(
316
  name=datasets.Split.TRAIN,
317
  gen_kwargs={
318
- "filepath": data_dir,
319
  "split": "train",
320
  "lang": self.config.name,
321
  }
@@ -323,7 +322,7 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
323
  datasets.SplitGenerator(
324
  name=datasets.Split.VALIDATION,
325
  gen_kwargs={
326
- "filepath": data_dir,
327
  "split": "dev",
328
  "lang": self.config.name,
329
  }
@@ -331,7 +330,7 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
331
  datasets.SplitGenerator(
332
  name=datasets.Split.TEST,
333
  gen_kwargs={
334
- "filepath": data_dir,
335
  "split": "test",
336
  "lang": self.config.name,
337
  }
 
308
 
309
  def _split_generators(self, dl_manager):
310
 
311
+ path = dl_manager.download_and_extract(_URL)
 
312
 
313
  return [
314
  datasets.SplitGenerator(
315
  name=datasets.Split.TRAIN,
316
  gen_kwargs={
317
+ "filepath": path,
318
  "split": "train",
319
  "lang": self.config.name,
320
  }
 
322
  datasets.SplitGenerator(
323
  name=datasets.Split.VALIDATION,
324
  gen_kwargs={
325
+ "filepath": path,
326
  "split": "dev",
327
  "lang": self.config.name,
328
  }
 
330
  datasets.SplitGenerator(
331
  name=datasets.Split.TEST,
332
  gen_kwargs={
333
+ "filepath": path,
334
  "split": "test",
335
  "lang": self.config.name,
336
  }
test_MASSIVE.py CHANGED
@@ -1,12 +1,14 @@
1
  from datasets import load_dataset
2
 
3
- # source = "MASSIVE.py"
4
- source = "qanastek/MASSIVE"
5
 
6
- # dataset = load_dataset(source, "fr-FR")
7
  # print(dataset)
8
 
9
- dataset = load_dataset(source, "en-US")
 
10
  print(dataset)
11
 
 
12
  print(dataset["train"][0])
 
1
  from datasets import load_dataset
2
 
3
+ source = "MASSIVE.py"
4
+ # source = "qanastek/MASSIVE"
5
 
6
+ # dataset = load_dataset(source, "fr-FR", download_mode="force_redownload")
7
  # print(dataset)
8
 
9
+ dataset = load_dataset(source, "en-US", download_mode="force_redownload")
10
+ # , split="train"
11
  print(dataset)
12
 
13
+ # print(dataset[0])
14
  print(dataset["train"][0])