Datasets:
Tasks:
Text Classification
Sub-tasks:
intent-classification
Languages:
Polish
Size:
10K<n<100K
License:
Convert dataset to Parquet
#5
by
lhoestq
HF Staff
- opened
- README.md +21 -8
- poleval2019_cyberbullying.py +0 -153
- task01/test-00000-of-00001.parquet +3 -0
- task01/train-00000-of-00001.parquet +3 -0
- task02/test-00000-of-00001.parquet +3 -0
- task02/train-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -31,13 +31,13 @@ dataset_info:
|
|
31 |
'1': '1'
|
32 |
splits:
|
33 |
- name: train
|
34 |
-
num_bytes:
|
35 |
num_examples: 10041
|
36 |
- name: test
|
37 |
-
num_bytes:
|
38 |
num_examples: 1000
|
39 |
-
download_size:
|
40 |
-
dataset_size:
|
41 |
- config_name: task02
|
42 |
features:
|
43 |
- name: text
|
@@ -51,13 +51,26 @@ dataset_info:
|
|
51 |
'2': '2'
|
52 |
splits:
|
53 |
- name: train
|
54 |
-
num_bytes:
|
55 |
num_examples: 10041
|
56 |
- name: test
|
57 |
-
num_bytes:
|
58 |
num_examples: 1000
|
59 |
-
download_size:
|
60 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
---
|
62 |
|
63 |
# Dataset Card for Poleval 2019 cyberbullying
|
|
|
31 |
'1': '1'
|
32 |
splits:
|
33 |
- name: train
|
34 |
+
num_bytes: 1104314
|
35 |
num_examples: 10041
|
36 |
- name: test
|
37 |
+
num_bytes: 109677
|
38 |
num_examples: 1000
|
39 |
+
download_size: 645430
|
40 |
+
dataset_size: 1213991
|
41 |
- config_name: task02
|
42 |
features:
|
43 |
- name: text
|
|
|
51 |
'2': '2'
|
52 |
splits:
|
53 |
- name: train
|
54 |
+
num_bytes: 1104314
|
55 |
num_examples: 10041
|
56 |
- name: test
|
57 |
+
num_bytes: 109677
|
58 |
num_examples: 1000
|
59 |
+
download_size: 646033
|
60 |
+
dataset_size: 1213991
|
61 |
+
configs:
|
62 |
+
- config_name: task01
|
63 |
+
data_files:
|
64 |
+
- split: train
|
65 |
+
path: task01/train-*
|
66 |
+
- split: test
|
67 |
+
path: task01/test-*
|
68 |
+
- config_name: task02
|
69 |
+
data_files:
|
70 |
+
- split: train
|
71 |
+
path: task02/train-*
|
72 |
+
- split: test
|
73 |
+
path: task02/test-*
|
74 |
---
|
75 |
|
76 |
# Dataset Card for Poleval 2019 cyberbullying
|
poleval2019_cyberbullying.py
DELETED
@@ -1,153 +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 |
-
"""Cyberbullying Classification Dataset in Polish"""
|
16 |
-
|
17 |
-
|
18 |
-
import os
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
|
22 |
-
|
23 |
-
_DESCRIPTION = """\
|
24 |
-
In Task 6-1, the participants are to distinguish between normal/non-harmful tweets (class: 0) and tweets
|
25 |
-
that contain any kind of harmful information (class: 1). This includes cyberbullying, hate speech and
|
26 |
-
related phenomena.
|
27 |
-
|
28 |
-
In Task 6-2, the participants shall distinguish between three classes of tweets: 0 (non-harmful),
|
29 |
-
1 (cyberbullying), 2 (hate-speech). There are various definitions of both cyberbullying and hate-speech,
|
30 |
-
some of them even putting those two phenomena in the same group. The specific conditions on which we based
|
31 |
-
our annotations for both cyberbullying and hate-speech, which have been worked out during ten years of research
|
32 |
-
will be summarized in an introductory paper for the task, however, the main and definitive condition to 1
|
33 |
-
distinguish the two is whether the harmful action is addressed towards a private person(s) (cyberbullying),
|
34 |
-
or a public person/entity/large group (hate-speech).
|
35 |
-
"""
|
36 |
-
|
37 |
-
_HOMEPAGE = "http://2019.poleval.pl/index.php/tasks/task6"
|
38 |
-
|
39 |
-
_URL_TRAIN_TASK1 = "http://2019.poleval.pl/task6/task_6-1.zip"
|
40 |
-
_URL_TRAIN_TASK2 = "http://2019.poleval.pl/task6/task_6-2.zip"
|
41 |
-
_URL_TEST = "http://2019.poleval.pl/task6/task6_test.zip"
|
42 |
-
|
43 |
-
_CITATION = """\
|
44 |
-
@proceedings{ogr:kob:19:poleval,
|
45 |
-
editor = {Maciej Ogrodniczuk and Łukasz Kobyliński},
|
46 |
-
title = {{Proceedings of the PolEval 2019 Workshop}},
|
47 |
-
year = {2019},
|
48 |
-
address = {Warsaw, Poland},
|
49 |
-
publisher = {Institute of Computer Science, Polish Academy of Sciences},
|
50 |
-
url = {http://2019.poleval.pl/files/poleval2019.pdf},
|
51 |
-
isbn = "978-83-63159-28-3"}
|
52 |
-
}
|
53 |
-
"""
|
54 |
-
|
55 |
-
|
56 |
-
class Poleval2019CyberBullyingConfig(datasets.BuilderConfig):
|
57 |
-
"""BuilderConfig for Poleval2019CyberBullying."""
|
58 |
-
|
59 |
-
def __init__(
|
60 |
-
self,
|
61 |
-
text_features,
|
62 |
-
label_classes,
|
63 |
-
**kwargs,
|
64 |
-
):
|
65 |
-
super(Poleval2019CyberBullyingConfig, self).__init__(version=datasets.Version("1.0.0"), **kwargs)
|
66 |
-
self.text_features = text_features
|
67 |
-
self.label_classes = label_classes
|
68 |
-
|
69 |
-
|
70 |
-
class Poleval2019CyberBullying(datasets.GeneratorBasedBuilder):
|
71 |
-
"""Cyberbullying Classification Dataset in Polish"""
|
72 |
-
|
73 |
-
VERSION = datasets.Version("1.0.0")
|
74 |
-
|
75 |
-
BUILDER_CONFIGS = [
|
76 |
-
Poleval2019CyberBullyingConfig(
|
77 |
-
name="task01",
|
78 |
-
text_features=["text"],
|
79 |
-
label_classes=["0", "1"],
|
80 |
-
),
|
81 |
-
Poleval2019CyberBullyingConfig(
|
82 |
-
name="task02",
|
83 |
-
text_features=["text"],
|
84 |
-
label_classes=["0", "1", "2"],
|
85 |
-
),
|
86 |
-
]
|
87 |
-
|
88 |
-
def _info(self):
|
89 |
-
|
90 |
-
features = {text_feature: datasets.Value("string") for text_feature in self.config.text_features}
|
91 |
-
features["label"] = datasets.features.ClassLabel(names=self.config.label_classes)
|
92 |
-
|
93 |
-
return datasets.DatasetInfo(
|
94 |
-
description=_DESCRIPTION,
|
95 |
-
features=datasets.Features(features),
|
96 |
-
supervised_keys=("text", "label"),
|
97 |
-
homepage=_HOMEPAGE,
|
98 |
-
citation=_CITATION,
|
99 |
-
)
|
100 |
-
|
101 |
-
def _split_generators(self, dl_manager):
|
102 |
-
"""Returns SplitGenerators."""
|
103 |
-
|
104 |
-
if self.config.name == "task01":
|
105 |
-
train_path = dl_manager.download_and_extract(_URL_TRAIN_TASK1)
|
106 |
-
|
107 |
-
if self.config.name == "task02":
|
108 |
-
train_path = dl_manager.download_and_extract(_URL_TRAIN_TASK2)
|
109 |
-
|
110 |
-
data_dir_test = dl_manager.download_and_extract(_URL_TEST)
|
111 |
-
|
112 |
-
if self.config.name == "task01":
|
113 |
-
test_path = os.path.join(data_dir_test, "Task6", "task 01")
|
114 |
-
|
115 |
-
if self.config.name == "task02":
|
116 |
-
test_path = os.path.join(data_dir_test, "Task6", "task 02")
|
117 |
-
|
118 |
-
return [
|
119 |
-
datasets.SplitGenerator(
|
120 |
-
name=datasets.Split.TRAIN,
|
121 |
-
gen_kwargs={
|
122 |
-
"filepath": train_path,
|
123 |
-
"split": "train",
|
124 |
-
},
|
125 |
-
),
|
126 |
-
datasets.SplitGenerator(
|
127 |
-
name=datasets.Split.TEST,
|
128 |
-
gen_kwargs={
|
129 |
-
"filepath": test_path,
|
130 |
-
"split": "test",
|
131 |
-
},
|
132 |
-
),
|
133 |
-
]
|
134 |
-
|
135 |
-
def _generate_examples(self, filepath, split):
|
136 |
-
"""Yields examples."""
|
137 |
-
|
138 |
-
if split == "train":
|
139 |
-
text_path = os.path.join(filepath, "training_set_clean_only_text.txt")
|
140 |
-
label_path = os.path.join(filepath, "training_set_clean_only_tags.txt")
|
141 |
-
|
142 |
-
if split == "test":
|
143 |
-
if self.config.name == "task01":
|
144 |
-
text_path = os.path.join(filepath, "test_set_clean_only_text.txt")
|
145 |
-
label_path = os.path.join(filepath, "test_set_clean_only_tags.txt")
|
146 |
-
if self.config.name == "task02":
|
147 |
-
text_path = os.path.join(filepath, "test_set_only_text.txt")
|
148 |
-
label_path = os.path.join(filepath, "test_set_only_tags.txt")
|
149 |
-
|
150 |
-
with open(text_path, encoding="utf-8") as text_file:
|
151 |
-
with open(label_path, encoding="utf-8") as label_file:
|
152 |
-
for id_, (text, label) in enumerate(zip(text_file, label_file)):
|
153 |
-
yield id_, {"text": text.strip(), "label": int(label.strip())}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
task01/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:285b260c226da9609a4d6729c035d2196413aede1b6d914a65a4a1e14a3b8fd5
|
3 |
+
size 58740
|
task01/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c92b5febe2e7c8acc7918d834a1a0191e1706d157def27dd52e0a53113d22fda
|
3 |
+
size 586690
|
task02/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a7ed4150d1b1206336236b20dd1ad44e732bd385dedfffbea1f10317b5103039
|
3 |
+
size 58821
|
task02/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8e7cd5ce32bab3741da839e54b155758209044591b0315c4a9bac414c64aa522
|
3 |
+
size 587212
|