system HF staff commited on
Commit
88d89a0
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.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
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"plain_text": {"description": "XNLI is a subset of a few thousand examples from MNLI which has been translated\ninto a 14 different languages (some low-ish resource). As with MNLI, the goal is\nto predict textual entailment (does sentence A imply/contradict/neither sentence\nB) and is a classification task (given two sentences, predict one of three\nlabels).\n", "citation": "@InProceedings{conneau2018xnli,\n author = \"Conneau, Alexis\n and Rinott, Ruty\n and Lample, Guillaume\n and Williams, Adina\n and Bowman, Samuel R.\n and Schwenk, Holger\n and Stoyanov, Veselin\",\n title = \"XNLI: Evaluating Cross-lingual Sentence Representations\",\n booktitle = \"Proceedings of the 2018 Conference on Empirical Methods\n in Natural Language Processing\",\n year = \"2018\",\n publisher = \"Association for Computational Linguistics\",\n location = \"Brussels, Belgium\",\n}", "homepage": "https://www.nyu.edu/projects/bowman/xnli/", "license": "", "features": {"premise": {"languages": ["ar", "bg", "de", "el", "en", "es", "fr", "hi", "ru", "sw", "th", "tr", "ur", "vi", "zh"], "id": null, "_type": "Translation"}, "hypothesis": {"languages": ["ar", "bg", "de", "el", "en", "es", "fr", "hi", "ru", "sw", "th", "tr", "ur", "vi", "zh"], "num_languages": 15, "id": null, "_type": "TranslationVariableLanguages"}, "label": {"num_classes": 3, "names": ["entailment", "neutral", "contradiction"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "supervised_keys": null, "builder_name": "xnli", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 19419463, "num_examples": 5010, "dataset_name": "xnli"}, "validation": {"name": "validation", "num_bytes": 9582145, "num_examples": 2490, "dataset_name": "xnli"}}, "download_checksums": {"https://www.nyu.edu/projects/bowman/xnli/XNLI-1.0.zip": {"num_bytes": 17865352, "checksum": "4ba1d5e1afdb7161f0f23c66dc787802ccfa8a25a3ddd3b165a35e50df346ab1"}}, "download_size": 17865352, "dataset_size": 29001608, "size_in_bytes": 46866960}}
dummy/plain_text/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:087e5fb69a4751ad440cfac64e14928dd0ada6afe3d1ec2caaaaf2128b00da6b
3
+ size 6032
xnli.py ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """XNLI: The Cross-Lingual NLI Corpus."""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import collections
22
+ import csv
23
+ import os
24
+
25
+ import six
26
+
27
+ import datasets
28
+
29
+
30
+ _CITATION = """\
31
+ @InProceedings{conneau2018xnli,
32
+ author = {Conneau, Alexis
33
+ and Rinott, Ruty
34
+ and Lample, Guillaume
35
+ and Williams, Adina
36
+ and Bowman, Samuel R.
37
+ and Schwenk, Holger
38
+ and Stoyanov, Veselin},
39
+ title = {XNLI: Evaluating Cross-lingual Sentence Representations},
40
+ booktitle = {Proceedings of the 2018 Conference on Empirical Methods
41
+ in Natural Language Processing},
42
+ year = {2018},
43
+ publisher = {Association for Computational Linguistics},
44
+ location = {Brussels, Belgium},
45
+ }"""
46
+
47
+ _DESCRIPTION = """\
48
+ XNLI is a subset of a few thousand examples from MNLI which has been translated
49
+ into a 14 different languages (some low-ish resource). As with MNLI, the goal is
50
+ to predict textual entailment (does sentence A imply/contradict/neither sentence
51
+ B) and is a classification task (given two sentences, predict one of three
52
+ labels).
53
+ """
54
+
55
+ _DATA_URL = "https://www.nyu.edu/projects/bowman/xnli/XNLI-1.0.zip"
56
+
57
+ _LANGUAGES = ("ar", "bg", "de", "el", "en", "es", "fr", "hi", "ru", "sw", "th", "tr", "ur", "vi", "zh")
58
+
59
+
60
+ class Xnli(datasets.GeneratorBasedBuilder):
61
+ """XNLI: The Cross-Lingual NLI Corpus. Version 1.0."""
62
+
63
+ BUILDER_CONFIGS = [
64
+ datasets.BuilderConfig(
65
+ name="plain_text",
66
+ version=datasets.Version("1.0.0", ""),
67
+ description="Plain text import of XNLI",
68
+ )
69
+ ]
70
+
71
+ def _info(self):
72
+ return datasets.DatasetInfo(
73
+ description=_DESCRIPTION,
74
+ features=datasets.Features(
75
+ {
76
+ "premise": datasets.features.Translation(
77
+ languages=_LANGUAGES,
78
+ ),
79
+ "hypothesis": datasets.features.TranslationVariableLanguages(
80
+ languages=_LANGUAGES,
81
+ ),
82
+ "label": datasets.features.ClassLabel(names=["entailment", "neutral", "contradiction"]),
83
+ }
84
+ ),
85
+ # No default supervised_keys (as we have to pass both premise
86
+ # and hypothesis as input).
87
+ supervised_keys=None,
88
+ homepage="https://www.nyu.edu/projects/bowman/xnli/",
89
+ citation=_CITATION,
90
+ )
91
+
92
+ def _split_generators(self, dl_manager):
93
+ dl_dir = dl_manager.download_and_extract(_DATA_URL)
94
+ data_dir = os.path.join(dl_dir, "XNLI-1.0")
95
+ return [
96
+ datasets.SplitGenerator(
97
+ name=datasets.Split.TEST, gen_kwargs={"filepath": os.path.join(data_dir, "xnli.test.tsv")}
98
+ ),
99
+ datasets.SplitGenerator(
100
+ name=datasets.Split.VALIDATION, gen_kwargs={"filepath": os.path.join(data_dir, "xnli.dev.tsv")}
101
+ ),
102
+ ]
103
+
104
+ def _generate_examples(self, filepath):
105
+ """This function returns the examples in the raw (text) form."""
106
+ rows_per_pair_id = collections.defaultdict(list)
107
+
108
+ with open(filepath, encoding="utf-8") as f:
109
+ reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
110
+ for row in reader:
111
+ rows_per_pair_id[row["pairID"]].append(row)
112
+
113
+ for rows in six.itervalues(rows_per_pair_id):
114
+ premise = {row["language"]: row["sentence1"] for row in rows}
115
+ hypothesis = {row["language"]: row["sentence2"] for row in rows}
116
+ yield rows[0]["pairID"], {
117
+ "premise": premise,
118
+ "hypothesis": hypothesis,
119
+ "label": rows[0]["gold_label"],
120
+ }