Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:

Convert dataset to Parquet

#1
MATH-lighteval.py DELETED
@@ -1,114 +0,0 @@
1
- """Mathematics Aptitude Test of Heuristics (MATH) dataset, lighteval format with correct builder configs."""
2
-
3
- import json
4
- import os
5
-
6
-
7
- from datasets import load_dataset, Dataset, DatasetDict, GeneratorBasedBuilder, BuilderConfig, DatasetInfo, Value, Features, Split, SplitGenerator, Version
8
-
9
-
10
- _CITATION = """\
11
- @article{hendrycksmath2021,
12
- title={Measuring Mathematical Problem Solving With the MATH Dataset},
13
- author={Dan Hendrycks
14
- and Collin Burns
15
- and Saurav Kadavath
16
- and Akul Arora
17
- and Steven Basart
18
- and Eric Tang
19
- and Dawn Song
20
- and Jacob Steinhardt},
21
- journal={arXiv preprint arXiv:2103.03874},
22
- year={2021}
23
- }
24
- """
25
-
26
-
27
- _DESCRIPTION = """\
28
- The Mathematics Aptitude Test of Heuristics (MATH) dataset consists of problems
29
- from mathematics competitions, including the AMC 10, AMC 12, AIME, and more.
30
- Each problem in MATH has a full step-by-step solution, which can be used to teach
31
- models to generate answer derivations and explanations. This version of the dataset
32
- includes appropriate builder configs s.t. it can be used as a drop-in replacement
33
- for the now missing lighteval/MATH dataset.
34
- """
35
-
36
-
37
- _HOMEPAGE = "https://github.com/hendrycks/math"
38
-
39
-
40
- _LICENSE = "https://github.com/hendrycks/math/blob/main/LICENSE"
41
-
42
-
43
- # Original data URL: "https://people.eecs.berkeley.edu/~hendrycks/MATH.tar"
44
- _URL = "data/MATH.zip"
45
-
46
-
47
- class FilteredTypeConfig(BuilderConfig):
48
- def __init__(self, type_value, type_name, **kwargs):
49
- super().__init__(**kwargs)
50
- self.type_value = type_value
51
- self.type_name = type_name
52
-
53
- class FilteredTypeDatasetBuilder(GeneratorBasedBuilder):
54
- """Mathematics Aptitude Test of Heuristics (MATH) dataset."""
55
-
56
- VERSION = Version("1.0.0")
57
-
58
- BUILDER_CONFIGS = [FilteredTypeConfig(
59
- name="default",
60
- version="1.0.0",
61
- description=f"default builder config",
62
- type_name="default", # for builder config
63
- type_value="default", # in original dataset
64
- )] + [
65
- FilteredTypeConfig(
66
- name=type_name,
67
- version="1.0.0",
68
- description=f"Dataset filtered by type: {type_value}",
69
- type_name=type_name, # for builder config
70
- type_value=type_value, # in original dataset
71
- )
72
- for type_name, type_value in [("algebra", "Algebra"), ("counting_and_probability", "Counting & Probability"), ("geometry", "Geometry"), ("intermediate_algebra", "Intermediate Algebra"), ("number_theory", "Number Theory"), ("prealgebra", "Prealgebra"), ("precalculus", "Precalculus")]
73
- ]
74
-
75
- def _info(self):
76
- return DatasetInfo(
77
- description=_DESCRIPTION,
78
- features=Features({
79
- "problem": Value("string"),
80
- "level": Value("string"),
81
- "solution": Value("string"),
82
- "type": Value("string"),
83
- }),
84
- supervised_keys=None,
85
- homepage=_HOMEPAGE,
86
- license=_LICENSE,
87
- citation=_CITATION
88
- )
89
-
90
- def _split_generators(self, dl_manager):
91
- """Returns SplitGenerators."""
92
- download_dir = dl_manager.download_and_extract(_URL)
93
- return [
94
- SplitGenerator(
95
- name=Split.TRAIN,
96
- gen_kwargs={"data_dir": dl_manager.iter_files(os.path.join(download_dir, "MATH", "train"))},
97
- ),
98
- SplitGenerator(
99
- name=Split.TEST,
100
- gen_kwargs={"data_dir": dl_manager.iter_files(os.path.join(download_dir, "MATH", "test"))},
101
- ),
102
- ]
103
-
104
- def _generate_examples(self, data_dir):
105
- type_value = self.config.type_value # Access the type value for the current config
106
-
107
- """Yields examples as (key, example) tuples. Filters by type if appropriate builder config is given."""
108
- for id_, filepath in enumerate(data_dir):
109
- with open(filepath, "rb") as fin:
110
- example = json.load(fin)
111
- if type_value == "default" or example["type"] == type_value:
112
- yield id_, example
113
-
114
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -1,3 +1,205 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
1
  ---
