system HF staff commited on
Commit
41fbce6
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.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,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - machine-generated
4
+ language_creators:
5
+ - crowdsourced
6
+ languages:
7
+ - tl
8
+ licenses:
9
+ - unknown
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 10K<n<100K
14
+ source_datasets:
15
+ - extended|other-twitter-data-philippine-election
16
+ task_categories:
17
+ - text-classification
18
+ task_ids:
19
+ - sentiment-analysis
20
+ ---
21
+
22
+ # Dataset Card for Hate Speech in Filipino
23
+
24
+ ## Table of Contents
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-instances)
32
+ - [Data Splits](#data-instances)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+
47
+ ## Dataset Description
48
+
49
+ - **Homepage: [Hate Speech Dataset in Filipino homepage](https://github.com/jcblaisecruz02/Filipino-Text-Benchmarks)**
50
+ - **Repository: [Hate Speech Dataset in Filipino homepage](https://github.com/jcblaisecruz02/Filipino-Text-Benchmarks)**
51
+ - **Paper: [PCJ paper](https://pcj.csp.org.ph/index.php/pcj/issue/download/29/PCJ%20V14%20N1%20pp1-14%202019)**
52
+ - **Leaderboard:**
53
+ - **Point of Contact: [Jan Christian Cruz](mailto:jan_christian_cruz@dlsu.edu.ph)**
54
+
55
+ ### Dataset Summary
56
+ Contains 10k tweets (training set) that are labeled as hate speech or non-hate speech. Released with 4,232 validation and 4,232 testing samples. Collected during the 2016 Philippine Presidential Elections.
57
+
58
+ ### Supported Tasks and Leaderboards
59
+
60
+ [More Information Needed]
61
+
62
+ ### Languages
63
+
64
+ The dataset is primarily in Filipino, with the addition of some English words commonly used in Filipino vernacular
65
+
66
+ ## Dataset Structure
67
+
68
+ ### Data Instances
69
+
70
+ Sample data:
71
+ ```
72
+ {
73
+ "text": "Taas ni Mar Roxas ah. KULTONG DILAW NGA NAMAN",
74
+ "label": 1
75
+ }
76
+ ```
77
+
78
+ ### Data Fields
79
+
80
+ [More Information Needed]
81
+
82
+ ### Data Splits
83
+
84
+ [More Information Needed]
85
+
86
+ ## Dataset Creation
87
+
88
+ ### Curation Rationale
89
+
90
+ This study seeks to contribute to the filling of this gap through the development of a model that can automate hate speech detection and classification in Philippine election-related tweets. The role of the microblogging site Twitter as a platform for the expression of support and hate during the 2016 Philippine presidential election has been supported in news reports and systematic studies. Thus, the particular question addressed in this paper is: Can existing techniques in language processing and machine learning be applied to detect hate speech in the Philippine election context?
91
+
92
+ ### Source Data
93
+
94
+ #### Initial Data Collection and Normalization
95
+
96
+ The dataset used in this study was a subset of the corpus 1,696,613 tweets crawled by Andrade et al. and posted from November 2015 to May 2016 during the campaign period for the Philippine presidential election. They were culled based on the presence of candidate names (e.g., Binay, Duterte, Poe, Roxas, and Santiago) and election-related hashtags (e.g., #Halalan2016, #Eleksyon2016, and #PiliPinas2016).
97
+
98
+ Data preprocessing was performed to prepare the tweets for feature extraction and classification. It consisted of the following steps: data de-identification, uniform resource locator (URL) removal, special character processing, normalization, hashtag processing, and tokenization.
99
+
100
+ [More Information Needed]
101
+
102
+ #### Who are the source language producers?
103
+
104
+ [More Information Needed]
105
+
106
+ ### Annotations
107
+
108
+ #### Annotation process
109
+
110
+ [More Information Needed]
111
+
112
+ #### Who are the annotators?
113
+
114
+ [More Information Needed]
115
+
116
+ ### Personal and Sensitive Information
117
+
118
+ [More Information Needed]
119
+
120
+ ## Considerations for Using the Data
121
+
122
+ ### Social Impact of Dataset
123
+
124
+ [More Information Needed]
125
+
126
+ ### Discussion of Biases
127
+
128
+ [More Information Needed]
129
+
130
+ ### Other Known Limitations
131
+
132
+ [More Information Needed]
133
+
134
+ ## Additional Information
135
+
136
+ ### Dataset Curators
137
+
138
+ [Jan Christian Cruz](mailto:jan_christian_cruz@dlsu.edu.ph)
139
+
140
+ ### Licensing Information
141
+
142
+ [More Information Needed]
143
+
144
+ ### Citation Information
145
+
146
+ @article{Cabasag-2019-hate-speech,
147
+ title={Hate speech in Philippine election-related tweets: Automatic detection and classification using natural language processing.},
148
+ author={Neil Vicente Cabasag, Vicente Raphael Chan, Sean Christian Lim, Mark Edward Gonzales, and Charibeth Cheng},
149
+ journal={Philippine Computing Journal},
150
+ volume={XIV},
151
+ number={1},
152
+ month={August},
153
+ year={2019}
154
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"default": {"description": " Contains 10k tweets (training set) that are labeled as hate speech or non-hate speech. Released with 4,232 validation and 4,232 testing samples. Collected during the 2016 Philippine Presidential Elections.\n", "citation": "@article{Cabasag-2019-hate-speech,\n title={Hate speech in Philippine election-related tweets: Automatic detection and classification using natural language processing.},\n author={Neil Vicente Cabasag, Vicente Raphael Chan, Sean Christian Lim, Mark Edward Gonzales, and Charibeth Cheng},\n journal={Philippine Computing Journal},\n volume={XIV},\n number={1},\n month={August},\n year={2019}\n}\n", "homepage": "https://github.com/jcblaisecruz02/Filipino-Text-Benchmarks", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["0", "1"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "hate_speech_filipino", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 995919, "num_examples": 10000, "dataset_name": "hate_speech_filipino"}, "test": {"name": "test", "num_bytes": 995919, "num_examples": 10000, "dataset_name": "hate_speech_filipino"}, "validation": {"name": "validation", "num_bytes": 424365, "num_examples": 4232, "dataset_name": "hate_speech_filipino"}}, "download_checksums": {"https://s3.us-east-2.amazonaws.com/blaisecruz.com/datasets/hatenonhate/hatespeech_raw.zip": {"num_bytes": 822927, "checksum": "c530a4b724f9893eef3cc911f9bc3bfbd31cfd03315c0b56462dd1987d6c94e1"}}, "download_size": 822927, "post_processing_size": null, "dataset_size": 2416203, "size_in_bytes": 3239130}}
dummy/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3924e7e1e94350ac0ad81f8e7626e8634e2f3ab68081e9841296d63b4e3ce421
3
+ size 1651
hate_speech_filipino.py ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Hate Speech Text Classification Dataset in Filipino."""
16
+
17
+ import csv
18
+ import os
19
+
20
+ import datasets
21
+
22
+
23
+ _DESCRIPTION = """\
24
+ Contains 10k tweets (training set) that are labeled as hate speech or non-hate speech. Released with 4,232 validation and 4,232 testing samples. Collected during the 2016 Philippine Presidential Elections.
25
+ """
26
+
27
+ _CITATION = """\
28
+ @article{Cabasag-2019-hate-speech,
29
+ title={Hate speech in Philippine election-related tweets: Automatic detection and classification using natural language processing.},
30
+ author={Neil Vicente Cabasag, Vicente Raphael Chan, Sean Christian Lim, Mark Edward Gonzales, and Charibeth Cheng},
31
+ journal={Philippine Computing Journal},
32
+ volume={XIV},
33
+ number={1},
34
+ month={August},
35
+ year={2019}
36
+ }
37
+ """
38
+
39
+ _HOMEPAGE = "https://github.com/jcblaisecruz02/Filipino-Text-Benchmarks"
40
+
41
+ # TODO: Add the licence for the dataset here if you can find it
42
+ _LICENSE = ""
43
+
44
+ _URL = "https://s3.us-east-2.amazonaws.com/blaisecruz.com/datasets/hatenonhate/hatespeech_raw.zip"
45
+
46
+
47
+ class HateSpeechFilipino(datasets.GeneratorBasedBuilder):
48
+ """Hate Speech Text Classification Dataset in Filipino."""
49
+
50
+ VERSION = datasets.Version("1.0.0")
51
+
52
+ def _info(self):
53
+ # Labels: 0="Non-hate Speech", 1="Hate Speech"
54
+ features = datasets.Features(
55
+ {"text": datasets.Value("string"), "label": datasets.features.ClassLabel(names=["0", "1"])}
56
+ )
57
+ return datasets.DatasetInfo(
58
+ description=_DESCRIPTION,
59
+ features=features,
60
+ supervised_keys=None,
61
+ homepage=_HOMEPAGE,
62
+ license=_LICENSE,
63
+ citation=_CITATION,
64
+ )
65
+
66
+ def _split_generators(self, dl_manager):
67
+ """Returns SplitGenerators."""
68
+ data_dir = dl_manager.download_and_extract(_URL)
69
+ train_path = os.path.join(data_dir, "hatespeech", "train.csv")
70
+ test_path = os.path.join(data_dir, "hatespeech", "train.csv")
71
+ validation_path = os.path.join(data_dir, "hatespeech", "valid.csv")
72
+
73
+ return [
74
+ datasets.SplitGenerator(
75
+ name=datasets.Split.TRAIN,
76
+ gen_kwargs={
77
+ "filepath": train_path,
78
+ "split": "train",
79
+ },
80
+ ),
81
+ datasets.SplitGenerator(
82
+ name=datasets.Split.TEST,
83
+ gen_kwargs={
84
+ "filepath": test_path,
85
+ "split": "test",
86
+ },
87
+ ),
88
+ datasets.SplitGenerator(
89
+ name=datasets.Split.VALIDATION,
90
+ gen_kwargs={
91
+ "filepath": validation_path,
92
+ "split": "dev",
93
+ },
94
+ ),
95
+ ]
96
+
97
+ def _generate_examples(self, filepath, split):
98
+ """ Yields examples. """
99
+ with open(filepath, encoding="utf-8") as csv_file:
100
+ csv_reader = csv.reader(
101
+ csv_file, quotechar='"', delimiter=",", quoting=csv.QUOTE_ALL, skipinitialspace=True
102
+ )
103
+ next(csv_reader)
104
+ for id_, row in enumerate(csv_reader):
105
+ try:
106
+ text, label = row
107
+ yield id_, {"text": text, "label": label}
108
+ except ValueError:
109
+ pass