Datasets:

Modalities:
Text
Languages:
English
ArXiv:
Libraries:
Datasets
License:

updated to dataset v 0.3 + added test split

#1
by soldni - opened
Files changed (1) hide show
  1. qasper.py +28 -7
qasper.py CHANGED
@@ -1,5 +1,5 @@
1
  # coding=utf-8
2
- # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
3
  #
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
@@ -38,10 +38,13 @@ A dataset containing 1585 papers with 5049 information-seeking questions asked b
38
  """
39
 
40
  _HOMEPAGE = "https://allenai.org/data/qasper"
41
- _URL = "https://qasper-dataset.s3-us-west-2.amazonaws.com/qasper-train-dev-v0.1.tgz"
42
- _DATA_FILES = {"train": "qasper-train-v0.1.json", "dev": "qasper-dev-v0.1.json"}
 
 
 
43
 
44
- _VERSION = "0.1.0"
45
 
46
 
47
  class Qasper(datasets.GeneratorBasedBuilder):
@@ -93,6 +96,12 @@ class Qasper(datasets.GeneratorBasedBuilder):
93
  ),
94
  }
95
  ),
 
 
 
 
 
 
96
  }
97
  )
98
 
@@ -106,16 +115,28 @@ class Qasper(datasets.GeneratorBasedBuilder):
106
  )
107
 
108
  def _split_generators(self, dl_manager):
109
- archive = dl_manager.download(_URL)
 
 
110
 
111
  return [
112
  datasets.SplitGenerator(
113
  name=datasets.Split.TRAIN,
114
- gen_kwargs={"filepath": _DATA_FILES["train"], "files": dl_manager.iter_archive(archive)},
 
 
115
  ),
116
  datasets.SplitGenerator(
117
  name=datasets.Split.VALIDATION,
118
- gen_kwargs={"filepath": _DATA_FILES["dev"], "files": dl_manager.iter_archive(archive)},
 
 
 
 
 
 
 
 
119
  ),
120
  ]
121
 
 
1
  # coding=utf-8
2
+ # Copyright 2022 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
3
  #
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
 
38
  """
39
 
40
  _HOMEPAGE = "https://allenai.org/data/qasper"
41
+ _URL_TRAIN_DEV = "https://qasper-dataset.s3.us-west-2.amazonaws.com/qasper-train-dev-v0.3.tgz"
42
+ _URL_TEST = "https://qasper-dataset.s3.us-west-2.amazonaws.com/qasper-test-and-evaluator-v0.3.tgz"
43
+ _DATA_FILES = {"train": "qasper-train-v0.3.json",
44
+ "dev": "qasper-dev-v0.3.json",
45
+ "test": "qasper-test-v0.3.json"}
46
 
47
+ _VERSION = "0.3.0"
48
 
49
 
50
  class Qasper(datasets.GeneratorBasedBuilder):
 
96
  ),
97
  }
98
  ),
99
+ "figures_and_tables": datasets.features.Sequence(
100
+ {
101
+ "caption": datasets.Value("string"),
102
+ "file": datasets.Value("string"),
103
+ }
104
+ ),
105
  }
106
  )
107
 
 
115
  )
116
 
117
  def _split_generators(self, dl_manager):
118
+ archive_train_dev, archive_test = dl_manager.download((
119
+ _URL_TRAIN_DEV, _URL_TEST)
120
+ )
121
 
122
  return [
123
  datasets.SplitGenerator(
124
  name=datasets.Split.TRAIN,
125
+ gen_kwargs={
126
+ "filepath": _DATA_FILES["train"],
127
+ "files": dl_manager.iter_archive(archive_train_dev)},
128
  ),
129
  datasets.SplitGenerator(
130
  name=datasets.Split.VALIDATION,
131
+ gen_kwargs={
132
+ "filepath": _DATA_FILES["dev"],
133
+ "files": dl_manager.iter_archive(archive_train_dev)},
134
+ ),
135
+ datasets.SplitGenerator(
136
+ name=datasets.Split.TEST,
137
+ gen_kwargs={
138
+ "filepath": _DATA_FILES["test"],
139
+ "files": dl_manager.iter_archive(archive_test)},
140
  ),
141
  ]
142