2
  license: mit
3
+ dataset_info:
4
+ - config_name: algebra
5
+ features:
6
+ - name: problem
7
+ dtype: string
8
+ - name: level
9
+ dtype: string
10
+ - name: solution
11
+ dtype: string
12
+ - name: type
13
+ dtype: string
14
+ splits:
15
+ - name: train
16
+ num_bytes: 955021
17
+ num_examples: 1744
18
+ - name: test
19
+ num_bytes: 648291
20
+ num_examples: 1187
21
+ download_size: 858300
22
+ dataset_size: 1603312
23
+ - config_name: counting_and_probability
24
+ features:
25
+ - name: problem
26
+ dtype: string
27
+ - name: level
28
+ dtype: string
29
+ - name: solution
30
+ dtype: string
31
+ - name: type
32
+ dtype: string
33
+ splits:
34
+ - name: train
35
+ num_bytes: 667385
36
+ num_examples: 771
37
+ - name: test
38
+ num_bytes: 353803
39
+ num_examples: 474
40
+ download_size: 504386
41
+ dataset_size: 1021188
42
+ - config_name: default
43
+ features:
44
+ - name: problem
45
+ dtype: string
46
+ - name: level
47
+ dtype: string
48
+ - name: solution
49
+ dtype: string
50
+ - name: type
51
+ dtype: string
52
+ splits:
53
+ - name: train
54
+ num_bytes: 5984772
55
+ num_examples: 7500
56
+ - name: test
57
+ num_bytes: 3732833
58
+ num_examples: 5000
59
+ download_size: 4848021
60
+ dataset_size: 9717605
61
+ - config_name: geometry
62
+ features:
63
+ - name: problem
64
+ dtype: string
65
+ - name: level
66
+ dtype: string
67
+ - name: solution
68
+ dtype: string
69
+ - name: type
70
+ dtype: string
71
+ splits:
72
+ - name: train
73
+ num_bytes: 1077241
74
+ num_examples: 870
75
+ - name: test
76
+ num_bytes: 523126
77
+ num_examples: 479
78
+ download_size: 813223
79
+ dataset_size: 1600367
80
+ - config_name: intermediate_algebra
81
+ features:
82
+ - name: problem
83
+ dtype: string
84
+ - name: level
85
+ dtype: string
86
+ - name: solution
87
+ dtype: string
88
+ - name: type
89
+ dtype: string
90
+ splits:
91
+ - name: train
92
+ num_bytes: 1157476
93
+ num_examples: 1295
94
+ - name: test
95
+ num_bytes: 795070
96
+ num_examples: 903
97
+ download_size: 969951
98
+ dataset_size: 1952546
99
+ - config_name: number_theory
100
+ features:
101
+ - name: problem
102
+ dtype: string
103
+ - name: level
104
+ dtype: string
105
+ - name: solution
106
+ dtype: string
107
+ - name: type
108
+ dtype: string
109
+ splits:
110
+ - name: train
111
+ num_bytes: 595793
112
+ num_examples: 869
113
+ - name: test
114
+ num_bytes: 349455
115
+ num_examples: 540
116
+ download_size: 490656
117
+ dataset_size: 945248
118
+ - config_name: prealgebra
119
+ features:
120
+ - name: problem
121
+ dtype: string
122
+ - name: level
123
+ dtype: string
124
+ - name: solution
125
+ dtype: string
126
+ - name: type
127
+ dtype: string
128
+ splits:
129
+ - name: train
130
+ num_bytes: 715611
131
+ num_examples: 1205
132
+ - name: test
133
+ num_bytes: 510195
134
+ num_examples: 871
135
+ download_size: 651355
136
+ dataset_size: 1225806
137
+ - config_name: precalculus
138
+ features:
139
+ - name: problem
140
+ dtype: string
141
+ - name: level
142
+ dtype: string
143
+ - name: solution
144
+ dtype: string
145
+ - name: type
146
+ dtype: string
147
+ splits:
148
+ - name: train
149
+ num_bytes: 816245
150
+ num_examples: 746
151
+ - name: test
152
+ num_bytes: 552893
153
+ num_examples: 546
154
+ download_size: 595986
155
+ dataset_size: 1369138
156
+ configs:
157
+ - config_name: algebra
158
+ data_files:
159
+ - split: train
160
+ path: algebra/train-*
161
+ - split: test
162
+ path: algebra/test-*
163
+ - config_name: counting_and_probability
164
+ data_files:
165
+ - split: train
166
+ path: counting_and_probability/train-*
167
+ - split: test
168
+ path: counting_and_probability/test-*
169
+ - config_name: default
170
+ data_files:
171
+ - split: train
172
+ path: data/train-*
173
+ - split: test
174
+ path: data/test-*
175
+ - config_name: geometry
176
+ data_files:
177
+ - split: train
178
+ path: geometry/train-*
179
+ - split: test
180
+ path: geometry/test-*
181
+ - config_name: intermediate_algebra
182
+ data_files:
183
+ - split: train
184
+ path: intermediate_algebra/train-*
185
+ - split: test
186
+ path: intermediate_algebra/test-*
187
+ - config_name: number_theory
188
+ data_files:
189
+ - split: train
190
+ path: number_theory/train-*
191
+ - split: test
192
+ path: number_theory/test-*
193
+ - config_name: prealgebra
194
+ data_files:
195
+ - split: train
196
+ path: prealgebra/train-*
197
+ - split: test
198
+ path: prealgebra/test-*
199
+ - config_name: precalculus
200
+ data_files:
201
+ - split: train
202
+ path: precalculus/train-*
203
+ - split: test
204
+ path: precalculus/test-*
205
  ---
