Datasets:
Commit
·
436cd87
1
Parent(s):
37c8b42
Update parquet files
Browse files- .gitattributes +0 -27
- FRENK-hate-sl.py +0 -143
- README.md +0 -116
- data.zip → binary/frenk-hate-sl-test.parquet +2 -2
- binary/frenk-hate-sl-train.parquet +3 -0
- binary/frenk-hate-sl-validation.parquet +3 -0
- multiclass/frenk-hate-sl-test.parquet +3 -0
- multiclass/frenk-hate-sl-train.parquet +3 -0
- multiclass/frenk-hate-sl-validation.parquet +3 -0
.gitattributes
DELETED
@@ -1,27 +0,0 @@
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FRENK-hate-sl.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 |
-
"""An annotated dataset for classifying offensive or acceptable speech."""
|
16 |
-
|
17 |
-
import os
|
18 |
-
import csv
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
_CITATION = """\
|
25 |
-
@misc{ljubešić2019frenk,
|
26 |
-
title={The FRENK Datasets of Socially Unacceptable Discourse in Slovene and English},
|
27 |
-
author={Nikola Ljubešić and Darja Fišer and Tomaž Erjavec},
|
28 |
-
year={2019},
|
29 |
-
eprint={1906.02045},
|
30 |
-
archivePrefix={arXiv},
|
31 |
-
primaryClass={cs.CL},
|
32 |
-
url={https://arxiv.org/abs/1906.02045}
|
33 |
-
}
|
34 |
-
"""
|
35 |
-
|
36 |
-
_DESCRIPTION = """\
|
37 |
-
The FRENK Datasets of Socially Unacceptable Discourse in Slovene.
|
38 |
-
"""
|
39 |
-
|
40 |
-
_HOMEPAGE = "https://www.clarin.si/repository/xmlui/handle/11356/1433"
|
41 |
-
|
42 |
-
_LICENSE = "CLARIN.SI Licence ACA ID-BY-NC-INF-NORED 1.0"
|
43 |
-
|
44 |
-
_URL = "https://huggingface.co/datasets/classla/FRENK-hate-sl/resolve/main/data.zip"
|
45 |
-
|
46 |
-
_CLASS_MAP_MULTICLASS = {
|
47 |
-
'Acceptable speech': 0,
|
48 |
-
'Inappropriate': 1,
|
49 |
-
'Background offensive': 2,
|
50 |
-
'Other offensive': 3,
|
51 |
-
'Background violence': 4,
|
52 |
-
'Other violence': 5,
|
53 |
-
}
|
54 |
-
|
55 |
-
_CLASS_MAP_BINARY = {
|
56 |
-
'Acceptable': 0,
|
57 |
-
'Offensive': 1,
|
58 |
-
}
|
59 |
-
|
60 |
-
class FRENKHateSpeechSL(datasets.GeneratorBasedBuilder):
|
61 |
-
"""The FRENK Datasets of Socially Unacceptable Discourse in Slovene"""
|
62 |
-
|
63 |
-
VERSION = datasets.Version("0.0.0")
|
64 |
-
|
65 |
-
BUILDER_CONFIGS = [
|
66 |
-
datasets.BuilderConfig(name="binary", version=VERSION,
|
67 |
-
description="Labels are either 'Offensive' or 'Acceptable'."),
|
68 |
-
datasets.BuilderConfig(name="multiclass", version=VERSION,
|
69 |
-
description="Labels are 'Acceptable speech', 'Other offensive', 'Background offensive', 'Inappropriate', 'Other violence', 'Background violence'"),
|
70 |
-
]
|
71 |
-
|
72 |
-
DEFAULT_CONFIG_NAME = "binary"
|
73 |
-
|
74 |
-
def _info(self):
|
75 |
-
feature_dict = {
|
76 |
-
"text": datasets.Value("string"),
|
77 |
-
"target": datasets.Value("string"),
|
78 |
-
"topic": datasets.Value("string"),
|
79 |
-
}
|
80 |
-
if self.config.name == "binary":
|
81 |
-
features = datasets.Features(
|
82 |
-
{
|
83 |
-
**feature_dict,
|
84 |
-
"label": datasets.ClassLabel(names=["Acceptable", "Offensive"]),
|
85 |
-
}
|
86 |
-
)
|
87 |
-
else:
|
88 |
-
features = datasets.Features(
|
89 |
-
{
|
90 |
-
**feature_dict,
|
91 |
-
"label": datasets.ClassLabel(names=['Acceptable speech', 'Other offensive', 'Background offensive', 'Inappropriate', 'Other violence', 'Background violence']),
|
92 |
-
}
|
93 |
-
)
|
94 |
-
return datasets.DatasetInfo(
|
95 |
-
description=_DESCRIPTION,
|
96 |
-
features=features,
|
97 |
-
supervised_keys=None,
|
98 |
-
homepage=_HOMEPAGE,
|
99 |
-
license=_LICENSE,
|
100 |
-
|
101 |
-
citation=_CITATION,
|
102 |
-
)
|
103 |
-
|
104 |
-
|
105 |
-
def _split_generators(self, dl_manager):
|
106 |
-
"""Returns SplitGenerators."""
|
107 |
-
|
108 |
-
data_file = dl_manager.download_and_extract(_URL)
|
109 |
-
return [
|
110 |
-
datasets.SplitGenerator(
|
111 |
-
name=datasets.Split.TRAIN, gen_kwargs={
|
112 |
-
'filepath': os.path.join(data_file, "train.tsv"),
|
113 |
-
}
|
114 |
-
),
|
115 |
-
datasets.SplitGenerator(
|
116 |
-
name=datasets.Split.VALIDATION, gen_kwargs={
|
117 |
-
'filepath': os.path.join(data_file, "dev.tsv"),
|
118 |
-
}
|
119 |
-
),
|
120 |
-
datasets.SplitGenerator(
|
121 |
-
name=datasets.Split.TEST, gen_kwargs={
|
122 |
-
'filepath': os.path.join(data_file, "test.tsv"),
|
123 |
-
}
|
124 |
-
),
|
125 |
-
]
|
126 |
-
|
127 |
-
def _generate_examples(self, filepath):
|
128 |
-
"""Yields examples."""
|
129 |
-
|
130 |
-
with open(filepath, encoding="utf-8") as f:
|
131 |
-
reader = csv.reader(f, delimiter="\t")
|
132 |
-
for id_, row in enumerate(reader):
|
133 |
-
if id_ == 0:
|
134 |
-
continue
|
135 |
-
to_return_dict = {
|
136 |
-
"text": row[1],
|
137 |
-
"target": row[4] ,
|
138 |
-
"topic": row[5]
|
139 |
-
}
|
140 |
-
yield id_, {
|
141 |
-
**to_return_dict,
|
142 |
-
**{"label": _CLASS_MAP_BINARY[row[3]] if self.config.name == "binary" else _CLASS_MAP_MULTICLASS[row[2]]}
|
143 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
---
|
2 |
-
language:
|
3 |
-
- sl
|
4 |
-
license:
|
5 |
-
- other
|
6 |
-
size_categories:
|
7 |
-
- 1K<n<10K
|
8 |
-
task_categories:
|
9 |
-
- text-classification
|
10 |
-
task_ids: []
|
11 |
-
tags:
|
12 |
-
- hate-speech-detection
|
13 |
-
- offensive-language
|
14 |
-
---
|
15 |
-
|
16 |
-
|
17 |
-
Slovenian subset of the [FRENK dataset](http://hdl.handle.net/11356/1433). Also available on HuggingFace dataset hub: [English subset](https://huggingface.co/datasets/5roop/FRENK-hate-en), [Croatian subset](https://huggingface.co/datasets/5roop/FRENK-hate-hr).
|
18 |
-
|
19 |
-
## Dataset Description
|
20 |
-
|
21 |
-
- **Homepage:** http://hdl.handle.net/11356/1433
|
22 |
-
- **Repository:** http://hdl.handle.net/11356/1433
|
23 |
-
- **Paper:** https://arxiv.org/abs/1906.02045
|
24 |
-
- **Project page** https://nl.ijs.si/frenk/
|
25 |
-
|
26 |
-
|
27 |
-
## Description of the original dataset
|
28 |
-
|
29 |
-
>The original FRENK dataset consists of comments to Facebook posts (news articles) of mainstream media outlets from Croatia, Great Britain, and Slovenia, on the topics of migrants and LGBT. The dataset contains whole discussion threads. Each comment is annotated by the type of socially unacceptable discourse (e.g., inappropriate, offensive, violent speech) and its target (e.g., migrants/LGBT, commenters, media). The annotation schema is described in detail in [https://arxiv.org/pdf/1906.02045.pdf]. Usernames in the metadata are pseudo-anonymised and removed from the comments.
|
30 |
-
>
|
31 |
-
>The data in each language (Croatian (hr), English (en), Slovenian (sl), and topic (migrants, LGBT) is divided into a training and a testing portion. The training and testing data consist of separate discussion threads, i.e., there is no cross-discussion-thread contamination between training and testing data. The sizes of the splits are the following: Croatian, migrants: 4356 training comments, 978 testing comments; Croatian LGBT: 4494 training comments, 1142 comments; English, migrants: 4540 training comments, 1285 testing comments; English, LGBT: 4819 training comments, 1017 testing comments; Slovenian, migrants: 5145 training comments, 1277 testing comments; Slovenian, LGBT: 2842 training comments, 900 testing comments.
|
32 |
-
|
33 |
-
For this dataset only the Croatian data was used. Training segment has been split into beginning 90% (published here as training split) and end 10% (published here as dev split).
|
34 |
-
|
35 |
-
## Usage in `Transformers`
|
36 |
-
|
37 |
-
```python
|
38 |
-
import datasets
|
39 |
-
ds = datasets.load_dataset("classla/FRENK-hate-sl","binary")
|
40 |
-
```
|
41 |
-
|
42 |
-
For binary classification the following encoding is used:
|
43 |
-
|
44 |
-
|
45 |
-
```python
|
46 |
-
_CLASS_MAP_BINARY = {
|
47 |
-
'Acceptable': 0,
|
48 |
-
'Offensive': 1,
|
49 |
-
}
|
50 |
-
```
|
51 |
-
The original labels are available if the dataset is loaded with the `multiclass` option:
|
52 |
-
|
53 |
-
```python
|
54 |
-
import datasets
|
55 |
-
ds = datasets.load_dataset("classla/FRENK-hate-sl","multiclass").
|
56 |
-
```
|
57 |
-
|
58 |
-
In this case the encoding used is:
|
59 |
-
```python
|
60 |
-
_CLASS_MAP_MULTICLASS = {
|
61 |
-
'Acceptable speech': 0,
|
62 |
-
'Inappropriate': 1,
|
63 |
-
'Background offensive': 2,
|
64 |
-
'Other offensive': 3,
|
65 |
-
'Background violence': 4,
|
66 |
-
'Other violence': 5,
|
67 |
-
}
|
68 |
-
```
|
69 |
-
|
70 |
-
## Data structure
|
71 |
-
|
72 |
-
* `text`: text
|
73 |
-
* `target`: who is the target of the hate-speech text ("no target", "commenter", "target" (migrants or LGBT, depending on the topic), or "related to" (again, the topic))
|
74 |
-
* `topic`: whether the text relates to lgbt or migrants hate-speech domains
|
75 |
-
* `label`: label of the text instance, see above.
|
76 |
-
|
77 |
-
## Data instance
|
78 |
-
|
79 |
-
|
80 |
-
```
|
81 |
-
{'text': 'Otroci so odprti in brez predsodkov.Predsodke jim vcepimo starejši,starši,družba,družina...Če otroku lepo razložimo,razume.Nikoli ni dobro,da omejujemo otroka,njegovo inteligenco in duhovnost z lastnim ne razumevanjem nečesa ali nekoga.Predsodek je miselni zapor,prepreka,da bi bili svobodni.Ljubezen je svoboda.Sem ZA spremembo zakona!Srečno :D',
|
82 |
-
'target': 'No target',
|
83 |
-
'topic': 'lgbt',
|
84 |
-
'label': 0}
|
85 |
-
```
|
86 |
-
|
87 |
-
## Licensing information
|
88 |
-
|
89 |
-
CLARIN.SI Licence ACA ID-BY-NC-INF-NORED 1.0
|
90 |
-
|
91 |
-
## Citation information
|
92 |
-
|
93 |
-
When using this dataset please cite the following paper:
|
94 |
-
|
95 |
-
```
|
96 |
-
@misc{ljubešić2019frenk,
|
97 |
-
title={The FRENK Datasets of Socially Unacceptable Discourse in Slovene and English},
|
98 |
-
author={Nikola Ljubešić and Darja Fišer and Tomaž Erjavec},
|
99 |
-
year={2019},
|
100 |
-
eprint={1906.02045},
|
101 |
-
archivePrefix={arXiv},
|
102 |
-
primaryClass={cs.CL},
|
103 |
-
url={https://arxiv.org/abs/1906.02045}
|
104 |
-
}
|
105 |
-
```
|
106 |
-
|
107 |
-
The original dataset can be cited as
|
108 |
-
```
|
109 |
-
@misc{11356/1433,
|
110 |
-
title = {Offensive language dataset of Croatian, English and Slovenian comments {FRENK} 1.0},
|
111 |
-
author = {Ljube{\v s}i{\'c}, Nikola and Fi{\v s}er, Darja and Erjavec, Toma{\v z}},
|
112 |
-
url = {http://hdl.handle.net/11356/1433},
|
113 |
-
note = {Slovenian language resource repository {CLARIN}.{SI}},
|
114 |
-
copyright = {{CLARIN}.{SI} Licence {ACA} {ID}-{BY}-{NC}-{INF}-{NORED} 1.0},
|
115 |
-
year = {2021} }
|
116 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.zip → binary/frenk-hate-sl-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:57d66b0e6fc13af90c9e7f15b5ba154c592bd162713e4d44fe8a4621984b1519
|
3 |
+
size 240885
|
binary/frenk-hate-sl-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0bcf2927107ea2b99b8389a96142ed1983eda6c2996fb99eb9427da11525450e
|
3 |
+
size 776082
|
binary/frenk-hate-sl-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5eaf7e4d49417928dd9ab2f33308f88937891ea9112c06c3bb7b1be8eed94e5d
|
3 |
+
size 81859
|
multiclass/frenk-hate-sl-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:79f1e9023ebcffd5a8cd209b2ef3653fe6651d5e0f7b4d2f497e94944275c348
|
3 |
+
size 241700
|
multiclass/frenk-hate-sl-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:44169e0d1fccdffca451b0f7de6553a6dff0ba4b1357e43b156da5785f2a5852
|
3 |
+
size 778212
|
multiclass/frenk-hate-sl-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d532a4c3d987aff0627969d6bfe3ef3365a8892c436625c4cdd5cf7b91af639c
|
3 |
+
size 82292
|