Commit
•
cfe9dd5
0
Parent(s):
Update files from the datasets library (from 1.0.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.0.0
- .gitattributes +27 -0
- ai2_arc.py +133 -0
- dataset_infos.json +1 -0
- dummy/ARC-Challenge/1.0.0/dummy_data.zip +3 -0
- dummy/ARC-Easy/1.0.0/dummy_data.zip +3 -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
|
ai2_arc.py
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""TODO(arc): 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(ai2_arc): BibTeX citation
|
12 |
+
_CITATION = """\
|
13 |
+
@article{allenai:arc,
|
14 |
+
author = {Peter Clark and Isaac Cowhey and Oren Etzioni and Tushar Khot and
|
15 |
+
Ashish Sabharwal and Carissa Schoenick and Oyvind Tafjord},
|
16 |
+
title = {Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge},
|
17 |
+
journal = {arXiv:1803.05457v1},
|
18 |
+
year = {2018},
|
19 |
+
}
|
20 |
+
"""
|
21 |
+
|
22 |
+
# TODO(ai2_arc):
|
23 |
+
_DESCRIPTION = """\
|
24 |
+
A new dataset of 7,787 genuine grade-school level, multiple-choice science questions, assembled to encourage research in
|
25 |
+
advanced question-answering. The dataset is partitioned into a Challenge Set and an Easy Set, where the former contains
|
26 |
+
only questions answered incorrectly by both a retrieval-based algorithm and a word co-occurrence algorithm. We are also
|
27 |
+
including a corpus of over 14 million science sentences relevant to the task, and an implementation of three neural baseline models for this dataset. We pose ARC as a challenge to the community.
|
28 |
+
"""
|
29 |
+
|
30 |
+
_URL = "https://s3-us-west-2.amazonaws.com/ai2-website/data/ARC-V1-Feb2018.zip"
|
31 |
+
|
32 |
+
|
33 |
+
class Ai2ArcConfig(datasets.BuilderConfig):
|
34 |
+
"""BuilderConfig for Ai2ARC."""
|
35 |
+
|
36 |
+
def __init__(self, **kwargs):
|
37 |
+
"""BuilderConfig for Ai2Arc.
|
38 |
+
|
39 |
+
Args:
|
40 |
+
**kwargs: keyword arguments forwarded to super.
|
41 |
+
"""
|
42 |
+
super(Ai2ArcConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
43 |
+
|
44 |
+
|
45 |
+
class Ai2Arc(datasets.GeneratorBasedBuilder):
|
46 |
+
"""TODO(arc): Short description of my dataset."""
|
47 |
+
|
48 |
+
# TODO(arc): Set up version.
|
49 |
+
VERSION = datasets.Version("1.0.0")
|
50 |
+
BUILDER_CONFIGS = [
|
51 |
+
Ai2ArcConfig(
|
52 |
+
name="ARC-Challenge",
|
53 |
+
description="""\
|
54 |
+
Challenge Set of 2590 “hard” questions (those that both a retrieval and a co-occurrence method fail to answer correctly)
|
55 |
+
""",
|
56 |
+
),
|
57 |
+
Ai2ArcConfig(
|
58 |
+
name="ARC-Easy",
|
59 |
+
description="""\
|
60 |
+
Easy Set of 5197 questions
|
61 |
+
""",
|
62 |
+
),
|
63 |
+
]
|
64 |
+
|
65 |
+
def _info(self):
|
66 |
+
# TODO(ai2_arc): Specifies the datasets.DatasetInfo object
|
67 |
+
return datasets.DatasetInfo(
|
68 |
+
# This is the description that will appear on the datasets page.
|
69 |
+
description=_DESCRIPTION,
|
70 |
+
# datasets.features.FeatureConnectors
|
71 |
+
features=datasets.Features(
|
72 |
+
{
|
73 |
+
"id": datasets.Value("string"),
|
74 |
+
"question": datasets.Value("string"),
|
75 |
+
"choices": datasets.features.Sequence(
|
76 |
+
{"text": datasets.Value("string"), "label": datasets.Value("string")}
|
77 |
+
),
|
78 |
+
"answerKey": datasets.Value("string")
|
79 |
+
# These are the features of your dataset like images, labels ...
|
80 |
+
}
|
81 |
+
),
|
82 |
+
# If there's a common (input, target) tuple from the features,
|
83 |
+
# specify them here. They'll be used if as_supervised=True in
|
84 |
+
# builder.as_dataset.
|
85 |
+
supervised_keys=None,
|
86 |
+
# Homepage of the dataset for documentation
|
87 |
+
homepage="https://allenai.org/data/arc",
|
88 |
+
citation=_CITATION,
|
89 |
+
)
|
90 |
+
|
91 |
+
def _split_generators(self, dl_manager):
|
92 |
+
"""Returns SplitGenerators."""
|
93 |
+
# TODO(ai2_arc): Downloads the data and defines the splits
|
94 |
+
# dl_manager is a datasets.download.DownloadManager that can be used to
|
95 |
+
# download and extract URLs
|
96 |
+
dl_dir = dl_manager.download_and_extract(_URL)
|
97 |
+
data_dir = os.path.join(dl_dir, "ARC-V1-Feb2018-2")
|
98 |
+
return [
|
99 |
+
datasets.SplitGenerator(
|
100 |
+
name=datasets.Split.TRAIN,
|
101 |
+
# These kwargs will be passed to _generate_examples
|
102 |
+
gen_kwargs={"filepath": os.path.join(data_dir, self.config.name, self.config.name + "-Train.jsonl")},
|
103 |
+
),
|
104 |
+
datasets.SplitGenerator(
|
105 |
+
name=datasets.Split.TEST,
|
106 |
+
# These kwargs will be passed to _generate_examples
|
107 |
+
gen_kwargs={"filepath": os.path.join(data_dir, self.config.name, self.config.name + "-Test.jsonl")},
|
108 |
+
),
|
109 |
+
datasets.SplitGenerator(
|
110 |
+
name=datasets.Split.VALIDATION,
|
111 |
+
# These kwargs will be passed to _generate_examples
|
112 |
+
gen_kwargs={"filepath": os.path.join(data_dir, self.config.name, self.config.name + "-Dev.jsonl")},
|
113 |
+
),
|
114 |
+
]
|
115 |
+
|
116 |
+
def _generate_examples(self, filepath):
|
117 |
+
"""Yields examples."""
|
118 |
+
# TODO(ai2_arc): Yields (key, example) tuples from the dataset
|
119 |
+
with open(filepath, encoding="utf-8") as f:
|
120 |
+
for row in f:
|
121 |
+
data = json.loads(row)
|
122 |
+
answerkey = data["answerKey"]
|
123 |
+
id_ = data["id"]
|
124 |
+
question = data["question"]["stem"]
|
125 |
+
choices = data["question"]["choices"]
|
126 |
+
text_choices = [choice["text"] for choice in choices]
|
127 |
+
label_choices = [choice["label"] for choice in choices]
|
128 |
+
yield id_, {
|
129 |
+
"id": id_,
|
130 |
+
"answerKey": answerkey,
|
131 |
+
"question": question,
|
132 |
+
"choices": {"text": text_choices, "label": label_choices},
|
133 |
+
}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"ARC-Challenge": {"description": "A new dataset of 7,787 genuine grade-school level, multiple-choice science questions, assembled to encourage research in\n advanced question-answering. The dataset is partitioned into a Challenge Set and an Easy Set, where the former contains\n only questions answered incorrectly by both a retrieval-based algorithm and a word co-occurrence algorithm. We are also\n including a corpus of over 14 million science sentences relevant to the task, and an implementation of three neural baseline models for this dataset. We pose ARC as a challenge to the community.\n", "citation": "@article{allenai:arc,\n author = {Peter Clark and Isaac Cowhey and Oren Etzioni and Tushar Khot and\n Ashish Sabharwal and Carissa Schoenick and Oyvind Tafjord},\n title = {Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge},\n journal = {arXiv:1803.05457v1},\n year = {2018},\n}\n", "homepage": "https://allenai.org/data/arc", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "choices": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "answerKey": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "ai2_arc", "config_name": "ARC-Challenge", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 377740, "num_examples": 1172, "dataset_name": "ai2_arc"}, "train": {"name": "train", "num_bytes": 351888, "num_examples": 1119, "dataset_name": "ai2_arc"}, "validation": {"name": "validation", "num_bytes": 97254, "num_examples": 299, "dataset_name": "ai2_arc"}}, "download_checksums": {"https://s3-us-west-2.amazonaws.com/ai2-website/data/ARC-V1-Feb2018.zip": {"num_bytes": 680841265, "checksum": "6d2d5ab50b2ceec6ba5f79c921be77cf2de712ea25a2b3f4fff3acc101cecfa0"}}, "download_size": 680841265, "dataset_size": 826882, "size_in_bytes": 681668147}, "ARC-Easy": {"description": "A new dataset of 7,787 genuine grade-school level, multiple-choice science questions, assembled to encourage research in\n advanced question-answering. The dataset is partitioned into a Challenge Set and an Easy Set, where the former contains\n only questions answered incorrectly by both a retrieval-based algorithm and a word co-occurrence algorithm. We are also\n including a corpus of over 14 million science sentences relevant to the task, and an implementation of three neural baseline models for this dataset. We pose ARC as a challenge to the community.\n", "citation": "@article{allenai:arc,\n author = {Peter Clark and Isaac Cowhey and Oren Etzioni and Tushar Khot and\n Ashish Sabharwal and Carissa Schoenick and Oyvind Tafjord},\n title = {Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge},\n journal = {arXiv:1803.05457v1},\n year = {2018},\n}\n", "homepage": "https://allenai.org/data/arc", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "choices": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "answerKey": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "ai2_arc", "config_name": "ARC-Easy", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 661997, "num_examples": 2376, "dataset_name": "ai2_arc"}, "train": {"name": "train", "num_bytes": 623254, "num_examples": 2251, "dataset_name": "ai2_arc"}, "validation": {"name": "validation", "num_bytes": 158498, "num_examples": 570, "dataset_name": "ai2_arc"}}, "download_checksums": {"https://s3-us-west-2.amazonaws.com/ai2-website/data/ARC-V1-Feb2018.zip": {"num_bytes": 680841265, "checksum": "6d2d5ab50b2ceec6ba5f79c921be77cf2de712ea25a2b3f4fff3acc101cecfa0"}}, "download_size": 680841265, "dataset_size": 1443749, "size_in_bytes": 682285014}}
|
dummy/ARC-Challenge/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:14cb5c6345df3095df22c78f301589322ddcef0d022dbe7b3685000cde442e33
|
3 |
+
size 3030
|
dummy/ARC-Easy/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:85600e425a311a70c8331bc6eba15b70e5e40bd03f9b76f935e42e27709f3db3
|
3 |
+
size 2960
|