data/MATH.zip → algebra/test-00000-of-00001.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d9b88da85e6ffa3e1057ae675238d6e192574243bdc45ca7d00a1339fc4d0874
3
- size 7914977
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82afa924bb3f78d48b8c91296f0b988f4a27d984b55722ce058dcf38581973af
3
+ size 353114
algebra/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f4f43beb2db5cacad772d30ad9eda027141a2abeff9aad08cf02d254d46175a
3
+ size 505186
counting_and_probability/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2d9564b7af4dcffa5bef1df13f90de648a5ac497342e2ce12bca9eec8aeabde
3
+ size 175032
counting_and_probability/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8bd338b2bb20e41bc3c70daa36ff93f30faee106ced6dc788d292e37eddce98b
3
+ size 329354
data/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7dca8d6e41af88ecf82f2b5f36eb5530e083aaaa86ee325f62bd5c31535178c6
3
+ size 1855870
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eca6e667f4305dd5e5ba09b4fd55e7f3174a0fbe361cdfd4c44758b593a76933
3
+ size 2992151
geometry/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:580ea70aa18c593ee7e2492623e6e42281d2db27b8ba7de8bc903ac2b6ca0865
3
+ size 263835
geometry/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b31a8b3eb50e509b4c6b704ccd59646ca70efb306c1215a64c4e5d308a835c61
3
+ size 549388
intermediate_algebra/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b69a6bc6216fe7997dd8399478b6feffc2fba4fc5a4e255228b0ed265dbbade
3
+ size 394797
intermediate_algebra/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d18b4ed64f77e3e45d7d7c4eb386a6bc0cc3ade39e5926938caf4d817acf07a6
3
+ size 575154
number_theory/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41695431c8c9f54c367f276b369586050b25fc86ba01d86468c13e050c397d67
3
+ size 182003
number_theory/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43145931797589e5ae252eabe747a8e447314d1498aa0f2e1c9ce781a514cea2
3
+ size 308653
prealgebra/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2aa4f6c0d0f53432e58f91aff18a27f6dcb83e668d963f2d5c0bc2e5df9023b6
3
+ size 267729
prealgebra/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef1622b40248ac858711ba61f6c76e0a4f1ae9b090a6a17e5cab7dcac53c9b05
3
+ size 383626
precalculus/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f5772bfcead8206f0645536e02dbe6e275371f9e2bbb3d45371f6946acb16bb
3
+ size 242241
precalculus/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c51572f7b5a4e1a18a7898c3f7bc111015ff5fa14dc9274d0c639a6beb23f1ed
3
+ size 353745