Datasets:
GEM
/

Languages:
English
Multilinguality:
unknown
Size Categories:
unknown
Language Creators:
unknown
Annotations Creators:
none
Source Datasets:
original
Tags:
data-to-text
License:
ratishsp commited on
Commit
7026ad6
1 Parent(s): e8fa5a7

combined tar.bz2

Browse files
Files changed (1) hide show
  1. mlb_data_to_text.py +5 -11
mlb_data_to_text.py CHANGED
@@ -48,11 +48,7 @@ _HOMEPAGE = "https://github.com/ratishsp/mlb-data-scripts"
48
 
49
  _LICENSE = ""
50
 
51
- _URLs = {
52
- "train": "train.jsonl.bz2",
53
- "validation": "validation.jsonl.bz2",
54
- "test": "test.jsonl.bz2"
55
- }
56
 
57
 
58
  class MlbDataToText(datasets.GeneratorBasedBuilder):
@@ -234,15 +230,13 @@ class MlbDataToText(datasets.GeneratorBasedBuilder):
234
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
235
  # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
236
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
237
- train_dir = dl_manager.download_and_extract(_URLs["train"])
238
- validation_dir = dl_manager.download_and_extract(_URLs["validation"])
239
- test_dir = dl_manager.download_and_extract(_URLs["test"])
240
  return [
241
  datasets.SplitGenerator(
242
  name=datasets.Split.TRAIN,
243
  # These kwargs will be passed to _generate_examples
244
  gen_kwargs={
245
- "filepath": train_dir,
246
  "split": "train",
247
  },
248
  ),
@@ -250,7 +244,7 @@ class MlbDataToText(datasets.GeneratorBasedBuilder):
250
  name=datasets.Split.TEST,
251
  # These kwargs will be passed to _generate_examples
252
  gen_kwargs={
253
- "filepath": test_dir,
254
  "split": "test"
255
  },
256
  ),
@@ -258,7 +252,7 @@ class MlbDataToText(datasets.GeneratorBasedBuilder):
258
  name=datasets.Split.VALIDATION,
259
  # These kwargs will be passed to _generate_examples
260
  gen_kwargs={
261
- "filepath": validation_dir,
262
  "split": "validation",
263
  },
264
  ),
 
48
 
49
  _LICENSE = ""
50
 
51
+ _URL = "data.tar.bz2"
 
 
 
 
52
 
53
 
54
  class MlbDataToText(datasets.GeneratorBasedBuilder):
 
230
  # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
231
  # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
232
  # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
233
+ data_dir = dl_manager.download_and_extract(_URL)
 
 
234
  return [
235
  datasets.SplitGenerator(
236
  name=datasets.Split.TRAIN,
237
  # These kwargs will be passed to _generate_examples
238
  gen_kwargs={
239
+ "filepath": os.path.join(data_dir, "train.jsonl"),
240
  "split": "train",
241
  },
242
  ),
 
244
  name=datasets.Split.TEST,
245
  # These kwargs will be passed to _generate_examples
246
  gen_kwargs={
247
+ "filepath": os.path.join(data_dir, "test.jsonl"),
248
  "split": "test"
249
  },
250
  ),
 
252
  name=datasets.Split.VALIDATION,
253
  # These kwargs will be passed to _generate_examples
254
  gen_kwargs={
255
+ "filepath": os.path.join(data_dir, "validation.jsonl"),
256
  "split": "validation",
257
  },
258
  ),