Datasets:

Tasks:
Other
Languages:
Polish
Multilinguality:
monolingual
Size Categories:
10K<n<100K
Language Creators:
other
Annotations Creators:
expert-generated
Source Datasets:
original
License:
albertvillanova HF staff commited on
Commit
0a6e4ce
1 Parent(s): bd30a6f

Delete loading script

Browse files
Files changed (1) hide show
  1. cdsc.py +0 -143
cdsc.py DELETED
@@ -1,143 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
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
- """cdsc-e & cdsc-r"""
16
-
17
-
18
- import csv
19
- import os
20
-
21
- import datasets
22
-
23
-
24
- _CITATION = """\
25
- @inproceedings{wroblewska2017polish,
26
- title={Polish evaluation dataset for compositional distributional semantics models},
27
- author={Wr{\'o}blewska, Alina and Krasnowska-Kiera{\'s}, Katarzyna},
28
- booktitle={Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
29
- pages={784--792},
30
- year={2017}
31
- }
32
- """
33
-
34
- _DESCRIPTION = """\
35
- Polish CDSCorpus consists of 10K Polish sentence pairs which are human-annotated for semantic relatedness and entailment. The dataset may be used for the evaluation of compositional distributional semantics models of Polish. The dataset was presented at ACL 2017. Please refer to the Wróblewska and Krasnowska-Kieraś (2017) for a detailed description of the resource.
36
- """
37
-
38
- _HOMEPAGE = "http://zil.ipipan.waw.pl/Scwad/CDSCorpus"
39
-
40
- _LICENSE = "CC BY-NC-SA 4.0"
41
-
42
- _URLs = {
43
- "cdsc-e": "https://klejbenchmark.com/static/data/klej_cdsc-e.zip",
44
- "cdsc-r": "https://klejbenchmark.com/static/data/klej_cdsc-r.zip",
45
- }
46
-
47
-
48
- class Cdsc(datasets.GeneratorBasedBuilder):
49
- """CDSCorpus"""
50
-
51
- VERSION = datasets.Version("1.1.0")
52
-
53
- BUILDER_CONFIGS = [
54
- datasets.BuilderConfig(
55
- name="cdsc-e",
56
- version=VERSION,
57
- description="Polish CDSCorpus consists of 10K Polish sentence pairs which are human-annotated for semantic entailment.",
58
- ),
59
- datasets.BuilderConfig(
60
- name="cdsc-r",
61
- version=VERSION,
62
- description="Polish CDSCorpus consists of 10K Polish sentence pairs which are human-annotated for semantic relatedness.",
63
- ),
64
- ]
65
-
66
- def _info(self):
67
- if self.config.name == "cdsc-e":
68
- features = datasets.Features(
69
- {
70
- "pair_ID": datasets.Value("int32"),
71
- "sentence_A": datasets.Value("string"),
72
- "sentence_B": datasets.Value("string"),
73
- "entailment_judgment": datasets.ClassLabel(
74
- names=[
75
- "NEUTRAL",
76
- "CONTRADICTION",
77
- "ENTAILMENT",
78
- ]
79
- ),
80
- }
81
- )
82
- elif self.config.name == "cdsc-r":
83
- features = datasets.Features(
84
- {
85
- "pair_ID": datasets.Value("int32"),
86
- "sentence_A": datasets.Value("string"),
87
- "sentence_B": datasets.Value("string"),
88
- "relatedness_score": datasets.Value("float"),
89
- }
90
- )
91
- return datasets.DatasetInfo(
92
- description=_DESCRIPTION,
93
- features=features,
94
- supervised_keys=None,
95
- homepage=_HOMEPAGE,
96
- license=_LICENSE,
97
- citation=_CITATION,
98
- )
99
-
100
- def _split_generators(self, dl_manager):
101
- """Returns SplitGenerators."""
102
- my_urls = _URLs[self.config.name]
103
- data_dir = dl_manager.download_and_extract(my_urls)
104
- return [
105
- datasets.SplitGenerator(
106
- name=datasets.Split.TRAIN,
107
- gen_kwargs={
108
- "filepath": os.path.join(data_dir, "train.tsv"),
109
- "split": "train",
110
- },
111
- ),
112
- datasets.SplitGenerator(
113
- name=datasets.Split.TEST,
114
- gen_kwargs={"filepath": os.path.join(data_dir, "test_features.tsv"), "split": "test"},
115
- ),
116
- datasets.SplitGenerator(
117
- name=datasets.Split.VALIDATION,
118
- gen_kwargs={
119
- "filepath": os.path.join(data_dir, "dev.tsv"),
120
- "split": "dev",
121
- },
122
- ),
123
- ]
124
-
125
- def _generate_examples(self, filepath, split):
126
- """Yields examples."""
127
- with open(filepath, encoding="utf-8") as f:
128
- reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
129
- for id_, row in enumerate(reader):
130
- if self.config.name == "cdsc-e":
131
- yield id_, {
132
- "pair_ID": row["pair_ID"],
133
- "sentence_A": row["sentence_A"],
134
- "sentence_B": row["sentence_B"],
135
- "entailment_judgment": -1 if split == "test" else row["entailment_judgment"],
136
- }
137
- elif self.config.name == "cdsc-r":
138
- yield id_, {
139
- "pair_ID": row["pair_ID"],
140
- "sentence_A": row["sentence_A"],
141
- "sentence_B": row["sentence_B"],
142
- "relatedness_score": "-1" if split == "test" else row["relatedness_score"],
143
- }