system HF staff commited on
Commit
4f0c1e0
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 +170 -0
  3. dataset_infos.json +1 -0
  4. dummy/0.0.0/dummy_data.zip +3 -0
  5. mocha.py +128 -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,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - cc-by-sa-4-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 10K<n<100K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - question-answering
18
+ task_ids:
19
+ - question-answering-other-generative-reading-comprehension-metric
20
+ ---
21
+
22
+ # Dataset Card for Mocha
23
+
24
+ ## Table of Contents
25
+
26
+ - [Dataset Card for Mocha](#dataset-card-for-mocha)
27
+ - [Table of Contents](#table-of-contents)
28
+ - [Dataset Description](#dataset-description)
29
+ - [Dataset Summary](#dataset-summary)
30
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
31
+ - [Languages](#languages)
32
+ - [Dataset Structure](#dataset-structure)
33
+ - [Data Instances](#data-instances)
34
+ - [Data Fields](#data-fields)
35
+ - [Data Splits](#data-splits)
36
+ - [Dataset Creation](#dataset-creation)
37
+ - [Curation Rationale](#curation-rationale)
38
+ - [Source Data](#source-data)
39
+ - [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
40
+ - [Who are the source language producers?](#who-are-the-source-language-producers)
41
+ - [Annotations](#annotations)
42
+ - [Annotation process](#annotation-process)
43
+ - [Who are the annotators?](#who-are-the-annotators)
44
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
45
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
46
+ - [Social Impact of Dataset](#social-impact-of-dataset)
47
+ - [Discussion of Biases](#discussion-of-biases)
48
+ - [Other Known Limitations](#other-known-limitations)
49
+ - [Additional Information](#additional-information)
50
+ - [Dataset Curators](#dataset-curators)
51
+ - [Licensing Information](#licensing-information)
52
+ - [Citation Information](#citation-information)
53
+
54
+ ## Dataset Description
55
+
56
+ - **Homepage:[Mocha](https://allennlp.org/mocha)**
57
+ - **Repository:[https://github.com/anthonywchen/MOCHA](https://github.com/anthonywchen/MOCHA)**
58
+ - **Paper:[MOCHA: A Dataset for Training and Evaluating Generative Reading Comprehension Metrics](https://www.aclweb.org/anthology/2020.emnlp-main.528/)**
59
+ - **Leaderboard:**
60
+ - **Point of Contact:**
61
+
62
+ ### Dataset Summary
63
+
64
+ Posing reading comprehension as a generation problem provides a great deal of flexibility, allowing for open-ended questions with few restrictions on possible answers. However, progress is impeded by existing generation metrics, which rely on token overlap and are agnostic to the nuances of reading comprehension. To address this, we introduce a benchmark for training and evaluating generative reading comprehension metrics: MOdeling Correctness with Human Annotations. MOCHA contains 40K human judgement scores on model outputs from 6 diverse question answering datasets and an additional set of minimal pairs for evaluation. Using MOCHA, we train a Learned Evaluation metric for Reading Comprehension, LERC, to mimic human judgement scores. LERC outperforms baseline metrics by 10 to 36 absolute Pearson points on held-out annotations. When we evaluate robustness on minimal pairs, LERC achieves 80% accuracy, outperforming baselines by 14 to 26 absolute percentage points while leaving significant room for improvement. MOCHA presents a challenging problem for developing accurate and robust generative reading comprehension metrics.
65
+
66
+ ### Supported Tasks and Leaderboards
67
+
68
+ [More Information Needed]
69
+
70
+ ### Languages
71
+
72
+ English
73
+
74
+ ## Dataset Structure
75
+
76
+ ### Data Instances
77
+
78
+ MOCHA contains 40K human judgement scores on model outputs from 6 diverse question answering datasets and an additional set of minimal pairs for evaluation. MOCHA pairs reading comprehension instances, which consists of a passage, question, and reference, with candidates and human judgement scores.
79
+
80
+ ### Data Fields
81
+
82
+ - `constituent_dataset`: the original QA dataset which the data instance came from.
83
+ - `id`
84
+ - `context`: the passage content.
85
+ - `question`: the question related to the passage content.
86
+ - `reference`: the correct answer for the question.
87
+ - `candidate`: the answer generated from the `reference` by `source`
88
+ - `score`: the human judgement score for the `candidate`. Not included in test split, defaults to `-1`
89
+ - `metadata`: Not included in minimal pairs split.
90
+ - `scores`: list of scores from difference judges, averaged out to get final `score`. defaults to `[]`
91
+ - `source`: the generative model to generate the `candidate`
92
+
93
+ In minimal pairs, we'll have an additional candidate for robust evaluation.
94
+
95
+ - `candidate2`
96
+ - `score2`
97
+
98
+ ### Data Splits
99
+
100
+ Dataset Split | Number of Instances in Split
101
+ --------------|--------------------------------------------
102
+ Train | 31,069
103
+ Validation | 4,009
104
+ Test | 6,321
105
+ Minimal Pairs | 200
106
+
107
+ ## Dataset Creation
108
+
109
+ ### Curation Rationale
110
+
111
+ [More Information Needed]
112
+
113
+ ### Source Data
114
+
115
+ #### Initial Data Collection and Normalization
116
+
117
+ [More Information Needed]
118
+
119
+ #### Who are the source language producers?
120
+
121
+ [More Information Needed]
122
+
123
+ ### Annotations
124
+
125
+ #### Annotation process
126
+
127
+ [More Information Needed]
128
+
129
+ #### Who are the annotators?
130
+
131
+ [More Information Needed]
132
+
133
+ ### Personal and Sensitive Information
134
+
135
+ [More Information Needed]
136
+
137
+ ## Considerations for Using the Data
138
+
139
+ ### Social Impact of Dataset
140
+
141
+ [More Information Needed]
142
+
143
+ ### Discussion of Biases
144
+
145
+ [More Information Needed]
146
+
147
+ ### Other Known Limitations
148
+
149
+ [More Information Needed]
150
+
151
+ ## Additional Information
152
+
153
+ ### Dataset Curators
154
+
155
+ [More Information Needed]
156
+
157
+ ### Licensing Information
158
+
159
+ [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/legalcode)
160
+
161
+ ### Citation Information
162
+
163
+ ```bitex
164
+ @inproceedings{Chen2020MOCHAAD,
165
+ author={Anthony Chen and Gabriel Stanovsky and Sameer Singh and Matt Gardner},
166
+ title={MOCHA: A Dataset for Training and Evaluating Generative Reading Comprehension Metrics},
167
+ booktitle={EMNLP},
168
+ year={2020}
169
+ }
170
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"default": {"description": "Posing reading comprehension as a generation problem provides a great deal of flexibility, allowing for open-ended questions with few restrictions on possible answers. However, progress is impeded by existing generation metrics, which rely on token overlap and are agnostic to the nuances of reading comprehension. To address this, we introduce a benchmark for training and evaluating generative reading comprehension metrics: MOdeling Correctness with Human Annotations. MOCHA contains 40K human judgement scores on model outputs from 6 diverse question answering datasets and an additional set of minimal pairs for evaluation. Using MOCHA, we train an evaluation metric: LERC, a Learned Evaluation metric for Reading Comprehension, to mimic human judgement scores.\n", "citation": "@inproceedings{Chen2020MOCHAAD,\n author={Anthony Chen and Gabriel Stanovsky and Sameer Singh and Matt Gardner},\n title={MOCHA: A Dataset for Training and Evaluating Generative Reading Comprehension Metrics},\n booktitle={EMNLP},\n year={2020}\n}\n", "homepage": "https://allennlp.org/mocha", "license": "https://creativecommons.org/licenses/by-sa/4.0/legalcode", "features": {"constituent_dataset": {"dtype": "string", "id": null, "_type": "Value"}, "id": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "reference": {"dtype": "string", "id": null, "_type": "Value"}, "candidate": {"dtype": "string", "id": null, "_type": "Value"}, "score": {"dtype": "float32", "id": null, "_type": "Value"}, "metadata": {"scores": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "source": {"dtype": "string", "id": null, "_type": "Value"}}, "candidate2": {"dtype": "string", "id": null, "_type": "Value"}, "score2": {"dtype": "float32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "mocha", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 33292592, "num_examples": 31069, "dataset_name": "mocha"}, "validation": {"name": "validation", "num_bytes": 4236883, "num_examples": 4009, "dataset_name": "mocha"}, "test": {"name": "test", "num_bytes": 6767409, "num_examples": 6321, "dataset_name": "mocha"}, "minimal_pairs": {"name": "minimal_pairs", "num_bytes": 193560, "num_examples": 200, "dataset_name": "mocha"}}, "download_checksums": {"https://github.com/anthonywchen/MOCHA/raw/main/data/mocha.tar.gz": {"num_bytes": 14452311, "checksum": "036a14c1ad2eb554b77d32051940cb2808f20557f5edcc24b658df703d3c4302"}}, "download_size": 14452311, "post_processing_size": null, "dataset_size": 44490444, "size_in_bytes": 58942755}}
dummy/0.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ecc25b7e076917531e64ccc8a9afd5a97e8b934a0f904d99da885ec424d2615
3
+ size 2523
mocha.py ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The TensorFlow Datasets Authors and 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
+
16
+ # Lint as: python3
17
+ """MOCHA: A Dataset for Training and Evaluating Generative Reading Comprehension Metrics"""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import json
22
+ import logging
23
+ import os
24
+
25
+ import datasets
26
+
27
+
28
+ _CITATION = """\
29
+ @inproceedings{Chen2020MOCHAAD,
30
+ author={Anthony Chen and Gabriel Stanovsky and Sameer Singh and Matt Gardner},
31
+ title={MOCHA: A Dataset for Training and Evaluating Generative Reading Comprehension Metrics},
32
+ booktitle={EMNLP},
33
+ year={2020}
34
+ }
35
+ """
36
+
37
+ _DESCRIPTION = """\
38
+ Posing reading comprehension as a generation problem provides a great deal of flexibility, allowing for \
39
+ open-ended questions with few restrictions on possible answers. However, progress is impeded by existing \
40
+ generation metrics, which rely on token overlap and are agnostic to the nuances of reading comprehension. \
41
+ To address this, we introduce a benchmark for training and evaluating generative reading comprehension metrics: \
42
+ MOdeling Correctness with Human Annotations. MOCHA contains 40K human judgement scores on model outputs from \
43
+ 6 diverse question answering datasets and an additional set of minimal pairs for evaluation. Using MOCHA, \
44
+ we train an evaluation metric: LERC, a Learned Evaluation metric for Reading Comprehension, to mimic human \
45
+ judgement scores.
46
+ """
47
+
48
+ _HOMEPAGE = "https://allennlp.org/mocha"
49
+
50
+ _LICENSE = "https://creativecommons.org/licenses/by-sa/4.0/legalcode"
51
+
52
+ _URL = "https://github.com/anthonywchen/MOCHA/raw/main/data/mocha.tar.gz"
53
+
54
+ _MINIMAL_PAIRS_SPLIT = "minimal_pairs"
55
+
56
+ SPLIT_FILENAMES = {
57
+ datasets.Split.TRAIN: "train.json",
58
+ datasets.Split.VALIDATION: "dev.json",
59
+ datasets.Split.TEST: "test_no_labels.json",
60
+ _MINIMAL_PAIRS_SPLIT: "minimal_pairs.json",
61
+ }
62
+
63
+
64
+ class Mocha(datasets.GeneratorBasedBuilder):
65
+ """MOCHA: A Dataset for Training and Evaluating Generative Reading Comprehension Metrics"""
66
+
67
+ def _info(self):
68
+ return datasets.DatasetInfo(
69
+ description=_DESCRIPTION,
70
+ features=datasets.Features(
71
+ {
72
+ "constituent_dataset": datasets.Value("string"),
73
+ "id": datasets.Value("string"),
74
+ "context": datasets.Value("string"),
75
+ "question": datasets.Value("string"),
76
+ "reference": datasets.Value("string"),
77
+ "candidate": datasets.Value("string"),
78
+ "score": datasets.Value("float"),
79
+ "metadata": {
80
+ "scores": datasets.features.Sequence(datasets.Value("int32")),
81
+ "source": datasets.Value("string"),
82
+ },
83
+ # features for minimal pairs
84
+ "candidate2": datasets.Value("string"),
85
+ "score2": datasets.Value("float"),
86
+ }
87
+ ),
88
+ supervised_keys=None,
89
+ homepage=_HOMEPAGE,
90
+ license=_LICENSE,
91
+ citation=_CITATION,
92
+ )
93
+
94
+ def _split_generators(self, dl_manager):
95
+ dl_path = os.path.join(dl_manager.download_and_extract(_URL), "mocha")
96
+
97
+ return [
98
+ datasets.SplitGenerator(
99
+ name=split,
100
+ gen_kwargs={"filepath": os.path.join(dl_path, SPLIT_FILENAMES[split]), "split": split},
101
+ )
102
+ for split in SPLIT_FILENAMES
103
+ ]
104
+
105
+ def _generate_examples(self, filepath, split):
106
+ """This function returns the examples in the raw (text) form."""
107
+ logging.info("Generating examples from = %s", filepath)
108
+ with open(filepath, encoding="utf-8") as f:
109
+ mocha = json.load(f)
110
+ for constituent_dataset, samples in mocha.items():
111
+ for id_, sample in samples.items():
112
+ sample["id"] = id_
113
+ sample["constituent_dataset"] = constituent_dataset
114
+
115
+ # Add default values
116
+ if split == _MINIMAL_PAIRS_SPLIT:
117
+ sample["candidate"] = sample["candidate1"]
118
+ sample["score"] = sample["score1"]
119
+ del sample["candidate1"], sample["score1"]
120
+ sample["metadata"] = {"scores": [], "source": ""}
121
+ else:
122
+ if "score" not in sample:
123
+ sample["score"] = -1.0
124
+ sample["metadata"]["scores"] = []
125
+ sample["candidate2"] = ""
126
+ sample["score2"] = -1.0
127
+
128
+ yield id_, sample