system HF staff commited on
Commit
66143d3
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

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

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +141 -0
  3. dataset_infos.json +1 -0
  4. dummy/qed/1.0.0/dummy_data.zip +3 -0
  5. qed.py +140 -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
README.md ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 1K<n<10K
14
+ source_datasets:
15
+ - extended|natural_questions
16
+ task_categories:
17
+ - question-answering
18
+ task_ids:
19
+ - extractive-qa
20
+ - question-answering-other-explanations-in-question-answering
21
+ ---
22
+
23
+ # Dataset Card Creation Guide
24
+
25
+ ## Table of Contents
26
+ - [Dataset Description](#dataset-description)
27
+ - [Dataset Summary](#dataset-summary)
28
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
29
+ - [Languages](#languages)
30
+ - [Dataset Structure](#dataset-structure)
31
+ - [Data Instances](#data-instances)
32
+ - [Data Fields](#data-instances)
33
+ - [Data Splits](#data-instances)
34
+ - [Dataset Creation](#dataset-creation)
35
+ - [Curation Rationale](#curation-rationale)
36
+ - [Source Data](#source-data)
37
+ - [Annotations](#annotations)
38
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
39
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
40
+ - [Social Impact of Dataset](#social-impact-of-dataset)
41
+ - [Discussion of Biases](#discussion-of-biases)
42
+ - [Other Known Limitations](#other-known-limitations)
43
+ - [Additional Information](#additional-information)
44
+ - [Dataset Curators](#dataset-curators)
45
+ - [Licensing Information](#licensing-information)
46
+ - [Citation Information](#citation-information)
47
+
48
+ ## Dataset Description
49
+
50
+ - **Homepage:** N/A
51
+ - **Repository:** [GitHub](https://github.com/google-research-datasets/QED)
52
+ - **Paper:** [QED: A Framework and Dataset for Explanations in Question Answering](https://arxiv.org/abs/2009.06354)
53
+ - **Leaderboard:** N/A
54
+ - **Point of Contact:** -
55
+
56
+ ### Dataset Summary
57
+
58
+ [More Information Needed]
59
+
60
+ ### Supported Tasks and Leaderboards
61
+
62
+ [More Information Needed]
63
+
64
+ ### Languages
65
+
66
+ [More Information Needed]
67
+
68
+ ## Dataset Structure
69
+
70
+ ### Data Instances
71
+
72
+ [More Information Needed]
73
+
74
+ ### Data Fields
75
+
76
+ [More Information Needed]
77
+
78
+ ### Data Splits
79
+
80
+ [More Information Needed]
81
+ ## Dataset Creation
82
+
83
+ ### Curation Rationale
84
+
85
+ [More Information Needed]
86
+
87
+ ### Source Data
88
+
89
+ [More Information Needed]
90
+
91
+ #### Initial Data Collection and Normalization
92
+
93
+ [More Information Needed]
94
+
95
+ #### Who are the source language producers?
96
+
97
+ [More Information Needed]
98
+
99
+ ### Annotations
100
+
101
+ [More Information Needed]
102
+
103
+ #### Annotation process
104
+
105
+ [More Information Needed]
106
+
107
+ #### Who are the annotators?
108
+
109
+ [More Information Needed]
110
+
111
+ ### Personal and Sensitive Information
112
+
113
+ [More Information Needed]
114
+
115
+ ## Considerations for Using the Data
116
+
117
+ ### Social Impact of Dataset
118
+
119
+ [More Information Needed]
120
+
121
+ ### Discussion of Biases
122
+
123
+ [More Information Needed]
124
+
125
+ ### Other Known Limitations
126
+
127
+ [More Information Needed]
128
+
129
+ ## Additional Information
130
+
131
+ ### Dataset Curators
132
+
133
+ [More Information Needed]
134
+
135
+ ### Licensing Information
136
+
137
+ [More Information Needed]
138
+
139
+ ### Citation Information
140
+
141
+ [More Information Needed]
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"qed": {"description": "QED, is a linguistically informed, extensible framework for explanations in question answering. A QED explanation specifies the relationship between a question and answer according to formal semantic notions such as referential equality, sentencehood, and entailment. It is an expertannotated dataset of QED explanations built upon a subset of the Google Natural Questions dataset.\n", "citation": "@misc{lamm2020qed,\n title={QED: A Framework and Dataset for Explanations in Question Answering},\n author={Matthew Lamm and Jennimaria Palomaki and Chris Alberti and Daniel Andor and Eunsol Choi and Livio Baldini Soares and Michael Collins},\n year={2020},\n eprint={2009.06354},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://github.com/google-research-datasets/QED", "license": "", "features": {"example_id": {"dtype": "int64", "id": null, "_type": "Value"}, "title_text": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "paragraph_text": {"dtype": "string", "id": null, "_type": "Value"}, "sentence_starts": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "original_nq_answers": [[{"start": {"dtype": "int32", "id": null, "_type": "Value"}, "end": {"dtype": "int32", "id": null, "_type": "Value"}, "string": {"dtype": "string", "id": null, "_type": "Value"}}]], "annotation": {"referential_equalities": [{"question_reference": {"start": {"dtype": "int32", "id": null, "_type": "Value"}, "end": {"dtype": "int32", "id": null, "_type": "Value"}, "string": {"dtype": "string", "id": null, "_type": "Value"}}, "sentence_reference": {"start": {"dtype": "int32", "id": null, "_type": "Value"}, "end": {"dtype": "int32", "id": null, "_type": "Value"}, "bridge": {"dtype": "bool_", "id": null, "_type": "Value"}, "string": {"dtype": "string", "id": null, "_type": "Value"}}}], "answer": [{"sentence_reference": {"start": {"dtype": "int32", "id": null, "_type": "Value"}, "end": {"dtype": "int32", "id": null, "_type": "Value"}, "bridge": {"dtype": "bool_", "id": null, "_type": "Value"}, "string": {"dtype": "string", "id": null, "_type": "Value"}}, "paragraph_reference": {"start": {"dtype": "int32", "id": null, "_type": "Value"}, "end": {"dtype": "int32", "id": null, "_type": "Value"}, "string": {"dtype": "string", "id": null, "_type": "Value"}}}], "explanation_type": {"dtype": "string", "id": null, "_type": "Value"}, "selected_sentence": {"start": {"dtype": "int32", "id": null, "_type": "Value"}, "end": {"dtype": "int32", "id": null, "_type": "Value"}, "string": {"dtype": "string", "id": null, "_type": "Value"}}}}, "post_processed": null, "supervised_keys": null, "builder_name": "qed", "config_name": "qed", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 8560864, "num_examples": 7638, "dataset_name": "qed"}, "validation": {"name": "validation", "num_bytes": 1615171, "num_examples": 1355, "dataset_name": "qed"}}, "download_checksums": {"https://raw.githubusercontent.com/google-research-datasets/QED/master/qed-train.jsonlines": {"num_bytes": 11839736, "checksum": "b5cf65414defef8d42f6778dbd3cf0fa710adcdcb86fc693ab8edec8f0be7faf"}, "https://raw.githubusercontent.com/google-research-datasets/QED/master/qed-dev.jsonlines": {"num_bytes": 2244232, "checksum": "2ea322b71a333023380c3954083b81af2d5670c8ac47ddec58c843233895c429"}}, "download_size": 14083968, "post_processing_size": null, "dataset_size": 10176035, "size_in_bytes": 24260003}}
dummy/qed/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71bc5583a7f20c2180e00fd10beedcf31e986453078b3393c1329465cd1195ec
3
+ size 2981
qed.py ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The HuggingFace Datasets Authors.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ """QED: A Dataset for Explanations in Question Answering"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import json
20
+
21
+ import datasets
22
+
23
+
24
+ _CITATION = """\
25
+ @misc{lamm2020qed,
26
+ title={QED: A Framework and Dataset for Explanations in Question Answering},
27
+ author={Matthew Lamm and Jennimaria Palomaki and Chris Alberti and Daniel Andor and Eunsol Choi and Livio Baldini Soares and Michael Collins},
28
+ year={2020},
29
+ eprint={2009.06354},
30
+ archivePrefix={arXiv},
31
+ primaryClass={cs.CL}
32
+ }
33
+ """
34
+
35
+ _DESCRIPTION = """\
36
+ QED, is a linguistically informed, extensible framework for explanations in question answering. \
37
+ A QED explanation specifies the relationship between a question and answer according to formal semantic notions \
38
+ such as referential equality, sentencehood, and entailment. It is an expertannotated dataset of QED explanations \
39
+ built upon a subset of the Google Natural Questions dataset.
40
+ """
41
+
42
+ _HOMEPAGE = "https://github.com/google-research-datasets/QED"
43
+
44
+ _BASE_URL = "https://raw.githubusercontent.com/google-research-datasets/QED/master/"
45
+ _URLS = {
46
+ "train": _BASE_URL + "qed-train.jsonlines",
47
+ "dev": _BASE_URL + "qed-dev.jsonlines",
48
+ }
49
+
50
+
51
+ class Qed(datasets.GeneratorBasedBuilder):
52
+ """QED: A Dataset for Explanations in Question Answering"""
53
+
54
+ VERSION = datasets.Version("1.0.0")
55
+ BUILDER_CONFIGS = [
56
+ datasets.BuilderConfig(name="qed", version=datasets.Version("1.0.0")),
57
+ ]
58
+
59
+ def _info(self):
60
+ span_features = {
61
+ "start": datasets.Value("int32"),
62
+ "end": datasets.Value("int32"),
63
+ "string": datasets.Value("string"),
64
+ }
65
+ reference_features = {
66
+ "start": datasets.Value("int32"),
67
+ "end": datasets.Value("int32"),
68
+ "bridge": datasets.Value("bool_"),
69
+ "string": datasets.Value("string"),
70
+ }
71
+ return datasets.DatasetInfo(
72
+ description=_DESCRIPTION,
73
+ features=datasets.Features(
74
+ {
75
+ "example_id": datasets.Value("int64"),
76
+ "title_text": datasets.Value("string"),
77
+ "url": datasets.Value("string"),
78
+ "question": datasets.Value("string"),
79
+ "paragraph_text": datasets.Value("string"),
80
+ "sentence_starts": datasets.Sequence(datasets.Value("int32")),
81
+ "original_nq_answers": [span_features],
82
+ "annotation": {
83
+ "referential_equalities": [
84
+ {
85
+ "question_reference": span_features,
86
+ "sentence_reference": reference_features,
87
+ }
88
+ ],
89
+ "answer": [
90
+ {
91
+ "sentence_reference": reference_features,
92
+ "paragraph_reference": span_features,
93
+ }
94
+ ],
95
+ "explanation_type": datasets.Value("string"),
96
+ "selected_sentence": span_features,
97
+ },
98
+ }
99
+ ),
100
+ supervised_keys=None,
101
+ homepage=_HOMEPAGE,
102
+ citation=_CITATION,
103
+ )
104
+
105
+ def _split_generators(self, dl_manager):
106
+ downloaded_paths = dl_manager.download(_URLS)
107
+ return [
108
+ datasets.SplitGenerator(
109
+ name=datasets.Split.TRAIN,
110
+ gen_kwargs={"filepath": downloaded_paths["train"]},
111
+ ),
112
+ datasets.SplitGenerator(
113
+ name=datasets.Split.VALIDATION,
114
+ gen_kwargs={"filepath": downloaded_paths["dev"]},
115
+ ),
116
+ ]
117
+
118
+ def _generate_examples(self, filepath):
119
+ with open(filepath, encoding="utf-8") as f:
120
+ examples = f.readlines()
121
+ for example in examples:
122
+ example = json.loads(example.strip())
123
+ example["question"] = example.pop("question_text")
124
+
125
+ # some examples have missing annotation, assign empty values to such examples
126
+ if "answer" not in example["annotation"]:
127
+ example["annotation"]["answer"] = []
128
+ if "selected_sentence" not in example["annotation"]:
129
+ example["annotation"]["selected_sentence"] = {
130
+ "start": -1,
131
+ "end": -1,
132
+ "string": "",
133
+ }
134
+ if "referential_equalities" not in example["annotation"]:
135
+ example["annotation"]["referential_equalities"] = []
136
+
137
+ # remove the nested list
138
+ example["original_nq_answers"] = example["original_nq_answers"][0]
139
+
140
+ yield example["example_id"], example