system HF staff commited on
Commit
d53eaf3
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,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - crowdsourced
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - gpl-3-0
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
+ - sentiment-classification
20
+ ---
21
+
22
+ # Dataset Card for [Dataset Name]
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: [Home](https://github.com/sharmaroshan/Twitter-Sentiment-Analysis)
50
+ - **Repository:[Repo](https://github.com/sharmaroshan/Twitter-Sentiment-Analysis/blob/master/train_tweet.csv)
51
+ - **Paper:
52
+ - **Leaderboard:**
53
+ - **Point of Contact:[Darshan Gandhi](darshangandhi1151@gmail.com)
54
+
55
+ ### Dataset Summary
56
+
57
+ The objective of this task is to detect hate speech in tweets. For the sake of simplicity, we say a tweet contains hate speech if it has a racist or sexist sentiment associated with it. So, the task is to classify racist or sexist tweets from other tweets.
58
+
59
+ Formally, given a training sample of tweets and labels, where label ‘1’ denotes the tweet is racist/sexist and label ‘0’ denotes the tweet is not racist/sexist, your objective is to predict the labels on the given test dataset.
60
+
61
+ ### Supported Tasks and Leaderboards
62
+
63
+ [More Information Needed]
64
+
65
+ ### Languages
66
+ The tweets are primarily in English Language
67
+
68
+ ## Dataset Structure
69
+
70
+ ### Data Instances
71
+
72
+ The dataset contains a label denoting is the tweet a hate speech or not
73
+
74
+ ```
75
+ {'label': 0, # not a hate speech
76
+ 'tweet': ' @user when a father is dysfunctional and is so selfish he drags his kids into his dysfunction. #run'}
77
+ ```
78
+
79
+
80
+ ### Data Fields
81
+
82
+ * label : 1 - it is a hate specch, 0 - not a hate speech
83
+ * tweet: content of the tweet as a string
84
+
85
+ ### Data Splits
86
+
87
+ The data contains training data with :31962 entries
88
+
89
+ ## Dataset Creation
90
+
91
+ ### Curation Rationale
92
+
93
+ [More Information Needed]
94
+
95
+ ### Source Data
96
+
97
+ #### Initial Data Collection and Normalization
98
+
99
+ Crowdsourced from tweets of users
100
+
101
+ #### Who are the source language producers?
102
+
103
+ Cwodsourced from twitter
104
+
105
+ ### Annotations
106
+
107
+ #### Annotation process
108
+
109
+ The data has been precprocessed and a model has been trained to assign the relevant label to the tweet
110
+
111
+ #### Who are the annotators?
112
+
113
+ The data has been provided by Roshan Sharma
114
+
115
+ ### Personal and Sensitive Information
116
+
117
+ [More Information Needed]
118
+
119
+ ## Considerations for Using the Data
120
+
121
+ ### Social Impact of Dataset
122
+
123
+ With the help of this dataset, one can understand more about the human sentiments and also analye the situations when a particular person intends to make use of hatred/racist comments
124
+
125
+ ### Discussion of Biases
126
+
127
+ The data could be cleaned up further for additional purposes such as applying a better feature extraction techniques
128
+
129
+
130
+ [More Information Needed]
131
+
132
+ ### Other Known Limitations
133
+
134
+ [More Information Needed]
135
+
136
+ ## Additional Information
137
+
138
+ ### Dataset Curators
139
+
140
+ Roshan Sharma
141
+
142
+ ### Licensing Information
143
+
144
+ [Information](https://github.com/sharmaroshan/Twitter-Sentiment-Analysis/blob/master/LICENSE)
145
+
146
+ ### Citation Information
147
+
148
+ [Citation](https://github.com/sharmaroshan/Twitter-Sentiment-Analysis/blob/master/CONTRIBUTING.md)
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"default": {"description": "The objective of this task is to detect hate speech in tweets. For the sake of simplicity, we say a tweet contains hate speech if it has a racist or sexist sentiment associated with it. So, the task is to classify racist or sexist tweets from other tweets.\n\nFormally, given a training sample of tweets and labels, where label \u20181\u2019 denotes the tweet is racist/sexist and label \u20180\u2019 denotes the tweet is not racist/sexist, your objective is to predict the labels on the given test dataset.\n", "citation": "@InProceedings{Z\nRoshan Sharma:dataset,\ntitle = {Sentimental Analysis of Tweets for Detecting Hate/Racist Speeches},\nauthors={Roshan Sharma},\nyear={2018}\n}\n", "homepage": "https://github.com/sharmaroshan/Twitter-Sentiment-Analysis", "license": "", "features": {"label": {"num_classes": 2, "names": ["no-hate-speech", "hate-speech"], "names_file": null, "id": null, "_type": "ClassLabel"}, "tweet": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "tweets_hate_speech_detection", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3191776, "num_examples": 31962, "dataset_name": "tweets_hate_speech_detection"}}, "download_checksums": {"https://raw.githubusercontent.com/sharmaroshan/Twitter-Sentiment-Analysis/master/train_tweet.csv": {"num_bytes": 3103165, "checksum": "4f1bfabc2908029734fb2acd34028a8dfd1b92098bddfe60b0f0836c964e26ab"}}, "download_size": 3103165, "post_processing_size": null, "dataset_size": 3191776, "size_in_bytes": 6294941}}
dummy/0.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09a256280267e7670dfdf70cba0c10d94af707d6ef972a5844bcee12d3598ca8
3
+ size 506
tweets_hate_speech_detection.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
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
+
16
+ # Lint as: python3
17
+ """Detecing which tweets showcase hate or racist remarks."""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import csv
22
+
23
+ import datasets
24
+
25
+
26
+ _DESCRIPTION = """\
27
+ The objective of this task is to detect hate speech in tweets. For the sake of simplicity, we say a tweet contains hate speech if it has a racist or sexist sentiment associated with it. So, the task is to classify racist or sexist tweets from other tweets.
28
+
29
+ Formally, given a training sample of tweets and labels, where label ‘1’ denotes the tweet is racist/sexist and label ‘0’ denotes the tweet is not racist/sexist, your objective is to predict the labels on the given test dataset.
30
+ """
31
+
32
+ _CITATION = """\
33
+ @InProceedings{Z
34
+ Roshan Sharma:dataset,
35
+ title = {Sentimental Analysis of Tweets for Detecting Hate/Racist Speeches},
36
+ authors={Roshan Sharma},
37
+ year={2018}
38
+ }
39
+ """
40
+
41
+ _TRAIN_DOWNLOAD_URL = (
42
+ "https://raw.githubusercontent.com/sharmaroshan/Twitter-Sentiment-Analysis/master/train_tweet.csv"
43
+ )
44
+
45
+
46
+ class TweetsHateSpeechDetection(datasets.GeneratorBasedBuilder):
47
+ """Detecing which tweets showcase hate or racist remarks."""
48
+
49
+ def _info(self):
50
+ return datasets.DatasetInfo(
51
+ description=_DESCRIPTION,
52
+ features=datasets.Features(
53
+ {
54
+ "label": datasets.ClassLabel(names=["no-hate-speech", "hate-speech"]),
55
+ "tweet": datasets.Value("string"),
56
+ }
57
+ ),
58
+ homepage="https://github.com/sharmaroshan/Twitter-Sentiment-Analysis",
59
+ citation=_CITATION,
60
+ )
61
+
62
+ def _split_generators(self, dl_manager):
63
+ train_path = dl_manager.download_and_extract(_TRAIN_DOWNLOAD_URL)
64
+
65
+ return [
66
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
67
+ ]
68
+
69
+ def _generate_examples(self, filepath):
70
+ """Generate Tweet examples."""
71
+ with open(filepath, encoding="utf-8") as csv_file:
72
+ csv_reader = csv.reader(
73
+ csv_file, quotechar='"', delimiter=",", quoting=csv.QUOTE_ALL, skipinitialspace=True
74
+ )
75
+ next(csv_reader, None)
76
+ for id_, row in enumerate(csv_reader):
77
+ row = row[1:]
78
+ (label, tweet) = row
79
+
80
+ yield id_, {
81
+ "label": int(label),
82
+ "tweet": (tweet),
83
+ }