system HF staff commited on
Commit
7782c76
1 Parent(s): 8f1868b

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_es.py +10 -11
squad_es.py CHANGED
@@ -3,7 +3,6 @@
3
  from __future__ import absolute_import, division, print_function
4
 
5
  import json
6
- import os
7
 
8
  import datasets
9
 
@@ -29,6 +28,14 @@ automatic translation of the Stanford Question Answering Dataset (SQuAD) v2 into
29
  """
30
 
31
  _URL = "https://raw.githubusercontent.com/ccasimiro88/TranslateAlignRetrieve/master/"
 
 
 
 
 
 
 
 
32
 
33
 
34
  class SquadEsConfig(datasets.BuilderConfig):
@@ -98,18 +105,10 @@ class SquadEs(datasets.GeneratorBasedBuilder):
98
  # dl_manager is a datasets.download.DownloadManager that can be used to
99
 
100
  # download and extract URLs
101
- v1_urls = {
102
- "train": os.path.join(_URL, "SQuAD-es-v1.1/train-v1.1-es.json"),
103
- "dev": os.path.join(_URL, "SQuAD-es-v1.1/dev-v1.1-es.json"),
104
- }
105
- v2_urls = {
106
- "train": os.path.join(_URL, "SQuAD-es-v2.0/train-v2.0-es.json"),
107
- "dev": os.path.join(_URL, "SQuAD-es-v2.0/dev-v2.0-es.json"),
108
- }
109
  if self.config.name == "v1.1.0":
110
- dl_dir = dl_manager.download_and_extract(v1_urls)
111
  elif self.config.name == "v2.0.0":
112
- dl_dir = dl_manager.download_and_extract(v2_urls)
113
  else:
114
  raise Exception("version does not match any existing one")
115
  return [
 
3
  from __future__ import absolute_import, division, print_function
4
 
5
  import json
 
6
 
7
  import datasets
8
 
 
28
  """
29
 
30
  _URL = "https://raw.githubusercontent.com/ccasimiro88/TranslateAlignRetrieve/master/"
31
+ _URLS_V1 = {
32
+ "train": _URL + "SQuAD-es-v1.1/train-v1.1-es.json",
33
+ "dev": _URL + "SQuAD-es-v1.1/dev-v1.1-es.json",
34
+ }
35
+ _URLS_V2 = {
36
+ "train": _URL + "SQuAD-es-v2.0/train-v2.0-es.json",
37
+ "dev": _URL + "SQuAD-es-v2.0/dev-v2.0-es.json",
38
+ }
39
 
40
 
41
  class SquadEsConfig(datasets.BuilderConfig):
 
105
  # dl_manager is a datasets.download.DownloadManager that can be used to
106
 
107
  # download and extract URLs
 
 
 
 
 
 
 
 
108
  if self.config.name == "v1.1.0":
109
+ dl_dir = dl_manager.download_and_extract(_URLS_V1)
110
  elif self.config.name == "v2.0.0":
111
+ dl_dir = dl_manager.download_and_extract(_URLS_V2)
112
  else:
113
  raise Exception("version does not match any existing one")
114
  return [