Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets

Convert dataset to Parquet

#1
by SaylorTwift HF Staff - opened
README.md CHANGED
@@ -1,3 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ### Dataset Summary
2
 
3
  A small battery of 10 tests that involve asking language models a simple arithmetic problem in natural language.
 
1
+ ---
2
+ dataset_info:
3
+ - config_name: arithmetic_1dc
4
+ features:
5
+ - name: context
6
+ dtype: string
7
+ - name: completion
8
+ dtype: string
9
+ splits:
10
+ - name: validation
11
+ num_bytes: 97651
12
+ num_examples: 2000
13
+ download_size: 21322
14
+ dataset_size: 97651
15
+ - config_name: arithmetic_2da
16
+ features:
17
+ - name: context
18
+ dtype: string
19
+ - name: completion
20
+ dtype: string
21
+ splits:
22
+ - name: validation
23
+ num_bytes: 96624
24
+ num_examples: 2000
25
+ download_size: 20598
26
+ dataset_size: 96624
27
+ - config_name: arithmetic_2dm
28
+ features:
29
+ - name: context
30
+ dtype: string
31
+ - name: completion
32
+ dtype: string
33
+ splits:
34
+ - name: validation
35
+ num_bytes: 100685
36
+ num_examples: 2000
37
+ download_size: 27593
38
+ dataset_size: 100685
39
+ - config_name: arithmetic_2ds
40
+ features:
41
+ - name: context
42
+ dtype: string
43
+ - name: completion
44
+ dtype: string
45
+ splits:
46
+ - name: validation
47
+ num_bytes: 98216
48
+ num_examples: 2000
49
+ download_size: 20805
50
+ dataset_size: 98216
51
+ - config_name: arithmetic_3da
52
+ features:
53
+ - name: context
54
+ dtype: string
55
+ - name: completion
56
+ dtype: string
57
+ splits:
58
+ - name: validation
59
+ num_bytes: 102612
60
+ num_examples: 2000
61
+ download_size: 31042
62
+ dataset_size: 102612
63
+ - config_name: arithmetic_3ds
64
+ features:
65
+ - name: context
66
+ dtype: string
67
+ - name: completion
68
+ dtype: string
69
+ splits:
70
+ - name: validation
71
+ num_bytes: 104150
72
+ num_examples: 2000
73
+ download_size: 31035
74
+ dataset_size: 104150
75
+ - config_name: arithmetic_4da
76
+ features:
77
+ - name: context
78
+ dtype: string
79
+ - name: completion
80
+ dtype: string
81
+ splits:
82
+ - name: validation
83
+ num_bytes: 108570
84
+ num_examples: 2000
85
+ download_size: 39711
86
+ dataset_size: 108570
87
+ - config_name: arithmetic_4ds
88
+ features:
89
+ - name: context
90
+ dtype: string
91
+ - name: completion
92
+ dtype: string
93
+ splits:
94
+ - name: validation
95
+ num_bytes: 110150
96
+ num_examples: 2000
97
+ download_size: 39722
98
+ dataset_size: 110150
99
+ - config_name: arithmetic_5da
100
+ features:
101
+ - name: context
102
+ dtype: string
103
+ - name: completion
104
+ dtype: string
105
+ splits:
106
+ - name: validation
107
+ num_bytes: 114476
108
+ num_examples: 2000
109
+ download_size: 45989
110
+ dataset_size: 114476
111
+ - config_name: arithmetic_5ds
112
+ features:
113
+ - name: context
114
+ dtype: string
115
+ - name: completion
116
+ dtype: string
117
+ splits:
118
+ - name: validation
119
+ num_bytes: 116119
120
+ num_examples: 2000
121
+ download_size: 46059
122
+ dataset_size: 116119
123
+ configs:
124
+ - config_name: arithmetic_1dc
125
+ data_files:
126
+ - split: validation
127
+ path: arithmetic_1dc/validation-*
128
+ - config_name: arithmetic_2da
129
+ data_files:
130
+ - split: validation
131
+ path: arithmetic_2da/validation-*
132
+ - config_name: arithmetic_2dm
133
+ data_files:
134
+ - split: validation
135
+ path: arithmetic_2dm/validation-*
136
+ - config_name: arithmetic_2ds
137
+ data_files:
138
+ - split: validation
139
+ path: arithmetic_2ds/validation-*
140
+ - config_name: arithmetic_3da
141
+ data_files:
142
+ - split: validation
143
+ path: arithmetic_3da/validation-*
144
+ - config_name: arithmetic_3ds
145
+ data_files:
146
+ - split: validation
147
+ path: arithmetic_3ds/validation-*
148
+ - config_name: arithmetic_4da
149
+ data_files:
150
+ - split: validation
151
+ path: arithmetic_4da/validation-*
152
+ - config_name: arithmetic_4ds
153
+ data_files:
154
+ - split: validation
155
+ path: arithmetic_4ds/validation-*
156
+ - config_name: arithmetic_5da
157
+ data_files:
158
+ - split: validation
159
+ path: arithmetic_5da/validation-*
160
+ - config_name: arithmetic_5ds
161
+ data_files:
162
+ - split: validation
163
+ path: arithmetic_5ds/validation-*
164
+ ---
165
  ### Dataset Summary
