albertvillanova HF staff commited on
Commit
9961229
1 Parent(s): 3802629

Convert dataset to Parquet (#2)

Browse files

- Convert dataset to Parquet (c25bef766d34d9c1c74793b3fa1968def2a57d1c)
- Delete loading script (40229487a35af280a5082d81da92646e3aed5306)
- Delete legacy dataset_infos.json (4d0f5d54db95a28b93fca5f461a9b45d55e92d3a)

README.md CHANGED
@@ -36,10 +36,15 @@ dataset_info:
36
  '4': Gender abusive
37
  splits:
38
  - name: train
39
- num_bytes: 972635
40
  num_examples: 3418
41
- download_size: 974312
42
- dataset_size: 972635
 
 
 
 
 
43
  ---
44
 
45
  # Dataset Card for Bengali Hate Speech Dataset
 
36
  '4': Gender abusive
37
  splits:
38
  - name: train
39
+ num_bytes: 972631
40
  num_examples: 3418
41
+ download_size: 389814
42
+ dataset_size: 972631
43
+ configs:
44
+ - config_name: default
45
+ data_files:
46
+ - split: train
47
+ path: data/train-*
48
  ---
49
 
50
  # Dataset Card for Bengali Hate Speech Dataset
bn_hate_speech.py DELETED
@@ -1,89 +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
- """Bengali Hate Speech Dataset"""
16
-
17
-
18
- import csv
19
-
20
- import datasets
21
-
22
-
23
- _CITATION = """\
24
- @misc{karim2020classification,
25
- title={Classification Benchmarks for Under-resourced Bengali Language based on Multichannel Convolutional-LSTM Network},
26
- author={Md. Rezaul Karim and Bharathi Raja Chakravarthi and John P. McCrae and Michael Cochez},
27
- year={2020},
28
- eprint={2004.07807},
29
- archivePrefix={arXiv},
30
- primaryClass={cs.CL}
31
- }
32
- """
33
-
34
- _DESCRIPTION = """\
35
- The Bengali Hate Speech Dataset is a collection of Bengali articles collected from Bengali news articles,
36
- news dump of Bengali TV channels, books, blogs, and social media. Emphasis was placed on Facebook pages and
37
- newspaper sources because they attract close to 50 million followers and is a common source of opinions
38
- and hate speech. The raw text corpus contains 250 million articles and the full dataset is being prepared
39
- for release. This is a subset of the full dataset.
40
-
41
- This dataset was prepared for hate-speech text classification benchmark on Bengali, an under-resourced language.
42
- """
43
-
44
- _HOMEPAGE = "https://github.com/rezacsedu/Bengali-Hate-Speech-Dataset"
45
-
46
- _LICENSE = "MIT License"
47
-
48
- _URL = "https://raw.githubusercontent.com/rezacsedu/Bengali-Hate-Speech-Dataset/main/bengali_%20hate_v1.0.csv"
49
-
50
-
51
- # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
52
- class BnHateSpeech(datasets.GeneratorBasedBuilder):
53
- """Bengali Hate Speech Dataset"""
54
-
55
- def _info(self):
56
- features = datasets.Features(
57
- {
58
- "text": datasets.Value("string"),
59
- "label": datasets.features.ClassLabel(
60
- names=["Personal", "Political", "Religious", "Geopolitical", "Gender abusive"]
61
- ),
62
- }
63
- )
64
- return datasets.DatasetInfo(
65
- description=_DESCRIPTION,
66
- features=features,
67
- supervised_keys=None,
68
- homepage=_HOMEPAGE,
69
- license=_LICENSE,
70
- citation=_CITATION,
71
- )
72
-
73
- def _split_generators(self, dl_manager):
74
- """Returns SplitGenerators."""
75
-
76
- train_path = dl_manager.download_and_extract(_URL)
77
- return [
78
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
79
- ]
80
-
81
- def _generate_examples(self, filepath):
82
- """Generate Bengali Hate Speech examples."""
83
-
84
- with open(filepath, encoding="utf-8") as csv_file:
85
- reader = csv.reader(csv_file, delimiter="\t")
86
- next(reader, None)
87
- for id_, row in enumerate(reader):
88
- text, label = row
89
- yield id_, {"text": text, "label": label}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3555f0b7794a64e7a0dbd0e11a9f73b954683d61ae603b8e9a17a64c10bdc26
3
+ size 389814
dataset_infos.json DELETED
@@ -1 +0,0 @@
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, "task_templates": 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_v1.0.csv": {"num_bytes": 974312, "checksum": "8ad2aab71c0a9ee61119767c3b628d18e9f2556d5cf52c6c80e677fb928c5420"}}, "download_size": 974312, "post_processing_size": null, "dataset_size": 972635, "size_in_bytes": 1946947}}