system HF staff commited on
Commit
ebf8041
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/1.1.0/dummy_data.zip +3 -0
  5. refresd.py +94 -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
+ - machine-generated
5
+ language_creators:
6
+ - crowdsourced
7
+ - machine-generated
8
+ languages:
9
+ - en
10
+ - fr
11
+ licenses:
12
+ - mit
13
+ multilinguality:
14
+ - translation
15
+ size_categories:
16
+ - 1K<n<10K
17
+ source_datasets: []
18
+ task_categories:
19
+ - text-classification
20
+ - text-scoring
21
+ task_ids:
22
+ - semantic-similarity-classification
23
+ - semantic-similarity-scoring
24
+ ---
25
+
26
+ # Dataset Card for [Dataset Name]
27
+
28
+ ## Table of Contents
29
+ - [Dataset Description](#dataset-description)
30
+ - [Dataset Summary](#dataset-summary)
31
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
32
+ - [Languages](#languages)
33
+ - [Dataset Structure](#dataset-structure)
34
+ - [Data Instances](#data-instances)
35
+ - [Data Fields](#data-instances)
36
+ - [Data Splits](#data-instances)
37
+ - [Dataset Creation](#dataset-creation)
38
+ - [Curation Rationale](#curation-rationale)
39
+ - [Source Data](#source-data)
40
+ - [Annotations](#annotations)
41
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
42
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
43
+ - [Social Impact of Dataset](#social-impact-of-dataset)
44
+ - [Discussion of Biases](#discussion-of-biases)
45
+ - [Other Known Limitations](#other-known-limitations)
46
+ - [Additional Information](#additional-information)
47
+ - [Dataset Curators](#dataset-curators)
48
+ - [Licensing Information](#licensing-information)
49
+ - [Citation Information](#citation-information)
50
+
51
+ ## Dataset Description
52
+
53
+ - **Homepage:** [Github](https://github.com/Elbria/xling-SemDiv/tree/master/REFreSD)
54
+ - **Repository:** [Github](https://github.com/Elbria/xling-SemDiv/)
55
+ - **Paper:** [Aclweb](https://www.aclweb.org/anthology/2020.emnlp-main.121)
56
+ - **Leaderboard:**
57
+ - **Point of Contact:**
58
+
59
+ ### Dataset Summary
60
+
61
+ The Rationalized English-French Semantic Divergences (REFreSD) dataset consists of 1,039
62
+ English-French sentence-pairs annotated with sentence-level divergence judgments and token-level
63
+ rationales. For any questions, write to ebriakou@cs.umd.edu.
64
+
65
+ ### Supported Tasks and Leaderboards
66
+
67
+ Similarity classification and scoring (3 classes).
68
+
69
+ ### Languages
70
+
71
+ English and French
72
+
73
+ ## Dataset Structure
74
+ ### Data Instances
75
+ Each data point looks like this:
76
+
77
+ ```python
78
+ {
79
+ 'sentence_pair': {'en': 'The invention of farming some 10,000 years ago led to the development of agrarian societies , whether nomadic or peasant , the latter in particular almost always dominated by a strong sense of traditionalism .',
80
+ 'fr': "En quelques décennies , l' activité économique de la vallée est passée d' une mono-activité agricole essentiellement vivrière , à une quasi mono-activité touristique , si l' on excepte un artisanat du bâtiment traditionnel important , en partie saisonnier ."}
81
+ 'label': 0,
82
+ 'all_labels': 0,
83
+ 'rationale_en': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
84
+ 'rationale_fr': [2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3],
85
+ }
86
+ ```
87
+
88
+ ### Data Fields
89
+
90
+ - `sentence_pair`: Dictionary of sentences containing the following field.
91
+ - `en`: The English sentence.
92
+ - `fr`: The corresponding (or not) French sentence.
93
+
94
+ - `label`: Binary. Whether both sentences correspond. `{0:divergent, 1:equivalent}`
95
+ - `all_labels`: 3-class label `{0: "unrelated", 1: "some_meaning_difference", 2:"no_meaning_difference"}`. The first two are sub-classes of the `divergent` label.
96
+ - `rationale_en`: Word-aligned rationale for the classification, from English.
97
+ - `rationale_fr`: Word-aligned rationale for the classification, from French.
98
+
99
+ ### Data Splits
100
+ 1039 sentence pairs in a single `"train"` split.
101
+
102
+ ## Dataset Creation
103
+
104
+ ### Curation Rationale
105
+
106
+ See [paper](https://arxiv.org/abs/2010.03662v1).
107
+
108
+ ### Source Data
109
+
110
+ #### Initial Data Collection and Normalization
111
+
112
+ [More Information Needed]
113
+
114
+ #### Who are the source language producers?
115
+
116
+ [More Information Needed]
117
+
118
+ ### Annotations
119
+
120
+ #### Annotation process
121
+
122
+ See [paper](https://arxiv.org/abs/2010.03662v1).
123
+
124
+ #### Who are the annotators?
125
+
126
+ See [paper](https://arxiv.org/abs/2010.03662v1).
127
+
128
+ ### Personal and Sensitive Information
129
+
130
+ [More Information Needed]
131
+
132
+ ## Considerations for Using the Data
133
+
134
+ ### Social Impact of Dataset
135
+
136
+ [More Information Needed]
137
+
138
+ ### Discussion of Biases
139
+
140
+ [More Information Needed]
141
+
142
+ ### Other Known Limitations
143
+
144
+ [More Information Needed]
145
+
146
+ ## Additional Information
147
+
148
+ ### Dataset Curators
149
+
150
+ Eleftheria Briakou and Marine Carpuat
151
+
152
+ ### Licensing Information
153
+
154
+ [MIT License](https://github.com/Elbria/xling-SemDiv/blob/master/LICENSE)
155
+
156
+ ### Citation Information
157
+
158
+ ```BibTeX
159
+ @inproceedings{briakou-carpuat-2020-detecting,
160
+ title = "Detecting Fine-Grained Cross-Lingual Semantic Divergences without Supervision by Learning to Rank",
161
+ author = "Briakou, Eleftheria and Carpuat, Marine",
162
+ booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
163
+ month = nov,
164
+ year = "2020",
165
+ address = "Online",
166
+ publisher = "Association for Computational Linguistics",
167
+ url = "https://www.aclweb.org/anthology/2020.emnlp-main.121",
168
+ pages = "1563--1580",
169
+ }
170
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"default": {"description": "The Rationalized English-French Semantic Divergences (REFreSD) dataset consists of 1,039 \nEnglish-French sentence-pairs annotated with sentence-level divergence judgments and token-level \nrationales. For any questions, write to ebriakou@cs.umd.edu.\n", "citation": "@inproceedings{briakou-carpuat-2020-detecting,\n title = \"Detecting Fine-Grained Cross-Lingual Semantic Divergences without Supervision by Learning to Rank\",\n author = \"Briakou, Eleftheria and Carpuat, Marine\",\n booktitle = \"Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)\",\n month = nov,\n year = \"2020\",\n address = \"Online\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.emnlp-main.121\",\n pages = \"1563--1580\",\n}\n", "homepage": "https://github.com/Elbria/xling-SemDiv/tree/master/REFreSD", "license": "", "features": {"sentence_en": {"dtype": "string", "id": null, "_type": "Value"}, "sentence_fr": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["divergent", "equivalent"], "names_file": null, "id": null, "_type": "ClassLabel"}, "all_labels": {"num_classes": 3, "names": ["unrelated", "some_meaning_difference", "no_meaning_difference"], "names_file": null, "id": null, "_type": "ClassLabel"}, "rationale_en": {"dtype": "string", "id": null, "_type": "Value"}, "rationale_fr": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "refresd", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 501562, "num_examples": 1039, "dataset_name": "refresd"}}, "download_checksums": {"https://raw.githubusercontent.com/Elbria/xling-SemDiv/master/REFreSD/REFreSD_rationale": {"num_bytes": 503977, "checksum": "d0ee606a8e73f0a6c22b9ec4d7e02a827e48d8b8d65ea2585b6cd9e11fe6b1f0"}}, "download_size": 503977, "post_processing_size": null, "dataset_size": 501562, "size_in_bytes": 1005539}}
dummy/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b063e3ee71702cb6d81ea4107b48ab10194fd60a9b138fd4a4998eaeaaa3dd2
3
+ size 1155
refresd.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """The Rationalized English-French Semantic Divergences (REFreSD) dataset."""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import csv
20
+
21
+ import datasets
22
+
23
+
24
+ _CITATION = """\
25
+ @inproceedings{briakou-carpuat-2020-detecting,
26
+ title = "Detecting Fine-Grained Cross-Lingual Semantic Divergences without Supervision by Learning to Rank",
27
+ author = "Briakou, Eleftheria and Carpuat, Marine",
28
+ booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
29
+ month = nov,
30
+ year = "2020",
31
+ address = "Online",
32
+ publisher = "Association for Computational Linguistics",
33
+ url = "https://www.aclweb.org/anthology/2020.emnlp-main.121",
34
+ pages = "1563--1580",
35
+ }
36
+ """
37
+
38
+ _DESCRIPTION = """\
39
+ The Rationalized English-French Semantic Divergences (REFreSD) dataset consists of 1,039
40
+ English-French sentence-pairs annotated with sentence-level divergence judgments and token-level
41
+ rationales. For any questions, write to ebriakou@cs.umd.edu.
42
+ """
43
+
44
+ _HOMEPAGE = "https://github.com/Elbria/xling-SemDiv/tree/master/REFreSD"
45
+
46
+ _LICENSE = "MIT"
47
+
48
+ _URL = "https://raw.githubusercontent.com/Elbria/xling-SemDiv/master/REFreSD/REFreSD_rationale"
49
+
50
+
51
+ class Refresd(datasets.GeneratorBasedBuilder):
52
+ """The Rationalized English-French Semantic Divergences (REFreSD) dataset."""
53
+
54
+ VERSION = datasets.Version("1.1.0")
55
+
56
+ def _info(self):
57
+ features = datasets.Features(
58
+ {
59
+ "sentence_pair": datasets.Translation(languages=["en", "fr"]),
60
+ "label": datasets.features.ClassLabel(names=["divergent", "equivalent"]),
61
+ "all_labels": datasets.features.ClassLabel(
62
+ names=["unrelated", "some_meaning_difference", "no_meaning_difference"]
63
+ ),
64
+ "rationale_en": datasets.features.Sequence(datasets.Value("int32")),
65
+ "rationale_fr": datasets.features.Sequence(datasets.Value("int32")),
66
+ }
67
+ )
68
+ return datasets.DatasetInfo(
69
+ description=_DESCRIPTION,
70
+ features=features,
71
+ supervised_keys=None,
72
+ homepage=_HOMEPAGE,
73
+ license=_LICENSE,
74
+ citation=_CITATION,
75
+ )
76
+
77
+ def _split_generators(self, dl_manager):
78
+ """Returns SplitGenerators."""
79
+ my_urls = _URL
80
+ data_file_path = dl_manager.download_and_extract(my_urls)
81
+ return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_file_path})]
82
+
83
+ def _generate_examples(self, filepath):
84
+ """ Yields examples. """
85
+ with open(filepath, encoding="utf-8") as f:
86
+ reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
87
+ for idx, row in enumerate(reader):
88
+ yield idx, {
89
+ "sentence_pair": {"fr": row["#french_sentence"], "en": row["#english_sentence"]},
90
+ "label": row["#binary_label"],
91
+ "all_labels": row["#3_labels"],
92
+ "rationale_en": [int(v) for v in row["#english_rational"].split(" ")],
93
+ "rationale_fr": [int(v) for v in row["#french_rationale"].split(" ")],
94
+ }