Datasets:
Tasks:
Text Classification
Sub-tasks:
hate-speech-detection
Languages:
Portuguese
Size:
1K<n<10K
Tags:
instagram
DOI:
Commit
·
c3efdf4
1
Parent(s):
8f5a87c
hate speech labels
Browse files
hatebr.py
CHANGED
|
@@ -47,22 +47,18 @@ class Boun(datasets.GeneratorBasedBuilder):
|
|
| 47 |
"instagram_comments": datasets.Value("string"),
|
| 48 |
"offensive_language": datasets.Value("int32"),
|
| 49 |
"offensiveness_levels": datasets.Value("int32"),
|
| 50 |
-
"
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
"non-offensive": datasets.Value(dtype='bool', id=None)
|
| 63 |
-
})
|
| 64 |
-
}
|
| 65 |
-
),
|
| 66 |
supervised_keys=None,
|
| 67 |
homepage="https://github.com/franciellevargas/HateBR",
|
| 68 |
citation=_CITATION,
|
|
@@ -77,11 +73,11 @@ class Boun(datasets.GeneratorBasedBuilder):
|
|
| 77 |
def _generate_examples(self, filepath):
|
| 78 |
def process_row(row):
|
| 79 |
categories = row["hate_speech"].split(",")
|
| 80 |
-
row["hate_speech"]
|
| 81 |
for default_label in _LABEL_INT_KEY.keys():
|
| 82 |
-
row[
|
| 83 |
for int_label in categories:
|
| 84 |
-
row[
|
| 85 |
return row
|
| 86 |
records = pd.read_csv(filepath).to_dict("records")
|
| 87 |
for idx, row in enumerate(records):
|
|
|
|
| 47 |
"instagram_comments": datasets.Value("string"),
|
| 48 |
"offensive_language": datasets.Value("int32"),
|
| 49 |
"offensiveness_levels": datasets.Value("int32"),
|
| 50 |
+
"antisemitism": datasets.Value("bool"),
|
| 51 |
+
"apology_for_the_dictatorship": datasets.Value("bool"),
|
| 52 |
+
"fatphobia": datasets.Value("bool"),
|
| 53 |
+
"homophobia": datasets.Value("bool"),
|
| 54 |
+
"partyism": datasets.Value("bool"),
|
| 55 |
+
"racism": datasets.Value("bool"),
|
| 56 |
+
"religious_intolerance": datasets.Value("bool"),
|
| 57 |
+
"sexism": datasets.Value("bool"),
|
| 58 |
+
"xenophobia": datasets.Value("bool"),
|
| 59 |
+
"offensive_&_non-hate_speech": datasets.Value("bool"),
|
| 60 |
+
"non-offensive": datasets.Value("bool")
|
| 61 |
+
}),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
supervised_keys=None,
|
| 63 |
homepage="https://github.com/franciellevargas/HateBR",
|
| 64 |
citation=_CITATION,
|
|
|
|
| 73 |
def _generate_examples(self, filepath):
|
| 74 |
def process_row(row):
|
| 75 |
categories = row["hate_speech"].split(",")
|
| 76 |
+
del row["hate_speech"]
|
| 77 |
for default_label in _LABEL_INT_KEY.keys():
|
| 78 |
+
row[default_label] = False
|
| 79 |
for int_label in categories:
|
| 80 |
+
row[_INT_LABEL_KEY[int(int_label)]] = True
|
| 81 |
return row
|
| 82 |
records = pd.read_csv(filepath).to_dict("records")
|
| 83 |
for idx, row in enumerate(records):
|