Datasets:

Languages:
English
Multilinguality:
monolingual
Size Categories:
10K<n<100K
Annotations Creators:
crowdsourced
Source Datasets:
original
ArXiv:
Tags:
License:
albertvillanova HF staff commited on
Commit
3049d08
1 Parent(s): 36dbfeb

Delete loading script

Browse files
Files changed (1) hide show
  1. aqua_rat.py +0 -130
aqua_rat.py DELETED
@@ -1,130 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
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.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- """AQUA-RAT (Algebra Question Answering with Rationales) Dataset"""
16
-
17
-
18
- import json
19
-
20
- import datasets
21
-
22
-
23
- _CITATION = """\
24
- @InProceedings{ACL,
25
- title = {Program induction by rationale generation: Learning to solve and explain algebraic word problems},
26
- authors={Ling, Wang and Yogatama, Dani and Dyer, Chris and Blunsom, Phil},
27
- year={2017}
28
- }
29
- """
30
-
31
- _DESCRIPTION = """\
32
- A large-scale dataset consisting of approximately 100,000 algebraic word problems.
33
- The solution to each question is explained step-by-step using natural language.
34
- This data is used to train a program generation model that learns to generate the explanation,
35
- while generating the program that solves the question.
36
- """
37
-
38
- _LICENSE = """\
39
- Copyright 2017 Google Inc.
40
-
41
- Licensed under the Apache License, Version 2.0 (the "License");
42
- you may not use this file except in compliance with the License.
43
- You may obtain a copy of the License at
44
-
45
- http://www.apache.org/licenses/LICENSE-2.0
46
-
47
- Unless required by applicable law or agreed to in writing, software
48
- distributed under the License is distributed on an "AS IS" BASIS,
49
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
50
- See the License for the specific language governing permissions and
51
- limitations under the License.
52
- """
53
-
54
- _BASE_URL = "https://raw.githubusercontent.com/deepmind/AQuA/master/"
55
- _URLs = {
56
- "raw": {"train": _BASE_URL + "train.json", "dev": _BASE_URL + "dev.json", "test": _BASE_URL + "test.json"},
57
- "tokenized": {
58
- "train": _BASE_URL + "train.tok.json",
59
- "dev": _BASE_URL + "dev.tok.json",
60
- "test": _BASE_URL + "test.tok.json",
61
- },
62
- }
63
-
64
-
65
- class AquaRat(datasets.GeneratorBasedBuilder):
66
- """AQUA-RAT (Algebra Question Answering with Rationales) Dataset"""
67
-
68
- VERSION = datasets.Version("1.0.0")
69
-
70
- BUILDER_CONFIGS = [
71
- datasets.BuilderConfig(name="raw", description="Untokenized Dataset"),
72
- datasets.BuilderConfig(name="tokenized", description="Tokenized Dataset"),
73
- ]
74
-
75
- DEFAULT_CONFIG_NAME = "raw"
76
-
77
- def _info(self):
78
- features = datasets.Features(
79
- {
80
- "question": datasets.Value("string"),
81
- "options": datasets.features.Sequence(datasets.Value("string")),
82
- "rationale": datasets.Value("string"),
83
- "correct": datasets.Value("string"),
84
- }
85
- )
86
- return datasets.DatasetInfo(
87
- description=_DESCRIPTION,
88
- features=features,
89
- supervised_keys=None,
90
- homepage="https://github.com/deepmind/AQuA",
91
- license=_LICENSE,
92
- citation=_CITATION,
93
- )
94
-
95
- def _split_generators(self, dl_manager):
96
- """Returns SplitGenerators."""
97
- my_urls = _URLs[self.config.name]
98
- data_paths = dl_manager.download(my_urls)
99
- return [
100
- datasets.SplitGenerator(
101
- name=datasets.Split.TRAIN,
102
- gen_kwargs={
103
- "filepath": data_paths["train"],
104
- "split": "train",
105
- },
106
- ),
107
- datasets.SplitGenerator(
108
- name=datasets.Split.TEST,
109
- gen_kwargs={"filepath": data_paths["test"], "split": "test"},
110
- ),
111
- datasets.SplitGenerator(
112
- name=datasets.Split.VALIDATION,
113
- gen_kwargs={
114
- "filepath": data_paths["dev"],
115
- "split": "dev",
116
- },
117
- ),
118
- ]
119
-
120
- def _generate_examples(self, filepath, split):
121
- """Yields examples."""
122
- with open(filepath, encoding="utf-8") as f:
123
- for id_, row in enumerate(f):
124
- data = json.loads(row)
125
- yield id_, {
126
- "question": data["question"],
127
- "options": data["options"],
128
- "rationale": data["rationale"],
129
- "correct": data["correct"],
130
- }