Datasets:
Tasks:
Text Classification
Modalities:
Text
Sub-tasks:
hate-speech-detection
Languages:
English
Size:
100K - 1M
License:
Commit
·
5c05f44
1
Parent(s):
bb05a2f
Update wiki_toxic.py
Browse files- wiki_toxic.py +8 -12
wiki_toxic.py
CHANGED
|
@@ -52,14 +52,6 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
|
|
| 52 |
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
| 53 |
|
| 54 |
def _info(self):
|
| 55 |
-
return datasets.DatasetInfo(
|
| 56 |
-
description=_DESCRIPTION,
|
| 57 |
-
homepage=_HOMEPAGE,
|
| 58 |
-
license=_LICENSE,
|
| 59 |
-
citation=_CITATION,
|
| 60 |
-
)
|
| 61 |
-
|
| 62 |
-
def _split_generators(self, dl_manager):
|
| 63 |
features = datasets.Features(
|
| 64 |
{
|
| 65 |
"id": datasets.Value("string"),
|
|
@@ -67,11 +59,18 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
|
|
| 67 |
"label": datasets.ClassLabel(names=["non", "tox"])
|
| 68 |
}
|
| 69 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
|
|
|
| 71 |
return [
|
| 72 |
datasets.SplitGenerator(
|
| 73 |
name=datasets.Split.TRAIN,
|
| 74 |
-
features=features,
|
| 75 |
# These kwargs will be passed to _generate_examples
|
| 76 |
gen_kwargs={
|
| 77 |
"filepath": "train.csv",
|
|
@@ -80,7 +79,6 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
|
|
| 80 |
),
|
| 81 |
datasets.SplitGenerator(
|
| 82 |
name=datasets.Split.VALIDATION,
|
| 83 |
-
features=features,
|
| 84 |
# These kwargs will be passed to _generate_examples
|
| 85 |
gen_kwargs={
|
| 86 |
"filepath": "validation.csv",
|
|
@@ -89,7 +87,6 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
|
|
| 89 |
),
|
| 90 |
datasets.SplitGenerator(
|
| 91 |
name=datasets.Split.TEST,
|
| 92 |
-
features=features,
|
| 93 |
# These kwargs will be passed to _generate_examples
|
| 94 |
gen_kwargs={
|
| 95 |
"filepath": "test.csv",
|
|
@@ -98,7 +95,6 @@ class WikiToxic(datasets.GeneratorBasedBuilder):
|
|
| 98 |
),
|
| 99 |
datasets.SplitGenerator(
|
| 100 |
name="balanced_train",
|
| 101 |
-
features=features,
|
| 102 |
# These kwargs will be passed to _generate_examples
|
| 103 |
gen_kwargs={
|
| 104 |
"filepath": "balanced_train.csv",
|
|
|
|
| 52 |
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
| 53 |
|
| 54 |
def _info(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
features = datasets.Features(
|
| 56 |
{
|
| 57 |
"id": datasets.Value("string"),
|
|
|
|
| 59 |
"label": datasets.ClassLabel(names=["non", "tox"])
|
| 60 |
}
|
| 61 |
)
|
| 62 |
+
return datasets.DatasetInfo(
|
| 63 |
+
description=_DESCRIPTION,
|
| 64 |
+
homepage=_HOMEPAGE,
|
| 65 |
+
license=_LICENSE,
|
| 66 |
+
citation=_CITATION,
|
| 67 |
+
features=features
|
| 68 |
+
)
|
| 69 |
|
| 70 |
+
def _split_generators(self, dl_manager):
|
| 71 |
return [
|
| 72 |
datasets.SplitGenerator(
|
| 73 |
name=datasets.Split.TRAIN,
|
|
|
|
| 74 |
# These kwargs will be passed to _generate_examples
|
| 75 |
gen_kwargs={
|
| 76 |
"filepath": "train.csv",
|
|
|
|
| 79 |
),
|
| 80 |
datasets.SplitGenerator(
|
| 81 |
name=datasets.Split.VALIDATION,
|
|
|
|
| 82 |
# These kwargs will be passed to _generate_examples
|
| 83 |
gen_kwargs={
|
| 84 |
"filepath": "validation.csv",
|
|
|
|
| 87 |
),
|
| 88 |
datasets.SplitGenerator(
|
| 89 |
name=datasets.Split.TEST,
|
|
|
|
| 90 |
# These kwargs will be passed to _generate_examples
|
| 91 |
gen_kwargs={
|
| 92 |
"filepath": "test.csv",
|
|
|
|
| 95 |
),
|
| 96 |
datasets.SplitGenerator(
|
| 97 |
name="balanced_train",
|
|
|
|
| 98 |
# These kwargs will be passed to _generate_examples
|
| 99 |
gen_kwargs={
|
| 100 |
"filepath": "balanced_train.csv",
|