Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:
system HF staff commited on
Commit
50e78e1
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
anli.py ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """The Adversarial NLI Corpus."""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import json
22
+ import os
23
+
24
+ import datasets
25
+
26
+
27
+ _CITATION = """\
28
+ @InProceedings{nie2019adversarial,
29
+ title={Adversarial NLI: A New Benchmark for Natural Language Understanding},
30
+ author={Nie, Yixin
31
+ and Williams, Adina
32
+ and Dinan, Emily
33
+ and Bansal, Mohit
34
+ and Weston, Jason
35
+ and Kiela, Douwe},
36
+ booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",
37
+ year = "2020",
38
+ publisher = "Association for Computational Linguistics",
39
+ }
40
+ """
41
+
42
+ _DESCRIPTION = """\
43
+ The Adversarial Natural Language Inference (ANLI) is a new large-scale NLI benchmark dataset,
44
+ The dataset is collected via an iterative, adversarial human-and-model-in-the-loop procedure.
45
+ ANLI is much more difficult than its predecessors including SNLI and MNLI.
46
+ It contains three rounds. Each round has train/dev/test splits.
47
+ """
48
+
49
+ stdnli_label = {
50
+ "e": "entailment",
51
+ "n": "neutral",
52
+ "c": "contradiction",
53
+ }
54
+
55
+
56
+ class ANLIConfig(datasets.BuilderConfig):
57
+ """BuilderConfig for ANLI."""
58
+
59
+ def __init__(self, **kwargs):
60
+ """BuilderConfig for ANLI.
61
+
62
+ Args:
63
+ .
64
+ **kwargs: keyword arguments forwarded to super.
65
+ """
66
+ super(ANLIConfig, self).__init__(version=datasets.Version("0.1.0", ""), **kwargs)
67
+
68
+
69
+ class ANLI(datasets.GeneratorBasedBuilder):
70
+ """ANLI: The ANLI Dataset."""
71
+
72
+ BUILDER_CONFIGS = [
73
+ ANLIConfig(
74
+ name="plain_text",
75
+ description="Plain text",
76
+ ),
77
+ ]
78
+
79
+ def _info(self):
80
+ return datasets.DatasetInfo(
81
+ description=_DESCRIPTION,
82
+ features=datasets.Features(
83
+ {
84
+ "uid": datasets.Value("string"),
85
+ "premise": datasets.Value("string"),
86
+ "hypothesis": datasets.Value("string"),
87
+ "label": datasets.features.ClassLabel(names=["entailment", "neutral", "contradiction"]),
88
+ "reason": datasets.Value("string"),
89
+ }
90
+ ),
91
+ # No default supervised_keys (as we have to pass both premise
92
+ # and hypothesis as input).
93
+ supervised_keys=None,
94
+ homepage="https://github.com/facebookresearch/anli/",
95
+ citation=_CITATION,
96
+ )
97
+
98
+ def _vocab_text_gen(self, filepath):
99
+ for _, ex in self._generate_examples(filepath):
100
+ yield " ".join([ex["premise"], ex["hypothesis"]])
101
+
102
+ def _split_generators(self, dl_manager):
103
+
104
+ downloaded_dir = dl_manager.download_and_extract("https://dl.fbaipublicfiles.com/anli/anli_v0.1.zip")
105
+
106
+ anli_path = os.path.join(downloaded_dir, "anli_v0.1")
107
+
108
+ path_dict = dict()
109
+ for round_tag in ["R1", "R2", "R3"]:
110
+ path_dict[round_tag] = dict()
111
+ for split_name in ["train", "dev", "test"]:
112
+ path_dict[round_tag][split_name] = os.path.join(anli_path, round_tag, f"{split_name}.jsonl")
113
+
114
+ return [
115
+ # Round 1
116
+ datasets.SplitGenerator(name="train_r1", gen_kwargs={"filepath": path_dict["R1"]["train"]}),
117
+ datasets.SplitGenerator(name="dev_r1", gen_kwargs={"filepath": path_dict["R1"]["dev"]}),
118
+ datasets.SplitGenerator(name="test_r1", gen_kwargs={"filepath": path_dict["R1"]["test"]}),
119
+ # Round 2
120
+ datasets.SplitGenerator(name="train_r2", gen_kwargs={"filepath": path_dict["R2"]["train"]}),
121
+ datasets.SplitGenerator(name="dev_r2", gen_kwargs={"filepath": path_dict["R2"]["dev"]}),
122
+ datasets.SplitGenerator(name="test_r2", gen_kwargs={"filepath": path_dict["R2"]["test"]}),
123
+ # Round 3
124
+ datasets.SplitGenerator(name="train_r3", gen_kwargs={"filepath": path_dict["R3"]["train"]}),
125
+ datasets.SplitGenerator(name="dev_r3", gen_kwargs={"filepath": path_dict["R3"]["dev"]}),
126
+ datasets.SplitGenerator(name="test_r3", gen_kwargs={"filepath": path_dict["R3"]["test"]}),
127
+ ]
128
+
129
+ def _generate_examples(self, filepath):
130
+ """Generate mnli examples.
131
+
132
+ Args:
133
+ filepath: a string
134
+
135
+ Yields:
136
+ dictionaries containing "premise", "hypothesis" and "label" strings
137
+ """
138
+ for idx, line in enumerate(open(filepath, "rb")):
139
+ if line is not None:
140
+ line = line.strip().decode("utf-8")
141
+ item = json.loads(line)
142
+
143
+ reason_text = ""
144
+ if "reason" in item:
145
+ reason_text = item["reason"]
146
+
147
+ yield item["uid"], {
148
+ "uid": item["uid"],
149
+ "premise": item["context"],
150
+ "hypothesis": item["hypothesis"],
151
+ "label": stdnli_label[item["label"]],
152
+ "reason": reason_text,
153
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"plain_text": {"description": "The Adversarial Natural Language Inference (ANLI) is a new large-scale NLI benchmark dataset, \nThe dataset is collected via an iterative, adversarial human-and-model-in-the-loop procedure.\nANLI is much more difficult than its predecessors including SNLI and MNLI.\nIt contains three rounds. Each round has train/dev/test splits.\n", "citation": "@InProceedings{nie2019adversarial,\n title={Adversarial NLI: A New Benchmark for Natural Language Understanding},\n author={Nie, Yixin \n and Williams, Adina \n and Dinan, Emily \n and Bansal, Mohit \n and Weston, Jason \n and Kiela, Douwe},\n booktitle = \"Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics\",\n year = \"2020\",\n publisher = \"Association for Computational Linguistics\",\n}\n", "homepage": "https://github.com/facebookresearch/anli/", "license": "", "features": {"uid": {"dtype": "string", "id": null, "_type": "Value"}, "premise": {"dtype": "string", "id": null, "_type": "Value"}, "hypothesis": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 3, "names": ["entailment", "neutral", "contradiction"], "names_file": null, "id": null, "_type": "ClassLabel"}, "reason": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "anli", "config_name": "plain_text", "version": {"version_str": "0.1.0", "description": "", "datasets_version_to_prepare": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"train_r1": {"name": "train_r1", "num_bytes": 8006920, "num_examples": 16946, "dataset_name": "anli"}, "dev_r1": {"name": "dev_r1", "num_bytes": 573444, "num_examples": 1000, "dataset_name": "anli"}, "test_r1": {"name": "test_r1", "num_bytes": 574933, "num_examples": 1000, "dataset_name": "anli"}, "train_r2": {"name": "train_r2", "num_bytes": 20801661, "num_examples": 45460, "dataset_name": "anli"}, "dev_r2": {"name": "dev_r2", "num_bytes": 556082, "num_examples": 1000, "dataset_name": "anli"}, "test_r2": {"name": "test_r2", "num_bytes": 572655, "num_examples": 1000, "dataset_name": "anli"}, "train_r3": {"name": "train_r3", "num_bytes": 44720895, "num_examples": 100459, "dataset_name": "anli"}, "dev_r3": {"name": "dev_r3", "num_bytes": 663164, "num_examples": 1200, "dataset_name": "anli"}, "test_r3": {"name": "test_r3", "num_bytes": 657602, "num_examples": 1200, "dataset_name": "anli"}}, "download_checksums": {"https://dl.fbaipublicfiles.com/anli/anli_v0.1.zip": {"num_bytes": 18621352, "checksum": "16ac929a7e90ecf9093deaec89cc81fe86a379265a5320a150028efe50c5cde8"}}, "download_size": 18621352, "dataset_size": 77127356, "size_in_bytes": 95748708}}
dummy/plain_text/0.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b5dc1754820aea5a610e12a5e0a0ebb6a6030d024a1daf974d8c875838fd8d4
3
+ size 18710394