Datasets:
Tasks:
Text Classification
Formats:
parquet
Languages:
English
Size:
10K - 100K
ArXiv:
Tags:
hate-speech-detection
License:
Commit
•
b3c9c21
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 +156 -0
- dataset_infos.json +1 -0
- dummy/1.0.0/dummy_data.zip +3 -0
- hate_speech_offensive.py +106 -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,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
- crowdsourced
|
5 |
+
language_creators:
|
6 |
+
- found
|
7 |
+
languages:
|
8 |
+
- en
|
9 |
+
licenses:
|
10 |
+
- unknown
|
11 |
+
multilinguality:
|
12 |
+
- monolingual
|
13 |
+
size_categories:
|
14 |
+
- 10k<n<100K
|
15 |
+
source_datasets:
|
16 |
+
- original
|
17 |
+
task_categories:
|
18 |
+
- text-classification
|
19 |
+
task_ids:
|
20 |
+
- text-classification-other-hate-speech-detection
|
21 |
+
---
|
22 |
+
|
23 |
+
# Dataset Card for [Dataset Name]
|
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 |
+
|
50 |
+
- **Homepage:** https://github.com/t-davidson/hate-speech-and-offensive-language
|
51 |
+
- **Repository:** https://github.com/t-davidson/hate-speech-and-offensive-language
|
52 |
+
- **Paper:** https://arxiv.org/abs/1703.04009
|
53 |
+
- **Leaderboard:**
|
54 |
+
- **Point of Contact:** https://docs.google.com/forms/d/e/1FAIpQLSdrPNlfVBlqxun2tivzAtsZaOoPC5YYMocn-xscCgeRakLXHg/viewform?usp=pp_url&entry.1506871634&entry.147453066&entry.1390333885&entry.516829772
|
55 |
+
|
56 |
+
### Dataset Summary
|
57 |
+
|
58 |
+
An annotated dataset for hate speech and offensive language detection on tweets.
|
59 |
+
|
60 |
+
### Supported Tasks and Leaderboards
|
61 |
+
|
62 |
+
[More Information Needed]
|
63 |
+
|
64 |
+
### Languages
|
65 |
+
English (`en`)
|
66 |
+
|
67 |
+
## Dataset Structure
|
68 |
+
|
69 |
+
### Data Instances
|
70 |
+
```
|
71 |
+
{
|
72 |
+
"count": 3,
|
73 |
+
"hate_speech_annotation": 0,
|
74 |
+
"offensive_language_annotation": 0,
|
75 |
+
"neither_annotation": 3,
|
76 |
+
"label": 2, # "neither"
|
77 |
+
"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...")
|
78 |
+
}
|
79 |
+
```
|
80 |
+
|
81 |
+
### Data Fields
|
82 |
+
```
|
83 |
+
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,
|
84 |
+
hate_speech_annotation: (Integer) number of users who judged the tweet to be hate speech,
|
85 |
+
offensive_language_annotation: (Integer) number of users who judged the tweet to be offensive,
|
86 |
+
neither_annotation: (Integer) number of users who judged the tweet to be neither offensive nor non-offensive,
|
87 |
+
label: (Class Label) class label for majority of CF users (0: 'hate-speech', 1: 'offensive-language' or 2: 'neither'),
|
88 |
+
tweet: (string)
|
89 |
+
```
|
90 |
+
|
91 |
+
### Data Splits
|
92 |
+
This dataset is not splitted, only the train split is available.
|
93 |
+
|
94 |
+
## Dataset Creation
|
95 |
+
|
96 |
+
### Curation Rationale
|
97 |
+
|
98 |
+
[More Information Needed]
|
99 |
+
|
100 |
+
### Source Data
|
101 |
+
|
102 |
+
#### Initial Data Collection and Normalization
|
103 |
+
|
104 |
+
[More Information Needed]
|
105 |
+
|
106 |
+
#### Who are the source language producers?
|
107 |
+
|
108 |
+
[More Information Needed]
|
109 |
+
|
110 |
+
### Annotations
|
111 |
+
|
112 |
+
#### Annotation process
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
#### Who are the annotators?
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
### Personal and Sensitive Information
|
121 |
+
Usernames are not anonymized in the dataset.
|
122 |
+
|
123 |
+
|
124 |
+
## Considerations for Using the Data
|
125 |
+
|
126 |
+
### Social Impact of Dataset
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
### Discussion of Biases
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
### Other Known Limitations
|
135 |
+
|
136 |
+
[More Information Needed]
|
137 |
+
|
138 |
+
## Additional Information
|
139 |
+
|
140 |
+
### Dataset Curators
|
141 |
+
|
142 |
+
[More Information Needed]
|
143 |
+
|
144 |
+
### Licensing Information
|
145 |
+
MIT License
|
146 |
+
|
147 |
+
### Citation Information
|
148 |
+
@inproceedings{hateoffensive,
|
149 |
+
title = {Automated Hate Speech Detection and the Problem of Offensive Language},
|
150 |
+
author = {Davidson, Thomas and Warmsley, Dana and Macy, Michael and Weber, Ingmar},
|
151 |
+
booktitle = {Proceedings of the 11th International AAAI Conference on Web and Social Media},
|
152 |
+
series = {ICWSM '17},
|
153 |
+
year = {2017},
|
154 |
+
location = {Montreal, Canada},
|
155 |
+
pages = {512-515}
|
156 |
+
}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "An annotated dataset for hate speech and offensive language detection on tweets.\n", "citation": "@inproceedings{hateoffensive,\ntitle = {Automated Hate Speech Detection and the Problem of Offensive Language},\nauthor = {Davidson, Thomas and Warmsley, Dana and Macy, Michael and Weber, Ingmar},\nbooktitle = {Proceedings of the 11th International AAAI Conference on Web and Social Media},\nseries = {ICWSM '17},\nyear = {2017},\nlocation = {Montreal, Canada},\npages = {512-515}\n}\n", "homepage": "https://github.com/t-davidson/hate-speech-and-offensive-language", "license": "MIT", "features": {"count": {"dtype": "int64", "id": null, "_type": "Value"}, "hate_speech_count": {"dtype": "int64", "id": null, "_type": "Value"}, "offensive_language_count": {"dtype": "int64", "id": null, "_type": "Value"}, "neither_count": {"dtype": "int64", "id": null, "_type": "Value"}, "class": {"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": "class"}, "builder_name": "hate_speech_offensive", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3207826, "num_examples": 24783, "dataset_name": "hate_speech_offensive"}}, "download_checksums": {"https://raw.githubusercontent.com/t-davidson/hate-speech-and-offensive-language/master/data/labeled_data.csv": {"num_bytes": 2546446, "checksum": "fcb8bc7c68120ae4af04a5b9acd58585513ede11e1548ebf36a5c2040b6f6281"}}, "download_size": 2546446, "post_processing_size": null, "dataset_size": 3207826, "size_in_bytes": 5754272}}
|
dummy/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d42ec225b8fd781c15f1ef78875eb489e2baa33164996467378ce7e79c2bff21
|
3 |
+
size 589
|
hate_speech_offensive.py
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 hate speech and offensive language detection on tweets."""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import csv
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@inproceedings{hateoffensive,
|
26 |
+
title = {Automated Hate Speech Detection and the Problem of Offensive Language},
|
27 |
+
author = {Davidson, Thomas and Warmsley, Dana and Macy, Michael and Weber, Ingmar},
|
28 |
+
booktitle = {Proceedings of the 11th International AAAI Conference on Web and Social Media},
|
29 |
+
series = {ICWSM '17},
|
30 |
+
year = {2017},
|
31 |
+
location = {Montreal, Canada},
|
32 |
+
pages = {512-515}
|
33 |
+
}
|
34 |
+
"""
|
35 |
+
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
An annotated dataset for hate speech and offensive language detection on tweets.
|
38 |
+
"""
|
39 |
+
|
40 |
+
_HOMEPAGE = "https://github.com/t-davidson/hate-speech-and-offensive-language"
|
41 |
+
|
42 |
+
_LICENSE = "MIT"
|
43 |
+
|
44 |
+
_URL = "https://raw.githubusercontent.com/t-davidson/hate-speech-and-offensive-language/master/data/labeled_data.csv"
|
45 |
+
|
46 |
+
_CLASS_MAP = {
|
47 |
+
"0": "hate speech",
|
48 |
+
"1": "offensive language",
|
49 |
+
"2": "neither",
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
class HateSpeechOffensive(datasets.GeneratorBasedBuilder):
|
54 |
+
"""An annotated dataset for hate speech and offensive language detection on tweets."""
|
55 |
+
|
56 |
+
VERSION = datasets.Version("1.0.0")
|
57 |
+
|
58 |
+
def _info(self):
|
59 |
+
return datasets.DatasetInfo(
|
60 |
+
description=_DESCRIPTION,
|
61 |
+
features=datasets.Features(
|
62 |
+
{
|
63 |
+
"count": datasets.Value("int64"),
|
64 |
+
"hate_speech_count": datasets.Value("int64"),
|
65 |
+
"offensive_language_count": datasets.Value("int64"),
|
66 |
+
"neither_count": datasets.Value("int64"),
|
67 |
+
"class": datasets.ClassLabel(names=["hate speech", "offensive language", "neither"]),
|
68 |
+
"tweet": datasets.Value("string"),
|
69 |
+
}
|
70 |
+
),
|
71 |
+
supervised_keys=("tweet", "class"),
|
72 |
+
homepage=_HOMEPAGE,
|
73 |
+
license=_LICENSE,
|
74 |
+
citation=_CITATION,
|
75 |
+
)
|
76 |
+
|
77 |
+
def _split_generators(self, dl_manager):
|
78 |
+
"""Returns SplitGenerators."""
|
79 |
+
|
80 |
+
data_file = dl_manager.download_and_extract(_URL)
|
81 |
+
return [
|
82 |
+
datasets.SplitGenerator(
|
83 |
+
name=datasets.Split.TRAIN,
|
84 |
+
gen_kwargs={
|
85 |
+
"filepath": data_file,
|
86 |
+
},
|
87 |
+
),
|
88 |
+
]
|
89 |
+
|
90 |
+
def _generate_examples(self, filepath):
|
91 |
+
""" Yields examples. """
|
92 |
+
|
93 |
+
with open(filepath, encoding="utf-8") as f:
|
94 |
+
reader = csv.reader(f)
|
95 |
+
for id_, row in enumerate(reader):
|
96 |
+
if id_ == 0:
|
97 |
+
continue
|
98 |
+
|
99 |
+
yield id_, {
|
100 |
+
"count": row[1],
|
101 |
+
"hate_speech_count": row[2],
|
102 |
+
"offensive_language_count": row[3],
|
103 |
+
"neither_count": row[4],
|
104 |
+
"class": _CLASS_MAP[row[5]],
|
105 |
+
"tweet": row[6],
|
106 |
+
}
|