Datasets:
EMBO
/

Languages:
English
ArXiv:
DOI:
License:
drAbreu commited on
Commit
94e03fc
·
1 Parent(s): 90590a2

Update SourceData.py

Browse files
Files changed (1) hide show
  1. SourceData.py +12 -25
SourceData.py CHANGED
@@ -21,7 +21,7 @@ from __future__ import absolute_import, division, print_function
21
  import json
22
  import datasets
23
 
24
- _BASE_URL = "https://huggingface.co/datasets/EMBO/SourceData/tree/main/"
25
 
26
  class SourceData(datasets.GeneratorBasedBuilder):
27
  """SourceDataNLP provides datasets to train NLP tasks in cell and molecular biology."""
@@ -171,27 +171,14 @@ class SourceData(datasets.GeneratorBasedBuilder):
171
 
172
  import pdb; pdb.set_trace()
173
 
174
- if self.config.name == "NER":
175
- url = self._URLS["NER"]
176
- data_dir = dl_manager.download(url)
177
- data_dir += "/"
178
- elif self.config.name == "PANELIZATION":
179
- url = self._URLS["PANELIZATION"]
180
- data_dir = dl_manager.download(url)
181
- data_dir += "/"
182
- elif self.config.name == "ROLES_GP":
183
- url = self._URLS["ROLES_GP"]
184
- data_dir = dl_manager.download(url)
185
- data_dir += "/"
186
- elif self.config.name == "ROLES_SM":
187
- url = self._URLS["ROLES_SM"]
188
- data_dir = dl_manager.download(url)
189
- data_dir += "/"
190
- elif self.config.name == "ROLES_MULTI":
191
- url = self._URLS["ROLES_MULTI"]
192
- data_dir = dl_manager.download(url)
193
- data_dir += "/"
194
- else:
195
  raise ValueError(f"unkonwn config name: {self.config.name}")
196
 
197
  return [
@@ -199,17 +186,17 @@ class SourceData(datasets.GeneratorBasedBuilder):
199
  name=datasets.Split.TRAIN,
200
  # These kwargs will be passed to _generate_examples
201
  gen_kwargs={
202
- "filepath": data_dir + "/train.jsonl"},
203
  ),
204
  datasets.SplitGenerator(
205
  name=datasets.Split.TEST,
206
  gen_kwargs={
207
- "filepath": data_dir + "/test.jsonl"},
208
  ),
209
  datasets.SplitGenerator(
210
  name=datasets.Split.VALIDATION,
211
  gen_kwargs={
212
- "filepath": data_dir + "/eval.jsonl"},
213
  ),
214
  ]
215
 
 
21
  import json
22
  import datasets
23
 
24
+ _BASE_URL = "https://huggingface.co/datasets/EMBO/SourceData/blob/main/"
25
 
26
  class SourceData(datasets.GeneratorBasedBuilder):
27
  """SourceDataNLP provides datasets to train NLP tasks in cell and molecular biology."""
 
171
 
172
  import pdb; pdb.set_trace()
173
 
174
+ try:
175
+ urls = [
176
+ self._URLS[self.config.name]+"train.jsonl",
177
+ self._URLS[self.config.name]+"test.jsonl",
178
+ self._URLS[self.config.name]+"validation.jsonl"
179
+ ]
180
+ data_files = dl_manager.download(urls)
181
+ except:
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  raise ValueError(f"unkonwn config name: {self.config.name}")
183
 
184
  return [
 
186
  name=datasets.Split.TRAIN,
187
  # These kwargs will be passed to _generate_examples
188
  gen_kwargs={
189
+ "filepath": data_files[0]},
190
  ),
191
  datasets.SplitGenerator(
192
  name=datasets.Split.TEST,
193
  gen_kwargs={
194
+ "filepath": data_files[1]},
195
  ),
196
  datasets.SplitGenerator(
197
  name=datasets.Split.VALIDATION,
198
  gen_kwargs={
199
+ "filepath": data_files[2]},
200
  ),
201
  ]
202