Datasets:

Modalities:
Text
Formats:
parquet
Sub-tasks:
extractive-qa
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:
system HF staff commited on
Commit
3c97d3b
1 Parent(s): 0b7cc9e

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.0

Files changed (1) hide show
  1. squad.py +7 -10
squad.py CHANGED
@@ -20,7 +20,6 @@ from __future__ import absolute_import, division, print_function
20
 
21
  import json
22
  import logging
23
- import os
24
 
25
  import datasets
26
 
@@ -46,6 +45,12 @@ articles, where the answer to every question is a segment of text, or span, \
46
  from the corresponding reading passage, or the question might be unanswerable.
47
  """
48
 
 
 
 
 
 
 
49
 
50
  class SquadConfig(datasets.BuilderConfig):
51
  """BuilderConfig for SQUAD."""
@@ -62,10 +67,6 @@ class SquadConfig(datasets.BuilderConfig):
62
  class Squad(datasets.GeneratorBasedBuilder):
63
  """SQUAD: The Stanford Question Answering Dataset. Version 1.1."""
64
 
65
- _URL = "https://rajpurkar.github.io/SQuAD-explorer/dataset/"
66
- _DEV_FILE = "dev-v1.1.json"
67
- _TRAINING_FILE = "train-v1.1.json"
68
-
69
  BUILDER_CONFIGS = [
70
  SquadConfig(
71
  name="plain_text",
@@ -99,11 +100,7 @@ class Squad(datasets.GeneratorBasedBuilder):
99
  )
100
 
101
  def _split_generators(self, dl_manager):
102
- urls_to_download = {
103
- "train": os.path.join(self._URL, self._TRAINING_FILE),
104
- "dev": os.path.join(self._URL, self._DEV_FILE),
105
- }
106
- downloaded_files = dl_manager.download_and_extract(urls_to_download)
107
 
108
  return [
109
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
 
20
 
21
  import json
22
  import logging
 
23
 
24
  import datasets
25
 
 
45
  from the corresponding reading passage, or the question might be unanswerable.
46
  """
47
 
48
+ _URL = "https://rajpurkar.github.io/SQuAD-explorer/dataset/"
49
+ _URLS = {
50
+ "train": _URL + "train-v1.1.json",
51
+ "dev": _URL + "dev-v1.1.json",
52
+ }
53
+
54
 
55
  class SquadConfig(datasets.BuilderConfig):
56
  """BuilderConfig for SQUAD."""
 
67
  class Squad(datasets.GeneratorBasedBuilder):
68
  """SQUAD: The Stanford Question Answering Dataset. Version 1.1."""
69
 
 
 
 
 
70
  BUILDER_CONFIGS = [
71
  SquadConfig(
72
  name="plain_text",
 
100
  )
101
 
102
  def _split_generators(self, dl_manager):
103
+ downloaded_files = dl_manager.download_and_extract(_URLS)
 
 
 
 
104
 
105
  return [
106
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),