system HF staff commited on
Commit
7a6289f
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

.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,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - other
4
+ language_creators:
5
+ - other
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ discovery:
14
+ - n>1M
15
+ discoverysmall:
16
+ - 10K<n<100K
17
+ source_datasets:
18
+ - original
19
+ task_categories:
20
+ - text-classification
21
+ task_ids:
22
+ - text-classification-other-discourse-marker-prediction
23
+ ---
24
+
25
+
26
+ # Dataset Card for Discovery
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-fields)
36
+ - [Data Splits](#data-splits)
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:** https://github.com/synapse-developpement/Discovery
54
+ - **Repository:** https://github.com/synapse-developpement/Discovery
55
+ - **Paper:** https://www.aclweb.org/anthology/N19-1351/
56
+ - **Leaderboard:**
57
+ - **Point of Contact:** damien.sileo at kuleuven.be
58
+
59
+ ### Dataset Summary
60
+
61
+ Discourse marker prediction with 174 markers
62
+
63
+ ### Supported Tasks and Leaderboards
64
+
65
+ [More Information Needed]
66
+
67
+ ### Languages
68
+
69
+ English
70
+
71
+ ## Dataset Structure
72
+
73
+ input : sentence1, sentence2,
74
+ label: marker originally between sentence1 and sentence2
75
+
76
+ ### Data Instances
77
+
78
+ [More Information Needed]
79
+
80
+ ### Data Fields
81
+
82
+ [More Information Needed]
83
+
84
+ ### Data Splits
85
+
86
+ Train/Val/Test
87
+
88
+ ## Dataset Creation
89
+
90
+ ### Curation Rationale
91
+
92
+ [More Information Needed]
93
+
94
+ ### Source Data
95
+
96
+ Aranea english web corpus
97
+
98
+ #### Initial Data Collection and Normalization
99
+
100
+ [More Information Needed]
101
+
102
+ #### Who are the source language producers?
103
+
104
+ [More Information Needed]
105
+
106
+ ### Annotations
107
+
108
+ Self supervised (see paper)
109
+
110
+ #### Annotation process
111
+
112
+ [More Information Needed]
113
+
114
+ #### Who are the annotators?
115
+
116
+ [More Information Needed]
117
+
118
+ ### Personal and Sensitive Information
119
+
120
+ [More Information Needed]
121
+
122
+ ## Considerations for Using the Data
123
+
124
+ ### Social Impact of Dataset
125
+
126
+ [More Information Needed]
127
+
128
+ ### Discussion of Biases
129
+
130
+ [More Information Needed]
131
+
132
+ ### Other Known Limitations
133
+
134
+ [More Information Needed]
135
+
136
+ ## Additional Information
137
+
138
+ ### Dataset Curators
139
+
140
+ [More Information Needed]
141
+
142
+ ### Licensing Information
143
+
144
+ [More Information Needed]
145
+
146
+ ### Citation Information
147
+
148
+ ```
149
+ @inproceedings{sileo-etal-2019-mining,
150
+ title = "Mining Discourse Markers for Unsupervised Sentence Representation Learning",
151
+ author = "Sileo, Damien and
152
+ Van De Cruys, Tim and
153
+ Pradel, Camille and
154
+ Muller, Philippe",
155
+ booktitle = "Proceedings of the 2019 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)",
156
+ month = jun,
157
+ year = "2019",
158
+ address = "Minneapolis, Minnesota",
159
+ publisher = "Association for Computational Linguistics",
160
+ url = "https://www.aclweb.org/anthology/N19-1351",
161
+ pages = "3477--3486",
162
+ abstract = "Current state of the art systems in NLP heavily rely on manually annotated datasets, which are expensive to construct. Very little work adequately exploits unannotated data {--} such as discourse markers between sentences {--} mainly because of data sparseness and ineffective extraction methods. In the present work, we propose a method to automatically discover sentence pairs with relevant discourse markers, and apply it to massive amounts of data. Our resulting dataset contains 174 discourse markers with at least 10k examples each, even for rare markers such as {``}coincidentally{''} or {``}amazingly{''}. We use the resulting data as supervision for learning transferable sentence embeddings. In addition, we show that even though sentence representation learning through prediction of discourse marker yields state of the art results across different transfer tasks, it{'}s not clear that our models made use of the semantic relation between sentences, thus leaving room for further improvements.",
163
+ }
164
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"discovery": {"description": "Discourse marker prediction with 174 different markers\n", "citation": "@inproceedings{sileo-etal-2019-mining,\n title = \"Mining Discourse Markers for Unsupervised Sentence Representation Learning\",\n author = \"Sileo, Damien and\n Van De Cruys, Tim and\n Pradel, Camille and\n Muller, Philippe\",\n booktitle = \"Proceedings of the 2019 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)\",\n month = jun,\n year = \"2019\",\n address = \"Minneapolis, Minnesota\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/N19-1351\",\n pages = \"3477--3486\",\n abstract = \"Current state of the art systems in NLP heavily rely on manually annotated datasets, which are expensive to construct. Very little work adequately exploits unannotated data {--} such as discourse markers between sentences {--} mainly because of data sparseness and ineffective extraction methods. In the present work, we propose a method to automatically discover sentence pairs with relevant discourse markers, and apply it to massive amounts of data. Our resulting dataset contains 174 discourse markers with at least 10k examples each, even for rare markers such as {``}coincidentally{''} or {``}amazingly{''}. We use the resulting data as supervision for learning transferable sentence embeddings. In addition, we show that even though sentence representation learning through prediction of discourse marker yields state of the art results across different transfer tasks, it{'}s not clear that our models made use of the semantic relation between sentences, thus leaving room for further improvements.\",\n}\n\n@inproceedings{sileo-etal-2019-mining,\n title = \"Mining Discourse Markers for Unsupervised Sentence Representation Learning\",\n author = \"Sileo, Damien and\n Van De Cruys, Tim and\n Pradel, Camille and\n Muller, Philippe\",\n booktitle = \"Proceedings of the 2019 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)\",\n month = jun,\n year = \"2019\",\n address = \"Minneapolis, Minnesota\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/N19-1351\",\n pages = \"3477--3486\",\n abstract = \"Current state of the art systems in NLP heavily rely on manually annotated datasets, which are expensive to construct. Very little work adequately exploits unannotated data {--} such as discourse markers between sentences {--} mainly because of data sparseness and ineffective extraction methods. In the present work, we propose a method to automatically discover sentence pairs with relevant discourse markers, and apply it to massive amounts of data. Our resulting dataset contains 174 discourse markers with at least 10k examples each, even for rare markers such as {``}coincidentally{''} or {``}amazingly{''}. We use the resulting data as supervision for learning transferable sentence embeddings. In addition, we show that even though sentence representation learning through prediction of discourse marker yields state of the art results across different transfer tasks, it{'}s not clear that our models made use of the semantic relation between sentences, thus leaving room for further improvements.\",\n}\n", "homepage": "", "license": "", "features": {"sentence1": {"dtype": "string", "id": null, "_type": "Value"}, "sentence2": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 174, "names": ["[no-conn]", "absolutely,", "accordingly", "actually,", "additionally", "admittedly,", "afterward", "again,", "already,", "also,", "alternately,", "alternatively", "although,", "altogether,", "amazingly,", "and", "anyway,", "apparently,", "arguably,", "as_a_result,", "basically,", "because_of_that", "because_of_this", "besides,", "but", "by_comparison,", "by_contrast,", "by_doing_this,", "by_then", "certainly,", "clearly,", "coincidentally,", "collectively,", "consequently", "conversely", "curiously,", "currently,", "elsewhere,", "especially,", "essentially,", "eventually,", "evidently,", "finally,", "first,", "firstly,", "for_example", "for_instance", "fortunately,", "frankly,", "frequently,", "further,", "furthermore", "generally,", "gradually,", "happily,", "hence,", "here,", "historically,", "honestly,", "hopefully,", "however", "ideally,", "immediately,", "importantly,", "in_contrast,", "in_fact,", "in_other_words", "in_particular,", "in_short,", "in_sum,", "in_the_end,", "in_the_meantime,", "in_turn,", "incidentally,", "increasingly,", "indeed,", "inevitably,", "initially,", "instead,", "interestingly,", "ironically,", "lastly,", "lately,", "later,", "likewise,", "locally,", "luckily,", "maybe,", "meaning,", "meantime,", "meanwhile,", "moreover", "mostly,", "namely,", "nationally,", "naturally,", "nevertheless", "next,", "nonetheless", "normally,", "notably,", "now,", "obviously,", "occasionally,", "oddly,", "often,", "on_the_contrary,", "on_the_other_hand", "once,", "only,", "optionally,", "or,", "originally,", "otherwise,", "overall,", "particularly,", "perhaps,", "personally,", "plus,", "preferably,", "presently,", "presumably,", "previously,", "probably,", "rather,", "realistically,", "really,", "recently,", "regardless,", "remarkably,", "sadly,", "second,", "secondly,", "separately,", "seriously,", "significantly,", "similarly,", "simultaneously", "slowly,", "so,", "sometimes,", "soon,", "specifically,", "still,", "strangely,", "subsequently,", "suddenly,", "supposedly,", "surely,", "surprisingly,", "technically,", "thankfully,", "then,", "theoretically,", "thereafter,", "thereby,", "therefore", "third,", "thirdly,", "this,", "though,", "thus,", "together,", "traditionally,", "truly,", "truthfully,", "typically,", "ultimately,", "undoubtedly,", "unfortunately,", "unsurprisingly,", "usually,", "well,", "yet,"], "names_file": null, "id": null, "_type": "ClassLabel"}, "idx": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "discovery", "config_name": "discovery", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 334809726, "num_examples": 1566000, "dataset_name": "discovery"}, "validation": {"name": "validation", "num_bytes": 18607661, "num_examples": 87000, "dataset_name": "discovery"}, "test": {"name": "test", "num_bytes": 18615474, "num_examples": 87000, "dataset_name": "discovery"}}, "download_checksums": {"https://www.dropbox.com/s/aox84z90nyyuikz/discovery.zip?dl=1": {"num_bytes": 146233621, "checksum": "f761e50dc11caeffb5a3ba9d02d45e0d4d0bdb3e45f34da5dbb3faeaf82dceaf"}}, "download_size": 146233621, "post_processing_size": null, "dataset_size": 372032861, "size_in_bytes": 518266482}, "discoverysmall": {"description": "Discourse marker prediction with 174 different markers\n", "citation": "@inproceedings{sileo-etal-2019-mining,\n title = \"Mining Discourse Markers for Unsupervised Sentence Representation Learning\",\n author = \"Sileo, Damien and\n Van De Cruys, Tim and\n Pradel, Camille and\n Muller, Philippe\",\n booktitle = \"Proceedings of the 2019 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)\",\n month = jun,\n year = \"2019\",\n address = \"Minneapolis, Minnesota\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/N19-1351\",\n pages = \"3477--3486\",\n abstract = \"Current state of the art systems in NLP heavily rely on manually annotated datasets, which are expensive to construct. Very little work adequately exploits unannotated data {--} such as discourse markers between sentences {--} mainly because of data sparseness and ineffective extraction methods. In the present work, we propose a method to automatically discover sentence pairs with relevant discourse markers, and apply it to massive amounts of data. Our resulting dataset contains 174 discourse markers with at least 10k examples each, even for rare markers such as {``}coincidentally{''} or {``}amazingly{''}. We use the resulting data as supervision for learning transferable sentence embeddings. In addition, we show that even though sentence representation learning through prediction of discourse marker yields state of the art results across different transfer tasks, it{'}s not clear that our models made use of the semantic relation between sentences, thus leaving room for further improvements.\",\n}\n\n@inproceedings{sileo-etal-2019-mining,\n title = \"Mining Discourse Markers for Unsupervised Sentence Representation Learning\",\n author = \"Sileo, Damien and\n Van De Cruys, Tim and\n Pradel, Camille and\n Muller, Philippe\",\n booktitle = \"Proceedings of the 2019 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)\",\n month = jun,\n year = \"2019\",\n address = \"Minneapolis, Minnesota\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/N19-1351\",\n pages = \"3477--3486\",\n abstract = \"Current state of the art systems in NLP heavily rely on manually annotated datasets, which are expensive to construct. Very little work adequately exploits unannotated data {--} such as discourse markers between sentences {--} mainly because of data sparseness and ineffective extraction methods. In the present work, we propose a method to automatically discover sentence pairs with relevant discourse markers, and apply it to massive amounts of data. Our resulting dataset contains 174 discourse markers with at least 10k examples each, even for rare markers such as {``}coincidentally{''} or {``}amazingly{''}. We use the resulting data as supervision for learning transferable sentence embeddings. In addition, we show that even though sentence representation learning through prediction of discourse marker yields state of the art results across different transfer tasks, it{'}s not clear that our models made use of the semantic relation between sentences, thus leaving room for further improvements.\",\n}\n", "homepage": "", "license": "", "features": {"sentence1": {"dtype": "string", "id": null, "_type": "Value"}, "sentence2": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 174, "names": ["[no-conn]", "absolutely,", "accordingly", "actually,", "additionally", "admittedly,", "afterward", "again,", "already,", "also,", "alternately,", "alternatively", "although,", "altogether,", "amazingly,", "and", "anyway,", "apparently,", "arguably,", "as_a_result,", "basically,", "because_of_that", "because_of_this", "besides,", "but", "by_comparison,", "by_contrast,", "by_doing_this,", "by_then", "certainly,", "clearly,", "coincidentally,", "collectively,", "consequently", "conversely", "curiously,", "currently,", "elsewhere,", "especially,", "essentially,", "eventually,", "evidently,", "finally,", "first,", "firstly,", "for_example", "for_instance", "fortunately,", "frankly,", "frequently,", "further,", "furthermore", "generally,", "gradually,", "happily,", "hence,", "here,", "historically,", "honestly,", "hopefully,", "however", "ideally,", "immediately,", "importantly,", "in_contrast,", "in_fact,", "in_other_words", "in_particular,", "in_short,", "in_sum,", "in_the_end,", "in_the_meantime,", "in_turn,", "incidentally,", "increasingly,", "indeed,", "inevitably,", "initially,", "instead,", "interestingly,", "ironically,", "lastly,", "lately,", "later,", "likewise,", "locally,", "luckily,", "maybe,", "meaning,", "meantime,", "meanwhile,", "moreover", "mostly,", "namely,", "nationally,", "naturally,", "nevertheless", "next,", "nonetheless", "normally,", "notably,", "now,", "obviously,", "occasionally,", "oddly,", "often,", "on_the_contrary,", "on_the_other_hand", "once,", "only,", "optionally,", "or,", "originally,", "otherwise,", "overall,", "particularly,", "perhaps,", "personally,", "plus,", "preferably,", "presently,", "presumably,", "previously,", "probably,", "rather,", "realistically,", "really,", "recently,", "regardless,", "remarkably,", "sadly,", "second,", "secondly,", "separately,", "seriously,", "significantly,", "similarly,", "simultaneously", "slowly,", "so,", "sometimes,", "soon,", "specifically,", "still,", "strangely,", "subsequently,", "suddenly,", "supposedly,", "surely,", "surprisingly,", "technically,", "thankfully,", "then,", "theoretically,", "thereafter,", "thereby,", "therefore", "third,", "thirdly,", "this,", "though,", "thus,", "together,", "traditionally,", "truly,", "truthfully,", "typically,", "ultimately,", "undoubtedly,", "unfortunately,", "unsurprisingly,", "usually,", "well,", "yet,"], "names_file": null, "id": null, "_type": "ClassLabel"}, "idx": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "discovery", "config_name": "discoverysmall", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3355192, "num_examples": 15662, "dataset_name": "discovery"}, "validation": {"name": "validation", "num_bytes": 185296, "num_examples": 871, "dataset_name": "discovery"}, "test": {"name": "test", "num_bytes": 187471, "num_examples": 869, "dataset_name": "discovery"}}, "download_checksums": {"https://www.dropbox.com/s/aox84z90nyyuikz/discovery.zip?dl=1": {"num_bytes": 146233621, "checksum": "f761e50dc11caeffb5a3ba9d02d45e0d4d0bdb3e45f34da5dbb3faeaf82dceaf"}}, "download_size": 146233621, "post_processing_size": null, "dataset_size": 3727959, "size_in_bytes": 149961580}}
discovery.py ADDED
@@ -0,0 +1,353 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Discourse marker prediction with 174 different markers"""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import csv
22
+ import os
23
+ import textwrap
24
+
25
+ import six
26
+
27
+ import datasets
28
+
29
+
30
+ _Discovery_CITATION = """@inproceedings{sileo-etal-2019-mining,
31
+ title = "Mining Discourse Markers for Unsupervised Sentence Representation Learning",
32
+ author = "Sileo, Damien and
33
+ Van De Cruys, Tim and
34
+ Pradel, Camille and
35
+ Muller, Philippe",
36
+ booktitle = "Proceedings of the 2019 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)",
37
+ month = jun,
38
+ year = "2019",
39
+ address = "Minneapolis, Minnesota",
40
+ publisher = "Association for Computational Linguistics",
41
+ url = "https://www.aclweb.org/anthology/N19-1351",
42
+ pages = "3477--3486",
43
+ abstract = "Current state of the art systems in NLP heavily rely on manually annotated datasets, which are expensive to construct. Very little work adequately exploits unannotated data {--} such as discourse markers between sentences {--} mainly because of data sparseness and ineffective extraction methods. In the present work, we propose a method to automatically discover sentence pairs with relevant discourse markers, and apply it to massive amounts of data. Our resulting dataset contains 174 discourse markers with at least 10k examples each, even for rare markers such as {``}coincidentally{''} or {``}amazingly{''}. We use the resulting data as supervision for learning transferable sentence embeddings. In addition, we show that even though sentence representation learning through prediction of discourse marker yields state of the art results across different transfer tasks, it{'}s not clear that our models made use of the semantic relation between sentences, thus leaving room for further improvements.",
44
+ }
45
+ """
46
+
47
+ _Discovery_DESCRIPTION = r"""\
48
+ Discourse marker prediction with 174 different markers
49
+ https://github.com/synapse-developpement/Discovery
50
+ """
51
+
52
+ DATA_URL = "https://www.dropbox.com/s/aox84z90nyyuikz/discovery.zip?dl=1"
53
+
54
+
55
+ LABELS = [
56
+ "[no-conn]",
57
+ "absolutely,",
58
+ "accordingly",
59
+ "actually,",
60
+ "additionally",
61
+ "admittedly,",
62
+ "afterward",
63
+ "again,",
64
+ "already,",
65
+ "also,",
66
+ "alternately,",
67
+ "alternatively",
68
+ "although,",
69
+ "altogether,",
70
+ "amazingly,",
71
+ "and",
72
+ "anyway,",
73
+ "apparently,",
74
+ "arguably,",
75
+ "as_a_result,",
76
+ "basically,",
77
+ "because_of_that",
78
+ "because_of_this",
79
+ "besides,",
80
+ "but",
81
+ "by_comparison,",
82
+ "by_contrast,",
83
+ "by_doing_this,",
84
+ "by_then",
85
+ "certainly,",
86
+ "clearly,",
87
+ "coincidentally,",
88
+ "collectively,",
89
+ "consequently",
90
+ "conversely",
91
+ "curiously,",
92
+ "currently,",
93
+ "elsewhere,",
94
+ "especially,",
95
+ "essentially,",
96
+ "eventually,",
97
+ "evidently,",
98
+ "finally,",
99
+ "first,",
100
+ "firstly,",
101
+ "for_example",
102
+ "for_instance",
103
+ "fortunately,",
104
+ "frankly,",
105
+ "frequently,",
106
+ "further,",
107
+ "furthermore",
108
+ "generally,",
109
+ "gradually,",
110
+ "happily,",
111
+ "hence,",
112
+ "here,",
113
+ "historically,",
114
+ "honestly,",
115
+ "hopefully,",
116
+ "however",
117
+ "ideally,",
118
+ "immediately,",
119
+ "importantly,",
120
+ "in_contrast,",
121
+ "in_fact,",
122
+ "in_other_words",
123
+ "in_particular,",
124
+ "in_short,",
125
+ "in_sum,",
126
+ "in_the_end,",
127
+ "in_the_meantime,",
128
+ "in_turn,",
129
+ "incidentally,",
130
+ "increasingly,",
131
+ "indeed,",
132
+ "inevitably,",
133
+ "initially,",
134
+ "instead,",
135
+ "interestingly,",
136
+ "ironically,",
137
+ "lastly,",
138
+ "lately,",
139
+ "later,",
140
+ "likewise,",
141
+ "locally,",
142
+ "luckily,",
143
+ "maybe,",
144
+ "meaning,",
145
+ "meantime,",
146
+ "meanwhile,",
147
+ "moreover",
148
+ "mostly,",
149
+ "namely,",
150
+ "nationally,",
151
+ "naturally,",
152
+ "nevertheless",
153
+ "next,",
154
+ "nonetheless",
155
+ "normally,",
156
+ "notably,",
157
+ "now,",
158
+ "obviously,",
159
+ "occasionally,",
160
+ "oddly,",
161
+ "often,",
162
+ "on_the_contrary,",
163
+ "on_the_other_hand",
164
+ "once,",
165
+ "only,",
166
+ "optionally,",
167
+ "or,",
168
+ "originally,",
169
+ "otherwise,",
170
+ "overall,",
171
+ "particularly,",
172
+ "perhaps,",
173
+ "personally,",
174
+ "plus,",
175
+ "preferably,",
176
+ "presently,",
177
+ "presumably,",
178
+ "previously,",
179
+ "probably,",
180
+ "rather,",
181
+ "realistically,",
182
+ "really,",
183
+ "recently,",
184
+ "regardless,",
185
+ "remarkably,",
186
+ "sadly,",
187
+ "second,",
188
+ "secondly,",
189
+ "separately,",
190
+ "seriously,",
191
+ "significantly,",
192
+ "similarly,",
193
+ "simultaneously",
194
+ "slowly,",
195
+ "so,",
196
+ "sometimes,",
197
+ "soon,",
198
+ "specifically,",
199
+ "still,",
200
+ "strangely,",
201
+ "subsequently,",
202
+ "suddenly,",
203
+ "supposedly,",
204
+ "surely,",
205
+ "surprisingly,",
206
+ "technically,",
207
+ "thankfully,",
208
+ "then,",
209
+ "theoretically,",
210
+ "thereafter,",
211
+ "thereby,",
212
+ "therefore",
213
+ "third,",
214
+ "thirdly,",
215
+ "this,",
216
+ "though,",
217
+ "thus,",
218
+ "together,",
219
+ "traditionally,",
220
+ "truly,",
221
+ "truthfully,",
222
+ "typically,",
223
+ "ultimately,",
224
+ "undoubtedly,",
225
+ "unfortunately,",
226
+ "unsurprisingly,",
227
+ "usually,",
228
+ "well,",
229
+ "yet,",
230
+ ]
231
+
232
+
233
+ class DiscoveryConfig(datasets.BuilderConfig):
234
+ """BuilderConfig for Discovery."""
235
+
236
+ def __init__(
237
+ self,
238
+ text_features,
239
+ label_classes=None,
240
+ process_label=lambda x: x,
241
+ **kwargs,
242
+ ):
243
+ """BuilderConfig for Discovery.
244
+ Args:
245
+ text_features: `dict[string, string]`, map from the name of the feature
246
+ dict for each text field to the name of the column in the tsv file
247
+ label_column: `string`, name of the column in the tsv file corresponding
248
+ to the label
249
+ data_url: `string`, url to download the zip file from
250
+ data_dir: `string`, the path to the folder containing the tsv files in the
251
+ downloaded zip
252
+ citation: `string`, citation for the data set
253
+ url: `string`, url for information about the data set
254
+ label_classes: `list[string]`, the list of classes if the label is
255
+ categorical. If not provided, then the label will be of type
256
+ `datasets.Value('float32')`.
257
+ process_label: `Function[string, any]`, function taking in the raw value
258
+ of the label and processing it to the form required by the label feature
259
+ **kwargs: keyword arguments forwarded to super.
260
+ """
261
+
262
+ super(DiscoveryConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
263
+
264
+ self.text_features = text_features
265
+ self.label_column = "label"
266
+ self.label_classes = LABELS
267
+ self.data_url = DATA_URL
268
+ self.data_dir = os.path.join("discovery", self.name)
269
+ self.citation = textwrap.dedent(_Discovery_CITATION)
270
+ self.process_label = process_label
271
+ self.description = ""
272
+ self.url = ""
273
+
274
+
275
+ class Discovery(datasets.GeneratorBasedBuilder):
276
+
277
+ """Discourse marker prediction with 174 different markers"""
278
+
279
+ BUILDER_CONFIG_CLASS = DiscoveryConfig
280
+
281
+ BUILDER_CONFIGS = [
282
+ DiscoveryConfig(
283
+ name="discovery",
284
+ text_features={"sentence1": "sentence1", "sentence2": "sentence2"},
285
+ ),
286
+ DiscoveryConfig(
287
+ name="discoverysmall",
288
+ text_features={"sentence1": "sentence1", "sentence2": "sentence2"},
289
+ ),
290
+ ]
291
+
292
+ def _info(self):
293
+ features = {text_feature: datasets.Value("string") for text_feature in six.iterkeys(self.config.text_features)}
294
+ if self.config.label_classes:
295
+ features["label"] = datasets.features.ClassLabel(names=self.config.label_classes)
296
+ else:
297
+ features["label"] = datasets.Value("float32")
298
+ features["idx"] = datasets.Value("int32")
299
+ return datasets.DatasetInfo(
300
+ description=_Discovery_DESCRIPTION,
301
+ features=datasets.Features(features),
302
+ homepage=self.config.url,
303
+ citation=self.config.citation + "\n" + _Discovery_CITATION,
304
+ )
305
+
306
+ def _split_generators(self, dl_manager):
307
+ dl_dir = dl_manager.download_and_extract(self.config.data_url)
308
+ data_dir = os.path.join(dl_dir, self.config.data_dir)
309
+
310
+ return [
311
+ datasets.SplitGenerator(
312
+ name=datasets.Split.TRAIN,
313
+ gen_kwargs={
314
+ "data_file": os.path.join(data_dir or "", "train.tsv"),
315
+ "split": "train",
316
+ },
317
+ ),
318
+ datasets.SplitGenerator(
319
+ name=datasets.Split.VALIDATION,
320
+ gen_kwargs={
321
+ "data_file": os.path.join(data_dir or "", "dev.tsv"),
322
+ "split": "dev",
323
+ },
324
+ ),
325
+ datasets.SplitGenerator(
326
+ name=datasets.Split.TEST,
327
+ gen_kwargs={
328
+ "data_file": os.path.join(data_dir or "", "test.tsv"),
329
+ "split": "test",
330
+ },
331
+ ),
332
+ ]
333
+
334
+ def _generate_examples(self, data_file, split):
335
+
336
+ process_label = self.config.process_label
337
+ label_classes = self.config.label_classes
338
+ print(data_file)
339
+ with open(data_file, encoding="utf8") as f:
340
+ reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
341
+
342
+ for n, row in enumerate(reader):
343
+ example = {feat: row[col] for feat, col in six.iteritems(self.config.text_features)}
344
+ example["idx"] = n
345
+
346
+ if self.config.label_column in row:
347
+ label = row[self.config.label_column]
348
+ if label_classes and label not in label_classes:
349
+ label = int(label) if label else None
350
+ example["label"] = process_label(label)
351
+ else:
352
+ example["label"] = process_label(-1)
353
+ yield example["idx"], example
dummy/discovery/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:932f1457879a94df9847f9059c047e0bcdea82465f590b84bb5f20ee7bfa01bd
3
+ size 5346
dummy/discoverysmall/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcc18e52bdd804557d4a477a36aeaf82638cc11d3ecdc9847b68c91fa03a4bf6
3
+ size 5346