Delete loading script
Browse files- numeracy.py +0 -67
numeracy.py
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
import datasets
|
2 |
-
import os
|
3 |
-
import json
|
4 |
-
|
5 |
-
|
6 |
-
_CITATION = """
|
7 |
-
|
8 |
-
"""
|
9 |
-
|
10 |
-
_DESCRIPTION = """
|
11 |
-
|
12 |
-
"""
|
13 |
-
names = ["linear_example",
|
14 |
-
"linear_standard",
|
15 |
-
"parabola_example",
|
16 |
-
"parabola_standard",
|
17 |
-
"plane_example",
|
18 |
-
"plane_standard",
|
19 |
-
"paraboloid_example",
|
20 |
-
"paraboloid_standard",
|
21 |
-
]
|
22 |
-
|
23 |
-
class Builder(datasets.GeneratorBasedBuilder):
|
24 |
-
VERSION = datasets.Version("1.0.0")
|
25 |
-
|
26 |
-
BUILDER_CONFIGS = [
|
27 |
-
datasets.BuilderConfig(name=name, version=datasets.Version("1.0.0"), description=_DESCRIPTION)
|
28 |
-
for name in names
|
29 |
-
]
|
30 |
-
|
31 |
-
def _info(self):
|
32 |
-
features = datasets.Features(
|
33 |
-
{
|
34 |
-
"equation": datasets.Value("string"),
|
35 |
-
"vars": datasets.Sequence(datasets.Value("int64")),
|
36 |
-
"output": datasets.Value("int64"),
|
37 |
-
}
|
38 |
-
)
|
39 |
-
|
40 |
-
return datasets.DatasetInfo(
|
41 |
-
description=_DESCRIPTION,
|
42 |
-
features=features,
|
43 |
-
homepage="",
|
44 |
-
license="",
|
45 |
-
citation=_CITATION,
|
46 |
-
)
|
47 |
-
|
48 |
-
def _split_generators(self, dl_manager):
|
49 |
-
train_json = dl_manager.download(os.path.join(self.config.name, "train.jsonl"))
|
50 |
-
test_json = dl_manager.download(os.path.join(self.config.name, "test.jsonl"))
|
51 |
-
|
52 |
-
return [
|
53 |
-
datasets.SplitGenerator(
|
54 |
-
name=datasets.Split.TRAIN,
|
55 |
-
gen_kwargs={"path": train_json},
|
56 |
-
),
|
57 |
-
datasets.SplitGenerator(
|
58 |
-
name=datasets.Split.TEST,
|
59 |
-
gen_kwargs={"path": test_json},
|
60 |
-
),
|
61 |
-
]
|
62 |
-
|
63 |
-
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
64 |
-
def _generate_examples(self, path):
|
65 |
-
with open(path, encoding="utf-8") as f:
|
66 |
-
for key, row in enumerate(f):
|
67 |
-
yield key, json.loads(row)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|