first operands are the subsets
Browse files
numerical_reasoning_arithmetic.py
CHANGED
@@ -43,7 +43,7 @@ class NumericalReasoningArithmetic(datasets.GeneratorBasedBuilder):
|
|
43 |
BUILDER_CONFIGS = [
|
44 |
datasets.BuilderConfig(
|
45 |
name="{}".format(num),
|
46 |
-
version=
|
47 |
description="Task with {} as the first operand".format(num)) \
|
48 |
for num in range(0,100)
|
49 |
]
|
@@ -53,8 +53,8 @@ class NumericalReasoningArithmetic(datasets.GeneratorBasedBuilder):
|
|
53 |
def _info(self):
|
54 |
features = datasets.Features(
|
55 |
{
|
56 |
-
"x1": datasets.Value("
|
57 |
-
"x2": datasets.Value("
|
58 |
"y_mul": datasets.Value("int32"),
|
59 |
"y_add": datasets.Value("int32"),
|
60 |
}
|
@@ -80,13 +80,11 @@ class NumericalReasoningArithmetic(datasets.GeneratorBasedBuilder):
|
|
80 |
|
81 |
def _generate_examples(self, split):
|
82 |
|
83 |
-
|
84 |
-
for
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
"y_add": x1+x2,
|
92 |
-
}
|
|
|
43 |
BUILDER_CONFIGS = [
|
44 |
datasets.BuilderConfig(
|
45 |
name="{}".format(num),
|
46 |
+
version=datasets.Version("0.1.0"),
|
47 |
description="Task with {} as the first operand".format(num)) \
|
48 |
for num in range(0,100)
|
49 |
]
|
|
|
53 |
def _info(self):
|
54 |
features = datasets.Features(
|
55 |
{
|
56 |
+
"x1": datasets.Value("int32"),
|
57 |
+
"x2": datasets.Value("int32"),
|
58 |
"y_mul": datasets.Value("int32"),
|
59 |
"y_add": datasets.Value("int32"),
|
60 |
}
|
|
|
80 |
|
81 |
def _generate_examples(self, split):
|
82 |
|
83 |
+
x1 = int(self.config.name)
|
84 |
+
for key, x2 in enumerate(range(1,51)):
|
85 |
+
yield key, {
|
86 |
+
"x1": x1,
|
87 |
+
"x2": x2,
|
88 |
+
"y_mul": x1*x2,
|
89 |
+
"y_add": x1+x2,
|
90 |
+
}
|
|
|
|