Commit
•
c7ad675
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 +155 -0
- bn_hate_speech.py +90 -0
- dataset_infos.json +1 -0
- dummy/0.0.0/dummy_data.zip +3 -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,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
- expert-generated
|
5 |
+
language_creators:
|
6 |
+
- found
|
7 |
+
languages:
|
8 |
+
- bn
|
9 |
+
licenses:
|
10 |
+
- mit
|
11 |
+
multilinguality:
|
12 |
+
- monolingual
|
13 |
+
size_categories:
|
14 |
+
- 1K<n<10K
|
15 |
+
source_datasets:
|
16 |
+
- original
|
17 |
+
task_categories:
|
18 |
+
- text-classification
|
19 |
+
task_ids:
|
20 |
+
- text-classification-other-hate-speech-topic-classification
|
21 |
+
---
|
22 |
+
|
23 |
+
# Dataset Card for Bengali Hate Speech Dataset
|
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-fields)
|
33 |
+
- [Data Splits](#data-splits)
|
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: [Bengali Hate Speech Dataset](https://github.com/rezacsedu/Bengali-Hate-Speech-Dataset)**
|
51 |
+
- **Repository: [Bengali Hate Speech Dataset](https://github.com/rezacsedu/Bengali-Hate-Speech-Dataset)**
|
52 |
+
- **Paper: [Classification Benchmarks for Under-resourced Bengali Language based on Multichannel Convolutional-LSTM Network](https://arxiv.org/abs/2004.07807)**
|
53 |
+
- **Point of Contact: [Md. Rezaul Karim]([email protected])**
|
54 |
+
|
55 |
+
### Dataset Summary
|
56 |
+
|
57 |
+
The Bengali Hate Speech Dataset is a Bengali-language dataset of news articles collected from various Bengali media sources and categorized based on the type of hate in the text. The dataset was created to provide greater support for under-resourced languages like Bengali on NLP tasks, and serves as a benchmark for multiple types of classification tasks.
|
58 |
+
|
59 |
+
### Supported Tasks and Leaderboards
|
60 |
+
|
61 |
+
* `topic classification`: The dataset can be used to train a Multichannel Convolutional-LSTM for classifying different types of hate speech. The model performance can be measured by its F1 score.
|
62 |
+
|
63 |
+
### Languages
|
64 |
+
|
65 |
+
The text in the dataset is in Bengali and the associated BCP-47 code is `bn`.
|
66 |
+
|
67 |
+
## Dataset Structure
|
68 |
+
|
69 |
+
### Data Instances
|
70 |
+
|
71 |
+
A data instance takes the form of a news article and its associated label.
|
72 |
+
|
73 |
+
🚨 Beware that the following example contains extremely offensive content!
|
74 |
+
|
75 |
+
An example looks like this:
|
76 |
+
|
77 |
+
```
|
78 |
+
{"text": "রেন্ডিয়াকে পৃথীবির মানচিএ থেকে মুচে ফেলতে হবে",
|
79 |
+
"label": "Geopolitical"}
|
80 |
+
```
|
81 |
+
|
82 |
+
### Data Fields
|
83 |
+
|
84 |
+
* `text`: the text of the Bengali news article
|
85 |
+
* `label`: one of `Geopolitical`, `Personal`, `Political`, `Religious`, or `Gender abusive` indicating the type of hate speech
|
86 |
+
|
87 |
+
### Data Splits
|
88 |
+
|
89 |
+
The dataset has 3418 examples.
|
90 |
+
|
91 |
+
## Dataset Creation
|
92 |
+
|
93 |
+
### Curation Rationale
|
94 |
+
|
95 |
+
Under-resourced languages like Bengali lack supporting resources that languages like English have. This dataset was collected from multiple Bengali news sources to provide several classification benchmarks for hate speech detection, document classification and sentiment analysis.
|
96 |
+
|
97 |
+
### Source Data
|
98 |
+
|
99 |
+
#### Initial Data Collection and Normalization
|
100 |
+
|
101 |
+
Bengali articles were collected from a Bengali Wikipedia dump, Bengali news articles, news dumps of TV channels, books, blogs, sports portal and social media. Emphasis was placed on Facebook pages and newspaper sources because they have about 50 million followers and is a common source of opinion and hate speech. The full dataset consists of 250 million articles and is currently being prepared. This is a subset of the full dataset.
|
102 |
+
|
103 |
+
#### Who are the source language producers?
|
104 |
+
|
105 |
+
The source language producers are Bengali authors and users who interact with these various forms of Bengali media.
|
106 |
+
|
107 |
+
### Annotations
|
108 |
+
|
109 |
+
#### Annotation process
|
110 |
+
|
111 |
+
The data was annotated by manually identifying freqently occurring terms in texts containing hate speech and references to specific entities. The authors also prepared normalized frequency vectors of 175 abusive terms that are commonly used to express hate in Bengali. A hate label is assigned if at least one of these terms exists in the text. Annotator's were provided with unbiased text only contents to make the decision. Non-hate statements were removed from the list and the category of hate was further divided into political, personal, gender abusive, geopolitical and religious. To reduce possible bias, each label was assigned based on a majority voting on the annotator's opinions and Cohen's Kappa was computed to measure inter-annotator agreement.
|
112 |
+
|
113 |
+
#### Who are the annotators?
|
114 |
+
|
115 |
+
Three native Bengali speakers and two linguists annotated the dataset which was then reviewed and validated by three experts (one South Asian linguist and two native speakers).
|
116 |
+
|
117 |
+
### Personal and Sensitive Information
|
118 |
+
|
119 |
+
The dataset contains very sensitive and highly offensive comments in a religious, political and gendered context. Some of the comments are directed towards contemporary public figures like politicians, religious leaders, celebrities and athletes.
|
120 |
+
|
121 |
+
## Considerations for Using the Data
|
122 |
+
|
123 |
+
### Social Impact of Dataset
|
124 |
+
|
125 |
+
The purpose of the dataset is to improve hate speech detection in Bengali. The growth of social media has enabled people to express hate freely online and there has been a lot of focus on detecting hate speech for highly resourced languages like English. The use of hate speech is pervasive, like any other major language, which can have serious and deadly consequences. Failure to react to hate speech renders targeted minorities more vulnerable to attack and it can also create indifference towards their treatment from majority populations.
|
126 |
+
|
127 |
+
### Discussion of Biases
|
128 |
+
|
129 |
+
The dataset was collected using a bootstrapping approach. An initial search was made for specific types of texts, articles and tweets containing common harassment directed at targeting characteristics. As a result, this dataset contains **extremely** offensive content that is disturbing. In addition, Facebook pages and newspaper sources were emphasized because they are well-known for having hate and harassment issues.
|
130 |
+
|
131 |
+
### Other Known Limitations
|
132 |
+
|
133 |
+
The dataset contains racist, sexist, homophobic and offensive comments. It is collected and annotated for research related purposes only.
|
134 |
+
|
135 |
+
## Additional Information
|
136 |
+
|
137 |
+
### Dataset Curators
|
138 |
+
|
139 |
+
The dataset was curated by Md. Rezaul Karim, Sumon Kanti Dey, Bharathi Raja Chakravarthi, John McCrae and Michael Cochez.
|
140 |
+
|
141 |
+
### Licensing Information
|
142 |
+
|
143 |
+
This dataset is licensed under the MIT License.
|
144 |
+
|
145 |
+
### Citation Information
|
146 |
+
|
147 |
+
```
|
148 |
+
@inproceedings{karim2020BengaliNLP,
|
149 |
+
title={Classification Benchmarks for Under-resourced Bengali Language based on Multichannel Convolutional-LSTM Network},
|
150 |
+
author={Karim, Md. Rezaul and Chakravarti, Bharathi Raja and P. McCrae, John and Cochez, Michael},
|
151 |
+
booktitle={7th IEEE International Conference on Data Science and Advanced Analytics (IEEE DSAA,2020)},
|
152 |
+
publisher={IEEE},
|
153 |
+
year={2020}
|
154 |
+
}
|
155 |
+
```
|
bn_hate_speech.py
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""Bengali Hate Speech Dataset"""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import csv
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@misc{karim2020classification,
|
26 |
+
title={Classification Benchmarks for Under-resourced Bengali Language based on Multichannel Convolutional-LSTM Network},
|
27 |
+
author={Md. Rezaul Karim and Bharathi Raja Chakravarthi and John P. McCrae and Michael Cochez},
|
28 |
+
year={2020},
|
29 |
+
eprint={2004.07807},
|
30 |
+
archivePrefix={arXiv},
|
31 |
+
primaryClass={cs.CL}
|
32 |
+
}
|
33 |
+
"""
|
34 |
+
|
35 |
+
_DESCRIPTION = """\
|
36 |
+
The Bengali Hate Speech Dataset is a collection of Bengali articles collected from Bengali news articles,
|
37 |
+
news dump of Bengali TV channels, books, blogs, and social media. Emphasis was placed on Facebook pages and
|
38 |
+
newspaper sources because they attract close to 50 million followers and is a common source of opinions
|
39 |
+
and hate speech. The raw text corpus contains 250 million articles and the full dataset is being prepared
|
40 |
+
for release. This is a subset of the full dataset.
|
41 |
+
|
42 |
+
This dataset was prepared for hate-speech text classification benchmark on Bengali, an under-resourced language.
|
43 |
+
"""
|
44 |
+
|
45 |
+
_HOMEPAGE = "https://github.com/rezacsedu/Bengali-Hate-Speech-Dataset"
|
46 |
+
|
47 |
+
_LICENSE = "MIT License"
|
48 |
+
|
49 |
+
_URL = "https://raw.githubusercontent.com/rezacsedu/Bengali-Hate-Speech-Dataset/main/Bengali_%20Hate_Speech_Dataset_Subset.csv"
|
50 |
+
|
51 |
+
|
52 |
+
# TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
|
53 |
+
class BnHateSpeech(datasets.GeneratorBasedBuilder):
|
54 |
+
"""Bengali Hate Speech Dataset"""
|
55 |
+
|
56 |
+
def _info(self):
|
57 |
+
features = datasets.Features(
|
58 |
+
{
|
59 |
+
"text": datasets.Value("string"),
|
60 |
+
"label": datasets.features.ClassLabel(
|
61 |
+
names=["Personal", "Political", "Religious", "Geopolitical", "Gender abusive"]
|
62 |
+
),
|
63 |
+
}
|
64 |
+
)
|
65 |
+
return datasets.DatasetInfo(
|
66 |
+
description=_DESCRIPTION,
|
67 |
+
features=features,
|
68 |
+
supervised_keys=None,
|
69 |
+
homepage=_HOMEPAGE,
|
70 |
+
license=_LICENSE,
|
71 |
+
citation=_CITATION,
|
72 |
+
)
|
73 |
+
|
74 |
+
def _split_generators(self, dl_manager):
|
75 |
+
"""Returns SplitGenerators."""
|
76 |
+
|
77 |
+
train_path = dl_manager.download_and_extract(_URL)
|
78 |
+
return [
|
79 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
|
80 |
+
]
|
81 |
+
|
82 |
+
def _generate_examples(self, filepath):
|
83 |
+
"""Generate Bengali Hate Speech examples."""
|
84 |
+
|
85 |
+
with open(filepath, encoding="utf-8") as csv_file:
|
86 |
+
reader = csv.reader(csv_file, delimiter="\t")
|
87 |
+
next(reader, None)
|
88 |
+
for id_, row in enumerate(reader):
|
89 |
+
text, label = row
|
90 |
+
yield id_, {"text": text, "label": label}
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "The Bengali Hate Speech Dataset is a collection of Bengali articles collected from Bengali news articles,\nnews dump of Bengali TV channels, books, blogs, and social media. Emphasis was placed on Facebook pages and \nnewspaper sources because they attract close to 50 million followers and is a common source of opinions\nand hate speech. The raw text corpus contains 250 million articles and the full dataset is being prepared\nfor release. This is a subset of the full dataset. \n\nThis dataset was prepared for hate-speech text classification benchmark on Bengali, an under-resourced language.\n", "citation": "@misc{karim2020classification,\n title={Classification Benchmarks for Under-resourced Bengali Language based on Multichannel Convolutional-LSTM Network}, \n author={Md. Rezaul Karim and Bharathi Raja Chakravarthi and John P. McCrae and Michael Cochez},\n year={2020},\n eprint={2004.07807},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "https://github.com/rezacsedu/Bengali-Hate-Speech-Dataset", "license": "MIT License", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 5, "names": ["Personal", "Political", "Religious", "Geopolitical", "Gender abusive"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "bn_hate_speech", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 972635, "num_examples": 3418, "dataset_name": "bn_hate_speech"}}, "download_checksums": {"https://raw.githubusercontent.com/rezacsedu/Bengali-Hate-Speech-Dataset/main/Bengali_%20Hate_Speech_Dataset_Subset.csv": {"num_bytes": 974312, "checksum": "8ad2aab71c0a9ee61119767c3b628d18e9f2556d5cf52c6c80e677fb928c5420"}}, "download_size": 974312, "post_processing_size": null, "dataset_size": 972635, "size_in_bytes": 1946947}}
|
dummy/0.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3b2ee1f4b382e01e2b069df5ec9cfcdade5712cdc334fc3d34aceb76283ae7cc
|
3 |
+
size 715
|