166
 
167
  A small battery of 10 tests that involve asking language models a simple arithmetic problem in natural language.
arithmetic.py DELETED
@@ -1,162 +0,0 @@
1
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- """GPT-3 Arithmetic Test Dataset."""
15
-
16
-
17
- import json
18
-
19
- import datasets
20
-
21
-
22
- _CITATION = """\
23
- @inproceedings{NEURIPS2020_1457c0d6,
24
- author = {Brown, Tom and Mann, Benjamin and Ryder, Nick and Subbiah, Melanie and Kaplan, Jared D and Dhariwal, Prafulla and Neelakantan, Arvind and Shyam, Pranav and Sastry, Girish and Askell, Amanda and Agarwal, Sandhini and Herbert-Voss, Ariel and Krueger, Gretchen and Henighan, Tom and Child, Rewon and Ramesh, Aditya and Ziegler, Daniel and Wu, Jeffrey and Winter, Clemens and Hesse, Chris and Chen, Mark and Sigler, Eric and Litwin, Mateusz and Gray, Scott and Chess, Benjamin and Clark, Jack and Berner, Christopher and McCandlish, Sam and Radford, Alec and Sutskever, Ilya and Amodei, Dario},
25
- booktitle = {Advances in Neural Information Processing Systems},
26
- editor = {H. Larochelle and M. Ranzato and R. Hadsell and M. F. Balcan and H. Lin},
27
- pages = {1877--1901},
28
- publisher = {Curran Associates, Inc.},
29
- title = {Language Models are Few-Shot Learners},
30
- url = {https://proceedings.neurips.cc/paper/2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf},
31
- volume = {33},
32
- year = {2020}
33
- }
34
- """
35
-
36
- _DESCRIPTION = """\
37
- A small battery of 10 tests that involve asking language models a simple arithmetic
38
- problem in natural language.
39
- """
40
-
41
- _HOMEPAGE = "https://github.com/openai/gpt-3/tree/master/data"
42
-
43
- # TODO: Add the licence for the dataset here if you can find it
44
- _LICENSE = ""
45
-
46
- _BASE_URL = "https://huggingface.co/datasets/EleutherAI/arithmetic/resolve/main/data"
47
-
48
-
49
- _URLS = {
50
- "arithmetic_2da": f"{_BASE_URL}/two_digit_addition.jsonl",
51
- "arithmetic_2ds": f"{_BASE_URL}/two_digit_subtraction.jsonl",
52
- "arithmetic_3da": f"{_BASE_URL}/three_digit_addition.jsonl",
53
- "arithmetic_3ds": f"{_BASE_URL}/three_digit_subtraction.jsonl",
54
- "arithmetic_4da": f"{_BASE_URL}/four_digit_addition.jsonl",
55
- "arithmetic_4ds": f"{_BASE_URL}/four_digit_subtraction.jsonl",
56
- "arithmetic_5da": f"{_BASE_URL}/five_digit_addition.jsonl",
57
- "arithmetic_5ds": f"{_BASE_URL}/five_digit_subtraction.jsonl",
58
- "arithmetic_2dm": f"{_BASE_URL}/two_digit_multiplication.jsonl",
59
- "arithmetic_1dc": f"{_BASE_URL}/single_digit_three_ops.jsonl"
60
- }
61
-
62
- class Arithmetic(datasets.GeneratorBasedBuilder):
63
- """A small battery of 10 tests involving simple arithmetic problems."""
64
-
65
- VERSION = datasets.Version("0.0.1")
66
-
67
- BUILDER_CONFIGS = [
68
- datasets.BuilderConfig(
69
- name = "arithmetic_2da",
70
- version = VERSION,
71
- description = "2-digit addition"
72
- ),
73
- datasets.BuilderConfig(
74
- name = "arithmetic_2ds",
75
- version = VERSION,
76
- description = "2-digit subtraction"
77
- ),
78
- datasets.BuilderConfig(
79
- name = "arithmetic_3da",
80
- version = VERSION,
81
- description = "3-digit addition"
82
- ),
83
- datasets.BuilderConfig(
84
- name = "arithmetic_3ds",
85
- version = VERSION,
86
- description = "3-digit subtraction"
87
- ),
88
- datasets.BuilderConfig(
89
- name = "arithmetic_4da",
90
- version = VERSION,
91
- description = "4-digit addition"
92
- ),
93
- datasets.BuilderConfig(
94
- name = "arithmetic_4ds",
95
- version = VERSION,
96
- description = "4-digit subtraction"
97
- ),
98
- datasets.BuilderConfig(
99
- name = "arithmetic_5da",
100
- version = VERSION,
101
- description = "5-digit addition"
102
- ),
103
- datasets.BuilderConfig(
104
- name = "arithmetic_5ds",
105
- version = VERSION,
106
- description = "5-digit subtraction"
107
- ),
108
- datasets.BuilderConfig(
109
- name = "arithmetic_2dm",
110
- version = VERSION,
111
- description = "2-digit multiplication"
112
- ),
113
- datasets.BuilderConfig(
114
- name = "arithmetic_1dc",
115
- version = VERSION,
116
- description = "Single digit 3 operations"
117
- )
118
- ]
119
-
120
- def _info(self):
121
- features = datasets.Features(
122
- {
123
- "context": datasets.Value("string"),
124
- "completion": datasets.Value("string"),
125
- }
126
- )
127
- return datasets.DatasetInfo(
128
- description=f"{_DESCRIPTION}\n{self.config.description}",
129
- features=features,
130
- homepage=_HOMEPAGE,
131
- license=_LICENSE,
132
- citation=_CITATION,
133
- )
134
-
135
- def _split_generators(self, dl_manager):
136
- urls = _URLS[self.config.name]
137
- data_dir = dl_manager.download_and_extract(urls)
138
- return [
139
- datasets.SplitGenerator(
140
- name=datasets.Split.VALIDATION,
141
- # These kwargs will be passed to _generate_examples
142
- gen_kwargs={
143
- "filepath": data_dir,
144
- "split": datasets.Split.VALIDATION,
145
- },
146
- ),
147
- ]
148
-
149
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
150
- def _generate_examples(self, filepath, split):
151
- with open(filepath, encoding="utf-8") as f:
152
- for key, row in enumerate(f):
153
- data = json.loads(row)
154
- context = (
155
- data["context"]
156
- .strip()
157
- .replace("\n\n", "\n")
158
- .replace("Q:", "Question:")
159
- .replace("A:", "Answer:")
160
- )
161
- completion = data["completion"]
162
- yield key, {"context": context, "completion": completion}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
arithmetic_1dc/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:596467621638db2bb172c22da9c956b00c67086056a6017effc54a40b16f08db
3
+ size 21322
arithmetic_2da/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e443adc9fe02c61a96f0ceeda9541c52b889f199df5518435d68f9a44e77e22
3
+ size 20598
arithmetic_2dm/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7788dd6d20439e07babeb659ba3430592db265faead2dd3d4f6f931705ff6559
3
+ size 27593
arithmetic_2ds/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa63a296b93191cd98a76b2aae31f326ba23abeaf440c88263f91673b0c0c682
3
+ size 20805
arithmetic_3da/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa9c052ca514eb047dee30a8bd33c358edbd9a6a36bdcae19d6093e913940707
3
+ size 31042
arithmetic_3ds/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:18e74c1049444df6d51be094ebe70ccda95a15df0c6a49f680c2592bec9182d1
3
+ size 31035
arithmetic_4da/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11b596829e817255a9651c698d732394dc990f802372f65c62957780231bbeaf
3
+ size 39711
arithmetic_4ds/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a8304f718d0930e07bb3db0b36269c2a9765b5fd3d31d6dd844c4678c370b8d
3
+ size 39722
arithmetic_5da/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:865d133cf5fd33ba4b032a3c4f72167458bfd2ff3616253e52f3550bb05bda19
3
+ size 45989
arithmetic_5ds/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fff1f7b49256a328b3817ccdfc23ad5567701b5f64ffd59bb8c16e25b7eafbc7
3
+ size 46059
data/five_digit_addition.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/five_digit_subtraction.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/four_digit_addition.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/four_digit_subtraction.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/single_digit_three_ops.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/three_digit_addition.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/three_digit_subtraction.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/two_digit_addition.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/two_digit_multiplication.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
data/two_digit_subtraction.jsonl DELETED
The diff for this file is too large to render. See raw diff