Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Sub-tasks:
sentiment-classification
Languages:
Polish
Size:
10K - 100K
License:
Convert dataset to Parquet
#4
by
albertvillanova
HF Staff
- opened
- README.md +11 -4
- cdt.py +0 -93
- data/test-00000-of-00001.parquet +3 -0
- data/train-00000-of-00001.parquet +3 -0
README.md
CHANGED
|
@@ -30,13 +30,20 @@ dataset_info:
|
|
| 30 |
'1': '1'
|
| 31 |
splits:
|
| 32 |
- name: train
|
| 33 |
-
num_bytes:
|
| 34 |
num_examples: 10041
|
| 35 |
- name: test
|
| 36 |
-
num_bytes:
|
| 37 |
num_examples: 1000
|
| 38 |
-
download_size:
|
| 39 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
---
|
| 41 |
|
| 42 |
# Dataset Card for [Dataset Name]
|
|
|
|
| 30 |
'1': '1'
|
| 31 |
splits:
|
| 32 |
- name: train
|
| 33 |
+
num_bytes: 1104314
|
| 34 |
num_examples: 10041
|
| 35 |
- name: test
|
| 36 |
+
num_bytes: 109677
|
| 37 |
num_examples: 1000
|
| 38 |
+
download_size: 649329
|
| 39 |
+
dataset_size: 1213991
|
| 40 |
+
configs:
|
| 41 |
+
- config_name: default
|
| 42 |
+
data_files:
|
| 43 |
+
- split: train
|
| 44 |
+
path: data/train-*
|
| 45 |
+
- split: test
|
| 46 |
+
path: data/test-*
|
| 47 |
---
|
| 48 |
|
| 49 |
# Dataset Card for [Dataset Name]
|
cdt.py
DELETED
|
@@ -1,93 +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 detection task"""
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
import csv
|
| 19 |
-
import os
|
| 20 |
-
|
| 21 |
-
import datasets
|
| 22 |
-
from datasets.tasks import TextClassification
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
_CITATION = """\
|
| 26 |
-
@article{ptaszynski2019results,
|
| 27 |
-
title={Results of the PolEval 2019 Shared Task 6: First Dataset and Open Shared Task for Automatic Cyberbullying Detection in Polish Twitter},
|
| 28 |
-
author={Ptaszynski, Michal and Pieciukiewicz, Agata and Dybala, Pawel},
|
| 29 |
-
journal={Proceedings of the PolEval 2019 Workshop},
|
| 30 |
-
publisher={Institute of Computer Science, Polish Academy of Sciences},
|
| 31 |
-
pages={89},
|
| 32 |
-
year={2019}
|
| 33 |
-
}
|
| 34 |
-
"""
|
| 35 |
-
|
| 36 |
-
_DESCRIPTION = """\
|
| 37 |
-
The Cyberbullying Detection task was part of 2019 edition of PolEval competition. The goal is to predict if a given Twitter message contains a cyberbullying (harmful) content.
|
| 38 |
-
"""
|
| 39 |
-
|
| 40 |
-
_HOMEPAGE = "https://github.com/ptaszynski/cyberbullying-Polish"
|
| 41 |
-
|
| 42 |
-
_LICENSE = "BSD 3-Clause"
|
| 43 |
-
|
| 44 |
-
_URLs = "https://klejbenchmark.com/static/data/klej_cbd.zip"
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
class Cdt(datasets.GeneratorBasedBuilder):
|
| 48 |
-
"""CyberbullyingDetectionTask"""
|
| 49 |
-
|
| 50 |
-
VERSION = datasets.Version("1.1.0")
|
| 51 |
-
|
| 52 |
-
def _info(self):
|
| 53 |
-
return datasets.DatasetInfo(
|
| 54 |
-
description=_DESCRIPTION,
|
| 55 |
-
features=datasets.Features(
|
| 56 |
-
{
|
| 57 |
-
"sentence": datasets.Value("string"),
|
| 58 |
-
"target": datasets.ClassLabel(names=["0", "1"]),
|
| 59 |
-
}
|
| 60 |
-
),
|
| 61 |
-
supervised_keys=None,
|
| 62 |
-
homepage=_HOMEPAGE,
|
| 63 |
-
license=_LICENSE,
|
| 64 |
-
citation=_CITATION,
|
| 65 |
-
task_templates=[TextClassification(text_column="sentence", label_column="target")],
|
| 66 |
-
)
|
| 67 |
-
|
| 68 |
-
def _split_generators(self, dl_manager):
|
| 69 |
-
"""Returns SplitGenerators."""
|
| 70 |
-
data_dir = dl_manager.download_and_extract(_URLs)
|
| 71 |
-
return [
|
| 72 |
-
datasets.SplitGenerator(
|
| 73 |
-
name=datasets.Split.TRAIN,
|
| 74 |
-
gen_kwargs={
|
| 75 |
-
"filepath": os.path.join(data_dir, "train.tsv"),
|
| 76 |
-
"split": "train",
|
| 77 |
-
},
|
| 78 |
-
),
|
| 79 |
-
datasets.SplitGenerator(
|
| 80 |
-
name=datasets.Split.TEST,
|
| 81 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "test_features.tsv"), "split": "test"},
|
| 82 |
-
),
|
| 83 |
-
]
|
| 84 |
-
|
| 85 |
-
def _generate_examples(self, filepath, split):
|
| 86 |
-
"""Yields examples."""
|
| 87 |
-
with open(filepath, encoding="utf-8") as f:
|
| 88 |
-
reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
|
| 89 |
-
for id_, row in enumerate(reader):
|
| 90 |
-
yield id_, {
|
| 91 |
-
"sentence": row["sentence"],
|
| 92 |
-
"target": -1 if split == "test" else row["target"],
|
| 93 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98d4043c942922e64089ee37cc5201e773e221bbda7a73dbcb8cad94e0ad0a92
|
| 3 |
+
size 59007
|
data/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9f546b7a806eba3d31d88b0be0c93049a393e8baed75821144583b2ed116e047
|
| 3 |
+
size 590322
|