Datasets:
Download pair_classification.py from ks-pf/JMTEB-fixed: direct link, hf CLI and curl.
- Browser
- Download file 2.78 kB
-
https://huggingface.co/datasets/ks-pf/JMTEB-fixed/resolve/main/pair_classification.py
- Command line
-
hf download hf://datasets/ks-pf/JMTEB-fixed/pair_classification.py
-
curl -L -o pair_classification.py https://huggingface.co/datasets/ks-pf/JMTEB-fixed/resolve/main/pair_classification.py
2.78 kB
| from __future__ import annotations | |
| from dataclasses import dataclass | |
| import datasets | |
| class PAWSXJaHelper: | |
| 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} | |
| } | |
| @InProceedings{pawsx2019emnlp, | |
| title = {{PAWS-X: A Cross-lingual Adversarial Dataset for Paraphrase Identification}}, | |
| author = {Yang, Yinfei and Zhang, Yuan and Tar, Chris and Baldridge, Jason}, | |
| booktitle = {Proc. of EMNLP}, | |
| year = {2019} | |
| } | |
| """ | |
| DESCRIPTION = """\ | |
| PAWS-X: A Cross-lingual Adversarial Dataset for Paraphrase Identification | |
| This dataset contains 23,659 human translated PAWS evaluation pairs and 296,406 machine translated training pairs in six typologically distinct languages: French, Spanish, German, Chinese, Japanese, and Korean. All translated pairs are sourced from examples in PAWS-Wiki. | |
| This is the Japanese part of the original multilingual dataset. | |
| """ | |
| HOMEPAGE_URL = "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. | |
| """ | |
| VERSION = "1.0.0" | |
| def split_generator() -> list[datasets.SplitGenerator]: | |
| dataset = datasets.load_dataset("paws-x", "ja", trust_remote_code=True) | |
| return [ | |
| datasets.SplitGenerator( | |
| name=datasets.Split.TRAIN, | |
| gen_kwargs={"data": dataset["train"]}, | |
| ), | |
| datasets.SplitGenerator( | |
| name=datasets.Split.VALIDATION, | |
| gen_kwargs={"data": dataset["validation"]}, | |
| ), | |
| datasets.SplitGenerator( | |
| name=datasets.Split.TEST, | |
| gen_kwargs={"data": dataset["test"]}, | |
| ), | |
| ] | |
| class PAWSXJaConfig(datasets.BuilderConfig): | |
| def __init__( | |
| self, | |
| name: str = "paws_x_ja", | |
| version: datasets.Version | str | None = datasets.Version("1.0.0"), | |
| data_dir: str | None = None, | |
| data_files: datasets.data_files.DataFilesDict | None = None, | |
| description: str | None = PAWSXJaHelper.DESCRIPTION, | |
| ): | |
| super().__init__( | |
| name=name, | |
| version=version, | |
| data_dir=data_dir, | |
| data_files=data_files, | |
| description=description, | |
| ) | |