Commit ·
804ca82
1
Parent(s): f838d5a
Update parquet files
Browse files- README.md +0 -1
- arithmetic_addition/numerical_reasoning-test.parquet +3 -0
- arithmetic_multiplication/numerical_reasoning-test.parquet +3 -0
- numerical_reasoning.py +0 -157
- op_infer_add/numerical_reasoning-test.parquet +3 -0
- op_infer_mult/numerical_reasoning-test.parquet +3 -0
- time_unit_day_hour/numerical_reasoning-test.parquet +3 -0
- time_unit_decade_year/numerical_reasoning-test.parquet +3 -0
- time_unit_hour_min/numerical_reasoning-test.parquet +3 -0
- time_unit_min_sec/numerical_reasoning-test.parquet +3 -0
- time_unit_month_week/numerical_reasoning-test.parquet +3 -0
- time_unit_week_day/numerical_reasoning-test.parquet +3 -0
- time_unit_year_month/numerical_reasoning-test.parquet +3 -0
README.md
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
# Numerical Reasoning
|
|
|
|
|
|
arithmetic_addition/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a44f558002728ed29089527e626bcbc4a0b4b23a98a28e17cbf2ce72b48ae7f
|
| 3 |
+
size 27154
|
arithmetic_multiplication/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a44f558002728ed29089527e626bcbc4a0b4b23a98a28e17cbf2ce72b48ae7f
|
| 3 |
+
size 27154
|
numerical_reasoning.py
DELETED
|
@@ -1,157 +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 |
-
# TODO: Address all TODOs and remove all explanatory comments
|
| 15 |
-
"""TODO: Add a description here."""
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
import csv
|
| 19 |
-
import json
|
| 20 |
-
import os
|
| 21 |
-
|
| 22 |
-
import datasets
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
# TODO: Add BibTeX citation
|
| 26 |
-
# Find for instance the citation on arxiv or on the dataset repo/website
|
| 27 |
-
_CITATION = """\
|
| 28 |
-
|
| 29 |
-
"""
|
| 30 |
-
|
| 31 |
-
# TODO: Add description of the dataset here
|
| 32 |
-
# You can copy an official description
|
| 33 |
-
_DESCRIPTION = """\
|
| 34 |
-
Generated dataset for testing numerical reasoning
|
| 35 |
-
"""
|
| 36 |
-
|
| 37 |
-
# TODO: Add a link to an official homepage for the dataset here
|
| 38 |
-
_HOMEPAGE = ""
|
| 39 |
-
|
| 40 |
-
# TODO: Add the licence for the dataset here if you can find it
|
| 41 |
-
_LICENSE = ""
|
| 42 |
-
|
| 43 |
-
# TODO: Add link to the official dataset URLs here
|
| 44 |
-
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
| 45 |
-
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
| 46 |
-
_URLS = {
|
| 47 |
-
"first_domain": "https://huggingface.co/great-new-dataset-first_domain.zip",
|
| 48 |
-
"second_domain": "https://huggingface.co/great-new-dataset-second_domain.zip",
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
# TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
|
| 53 |
-
class NewDataset(datasets.GeneratorBasedBuilder):
|
| 54 |
-
"""TODO: Short description of my dataset."""
|
| 55 |
-
|
| 56 |
-
VERSION = datasets.Version("0.1.0")
|
| 57 |
-
|
| 58 |
-
BUILDER_CONFIGS = [
|
| 59 |
-
datasets.BuilderConfig(name="arithmetic_multiplication", version=VERSION, description="x1 x x2 = y"),
|
| 60 |
-
datasets.BuilderConfig(name="arithmetic_addition", version=VERSION, description="x1 + x2 = y"),
|
| 61 |
-
datasets.BuilderConfig(name="op_infer_mult", version=VERSION, description="x1 # x2 = y, must infer that # is multiplication"),
|
| 62 |
-
datasets.BuilderConfig(name="op_infer_add", version=VERSION, description="x1 # x2 = y, must infer that # is addition"),
|
| 63 |
-
datasets.BuilderConfig(name="time_unit_min_sec", version=VERSION, description="x minutes equals y seconds"),
|
| 64 |
-
datasets.BuilderConfig(name="time_unit_hour_min", version=VERSION, description="x hours equals y minutes"),
|
| 65 |
-
datasets.BuilderConfig(name="time_unit_day_hour", version=VERSION, description="x days equals y hours"),
|
| 66 |
-
datasets.BuilderConfig(name="time_unit_week_day", version=VERSION, description="x minutes equals y seconds"),
|
| 67 |
-
datasets.BuilderConfig(name="time_unit_month_week", version=VERSION, description="x months equals y weeks"),
|
| 68 |
-
datasets.BuilderConfig(name="time_unit_year_month", version=VERSION, description="x years equals y months"),
|
| 69 |
-
datasets.BuilderConfig(name="time_unit_decade_year", version=VERSION, description="x decades equals y years"),
|
| 70 |
-
]
|
| 71 |
-
|
| 72 |
-
DEFAULT_CONFIG_NAME = "first_domain" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
| 73 |
-
|
| 74 |
-
def _info(self):
|
| 75 |
-
if ("arithmetic" in self.config.name) or ("op_infer" in self.config.name): # This is the name of the configuration selected in BUILDER_CONFIGS above
|
| 76 |
-
features = datasets.Features(
|
| 77 |
-
{
|
| 78 |
-
"x1": datasets.Value("int32"),
|
| 79 |
-
"x2": datasets.Value("int32"),
|
| 80 |
-
"y": datasets.Value("int32")
|
| 81 |
-
}
|
| 82 |
-
)
|
| 83 |
-
else:
|
| 84 |
-
features = datasets.Features(
|
| 85 |
-
{
|
| 86 |
-
"x1": datasets.Value("int32"),
|
| 87 |
-
"time_unit": datasets.Value("string"),
|
| 88 |
-
"y": datasets.Value("int32")
|
| 89 |
-
}
|
| 90 |
-
)
|
| 91 |
-
return datasets.DatasetInfo(
|
| 92 |
-
description=_DESCRIPTION,
|
| 93 |
-
features=features, # Here we define them above because they are different between the two configurations
|
| 94 |
-
homepage=_HOMEPAGE,
|
| 95 |
-
license=_LICENSE,
|
| 96 |
-
citation=_CITATION,
|
| 97 |
-
)
|
| 98 |
-
|
| 99 |
-
def _split_generators(self, dl_manager):
|
| 100 |
-
return [
|
| 101 |
-
datasets.SplitGenerator(
|
| 102 |
-
name=datasets.Split.TEST,
|
| 103 |
-
# These kwargs will be passed to _generate_examples
|
| 104 |
-
gen_kwargs={
|
| 105 |
-
"split": "test"
|
| 106 |
-
},
|
| 107 |
-
),
|
| 108 |
-
]
|
| 109 |
-
|
| 110 |
-
def _generate_examples(self, split):
|
| 111 |
-
|
| 112 |
-
if ("arithmetic" in self.config.name) or ("op_infer" in self.config.name):
|
| 113 |
-
key = 0
|
| 114 |
-
for x1 in range(0,100):
|
| 115 |
-
for x2 in range(1,51):
|
| 116 |
-
key += 1
|
| 117 |
-
# Yields examples as (key, example) tuples
|
| 118 |
-
yield key, {
|
| 119 |
-
"x1": x1,
|
| 120 |
-
"x2": x2,
|
| 121 |
-
"y": x1*x2,
|
| 122 |
-
}
|
| 123 |
-
else:
|
| 124 |
-
if "min_sec" in self.config.name:
|
| 125 |
-
time_unit = "minutes"
|
| 126 |
-
multiplier = 60
|
| 127 |
-
|
| 128 |
-
elif "hour_min" in self.config.name:
|
| 129 |
-
time_unit = "hours"
|
| 130 |
-
multiplier = 60
|
| 131 |
-
|
| 132 |
-
elif "day_hour" in self.config.name:
|
| 133 |
-
time_unit = "days"
|
| 134 |
-
multiplier = 24
|
| 135 |
-
|
| 136 |
-
elif "week_day" in self.config.name:
|
| 137 |
-
time_unit = "weeks"
|
| 138 |
-
multiplier = 7
|
| 139 |
-
|
| 140 |
-
elif "month_week" in self.config.name:
|
| 141 |
-
time_unit = "months"
|
| 142 |
-
multiplier = 30
|
| 143 |
-
|
| 144 |
-
elif "year_month" in self.config.name:
|
| 145 |
-
time_unit = "years"
|
| 146 |
-
multiplier = 12
|
| 147 |
-
|
| 148 |
-
elif "decade_year" in self.config.name:
|
| 149 |
-
time_unit = "decades"
|
| 150 |
-
multiplier = 10
|
| 151 |
-
|
| 152 |
-
for key, x1 in enumerate(range(0, 100)):
|
| 153 |
-
yield key, {
|
| 154 |
-
"x1": x1,
|
| 155 |
-
"time_unit": time_unit,
|
| 156 |
-
"y": multiplier*x1,
|
| 157 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
op_infer_add/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a44f558002728ed29089527e626bcbc4a0b4b23a98a28e17cbf2ce72b48ae7f
|
| 3 |
+
size 27154
|
op_infer_mult/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a44f558002728ed29089527e626bcbc4a0b4b23a98a28e17cbf2ce72b48ae7f
|
| 3 |
+
size 27154
|
time_unit_day_hour/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:283f8a8d8676f273989d4caad15f1c1da11154b5952f93e124c719e231feec18
|
| 3 |
+
size 2611
|
time_unit_decade_year/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e7a8a28188756bf96631434727ec58be62a60f36012883018c45d06fbab9091
|
| 3 |
+
size 2632
|
time_unit_hour_min/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e94700e872eb3695210a8de85d37ea3999e47f5c154643bdfa67fb6615368504
|
| 3 |
+
size 2618
|
time_unit_min_sec/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d93b73f0f59a2ea3bf53e7a41306953d09c903b75fa2f53abcbe7e3f6f8ac409
|
| 3 |
+
size 2632
|
time_unit_month_week/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b2de65d119eaa8a7c88db6d53d353e34f3382fd97c39394d821c42c055fc395
|
| 3 |
+
size 2625
|
time_unit_week_day/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35790babced7607d64461a9ae3ef8d9570c0fecf00ee3c0ff98b8f87f5bc4dae
|
| 3 |
+
size 2618
|
time_unit_year_month/numerical_reasoning-test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:126d2309e5a1a82a1de4467e9c15f506b4532fb97761e0c75a6747aa8499c044
|
| 3 |
+
size 2618
|