Commit
•
e787f92
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
- dataset_infos.json +1 -0
- dummy/0.1.0/dummy_data.zip +3 -0
- social_i_qa.py +101 -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": "We introduce Social IQa: Social Interaction QA, a new question-answering benchmark for testing social commonsense intelligence. Contrary to many prior benchmarks that focus on physical or taxonomic knowledge, Social IQa focuses on reasoning about people\u2019s actions and their social implications. For example, given an action like \"Jesse saw a concert\" and a question like \"Why did Jesse do this?\", humans can easily infer that Jesse wanted \"to see their favorite performer\" or \"to enjoy the music\", and not \"to see what's happening inside\" or \"to see if it works\". The actions in Social IQa span a wide variety of social situations, and answer candidates contain both human-curated answers and adversarially-filtered machine-generated candidates. Social IQa contains over 37,000 QA pairs for evaluating models\u2019 abilities to reason about the social implications of everyday events and situations. (Less)\n", "citation": "\n", "homepage": "https://leaderboard.allenai.org/socialiqa/submissions/get-started", "license": "", "features": {"context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answerA": {"dtype": "string", "id": null, "_type": "Value"}, "answerB": {"dtype": "string", "id": null, "_type": "Value"}, "answerC": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "social_i_qa", "config_name": "default", "version": {"version_str": "0.1.0", "description": null, "datasets_version_to_prepare": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 6389954, "num_examples": 33410, "dataset_name": "social_i_qa"}, "validation": {"name": "validation", "num_bytes": 376508, "num_examples": 1954, "dataset_name": "social_i_qa"}}, "download_checksums": {"https://storage.googleapis.com/ai2-mosaic/public/socialiqa/socialiqa-train-dev.zip": {"num_bytes": 2198056, "checksum": "ee073914a0fc33265cfbcfc50ec20df9b2e07809c3f420f599138d1f394ef5c3"}}, "download_size": 2198056, "dataset_size": 6766462, "size_in_bytes": 8964518}}
|
dummy/0.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8149f5e84940d3e94a2cec89966774f1500ef2e8e6b8148cbb60468ff12d49fe
|
3 |
+
size 2274
|
social_i_qa.py
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""TODO(social_i_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(social_i_qa): BibTeX citation
|
12 |
+
_CITATION = """
|
13 |
+
"""
|
14 |
+
|
15 |
+
# TODO(social_i_qa):
|
16 |
+
_DESCRIPTION = """\
|
17 |
+
We introduce Social IQa: Social Interaction QA, a new question-answering benchmark for testing social commonsense intelligence. Contrary to many prior benchmarks that focus on physical or taxonomic knowledge, Social IQa focuses on reasoning about people’s actions and their social implications. For example, given an action like "Jesse saw a concert" and a question like "Why did Jesse do this?", humans can easily infer that Jesse wanted "to see their favorite performer" or "to enjoy the music", and not "to see what's happening inside" or "to see if it works". The actions in Social IQa span a wide variety of social situations, and answer candidates contain both human-curated answers and adversarially-filtered machine-generated candidates. Social IQa contains over 37,000 QA pairs for evaluating models’ abilities to reason about the social implications of everyday events and situations. (Less)
|
18 |
+
"""
|
19 |
+
_URL = "https://storage.googleapis.com/ai2-mosaic/public/socialiqa/socialiqa-train-dev.zip"
|
20 |
+
|
21 |
+
|
22 |
+
class SocialIQa(datasets.GeneratorBasedBuilder):
|
23 |
+
"""TODO(social_i_qa): Short description of my dataset."""
|
24 |
+
|
25 |
+
# TODO(social_i_qa): Set up version.
|
26 |
+
VERSION = datasets.Version("0.1.0")
|
27 |
+
|
28 |
+
def _info(self):
|
29 |
+
# TODO(social_i_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 |
+
"context": datasets.Value("string"),
|
38 |
+
"question": datasets.Value("string"),
|
39 |
+
"answerA": datasets.Value("string"),
|
40 |
+
"answerB": datasets.Value("string"),
|
41 |
+
"answerC": datasets.Value("string"),
|
42 |
+
"label": datasets.Value("string"),
|
43 |
+
}
|
44 |
+
),
|
45 |
+
# If there's a common (input, target) tuple from the features,
|
46 |
+
# specify them here. They'll be used if as_supervised=True in
|
47 |
+
# builder.as_dataset.
|
48 |
+
supervised_keys=None,
|
49 |
+
# Homepage of the dataset for documentation
|
50 |
+
homepage="https://leaderboard.allenai.org/socialiqa/submissions/get-started",
|
51 |
+
citation=_CITATION,
|
52 |
+
)
|
53 |
+
|
54 |
+
def _split_generators(self, dl_manager):
|
55 |
+
"""Returns SplitGenerators."""
|
56 |
+
# TODO(social_i_qa): Downloads the data and defines the splits
|
57 |
+
# dl_manager is a datasets.download.DownloadManager that can be used to
|
58 |
+
# download and extract URLs
|
59 |
+
dl_dir = dl_manager.download_and_extract(_URL)
|
60 |
+
dl_dir = os.path.join(dl_dir, "socialiqa-train-dev")
|
61 |
+
return [
|
62 |
+
datasets.SplitGenerator(
|
63 |
+
name=datasets.Split.TRAIN,
|
64 |
+
# These kwargs will be passed to _generate_examples
|
65 |
+
gen_kwargs={
|
66 |
+
"filepath": os.path.join(dl_dir, "train.jsonl"),
|
67 |
+
"labelpath": os.path.join(dl_dir, "train-labels.lst"),
|
68 |
+
},
|
69 |
+
),
|
70 |
+
datasets.SplitGenerator(
|
71 |
+
name=datasets.Split.VALIDATION,
|
72 |
+
# These kwargs will be passed to _generate_examples
|
73 |
+
gen_kwargs={
|
74 |
+
"filepath": os.path.join(dl_dir, "dev.jsonl"),
|
75 |
+
"labelpath": os.path.join(dl_dir, "dev-labels.lst"),
|
76 |
+
},
|
77 |
+
),
|
78 |
+
]
|
79 |
+
|
80 |
+
def _generate_examples(self, filepath, labelpath):
|
81 |
+
"""Yields examples."""
|
82 |
+
# TODO(social_i_qa): Yields (key, example) tuples from the dataset
|
83 |
+
with open(labelpath, encoding="utf-8") as f:
|
84 |
+
labels = [label for label in f]
|
85 |
+
with open(filepath, encoding="utf-8") as f1:
|
86 |
+
for id_, row in enumerate(f1):
|
87 |
+
data = json.loads(row)
|
88 |
+
label = labels[id_]
|
89 |
+
context = data["context"]
|
90 |
+
answerA = data["answerA"]
|
91 |
+
answerB = data["answerB"]
|
92 |
+
answerC = data["answerC"]
|
93 |
+
question = data["question"]
|
94 |
+
yield id_, {
|
95 |
+
"context": context,
|
96 |
+
"question": question,
|
97 |
+
"answerA": answerA,
|
98 |
+
"answerB": answerB,
|
99 |
+
"answerC": answerC,
|
100 |
+
"label": label,
|
101 |
+
}
|