Datasets:
Tasks:
Text Classification
Sub-tasks:
multi-class-classification
Languages:
English
Size:
10K<n<100K
ArXiv:
Tags:
hate-speech-detection
License:
Commit
•
7487975
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +149 -0
- dataset_infos.json +1 -0
- dummy/1.1.0/dummy_data.zip +3 -0
- hate_offensive.py +88 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
README.md
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
language_creators:
|
5 |
+
- machine-generated
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses:
|
9 |
+
- mit
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10k<n<100k
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- text-classification
|
18 |
+
task_ids:
|
19 |
+
- multi-class-classification
|
20 |
+
- text-classification-other-hate-speech-detection
|
21 |
+
---
|
22 |
+
|
23 |
+
# Dataset Card for HateOffensive
|
24 |
+
|
25 |
+
## Table of Contents
|
26 |
+
- [Dataset Description](#dataset-description)
|
27 |
+
- [Dataset Summary](#dataset-summary)
|
28 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
29 |
+
- [Languages](#languages)
|
30 |
+
- [Dataset Structure](#dataset-structure)
|
31 |
+
- [Data Instances](#data-instances)
|
32 |
+
- [Data Fields](#data-instances)
|
33 |
+
- [Data Splits](#data-instances)
|
34 |
+
- [Dataset Creation](#dataset-creation)
|
35 |
+
- [Curation Rationale](#curation-rationale)
|
36 |
+
- [Source Data](#source-data)
|
37 |
+
- [Annotations](#annotations)
|
38 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
39 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
40 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
41 |
+
- [Discussion of Biases](#discussion-of-biases)
|
42 |
+
- [Other Known Limitations](#other-known-limitations)
|
43 |
+
- [Additional Information](#additional-information)
|
44 |
+
- [Dataset Curators](#dataset-curators)
|
45 |
+
- [Licensing Information](#licensing-information)
|
46 |
+
- [Citation Information](#citation-information)
|
47 |
+
|
48 |
+
## Dataset Description
|
49 |
+
- **Homepage** : https://arxiv.org/abs/1905.12516
|
50 |
+
- **Repository** : https://github.com/t-davidson/hate-speech-and-offensive-language
|
51 |
+
- **Paper** : https://arxiv.org/abs/1905.12516
|
52 |
+
- **Leaderboard** :
|
53 |
+
- **Point of Contact** : trd54 at cornell dot edu
|
54 |
+
|
55 |
+
### Dataset Summary
|
56 |
+
|
57 |
+
### Supported Tasks and Leaderboards
|
58 |
+
[More Information Needed]
|
59 |
+
|
60 |
+
### Languages
|
61 |
+
English (`en`)
|
62 |
+
|
63 |
+
## Dataset Structure
|
64 |
+
|
65 |
+
### Data Instances
|
66 |
+
```
|
67 |
+
{
|
68 |
+
"count": 3,
|
69 |
+
"hate_speech_annotation": 0,
|
70 |
+
"offensive_language_annotation": 0,
|
71 |
+
"neither_annotation": 3,
|
72 |
+
"label": 2, # "neither"
|
73 |
+
"tweet": "!!! RT @mayasolovely: As a woman you shouldn't complain about cleaning up your house. & as a man you should always take the trash out...")
|
74 |
+
}
|
75 |
+
```
|
76 |
+
|
77 |
+
### Data Fields
|
78 |
+
|
79 |
+
count: (Integer) number of users who coded each tweet (min is 3, sometimes more users coded a tweet when judgments were determined to be unreliable,
|
80 |
+
hate_speech_annotation: (Integer) number of users who judged the tweet to be hate speech,
|
81 |
+
offensive_language_annotation: (Integer) number of users who judged the tweet to be offensive,
|
82 |
+
neither_annotation: (Integer) number of users who judged the tweet to be neither offensive nor non-offensive,
|
83 |
+
label: (Class Label) integer class label for majority of CF users (0: 'hate-speech', 1: 'offensive-language' or 2: 'neither'),
|
84 |
+
tweet: (string)
|
85 |
+
|
86 |
+
### Data Splits
|
87 |
+
This dataset is not splitted, only the train split is available.
|
88 |
+
|
89 |
+
## Dataset Creation
|
90 |
+
|
91 |
+
### Curation Rationale
|
92 |
+
[More Information Needed]
|
93 |
+
|
94 |
+
### Source Data
|
95 |
+
|
96 |
+
#### Initial Data Collection and Normalization
|
97 |
+
|
98 |
+
[More Information Needed]
|
99 |
+
|
100 |
+
#### Who are the source language producers?
|
101 |
+
|
102 |
+
[More Information Needed]
|
103 |
+
|
104 |
+
### Annotations
|
105 |
+
|
106 |
+
#### Annotation process
|
107 |
+
|
108 |
+
[More Information Needed]
|
109 |
+
|
110 |
+
#### Who are the annotators?
|
111 |
+
|
112 |
+
[More Information Needed]
|
113 |
+
|
114 |
+
### Personal and Sensitive Information
|
115 |
+
Usernames are not anonymized in the dataset.
|
116 |
+
|
117 |
+
## Considerations for Using the Data
|
118 |
+
|
119 |
+
### Social Impact of Dataset
|
120 |
+
|
121 |
+
[More Information Needed]
|
122 |
+
|
123 |
+
### Discussion of Biases
|
124 |
+
|
125 |
+
[More Information Needed]
|
126 |
+
|
127 |
+
### Other Known Limitations
|
128 |
+
|
129 |
+
[More Information Needed]
|
130 |
+
|
131 |
+
## Additional Information
|
132 |
+
|
133 |
+
### Dataset Curators
|
134 |
+
|
135 |
+
[More Information Needed]
|
136 |
+
|
137 |
+
### Licensing Information
|
138 |
+
MIT License
|
139 |
+
|
140 |
+
### Citation Information
|
141 |
+
@inproceedings{hateoffensive,
|
142 |
+
title = {Automated Hate Speech Detection and the Problem of Offensive Language},
|
143 |
+
author = {Davidson, Thomas and Warmsley, Dana and Macy, Michael and Weber, Ingmar},
|
144 |
+
booktitle = {Proceedings of the 11th International AAAI Conference on Web and Social Media},
|
145 |
+
series = {ICWSM '17},
|
146 |
+
year = {2017},
|
147 |
+
location = {Montreal, Canada},
|
148 |
+
pages = {512-515}
|
149 |
+
}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "This dataset contains annotated tweets for automated hate-speech recognition", "citation": "\n@article{article,\nauthor = {Davidson, Thomas and Warmsley, Dana and Macy, Michael and Weber, Ingmar},\nyear = {2017},\nmonth = {03},\npages = {},\ntitle = {Automated Hate Speech Detection and the Problem of Offensive Language}\n}\n", "homepage": "https://arxiv.org/abs/1905.12516", "license": "", "features": {"total_annotation_count": {"dtype": "int32", "id": null, "_type": "Value"}, "hate_speech_annotations": {"dtype": "int32", "id": null, "_type": "Value"}, "offensive_language_annotations": {"dtype": "int32", "id": null, "_type": "Value"}, "neither_annotations": {"dtype": "int32", "id": null, "_type": "Value"}, "label": {"num_classes": 3, "names": ["hate-speech", "offensive-language", "neither"], "names_file": null, "id": null, "_type": "ClassLabel"}, "tweet": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": {"input": "tweet", "output": "label"}, "builder_name": "hate_offensive", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2811298, "num_examples": 24783, "dataset_name": "hate_offensive"}}, "download_checksums": {"https://github.com/t-davidson/hate-speech-and-offensive-language/raw/master/data/labeled_data.csv": {"num_bytes": 2546446, "checksum": "fcb8bc7c68120ae4af04a5b9acd58585513ede11e1548ebf36a5c2040b6f6281"}}, "download_size": 2546446, "post_processing_size": null, "dataset_size": 2811298, "size_in_bytes": 5357744}}
|
dummy/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0531cb107afe7d94118d7aaed647f7e2fbd48cd194ae99646f788bbf443def18
|
3 |
+
size 589
|
hate_offensive.py
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""Automated Hate Speech Detection and the Problem of Offensive Language."""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import csv
|
20 |
+
import os
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
|
24 |
+
|
25 |
+
_CITATION = """
|
26 |
+
@article{article,
|
27 |
+
author = {Davidson, Thomas and Warmsley, Dana and Macy, Michael and Weber, Ingmar},
|
28 |
+
year = {2017},
|
29 |
+
month = {03},
|
30 |
+
pages = {},
|
31 |
+
title = {Automated Hate Speech Detection and the Problem of Offensive Language}
|
32 |
+
}
|
33 |
+
"""
|
34 |
+
|
35 |
+
_DESCRIPTION = "This dataset contains annotated tweets for automated hate-speech recognition"
|
36 |
+
|
37 |
+
_HOMEPAGE = "https://arxiv.org/abs/1905.12516"
|
38 |
+
|
39 |
+
_LICENSE = "MIT License"
|
40 |
+
|
41 |
+
_URLs = "https://github.com/t-davidson/hate-speech-and-offensive-language/raw/master/data/labeled_data.csv"
|
42 |
+
|
43 |
+
|
44 |
+
class HateOffensive(datasets.GeneratorBasedBuilder):
|
45 |
+
"""Automated Hate Speech Detection and the Problem of Offensive Language """
|
46 |
+
|
47 |
+
VERSION = datasets.Version("1.1.0")
|
48 |
+
|
49 |
+
def _info(self):
|
50 |
+
features = datasets.Features(
|
51 |
+
{
|
52 |
+
"total_annotation_count": datasets.Value("int32"),
|
53 |
+
"hate_speech_annotations": datasets.Value("int32"),
|
54 |
+
"offensive_language_annotations": datasets.Value("int32"),
|
55 |
+
"neither_annotations": datasets.Value("int32"),
|
56 |
+
"label": datasets.ClassLabel(names=["hate-speech", "offensive-language", "neither"]),
|
57 |
+
"tweet": datasets.Value("string"),
|
58 |
+
}
|
59 |
+
)
|
60 |
+
return datasets.DatasetInfo(
|
61 |
+
description=_DESCRIPTION,
|
62 |
+
features=features,
|
63 |
+
supervised_keys=("tweet", "label"),
|
64 |
+
homepage=_HOMEPAGE,
|
65 |
+
citation=_CITATION,
|
66 |
+
)
|
67 |
+
|
68 |
+
def _split_generators(self, dl_manager):
|
69 |
+
"""Returns SplitGenerators."""
|
70 |
+
data_dir = dl_manager.download_and_extract(_URLs)
|
71 |
+
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": os.path.join(data_dir)})]
|
72 |
+
|
73 |
+
def _generate_examples(self, filepath):
|
74 |
+
""" Yields examples. """
|
75 |
+
with open(filepath, encoding="utf-8") as csv_file:
|
76 |
+
csv_reader = csv.reader(
|
77 |
+
csv_file, lineterminator="\n", delimiter=",", quoting=csv.QUOTE_ALL, skipinitialspace=True
|
78 |
+
)
|
79 |
+
next(csv_reader, None)
|
80 |
+
for id_, row in enumerate(csv_reader):
|
81 |
+
yield id_, {
|
82 |
+
"total_annotation_count": row[1],
|
83 |
+
"hate_speech_annotations": row[2],
|
84 |
+
"offensive_language_annotations": row[3],
|
85 |
+
"neither_annotations": row[4],
|
86 |
+
"label": int(row[5]),
|
87 |
+
"tweet": str(row[6]),
|
88 |
+
}
|