Datasets:
ju-resplande
commited on
Commit
·
5647b49
1
Parent(s):
80bbd2f
Upload plue.py
Browse files
plue.py
CHANGED
@@ -52,13 +52,14 @@ PLUE: Portuguese Language Understanding Evaluationis a Portuguese translation of
|
|
52 |
the GLUE benchmark and Scitail using OPUS-MT model and Google Cloud Translation.
|
53 |
"""
|
54 |
|
55 |
-
MNLI_URL = "https://github.com/
|
|
|
56 |
|
57 |
_MNLI_BASE_KWARGS = dict(
|
58 |
text_features={"premise": "sentence1", "hypothesis": "sentence2",},
|
59 |
label_classes=["entailment", "neutral", "contradiction"],
|
60 |
label_column="gold_label",
|
61 |
-
data_dir="
|
62 |
citation=textwrap.dedent(
|
63 |
"""\
|
64 |
@InProceedings{N18-1101,
|
@@ -123,12 +124,14 @@ class PlueConfig(datasets.BuilderConfig):
|
|
123 |
**kwargs: keyword arguments forwarded to super.
|
124 |
"""
|
125 |
super(PlueConfig, self).__init__(
|
126 |
-
version=datasets.Version("1.0.
|
127 |
)
|
128 |
self.text_features = text_features
|
129 |
self.label_column = label_column
|
130 |
self.label_classes = label_classes
|
131 |
-
self.data_url =
|
|
|
|
|
132 |
self.data_dir = data_dir
|
133 |
self.citation = citation
|
134 |
self.url = url
|
@@ -259,6 +262,33 @@ class Plue(datasets.GeneratorBasedBuilder):
|
|
259 |
url="http://ixa2.si.ehu.es/stswiki/index.php/STSbenchmark",
|
260 |
process_label=np.float32,
|
261 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
PlueConfig(
|
263 |
name="mnli",
|
264 |
description=textwrap.dedent(
|
@@ -454,7 +484,13 @@ with neutral label"""
|
|
454 |
)
|
455 |
|
456 |
def _split_generators(self, dl_manager):
|
457 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
dl_dir = dl_manager.download_and_extract(data_url)
|
459 |
data_dir = os.path.join(dl_dir, self.config.data_dir)
|
460 |
|
|
|
52 |
the GLUE benchmark and Scitail using OPUS-MT model and Google Cloud Translation.
|
53 |
"""
|
54 |
|
55 |
+
MNLI_URL = "https://github.com/ju-resplande/PLUE/releases/download/v1.0.0/MNLI.zip"
|
56 |
+
SNLI_URL = "https://github.com/ju-resplande/PLUE/releases/download/v1.0.0/SNLI.zip"
|
57 |
|
58 |
_MNLI_BASE_KWARGS = dict(
|
59 |
text_features={"premise": "sentence1", "hypothesis": "sentence2",},
|
60 |
label_classes=["entailment", "neutral", "contradiction"],
|
61 |
label_column="gold_label",
|
62 |
+
data_dir="MNLI",
|
63 |
citation=textwrap.dedent(
|
64 |
"""\
|
65 |
@InProceedings{N18-1101,
|
|
|
124 |
**kwargs: keyword arguments forwarded to super.
|
125 |
"""
|
126 |
super(PlueConfig, self).__init__(
|
127 |
+
version=datasets.Version("1.0.2", ""), **kwargs
|
128 |
)
|
129 |
self.text_features = text_features
|
130 |
self.label_column = label_column
|
131 |
self.label_classes = label_classes
|
132 |
+
self.data_url = (
|
133 |
+
"https://github.com/ju-resplande/PLUE/archive/refs/tags/v1.0.1.zip"
|
134 |
+
)
|
135 |
self.data_dir = data_dir
|
136 |
self.citation = citation
|
137 |
self.url = url
|
|
|
262 |
url="http://ixa2.si.ehu.es/stswiki/index.php/STSbenchmark",
|
263 |
process_label=np.float32,
|
264 |
),
|
265 |
+
PlueConfig(
|
266 |
+
name="snli",
|
267 |
+
description=textwrap.dedent(
|
268 |
+
"""\
|
269 |
+
The SNLI corpus (version 1.0) is a collection of 570k human-written English
|
270 |
+
sentence pairs manually labeled for balanced classification with the labels
|
271 |
+
entailment, contradiction, and neutral, supporting the task of natural language
|
272 |
+
inference (NLI), also known as recognizing textual entailment (RTE).
|
273 |
+
"""
|
274 |
+
),
|
275 |
+
text_features={"premise": "sentence1", "hypothesis": "sentence2",},
|
276 |
+
label_classes=["entailment", "neutral", "contradiction"],
|
277 |
+
label_column="gold_label",
|
278 |
+
data_dir="SNLI",
|
279 |
+
citation=textwrap.dedent(
|
280 |
+
"""\
|
281 |
+
@inproceedings{snli:emnlp2015,
|
282 |
+
Author = {Bowman, Samuel R. and Angeli, Gabor and Potts, Christopher, and Manning, Christopher D.},
|
283 |
+
Booktitle = {Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
|
284 |
+
Publisher = {Association for Computational Linguistics},
|
285 |
+
Title = {A large annotated corpus for learning natural language inference},
|
286 |
+
Year = {2015}
|
287 |
+
}
|
288 |
+
"""
|
289 |
+
),
|
290 |
+
url="https://nlp.stanford.edu/projects/snli/",
|
291 |
+
),
|
292 |
PlueConfig(
|
293 |
name="mnli",
|
294 |
description=textwrap.dedent(
|
|
|
484 |
)
|
485 |
|
486 |
def _split_generators(self, dl_manager):
|
487 |
+
if self.config.name == "mnli":
|
488 |
+
data_url = MNLI_URL
|
489 |
+
elif self.config.name == "snli":
|
490 |
+
data_url = SNLI_URL
|
491 |
+
else:
|
492 |
+
data_url = self.config.data_url
|
493 |
+
|
494 |
dl_dir = dl_manager.download_and_extract(data_url)
|
495 |
data_dir = os.path.join(dl_dir, self.config.data_dir)
|
496 |
|