Datasets:

Sub-tasks:
extractive-qa
Languages:
English
ArXiv:
License:
system HF staff commited on
Commit
64af0ae
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 +142 -0
  3. dataset_infos.json +1 -0
  4. dummy/sharc/1.0.0/dummy_data.zip +3 -0
  5. sharc.py +126 -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,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - crowdsourced
6
+ - expert-generated
7
+ languages:
8
+ - en
9
+ licenses:
10
+ - cc-by-sa-3-0
11
+ multilinguality:
12
+ - monolingual
13
+ size_categories:
14
+ - 10K<n<100K
15
+ source_datasets:
16
+ - original
17
+ task_categories:
18
+ - question-answering
19
+ task_ids:
20
+ - extractive-qa
21
+ - question-answering-other-conversational-qa
22
+ ---
23
+
24
+ # Dataset Card Creation Guide
25
+
26
+ ## Table of Contents
27
+ - [Dataset Description](#dataset-description)
28
+ - [Dataset Summary](#dataset-summary)
29
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
30
+ - [Languages](#languages)
31
+ - [Dataset Structure](#dataset-structure)
32
+ - [Data Instances](#data-instances)
33
+ - [Data Fields](#data-instances)
34
+ - [Data Splits](#data-instances)
35
+ - [Dataset Creation](#dataset-creation)
36
+ - [Curation Rationale](#curation-rationale)
37
+ - [Source Data](#source-data)
38
+ - [Annotations](#annotations)
39
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
40
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
41
+ - [Social Impact of Dataset](#social-impact-of-dataset)
42
+ - [Discussion of Biases](#discussion-of-biases)
43
+ - [Other Known Limitations](#other-known-limitations)
44
+ - [Additional Information](#additional-information)
45
+ - [Dataset Curators](#dataset-curators)
46
+ - [Licensing Information](#licensing-information)
47
+ - [Citation Information](#citation-information)
48
+
49
+ ## Dataset Description
50
+
51
+ - **Homepage:** [ShARC](https://sharc-data.github.io/index.html)
52
+ - **Repository:** [If the dataset is hosted on github or has a github homepage, add URL here]()
53
+ - **Paper:** [Interpretation of Natural Language Rules in Conversational Machine Reading](https://arxiv.org/abs/1809.01494)
54
+ - **Leaderboard:** [leaderboard](https://sharc-data.github.io/leaderboard.html)
55
+ - **Point of Contact:** [Marzieh Saeidi](marzieh.saeidi@gmail.com), [Max Bartolo](maxbartolo@gmail.com), [Patrick Lewis](patrick.s.h.lewis@gmail.com), [Sebastian Riedel](s.riedel@cs.ucl.ac.uk)
56
+
57
+ ### Dataset Summary
58
+
59
+ [More Information Needed]
60
+
61
+ ### Supported Tasks and Leaderboards
62
+
63
+ [More Information Needed]
64
+
65
+ ### Languages
66
+
67
+ [More Information Needed]
68
+
69
+ ## Dataset Structure
70
+
71
+ ### Data Instances
72
+
73
+ [More Information Needed]
74
+
75
+ ### Data Fields
76
+
77
+ [More Information Needed]
78
+
79
+ ### Data Splits
80
+
81
+ [More Information Needed]
82
+ ## Dataset Creation
83
+
84
+ ### Curation Rationale
85
+
86
+ [More Information Needed]
87
+
88
+ ### Source Data
89
+
90
+ [More Information Needed]
91
+
92
+ #### Initial Data Collection and Normalization
93
+
94
+ [More Information Needed]
95
+
96
+ #### Who are the source language producers?
97
+
98
+ [More Information Needed]
99
+
100
+ ### Annotations
101
+
102
+ [More Information Needed]
103
+
104
+ #### Annotation process
105
+
106
+ [More Information Needed]
107
+
108
+ #### Who are the annotators?
109
+
110
+ [More Information Needed]
111
+
112
+ ### Personal and Sensitive Information
113
+
114
+ [More Information Needed]
115
+
116
+ ## Considerations for Using the Data
117
+
118
+ ### Social Impact of Dataset
119
+
120
+ [More Information Needed]
121
+
122
+ ### Discussion of Biases
123
+
124
+ [More Information Needed]
125
+
126
+ ### Other Known Limitations
127
+
128
+ [More Information Needed]
129
+
130
+ ## Additional Information
131
+
132
+ ### Dataset Curators
133
+
134
+ [More Information Needed]
135
+
136
+ ### Licensing Information
137
+
138
+ [More Information Needed]
139
+
140
+ ### Citation Information
141
+
142
+ [More Information Needed]
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"sharc": {"description": "ShARC is a Conversational Question Answering dataset focussing on question answering from texts containing rules. The goal is to answer questions by possibly asking follow-up questions first. It is assumed assume that the question is often underspecified, in the sense that the question does not provide enough information to be answered directly. However, an agent can use the supporting rule text to infer what needs to be asked in order to determine the final answer.\n", "citation": "@misc{saeidi2018interpretation,\n title={Interpretation of Natural Language Rules in Conversational Machine Reading},\n author={Marzieh Saeidi and Max Bartolo and Patrick Lewis and Sameer Singh and Tim Rockt\u00e4schel and Mike Sheldon and Guillaume Bouchard and Sebastian Riedel},\n year={2018},\n eprint={1809.01494},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://sharc-data.github.io/index.html", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "utterance_id": {"dtype": "string", "id": null, "_type": "Value"}, "source_url": {"dtype": "string", "id": null, "_type": "Value"}, "snippet": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "scenario": {"dtype": "string", "id": null, "_type": "Value"}, "history": [{"follow_up_question": {"dtype": "string", "id": null, "_type": "Value"}, "follow_up_answer": {"dtype": "string", "id": null, "_type": "Value"}}], "evidence": [{"follow_up_question": {"dtype": "string", "id": null, "_type": "Value"}, "follow_up_answer": {"dtype": "string", "id": null, "_type": "Value"}}], "answer": {"dtype": "string", "id": null, "_type": "Value"}, "negative_question": {"dtype": "bool_", "id": null, "_type": "Value"}, "negative_scenario": {"dtype": "bool_", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "sharc", "config_name": "sharc", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 15088577, "num_examples": 21890, "dataset_name": "sharc"}, "validation": {"name": "validation", "num_bytes": 1469172, "num_examples": 2270, "dataset_name": "sharc"}}, "download_checksums": {"https://sharc-data.github.io/data/sharc1-official.zip": {"num_bytes": 5230207, "checksum": "0c185809b807c00df05eeca2c504dc5d6d0ecbf98cf60ea51f7d1e690493b69a"}}, "download_size": 5230207, "post_processing_size": null, "dataset_size": 16557749, "size_in_bytes": 21787956}}
dummy/sharc/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d50f53579b4052305b2bd807c6228d5bfec90b9494213f9a6d340f09e3a6c32
3
+ size 5683
sharc.py ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
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
+ """ShARC: A Conversational Question Answering dataset focussing on question answering from texts containing rules."""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import json
20
+ import os
21
+
22
+ import datasets
23
+
24
+
25
+ _CITATION = """\
26
+ @misc{saeidi2018interpretation,
27
+ title={Interpretation of Natural Language Rules in Conversational Machine Reading},
28
+ author={Marzieh Saeidi and Max Bartolo and Patrick Lewis and Sameer Singh and Tim Rocktäschel and Mike Sheldon and Guillaume Bouchard and Sebastian Riedel},
29
+ year={2018},
30
+ eprint={1809.01494},
31
+ archivePrefix={arXiv},
32
+ primaryClass={cs.CL}
33
+ }
34
+ """
35
+
36
+ _DESCRIPTION = """\
37
+ ShARC is a Conversational Question Answering dataset focussing on question answering from texts containing rules. \
38
+ The goal is to answer questions by possibly asking follow-up questions first. It is assumed assume that the question is often underspecified, \
39
+ in the sense that the question does not provide enough information to be answered directly. However, an agent can use the supporting rule text to \
40
+ infer what needs to be asked in order to determine the final answer.
41
+ """
42
+
43
+ _URL = "https://sharc-data.github.io/data/sharc1-official.zip"
44
+
45
+
46
+ class Sharc(datasets.GeneratorBasedBuilder):
47
+ """ShARC: A Conversational Question Answering dataset focussing on question answering from texts containing rules."""
48
+
49
+ VERSION = datasets.Version("1.0.0")
50
+ BUILDER_CONFIGS = [
51
+ datasets.BuilderConfig(name="sharc", version=datasets.Version("1.0.0")),
52
+ ]
53
+
54
+ def _info(self):
55
+ return datasets.DatasetInfo(
56
+ description=_DESCRIPTION,
57
+ features=datasets.Features(
58
+ {
59
+ "id": datasets.Value("string"),
60
+ "utterance_id": datasets.Value("string"),
61
+ "source_url": datasets.Value("string"),
62
+ "snippet": datasets.Value("string"),
63
+ "question": datasets.Value("string"),
64
+ "scenario": datasets.Value("string"),
65
+ "history": [
66
+ {"follow_up_question": datasets.Value("string"), "follow_up_answer": datasets.Value("string")}
67
+ ],
68
+ "evidence": [
69
+ {"follow_up_question": datasets.Value("string"), "follow_up_answer": datasets.Value("string")}
70
+ ],
71
+ "answer": datasets.Value("string"),
72
+ "negative_question": datasets.Value("bool_"),
73
+ "negative_scenario": datasets.Value("bool_"),
74
+ }
75
+ ),
76
+ supervised_keys=None,
77
+ homepage="https://sharc-data.github.io/index.html",
78
+ citation=_CITATION,
79
+ )
80
+
81
+ def _split_generators(self, dl_manager):
82
+ extracted_path = dl_manager.download_and_extract(_URL)
83
+ return [
84
+ datasets.SplitGenerator(
85
+ name=datasets.Split.TRAIN,
86
+ gen_kwargs={"data_dir": os.path.join(extracted_path, "sharc1-official"), "split": "train"},
87
+ ),
88
+ datasets.SplitGenerator(
89
+ name=datasets.Split.VALIDATION,
90
+ gen_kwargs={"data_dir": os.path.join(extracted_path, "sharc1-official"), "split": "dev"},
91
+ ),
92
+ ]
93
+
94
+ def _generate_examples(self, data_dir, split):
95
+ with open(
96
+ os.path.join(data_dir, "negative_sample_utterance_ids", "sharc_negative_scenario_utterance_ids.txt"),
97
+ encoding="utf-8",
98
+ ) as f:
99
+ negative_scenario_ids = f.readlines()
100
+ negative_scenario_ids = [id_.strip() for id_ in negative_scenario_ids]
101
+ with open(
102
+ os.path.join(data_dir, "negative_sample_utterance_ids", "sharc_negative_question_utterance_ids.txt"),
103
+ encoding="utf-8",
104
+ ) as f:
105
+ negative_question_ids = f.readlines()
106
+ negative_question_ids = [id_.strip() for id_ in negative_question_ids]
107
+
108
+ data_file = os.path.join(data_dir, "json", f"sharc_{split}.json")
109
+ with open(data_file, encoding="utf-8") as f:
110
+ examples = json.load(f)
111
+ for i, example in enumerate(examples):
112
+ example.pop("tree_id")
113
+
114
+ example["negative_question"] = example["utterance_id"] in negative_question_ids
115
+ example["negative_scenario"] = example["utterance_id"] in negative_scenario_ids
116
+
117
+ example["id"] = example["utterance_id"]
118
+
119
+ # the keys are misspelled for one of the example in dev set
120
+ # fix it here
121
+ for evidence in example["evidence"]:
122
+ if evidence.get("followup_answer") is not None:
123
+ evidence["follow_up_answer"] = evidence.pop("followup_answer")
124
+ if evidence.get("followup_question") is not None:
125
+ evidence["follow_up_question"] = evidence.pop("followup_question")
126
+ yield example["id"], example