parquet-converter commited on
Commit
7e21499
·
1 Parent(s): 7c27327

Update parquet files

Browse files
.gitattributes DELETED
@@ -1,27 +0,0 @@
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 DELETED
@@ -1,270 +0,0 @@
1
- ---
2
- pretty_name: 'PAWS: Paraphrase Adversaries from Word Scrambling'
3
- annotations_creators:
4
- - expert-generated
5
- - machine-generated
6
- language_creators:
7
- - machine-generated
8
- language:
9
- - en
10
- license:
11
- - other
12
- multilinguality:
13
- - monolingual
14
- size_categories:
15
- - 100K<n<1M
16
- - 10K<n<100K
17
- source_datasets:
18
- - original
19
- task_categories:
20
- - text-classification
21
- task_ids:
22
- - semantic-similarity-classification
23
- - semantic-similarity-scoring
24
- - text-scoring
25
- - multi-input-text-classification
26
- paperswithcode_id: paws
27
- configs:
28
- - labeled_final
29
- - labeled_swap
30
- - unlabeled_final
31
- tags:
32
- - paraphrase-identification
33
- dataset_info:
34
- - config_name: labeled_final
35
- features:
36
- - name: id
37
- dtype: int32
38
- - name: sentence1
39
- dtype: string
40
- - name: sentence2
41
- dtype: string
42
- - name: label
43
- dtype:
44
- class_label:
45
- names:
46
- 0: '0'
47
- 1: '1'
48
- splits:
49
- - name: train
50
- num_bytes: 12239978
51
- num_examples: 49401
52
- - name: test
53
- num_bytes: 1987802
54
- num_examples: 8000
55
- - name: validation
56
- num_bytes: 1975870
57
- num_examples: 8000
58
- download_size: 4687157
59
- dataset_size: 16203650
60
- - config_name: labeled_swap
61
- features:
62
- - name: id
63
- dtype: int32
64
- - name: sentence1
65
- dtype: string
66
- - name: sentence2
67
- dtype: string
68
- - name: label
69
- dtype:
70
- class_label:
71
- names:
72
- 0: '0'
73
- 1: '1'
74
- splits:
75
- - name: train
76
- num_bytes: 7963651
77
- num_examples: 30397
78
- download_size: 2257283
79
- dataset_size: 7963651
80
- - config_name: unlabeled_final
81
- features:
82
- - name: id
83
- dtype: int32
84
- - name: sentence1
85
- dtype: string
86
- - name: sentence2
87
- dtype: string
88
- - name: label
89
- dtype:
90
- class_label:
91
- names:
92
- 0: '0'
93
- 1: '1'
94
- splits:
95
- - name: train
96
- num_bytes: 157806996
97
- num_examples: 645652
98
- - name: validation
99
- num_bytes: 2442173
100
- num_examples: 10000
101
- download_size: 47393331
102
- dataset_size: 160249169
103
- ---
104
-
105
- # Dataset Card for PAWS: Paraphrase Adversaries from Word Scrambling
106
-
107
- ## Table of Contents
108
- - [Dataset Description](#dataset-description)
109
- - [Dataset Summary](#dataset-summary)
110
- - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
111
- - [Languages](#languages)
112
- - [Dataset Structure](#dataset-structure)
113
- - [Data Instances](#data-instances)
114
- - [Data Fields](#data-fields)
115
- - [Data Splits](#data-splits)
116
- - [Dataset Creation](#dataset-creation)
117
- - [Curation Rationale](#curation-rationale)
118
- - [Source Data](#source-data)
119
- - [Annotations](#annotations)
120
- - [Personal and Sensitive Information](#personal-and-sensitive-information)
121
- - [Considerations for Using the Data](#considerations-for-using-the-data)
122
- - [Social Impact of Dataset](#social-impact-of-dataset)
123
- - [Discussion of Biases](#discussion-of-biases)
124
- - [Other Known Limitations](#other-known-limitations)
125
- - [Additional Information](#additional-information)
126
- - [Dataset Curators](#dataset-curators)
127
- - [Licensing Information](#licensing-information)
128
- - [Citation Information](#citation-information)
129
- - [Contributions](#contributions)
130
-
131
- ## Dataset Description
132
-
133
- - **Homepage:** [PAWS](https://github.com/google-research-datasets/paws)
134
- - **Repository:** [PAWS](https://github.com/google-research-datasets/paws)
135
- - **Paper:** [PAWS: Paraphrase Adversaries from Word Scrambling](https://arxiv.org/abs/1904.01130)
136
- - **Point of Contact:** [Yuan Zhang]([email protected])
137
-
138
- ### Dataset Summary
139
-
140
- PAWS: Paraphrase Adversaries from Word Scrambling
141
-
142
- This dataset contains 108,463 human-labeled and 656k noisily labeled pairs that feature the importance of modeling structure, context, and word order information for the problem of paraphrase identification. The dataset has two subsets, one based on Wikipedia and the other one based on the Quora Question Pairs (QQP) dataset.
143
-
144
- For further details, see the accompanying paper: PAWS: Paraphrase Adversaries from Word Scrambling (https://arxiv.org/abs/1904.01130)
145
-
146
- PAWS-QQP is not available due to license of QQP. It must be reconstructed by downloading the original data and then running our scripts to produce the data and attach the labels.
147
-
148
- ### Supported Tasks and Leaderboards
149
-
150
- [More Information Needed]
151
-
152
- ### Languages
153
-
154
- The text in the dataset is in English.
155
-
156
- ## Dataset Structure
157
-
158
- ### Data Instances
159
-
160
- Below are two examples from the dataset:
161
-
162
- | | Sentence 1 | Sentence 2 | Label |
163
- | :-- | :---------------------------- | :---------------------------- | :---- |
164
- | (1) | Although interchangeable, the body pieces on the 2 cars are not similar. | Although similar, the body parts are not interchangeable on the 2 cars. | 0 |
165
- | (2) | Katz was born in Sweden in 1947 and moved to New York City at the age of 1. | Katz was born in 1947 in Sweden and moved to New York at the age of one. | 1 |
166
-
167
- The first pair has different semantic meaning while the second pair is a paraphrase. State-of-the-art models trained on existing datasets have dismal performance on PAWS (<40% accuracy); however, including PAWS training data for these models improves their accuracy to 85% while maintaining performance on existing datasets such as the [Quora Question Pairs](https://data.quora.com/First-Quora-Dataset-Release-Question-Pairs).
168
-
169
-
170
- ### Data Fields
171
-
172
- This corpus contains pairs generated from Wikipedia pages, and can be downloaded
173
- here:
174
-
175
- * **PAWS-Wiki Labeled (Final)**: containing pairs that are generated from both word swapping and back translation methods. All pairs have human judgements on both paraphrasing and fluency and they are split into Train/Dev/Test sections.
176
-
177
- * **PAWS-Wiki Labeled (Swap-only)**: containing pairs that have no back translation counterparts and therefore they are not included in the first set. Nevertheless, they are high-quality pairs with human judgements on both paraphrasing and fluency, and they can be included as an auxiliary training set.
178
-
179
- * **PAWS-Wiki Unlabeled (Final)**: Pairs in this set have noisy labels without human judgments and can also be used as an auxiliary training set. They are generated from both word swapping and back translation methods.
180
-
181
- All files are in the tsv format with four columns:
182
-
183
- Column Name | Data
184
- :------------ | :--------------------------
185
- id | A unique id for each pair
186
- sentence1 | The first sentence
187
- sentence2 | The second sentence
188
- (noisy_)label | (Noisy) label for each pair
189
-
190
- Each label has two possible values: `0` indicates the pair has different meaning, while `1` indicates the pair is a paraphrase.
191
-
192
-
193
- ### Data Splits
194
-
195
- The number of examples and the proportion of paraphrase (Yes%) pairs are shown
196
- below:
197
-
198
- Data | Train | Dev | Test | Yes%
199
- :------------------ | ------: | -----: | ----: | ----:
200
- Labeled (Final) | 49,401 | 8,000 | 8,000 | 44.2%
201
- Labeled (Swap-only) | 30,397 | -- | -- | 9.6%
202
- Unlabeled (Final) | 645,652 | 10,000 | -- | 50.0%
203
-
204
- ## Dataset Creation
205
-
206
- ### Curation Rationale
207
-
208
- Existing paraphrase identification datasets lack sentence pairs that have high lexical overlap without being paraphrases. Models trained on such data fail to distinguish pairs like *flights from New York to Florida* and *flights from Florida to New York*.
209
-
210
- ### Source Data
211
-
212
- #### Initial Data Collection and Normalization
213
-
214
- Their automatic generation method is based on two ideas. The first swaps words to generate a sentence pair with the same BOW, controlled by a language model. The second uses back translation to generate paraphrases with high BOW overlap but different word order. These two strategies generate high-quality, diverse PAWS pairs, balanced evenly between paraphrases and non-paraphrases.
215
-
216
- #### Who are the source language producers?
217
-
218
- Mentioned above.
219
-
220
- ### Annotations
221
-
222
- #### Annotation process
223
-
224
- Sentence pairs are presented to five annotators, each of which gives a binary judgment as to whether they are paraphrases or not. They chose binary judgments to make dataset have the same label schema as the QQP corpus. Overall, human agreement is high on both Quora (92.0%) and Wikipedia (94.7%) and each label only takes about 24 seconds. As such, answers are usually straight-forward to human raters.
225
-
226
- #### Who are the annotators?
227
-
228
- [More Information Needed]
229
-
230
- ### Personal and Sensitive Information
231
-
232
- [More Information Needed]
233
-
234
- ## Considerations for Using the Data
235
-
236
- ### Social Impact of Dataset
237
-
238
- [More Information Needed]
239
-
240
- ### Discussion of Biases
241
-
242
- [More Information Needed]
243
-
244
- ### Other Known Limitations
245
-
246
- [More Information Needed]
247
-
248
- ## Additional Information
249
-
250
- ### Dataset Curators
251
-
252
- List the people involved in collecting the dataset and their affiliation(s). If funding information is known, include it here.
253
-
254
- ### Licensing Information
255
-
256
- The dataset may be freely used for any purpose, although acknowledgement of Google LLC ("Google") as the data source would be appreciated. The dataset is provided "AS IS" without any warranty, express or implied. Google disclaims all liability for any damages, direct or indirect, resulting from the use of the dataset.
257
-
258
- ### Citation Information
259
-
260
- ```
261
- @InProceedings{paws2019naacl,
262
- title = {{PAWS: Paraphrase Adversaries from Word Scrambling}},
263
- author = {Zhang, Yuan and Baldridge, Jason and He, Luheng},
264
- booktitle = {Proc. of NAACL},
265
- year = {2019}
266
- }
267
- ```
268
- ### Contributions
269
-
270
- Thanks to [@bhavitvyamalik](https://github.com/bhavitvyamalik) for adding this dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"labeled_final": {"description": "PAWS: Paraphrase Adversaries from Word Scrambling\n\nThis dataset contains 108,463 human-labeled and 656k noisily labeled pairs that feature\nthe importance of modeling structure, context, and word order information for the problem\nof paraphrase identification. The dataset has two subsets, one based on Wikipedia and the\nother one based on the Quora Question Pairs (QQP) dataset.\n\nFor further details, see the accompanying paper: PAWS: Paraphrase Adversaries from Word Scrambling\n(https://arxiv.org/abs/1904.01130)\n\nPAWS-QQP is not available due to license of QQP. It must be reconstructed by downloading the original\ndata and then running our scripts to produce the data and attach the labels.\n\nNOTE: There might be some missing or wrong labels in the dataset and we have replaced them with -1.\n", "citation": "@InProceedings{paws2019naacl,\n title = {{PAWS: Paraphrase Adversaries from Word Scrambling}},\n author = {Zhang, Yuan and Baldridge, Jason and He, Luheng},\n booktitle = {Proc. of NAACL},\n year = {2019}\n}\n", "homepage": "https://github.com/google-research-datasets/paws", "license": "The dataset may be freely used for any purpose, although acknowledgement of Google LLC (\"Google\") as the data source would be appreciated. The dataset is provided \"AS IS\" without any warranty, express or implied. Google disclaims all liability for any damages, direct or indirect, resulting from the use of the dataset.", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "sentence1": {"dtype": "string", "id": null, "_type": "Value"}, "sentence2": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["0", "1"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "paws", "config_name": "labeled_final", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 12239978, "num_examples": 49401, "dataset_name": "paws"}, "test": {"name": "test", "num_bytes": 1987802, "num_examples": 8000, "dataset_name": "paws"}, "validation": {"name": "validation", "num_bytes": 1975870, "num_examples": 8000, "dataset_name": "paws"}}, "download_checksums": {"https://storage.googleapis.com/paws/english/paws_wiki_labeled_final.tar.gz": {"num_bytes": 4687157, "checksum": "1aad6cbb8a90b15563a0c154752c2b2c8e3bc5bdaa125172214d598bc76bc9fd"}}, "download_size": 4687157, "post_processing_size": null, "dataset_size": 16203650, "size_in_bytes": 20890807}, "labeled_swap": {"description": "PAWS: Paraphrase Adversaries from Word Scrambling\n\nThis dataset contains 108,463 human-labeled and 656k noisily labeled pairs that feature\nthe importance of modeling structure, context, and word order information for the problem\nof paraphrase identification. The dataset has two subsets, one based on Wikipedia and the\nother one based on the Quora Question Pairs (QQP) dataset.\n\nFor further details, see the accompanying paper: PAWS: Paraphrase Adversaries from Word Scrambling\n(https://arxiv.org/abs/1904.01130)\n\nPAWS-QQP is not available due to license of QQP. It must be reconstructed by downloading the original\ndata and then running our scripts to produce the data and attach the labels.\n\nNOTE: There might be some missing or wrong labels in the dataset and we have replaced them with -1.\n", "citation": "@InProceedings{paws2019naacl,\n title = {{PAWS: Paraphrase Adversaries from Word Scrambling}},\n author = {Zhang, Yuan and Baldridge, Jason and He, Luheng},\n booktitle = {Proc. of NAACL},\n year = {2019}\n}\n", "homepage": "https://github.com/google-research-datasets/paws", "license": "The dataset may be freely used for any purpose, although acknowledgement of Google LLC (\"Google\") as the data source would be appreciated. The dataset is provided \"AS IS\" without any warranty, express or implied. Google disclaims all liability for any damages, direct or indirect, resulting from the use of the dataset.", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "sentence1": {"dtype": "string", "id": null, "_type": "Value"}, "sentence2": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["0", "1"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "paws", "config_name": "labeled_swap", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 7963651, "num_examples": 30397, "dataset_name": "paws"}}, "download_checksums": {"https://storage.googleapis.com/paws/english/paws_wiki_labeled_swap.tar.gz": {"num_bytes": 2257283, "checksum": "886ddb2f7f7499b2f64d260956ebbd6e14fc436eadac56cdbb966831b00d7861"}}, "download_size": 2257283, "post_processing_size": null, "dataset_size": 7963651, "size_in_bytes": 10220934}, "unlabeled_final": {"description": "PAWS: Paraphrase Adversaries from Word Scrambling\n\nThis dataset contains 108,463 human-labeled and 656k noisily labeled pairs that feature\nthe importance of modeling structure, context, and word order information for the problem\nof paraphrase identification. The dataset has two subsets, one based on Wikipedia and the\nother one based on the Quora Question Pairs (QQP) dataset.\n\nFor further details, see the accompanying paper: PAWS: Paraphrase Adversaries from Word Scrambling\n(https://arxiv.org/abs/1904.01130)\n\nPAWS-QQP is not available due to license of QQP. It must be reconstructed by downloading the original\ndata and then running our scripts to produce the data and attach the labels.\n\nNOTE: There might be some missing or wrong labels in the dataset and we have replaced them with -1.\n", "citation": "@InProceedings{paws2019naacl,\n title = {{PAWS: Paraphrase Adversaries from Word Scrambling}},\n author = {Zhang, Yuan and Baldridge, Jason and He, Luheng},\n booktitle = {Proc. of NAACL},\n year = {2019}\n}\n", "homepage": "https://github.com/google-research-datasets/paws", "license": "The dataset may be freely used for any purpose, although acknowledgement of Google LLC (\"Google\") as the data source would be appreciated. The dataset is provided \"AS IS\" without any warranty, express or implied. Google disclaims all liability for any damages, direct or indirect, resulting from the use of the dataset.", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "sentence1": {"dtype": "string", "id": null, "_type": "Value"}, "sentence2": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["0", "1"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "paws", "config_name": "unlabeled_final", "version": {"version_str": "1.1.0", "description": "", "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 157806996, "num_examples": 645652, "dataset_name": "paws"}, "validation": {"name": "validation", "num_bytes": 2442173, "num_examples": 10000, "dataset_name": "paws"}}, "download_checksums": {"https://storage.googleapis.com/paws/english/paws_wiki_unlabeled_final.tar.gz": {"num_bytes": 47393331, "checksum": "c70222d390ece5218e397b3ea4b3797212ffe945fe1eae088fa6cb317c2ca3c6"}}, "download_size": 47393331, "post_processing_size": null, "dataset_size": 160249169, "size_in_bytes": 207642500}}
 
 
labeled_final/paws-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97b0c21f80e798b51932fda283b1f4745d80294b3db81412102a42eb782156ba
3
+ size 1235127
labeled_final/paws-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1c54aa3a9f31d471dceb6e5160017dd665104f6574f5e4d239ce648d2de092a
3
+ size 8433883
labeled_final/paws-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:04232fc7a3aff790d4703bb01af76246cf73615fd362affd808a214d4b0f47b0
3
+ size 1230378
labeled_swap/paws-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bd41c70509949ebf770eca13d22284afa6c8a3c9ef4dd79f5bf399e17382971
3
+ size 5741755
paws.py DELETED
@@ -1,209 +0,0 @@
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
- """PAWS, a dataset for paraphrase identification"""
16
-
17
-
18
- import csv
19
-
20
- import datasets
21
-
22
-
23
- _CITATION = """\
24
- @InProceedings{paws2019naacl,
25
- title = {{PAWS: Paraphrase Adversaries from Word Scrambling}},
26
- author = {Zhang, Yuan and Baldridge, Jason and He, Luheng},
27
- booktitle = {Proc. of NAACL},
28
- year = {2019}
29
- }
30
- """
31
-
32
- _DESCRIPTION = """\
33
- PAWS: Paraphrase Adversaries from Word Scrambling
34
-
35
- This dataset contains 108,463 human-labeled and 656k noisily labeled pairs that feature
36
- the importance of modeling structure, context, and word order information for the problem
37
- of paraphrase identification. The dataset has two subsets, one based on Wikipedia and the
38
- other one based on the Quora Question Pairs (QQP) dataset.
39
-
40
- For further details, see the accompanying paper: PAWS: Paraphrase Adversaries from Word Scrambling
41
- (https://arxiv.org/abs/1904.01130)
42
-
43
- PAWS-QQP is not available due to license of QQP. It must be reconstructed by downloading the original
44
- data and then running our scripts to produce the data and attach the labels.
45
-
46
- NOTE: There might be some missing or wrong labels in the dataset and we have replaced them with -1.
47
- """
48
-
49
- _HOMEPAGE = "https://github.com/google-research-datasets/paws"
50
-
51
- _LICENSE = 'The dataset may be freely used for any purpose, although acknowledgement of Google LLC ("Google") as the data source would be appreciated. The dataset is provided "AS IS" without any warranty, express or implied. Google disclaims all liability for any damages, direct or indirect, resulting from the use of the dataset.'
52
-
53
- _DATA_OPTIONS = [
54
- "labeled_final",
55
- "labeled_swap",
56
- "unlabeled_final",
57
- ]
58
-
59
-
60
- class PAWSConfig(datasets.BuilderConfig):
61
- """BuilderConfig for PAWS."""
62
-
63
- def __init__(self, **kwargs):
64
- """Constructs a PAWSConfig.
65
- Args:
66
- **kwargs: keyword arguments forwarded to super.
67
- """
68
- super(PAWSConfig, self).__init__(version=datasets.Version("1.1.0", ""), **kwargs),
69
-
70
-
71
- class PAWS(datasets.GeneratorBasedBuilder):
72
- """PAWS, a dataset for paraphrase identification"""
73
-
74
- VERSION = datasets.Version("1.1.0")
75
-
76
- BUILDER_CONFIGS = [
77
- PAWSConfig(
78
- name=config_name,
79
- description=(f"This config contains samples of {config_name}."),
80
- )
81
- for config_name in _DATA_OPTIONS
82
- ]
83
-
84
- def _info(self):
85
- features = datasets.Features(
86
- {
87
- "id": datasets.Value("int32"),
88
- "sentence1": datasets.Value("string"),
89
- "sentence2": datasets.Value("string"),
90
- "label": datasets.features.ClassLabel(names=["0", "1"]),
91
- }
92
- )
93
- return datasets.DatasetInfo(
94
- # This is the description that will appear on the datasets page.
95
- description=_DESCRIPTION,
96
- # This defines the different columns of the dataset and their types
97
- features=features, # Here we define them above because they are different between the two configurations
98
- # If there's a common (input, target) tuple from the features,
99
- # specify them here. They'll be used if as_supervised=True in
100
- # builder.as_dataset.
101
- supervised_keys=None,
102
- # Homepage of the dataset for documentation
103
- homepage=_HOMEPAGE,
104
- # License for the dataset if available
105
- license=_LICENSE,
106
- # Citation for the dataset
107
- citation=_CITATION,
108
- )
109
-
110
- def _split_generators(self, dl_manager):
111
- """Returns SplitGenerators."""
112
-
113
- _DATA_URL = f"https://storage.googleapis.com/paws/english/paws_wiki_{self.config.name}.tar.gz"
114
- archive = dl_manager.download(_DATA_URL)
115
-
116
- if self.config.name == "labeled_final":
117
- _TRAIN_FILE_NAME = "/".join(["final", "train.tsv"])
118
- _VAL_FILE_NAME = "/".join(["final", "dev.tsv"])
119
- _TEST_FILE_NAME = "/".join(["final", "test.tsv"])
120
- return [
121
- datasets.SplitGenerator(
122
- name=datasets.Split.TRAIN,
123
- # These kwargs will be passed to _generate_examples
124
- gen_kwargs={
125
- "filepath": _TRAIN_FILE_NAME,
126
- "files": dl_manager.iter_archive(archive),
127
- },
128
- ),
129
- datasets.SplitGenerator(
130
- name=datasets.Split.TEST,
131
- # These kwargs will be passed to _generate_examples
132
- gen_kwargs={
133
- "filepath": _TEST_FILE_NAME,
134
- "files": dl_manager.iter_archive(archive),
135
- },
136
- ),
137
- datasets.SplitGenerator(
138
- name=datasets.Split.VALIDATION,
139
- # These kwargs will be passed to _generate_examples
140
- gen_kwargs={
141
- "filepath": _VAL_FILE_NAME,
142
- "files": dl_manager.iter_archive(archive),
143
- },
144
- ),
145
- ]
146
-
147
- elif self.config.name == "labeled_swap":
148
- _TRAIN_FILE_NAME = "/".join(["swap", "train.tsv"])
149
- return [
150
- datasets.SplitGenerator(
151
- name=datasets.Split.TRAIN,
152
- # These kwargs will be passed to _generate_examples
153
- gen_kwargs={
154
- "filepath": _TRAIN_FILE_NAME,
155
- "files": dl_manager.iter_archive(archive),
156
- },
157
- ),
158
- ]
159
-
160
- elif self.config.name == "unlabeled_final":
161
- _TRAIN_FILE_NAME = "/".join(["unlabeled", "final", "train.tsv"])
162
- _VAL_FILE_NAME = "/".join(["unlabeled", "final", "dev.tsv"])
163
- return [
164
- datasets.SplitGenerator(
165
- name=datasets.Split.TRAIN,
166
- # These kwargs will be passed to _generate_examples
167
- gen_kwargs={
168
- "filepath": _TRAIN_FILE_NAME,
169
- "files": dl_manager.iter_archive(archive),
170
- },
171
- ),
172
- datasets.SplitGenerator(
173
- name=datasets.Split.VALIDATION,
174
- # These kwargs will be passed to _generate_examples
175
- gen_kwargs={
176
- "filepath": _VAL_FILE_NAME,
177
- "files": dl_manager.iter_archive(archive),
178
- },
179
- ),
180
- ]
181
- else:
182
- raise NotImplementedError(f"{self.config.name} does not exist")
183
-
184
- def _generate_examples(self, filepath, files):
185
- """Yields examples."""
186
- for path, f in files:
187
- if path == filepath:
188
- lines = (line.decode("utf-8") for line in f)
189
- data = csv.DictReader(lines, delimiter="\t")
190
- for id_, row in enumerate(data):
191
- if self.config.name != "unlabeled_final":
192
- if row["label"] not in ["0", "1"]:
193
- row["label"] = -1
194
- yield id_, {
195
- "id": row["id"],
196
- "sentence1": row["sentence1"],
197
- "sentence2": row["sentence2"],
198
- "label": row["label"],
199
- }
200
- else:
201
- if row["noisy_label"] not in ["0", "1"]:
202
- row["noisy_label"] = -1
203
- yield id_, {
204
- "id": row["id"],
205
- "sentence1": row["sentence1"],
206
- "sentence2": row["sentence2"],
207
- "label": row["noisy_label"],
208
- }
209
- break
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
unlabeled_final/paws-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96f648420cec5622584e1cc8a2d5e41eff7f76f506af4860cc1d16927a8743fa
3
+ size 110988708
unlabeled_final/paws-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5697ef260aa73c9336215dbc74e187ddd36e0e927a967d1ed5f8f23f4e049d28
3
+ size 1655575