system HF staff commited on
Commit
35664bd
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.0

Files changed (4) hide show
  1. .gitattributes +27 -0
  2. dataset_infos.json +1 -0
  3. dummy/0.1.0/dummy_data.zip +3 -0
  4. math_qa.py +85 -0
.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.model filter=lfs diff=lfs merge=lfs -text
12
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
13
+ *.onnx filter=lfs diff=lfs merge=lfs -text
14
+ *.ot filter=lfs diff=lfs merge=lfs -text
15
+ *.parquet filter=lfs diff=lfs merge=lfs -text
16
+ *.pb filter=lfs diff=lfs merge=lfs -text
17
+ *.pt filter=lfs diff=lfs merge=lfs -text
18
+ *.pth filter=lfs diff=lfs merge=lfs -text
19
+ *.rar filter=lfs diff=lfs merge=lfs -text
20
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
22
+ *.tflite filter=lfs diff=lfs merge=lfs -text
23
+ *.tgz filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "\nOur dataset is gathered by using a new representation language to annotate over the AQuA-RAT dataset. AQuA-RAT has provided the questions, options, rationale, and the correct options.\n", "citation": "\n", "homepage": "https://math-qa.github.io/math-QA/", "license": "", "features": {"Problem": {"dtype": "string", "id": null, "_type": "Value"}, "Rationale": {"dtype": "string", "id": null, "_type": "Value"}, "options": {"dtype": "string", "id": null, "_type": "Value"}, "correct": {"dtype": "string", "id": null, "_type": "Value"}, "annotated_formula": {"dtype": "string", "id": null, "_type": "Value"}, "linear_formula": {"dtype": "string", "id": null, "_type": "Value"}, "category": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "math_qa", "config_name": "default", "version": {"version_str": "0.1.0", "description": null, "datasets_version_to_prepare": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 1844184, "num_examples": 2985, "dataset_name": "math_qa"}, "train": {"name": "train", "num_bytes": 18368826, "num_examples": 29837, "dataset_name": "math_qa"}, "validation": {"name": "validation", "num_bytes": 2752969, "num_examples": 4475, "dataset_name": "math_qa"}}, "download_checksums": {"https://math-qa.github.io/math-QA/data/MathQA.zip": {"num_bytes": 7302821, "checksum": "7344f30456a7aef3176d4866cc953b35b41bec44eda6b00cdbcfde2876b2f07a"}}, "download_size": 7302821, "dataset_size": 22965979, "size_in_bytes": 30268800}}
dummy/0.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62911d2e287d14104f0fe62a3a2477eb2a3a40e6baf5b76641396cbd26168587
3
+ size 1867
math_qa.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TODO(math_qa): Add a description here."""
2
+
3
+ from __future__ import absolute_import, division, print_function
4
+
5
+ import json
6
+ import os
7
+
8
+ import datasets
9
+
10
+
11
+ # TODO(math_qa): BibTeX citation
12
+ _CITATION = """
13
+ """
14
+
15
+ # TODO(math_qa):
16
+ _DESCRIPTION = """
17
+ Our dataset is gathered by using a new representation language to annotate over the AQuA-RAT dataset. AQuA-RAT has provided the questions, options, rationale, and the correct options.
18
+ """
19
+ _URL = "https://math-qa.github.io/math-QA/data/MathQA.zip"
20
+
21
+
22
+ class MathQa(datasets.GeneratorBasedBuilder):
23
+ """TODO(math_qa): Short description of my dataset."""
24
+
25
+ # TODO(math_qa): Set up version.
26
+ VERSION = datasets.Version("0.1.0")
27
+
28
+ def _info(self):
29
+ # TODO(math_qa): Specifies the datasets.DatasetInfo object
30
+ return datasets.DatasetInfo(
31
+ # This is the description that will appear on the datasets page.
32
+ description=_DESCRIPTION,
33
+ # datasets.features.FeatureConnectors
34
+ features=datasets.Features(
35
+ {
36
+ # These are the features of your dataset like images, labels ...
37
+ "Problem": datasets.Value("string"),
38
+ "Rationale": datasets.Value("string"),
39
+ "options": datasets.Value("string"),
40
+ "correct": datasets.Value("string"),
41
+ "annotated_formula": datasets.Value("string"),
42
+ "linear_formula": datasets.Value("string"),
43
+ "category": datasets.Value("string"),
44
+ }
45
+ ),
46
+ # If there's a common (input, target) tuple from the features,
47
+ # specify them here. They'll be used if as_supervised=True in
48
+ # builder.as_dataset.
49
+ supervised_keys=None,
50
+ # Homepage of the dataset for documentation
51
+ homepage="https://math-qa.github.io/math-QA/",
52
+ citation=_CITATION,
53
+ )
54
+
55
+ def _split_generators(self, dl_manager):
56
+ """Returns SplitGenerators."""
57
+ # TODO(math_qa): Downloads the data and defines the splits
58
+ # dl_manager is a datasets.download.DownloadManager that can be used to
59
+ # download and extract URLs
60
+ dl_path = dl_manager.download_and_extract(_URL)
61
+ return [
62
+ datasets.SplitGenerator(
63
+ name=datasets.Split.TRAIN,
64
+ # These kwargs will be passed to _generate_examples
65
+ gen_kwargs={"filepath": os.path.join(dl_path, "train.json")},
66
+ ),
67
+ datasets.SplitGenerator(
68
+ name=datasets.Split.TEST,
69
+ # These kwargs will be passed to _generate_examples
70
+ gen_kwargs={"filepath": os.path.join(dl_path, "test.json")},
71
+ ),
72
+ datasets.SplitGenerator(
73
+ name=datasets.Split.VALIDATION,
74
+ # These kwargs will be passed to _generate_examples
75
+ gen_kwargs={"filepath": os.path.join(dl_path, "dev.json")},
76
+ ),
77
+ ]
78
+
79
+ def _generate_examples(self, filepath):
80
+ """Yields examples."""
81
+ # TODO(math_qa): Yields (key, example) tuples from the dataset
82
+ with open(filepath, encoding="utf-8") as f:
83
+ data = json.load(f)
84
+ for id_, row in enumerate(data):
85
+ yield id_, row