Datasets:
Tasks:
Text Classification
Modalities:
Text
Sub-tasks:
hate-speech-detection
Languages:
Portuguese
Size:
1K - 10K
Tags:
instagram
DOI:
ruanchaves
commited on
Commit
·
955707f
1
Parent(s):
38773ef
pandas
Browse files
hatebr.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
"""HateBR dataset"""
|
2 |
|
3 |
import datasets
|
4 |
-
import
|
5 |
|
6 |
_CITATION = """
|
7 |
@inproceedings{vargas2022hatebr,
|
@@ -46,13 +46,6 @@ class Boun(datasets.GeneratorBasedBuilder):
|
|
46 |
]
|
47 |
|
48 |
def _generate_examples(self, filepath):
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
if idx:
|
53 |
-
yield idx, {
|
54 |
-
"instagram_comments": row[0],
|
55 |
-
"offensive_language": row[1],
|
56 |
-
"offensiveness_levels": row[2],
|
57 |
-
"hate_speech": row[3]
|
58 |
-
}
|
|
|
1 |
"""HateBR dataset"""
|
2 |
|
3 |
import datasets
|
4 |
+
import pandas as pd
|
5 |
|
6 |
_CITATION = """
|
7 |
@inproceedings{vargas2022hatebr,
|
|
|
46 |
]
|
47 |
|
48 |
def _generate_examples(self, filepath):
|
49 |
+
records = pd.read_csv(filepath).to_dict("records")
|
50 |
+
for idx, row in enumerate(records):
|
51 |
+
yield idx, row
|
|
|
|
|
|
|
|
|
|
|
|
|
|