lintang commited on
Commit
b73bb19
1 Parent(s): c09750e

first operands are the subsets

Browse files
Files changed (1) hide show
  1. numerical_reasoning_arithmetic.py +11 -13
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=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("string"),
57
- "x2": datasets.Value("string"),
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
- key = 0
84
- for x1 in range(0,100):
85
- for x2 in range(1,51):
86
- key += 1
87
- yield key, {
88
- "x1": x1,
89
- "x2": x2,
90
- "y_mul": x1*x2,
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
+ }