Junyeob Kim commited on
Commit
01e9258
1 Parent(s): 01d534c

modify scripts download from hub

Browse files
Files changed (1) hide show
  1. few_glue.py +13 -3
few_glue.py CHANGED
@@ -300,6 +300,7 @@ class FewGlueConfig(datasets.BuilderConfig):
300
  self.features = features
301
  self.label_classes = label_classes
302
  self.citation = citation
 
303
  self.url = url
304
 
305
 
@@ -311,6 +312,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
311
  name="boolq",
312
  description=_BOOLQ_DESCRIPTION,
313
  features=["question", "passage"],
 
314
  citation=_BOOLQ_CITATION,
315
  url="https://github.com/google-research-datasets/boolean-questions",
316
  ),
@@ -319,6 +321,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
319
  description=_CB_DESCRIPTION,
320
  features=["premise", "hypothesis"],
321
  label_classes=["entailment", "contradiction", "neutral"],
 
322
  citation=_CB_CITATION,
323
  url="https://github.com/mcdm/CommitmentBank",
324
  ),
@@ -329,6 +332,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
329
  # Note that question will only be the X in the statement "What's
330
  # the X for this?".
331
  features=["premise", "choice1", "choice2", "question"],
 
332
  citation=_COPA_CITATION,
333
  url="http://people.ict.usc.edu/~gordon/copa.html",
334
  ),
@@ -336,6 +340,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
336
  name="multirc",
337
  description=_MULTIRC_DESCRIPTION,
338
  features=["paragraph", "question", "answer"],
 
339
  citation=_MULTIRC_CITATION,
340
  url="https://cogcomp.org/multirc/",
341
  ),
@@ -346,6 +351,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
346
  # will contain @placeholder as a substring, which represents the word
347
  # to be substituted in.
348
  features=["passage", "query", "entities", "answers"],
 
349
  citation=_RECORD_CITATION,
350
  url="https://sheng-z.github.io/ReCoRD-explorer/",
351
  ),
@@ -354,6 +360,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
354
  description=_RTE_DESCRIPTION,
355
  features=["premise", "hypothesis"],
356
  label_classes=["entailment", "not_entailment"],
 
357
  citation=_RTE_CITATION,
358
  url="https://aclweb.org/aclwiki/Recognizing_Textual_Entailment",
359
  ),
@@ -363,6 +370,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
363
  # Note that start1, start2, end1, and end2 will be integers stored as
364
  # datasets.Value('int32').
365
  features=["word", "sentence1", "sentence2", "start1", "start2", "end1", "end2"],
 
366
  citation=_WIC_CITATION,
367
  url="https://pilehvar.github.io/wic/",
368
  ),
@@ -372,6 +380,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
372
  # Note that span1_index and span2_index will be integers stored as
373
  # datasets.Value('int32').
374
  features=["text", "span1_index", "span2_index", "span1_text", "span2_text"],
 
375
  citation=_WSC_CITATION,
376
  url="https://cs.nyu.edu/faculty/davise/papers/WinogradSchemas/WS.html",
377
  ),
@@ -384,6 +393,7 @@ class FewGlue(datasets.GeneratorBasedBuilder):
384
  # Note that span1_index and span2_index will be integers stored as
385
  # datasets.Value('int32').
386
  features=["text", "span1_index", "span2_index", "span1_text", "span2_text"],
 
387
  citation=_WSC_CITATION,
388
  url="https://cs.nyu.edu/faculty/davise/papers/WinogradSchemas/WS.html",
389
  ),
@@ -433,9 +443,9 @@ class FewGlue(datasets.GeneratorBasedBuilder):
433
  )
434
 
435
  def _split_generators(self, dl_manager):
436
- dl_dir = 'FewGLUE_32dev'
437
- dl_dir = os.path.join(dl_dir, self.config.name)
438
-
439
  return [
440
  datasets.SplitGenerator(
441
  name=datasets.Split.TRAIN,
 
300
  self.features = features
301
  self.label_classes = label_classes
302
  self.citation = citation
303
+ self.data_url = data_url
304
  self.url = url
305
 
306
 
 
312
  name="boolq",
313
  description=_BOOLQ_DESCRIPTION,
314
  features=["question", "passage"],
315
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/boolq.zip",
316
  citation=_BOOLQ_CITATION,
317
  url="https://github.com/google-research-datasets/boolean-questions",
318
  ),
 
321
  description=_CB_DESCRIPTION,
322
  features=["premise", "hypothesis"],
323
  label_classes=["entailment", "contradiction", "neutral"],
324
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/cb.zip",
325
  citation=_CB_CITATION,
326
  url="https://github.com/mcdm/CommitmentBank",
327
  ),
 
332
  # Note that question will only be the X in the statement "What's
333
  # the X for this?".
334
  features=["premise", "choice1", "choice2", "question"],
335
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/copa.zip",
336
  citation=_COPA_CITATION,
337
  url="http://people.ict.usc.edu/~gordon/copa.html",
338
  ),
 
340
  name="multirc",
341
  description=_MULTIRC_DESCRIPTION,
342
  features=["paragraph", "question", "answer"],
343
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/multirc.zip",
344
  citation=_MULTIRC_CITATION,
345
  url="https://cogcomp.org/multirc/",
346
  ),
 
351
  # will contain @placeholder as a substring, which represents the word
352
  # to be substituted in.
353
  features=["passage", "query", "entities", "answers"],
354
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/record.zip",
355
  citation=_RECORD_CITATION,
356
  url="https://sheng-z.github.io/ReCoRD-explorer/",
357
  ),
 
360
  description=_RTE_DESCRIPTION,
361
  features=["premise", "hypothesis"],
362
  label_classes=["entailment", "not_entailment"],
363
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/rte.zip",
364
  citation=_RTE_CITATION,
365
  url="https://aclweb.org/aclwiki/Recognizing_Textual_Entailment",
366
  ),
 
370
  # Note that start1, start2, end1, and end2 will be integers stored as
371
  # datasets.Value('int32').
372
  features=["word", "sentence1", "sentence2", "start1", "start2", "end1", "end2"],
373
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/wic.zip",
374
  citation=_WIC_CITATION,
375
  url="https://pilehvar.github.io/wic/",
376
  ),
 
380
  # Note that span1_index and span2_index will be integers stored as
381
  # datasets.Value('int32').
382
  features=["text", "span1_index", "span2_index", "span1_text", "span2_text"],
383
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/wsc.zip",
384
  citation=_WSC_CITATION,
385
  url="https://cs.nyu.edu/faculty/davise/papers/WinogradSchemas/WS.html",
386
  ),
 
393
  # Note that span1_index and span2_index will be integers stored as
394
  # datasets.Value('int32').
395
  features=["text", "span1_index", "span2_index", "span1_text", "span2_text"],
396
+ data_url="https://huggingface.co/datasets/juny116/few_glue/resolve/main/FewGLUE_32dev/wsc.zip",
397
  citation=_WSC_CITATION,
398
  url="https://cs.nyu.edu/faculty/davise/papers/WinogradSchemas/WS.html",
399
  ),
 
443
  )
444
 
445
  def _split_generators(self, dl_manager):
446
+ dl_dir = dl_manager.download_and_extract(self.config.data_url) or ""
447
+ task_name = _get_task_name_from_data_url(self.config.data_url)
448
+ dl_dir = os.path.join(dl_dir, task_name)
449
  return [
450
  datasets.SplitGenerator(
451
  name=datasets.Split.TRAIN,