Commit ·
161ece9
1
Parent(s): cd6b868
Convert dataset to Parquet (#3)
Browse files- Convert dataset to Parquet (32e8ab15f0df7139ae5b8a87eded08f8ceedf11b)
- Add labeled_swap data files (6ddde35e8a87929d9536cd1463a579a44503e96a)
- Add unlabeled_final data files (06b62eae81864f3d8d9d9d7cc3a8130e542b5cc8)
- Delete loading script (638290f20b38fac4b9c3ef63d57fd053b3b4868c)
- Delete legacy dataset_infos.json (1e90e82ecadb712857d299abefce8df34387aaee)
Files changed (9)
- README.md+35-16
- dataset_infos.jsonDeleted-1
- labeled_final/test-00000-of-00001.parquetAdded+3
- labeled_final/train-00000-of-00001.parquetAdded+3
- labeled_final/validation-00000-of-00001.parquetAdded+3
- labeled_swap/train-00000-of-00001.parquetAdded+3
- paws.pyDeleted-209
- unlabeled_final/train-00000-of-00001.parquetAdded+3
- unlabeled_final/validation-00000-of-00001.parquetAdded+3
23 unmodified lines24252627282913 unmodified lines4344454647484950515253545556575810 unmodified lines6970717273747576777810 unmodified lines899091929394959697989910010110210310410523 unmodified lines- multi-input-text-classificationpaperswithcode_id: pawspretty_name: 'PAWS: Paraphrase Adversaries from Word Scrambling'tags:- paraphrase-identificationdataset_info:13 unmodified lines'1': '1'splits:- name: trainnum_bytes: 12239978num_examples: 49401- name: testnum_bytes: 1987802num_examples: 8000- name: validationnum_bytes: 1975870num_examples: 8000download_size: 4687157dataset_size: 16203650- config_name: labeled_swapfeatures:- name: id10 unmodified lines'1': '1'splits:- name: trainnum_bytes: 7963651num_examples: 30397download_size: 2257283dataset_size: 7963651- config_name: unlabeled_finalfeatures:- name: id10 unmodified lines'1': '1'splits:- name: trainnum_bytes: 157806996num_examples: 645652- name: validationnum_bytes: 2442173num_examples: 10000download_size: 47393331dataset_size: 160249169config_names:- labeled_final- labeled_swap- unlabeled_final---# Dataset Card for PAWS: Paraphrase Adversaries from Word Scrambling23 unmodified lines2425262728293031323313 unmodified lines4748495051525354555657585960616210 unmodified lines7374757677787980818210 unmodified lines9394959697989910010110210310410510610710810911011111211311411511611711811912012112212312423 unmodified lines- multi-input-text-classificationpaperswithcode_id: pawspretty_name: 'PAWS: Paraphrase Adversaries from Word Scrambling'config_names:- labeled_final- labeled_swap- unlabeled_finaltags:- paraphrase-identificationdataset_info:13 unmodified lines'1': '1'splits:- name: trainnum_bytes: 12239938num_examples: 49401- name: testnum_bytes: 1987794num_examples: 8000- name: validationnum_bytes: 1975862num_examples: 8000download_size: 10899391dataset_size: 16203594- config_name: labeled_swapfeatures:- name: id10 unmodified lines'1': '1'splits:- name: trainnum_bytes: 7963619num_examples: 30397download_size: 5741756dataset_size: 7963619- config_name: unlabeled_finalfeatures:- name: id10 unmodified lines'1': '1'splits:- name: trainnum_bytes: 157806476num_examples: 645652- name: validationnum_bytes: 2442165num_examples: 10000download_size: 112644285dataset_size: 160248641configs:- config_name: labeled_finaldata_files:- split: trainpath: labeled_final/train-*- split: testpath: labeled_final/test-*- split: validationpath: labeled_final/validation-*- config_name: labeled_swapdata_files:- split: trainpath: labeled_swap/train-*- config_name: unlabeled_finaldata_files:- split: trainpath: unlabeled_final/train-*- split: validationpath: unlabeled_final/validation-*---# Dataset Card for PAWS: Paraphrase Adversaries from Word Scrambling
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}}123version https://git-lfs.github.com/spec/v1oid sha256:ae342ff12bb84b84b95f468abf5db6cb7c7bd578271299fe9c99be75b8132f4dsize 1235128123version https://git-lfs.github.com/spec/v1oid sha256:8dc9ad3e5f30ad9a86b290fe236d528ef23a5751fec9a35d99cbacf68ba277cfsize 8433884123version https://git-lfs.github.com/spec/v1oid sha256:7760d829453764ba342a6f562809a8ed21c2c3eec3fd9ffa544089f145d42f6dsize 1230379123version https://git-lfs.github.com/spec/v1oid sha256:21b9b68cd9398f01e6c766a9b12bc9a31cee11a6170a5acc5fa87ba853033a9bsize 5741756123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209# coding=utf-8# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License."""PAWS, a dataset for paraphrase identification"""
import csv
import datasets
_CITATION = """\@InProceedings{paws2019naacl, title = {{PAWS: Paraphrase Adversaries from Word Scrambling}}, author = {Zhang, Yuan and Baldridge, Jason and He, Luheng}, booktitle = {Proc. of NAACL}, year = {2019}}"""
_DESCRIPTION = """\PAWS: Paraphrase Adversaries from Word Scrambling
This dataset contains 108,463 human-labeled and 656k noisily labeled pairs that featurethe importance of modeling structure, context, and word order information for the problemof paraphrase identification. The dataset has two subsets, one based on Wikipedia and theother one based on the Quora Question Pairs (QQP) dataset.
For further details, see the accompanying paper: PAWS: Paraphrase Adversaries from Word Scrambling(https://arxiv.org/abs/1904.01130)
PAWS-QQP is not available due to license of QQP. It must be reconstructed by downloading the originaldata and then running our scripts to produce the data and attach the labels.
NOTE: There might be some missing or wrong labels in the dataset and we have replaced them with -1."""
_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.'
_DATA_OPTIONS = [ "labeled_final", "labeled_swap", "unlabeled_final",]
class PAWSConfig(datasets.BuilderConfig): """BuilderConfig for PAWS."""
def __init__(self, **kwargs): """Constructs a PAWSConfig. Args: **kwargs: keyword arguments forwarded to super. """ super(PAWSConfig, self).__init__(version=datasets.Version("1.1.0", ""), **kwargs),
class PAWS(datasets.GeneratorBasedBuilder): """PAWS, a dataset for paraphrase identification"""
VERSION = datasets.Version("1.1.0")
BUILDER_CONFIGS = [ PAWSConfig( name=config_name, description=(f"This config contains samples of {config_name}."), ) for config_name in _DATA_OPTIONS ]
def _info(self): features = datasets.Features( { "id": datasets.Value("int32"), "sentence1": datasets.Value("string"), "sentence2": datasets.Value("string"), "label": datasets.features.ClassLabel(names=["0", "1"]), } ) return datasets.DatasetInfo( # This is the description that will appear on the datasets page. description=_DESCRIPTION, # This defines the different columns of the dataset and their types features=features, # Here we define them above because they are different between the two configurations # If there's a common (input, target) tuple from the features, # specify them here. They'll be used if as_supervised=True in # builder.as_dataset. supervised_keys=None, # Homepage of the dataset for documentation homepage=_HOMEPAGE, # License for the dataset if available license=_LICENSE, # Citation for the dataset citation=_CITATION, )
def _split_generators(self, dl_manager): """Returns SplitGenerators."""
_DATA_URL = f"https://storage.googleapis.com/paws/english/paws_wiki_{self.config.name}.tar.gz" archive = dl_manager.download(_DATA_URL)
if self.config.name == "labeled_final": _TRAIN_FILE_NAME = "/".join(["final", "train.tsv"]) _VAL_FILE_NAME = "/".join(["final", "dev.tsv"]) _TEST_FILE_NAME = "/".join(["final", "test.tsv"]) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": _TRAIN_FILE_NAME, "files": dl_manager.iter_archive(archive), }, ), datasets.SplitGenerator( name=datasets.Split.TEST, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": _TEST_FILE_NAME, "files": dl_manager.iter_archive(archive), }, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": _VAL_FILE_NAME, "files": dl_manager.iter_archive(archive), }, ), ]
elif self.config.name == "labeled_swap": _TRAIN_FILE_NAME = "/".join(["swap", "train.tsv"]) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": _TRAIN_FILE_NAME, "files": dl_manager.iter_archive(archive), }, ), ]
elif self.config.name == "unlabeled_final": _TRAIN_FILE_NAME = "/".join(["unlabeled", "final", "train.tsv"]) _VAL_FILE_NAME = "/".join(["unlabeled", "final", "dev.tsv"]) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": _TRAIN_FILE_NAME, "files": dl_manager.iter_archive(archive), }, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": _VAL_FILE_NAME, "files": dl_manager.iter_archive(archive), }, ), ] else: raise NotImplementedError(f"{self.config.name} does not exist")
def _generate_examples(self, filepath, files): """Yields examples.""" for path, f in files: if path == filepath: lines = (line.decode("utf-8") for line in f) data = csv.DictReader(lines, delimiter="\t") for id_, row in enumerate(data): if self.config.name != "unlabeled_final": if row["label"] not in ["0", "1"]: row["label"] = -1 yield id_, { "id": row["id"], "sentence1": row["sentence1"], "sentence2": row["sentence2"], "label": row["label"], } else: if row["noisy_label"] not in ["0", "1"]: row["noisy_label"] = -1 yield id_, { "id": row["id"], "sentence1": row["sentence1"], "sentence2": row["sentence2"], "label": row["noisy_label"], } break123version https://git-lfs.github.com/spec/v1oid sha256:c9724b30b187e8e2a6a4372cdefbeead1504d8645cdf0e1886c36b5ba3a68918size 110988709123version https://git-lfs.github.com/spec/v1oid sha256:438720a7c059d2be528953c6a32f8542098aea02c6697460fc7b2d52c124a798size 1655576README.md+35-16
dataset_infos.jsonDeleted-1
labeled_final/test-00000-of-00001.parquetAdded+3
labeled_final/train-00000-of-00001.parquetAdded+3
labeled_final/validation-00000-of-00001.parquetAdded+3
labeled_swap/train-00000-of-00001.parquetAdded+3
paws.pyDeleted-209
unlabeled_final/train-00000-of-00001.parquetAdded+3
unlabeled_final/validation-00000-of-00001.parquetAdded+3