holylovenia
commited on
Commit
•
1971955
1
Parent(s):
61edd1b
Upload local_id_abusive.py with huggingface_hub
Browse files- local_id_abusive.py +17 -17
local_id_abusive.py
CHANGED
@@ -19,9 +19,9 @@ from typing import Dict, List, Tuple
|
|
19 |
import datasets
|
20 |
import pandas as pd
|
21 |
|
22 |
-
from
|
23 |
-
from
|
24 |
-
from
|
25 |
|
26 |
_CITATION = """\
|
27 |
@inproceedings{putri2021abusive,
|
@@ -67,7 +67,7 @@ _URLS = {
|
|
67 |
_SUPPORTED_TASKS = [Tasks.ASPECT_BASED_SENTIMENT_ANALYSIS]
|
68 |
|
69 |
_SOURCE_VERSION = "1.0.0"
|
70 |
-
|
71 |
|
72 |
|
73 |
class LocalIDAbusive(datasets.GeneratorBasedBuilder):
|
@@ -75,35 +75,35 @@ class LocalIDAbusive(datasets.GeneratorBasedBuilder):
|
|
75 |
Sundanese words."""
|
76 |
|
77 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
78 |
-
|
79 |
|
80 |
BUILDER_CONFIGS = [
|
81 |
-
|
82 |
name="local_id_abusive_jav_source",
|
83 |
version=SOURCE_VERSION,
|
84 |
description="local_id_abusive source schema Javanese",
|
85 |
schema="source",
|
86 |
subset_id="local_id_abusive_jav",
|
87 |
),
|
88 |
-
|
89 |
name="local_id_abusive_sun_source",
|
90 |
version=SOURCE_VERSION,
|
91 |
description="local_id_abusive source schema Sundanese",
|
92 |
schema="source",
|
93 |
subset_id="local_id_abusive_sun",
|
94 |
),
|
95 |
-
|
96 |
-
name="
|
97 |
-
version=
|
98 |
description="local_id_abusive Nusantara schema Javanese",
|
99 |
-
schema="
|
100 |
subset_id="local_id_abusive_jav",
|
101 |
),
|
102 |
-
|
103 |
-
name="
|
104 |
-
version=
|
105 |
description="local_id_abusive Nusantara schema Sundanese",
|
106 |
-
schema="
|
107 |
subset_id="local_id_abusive_sun",
|
108 |
),
|
109 |
]
|
@@ -119,7 +119,7 @@ class LocalIDAbusive(datasets.GeneratorBasedBuilder):
|
|
119 |
"hs": datasets.Value("bool"),
|
120 |
}
|
121 |
)
|
122 |
-
elif self.config.schema == "
|
123 |
features = schemas.text_multi_features([0, 1])
|
124 |
|
125 |
return datasets.DatasetInfo(
|
@@ -151,7 +151,7 @@ class LocalIDAbusive(datasets.GeneratorBasedBuilder):
|
|
151 |
if self.config.schema == "source":
|
152 |
example = {"isi_tweet": row.isi_tweet, "uk": row.uk, "hs": row.hs}
|
153 |
yield i, example
|
154 |
-
elif self.config.schema == "
|
155 |
example = {
|
156 |
"id": str(i),
|
157 |
"text": row.isi_tweet,
|
|
|
19 |
import datasets
|
20 |
import pandas as pd
|
21 |
|
22 |
+
from seacrowd.utils import schemas
|
23 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
24 |
+
from seacrowd.utils.constants import Tasks
|
25 |
|
26 |
_CITATION = """\
|
27 |
@inproceedings{putri2021abusive,
|
|
|
67 |
_SUPPORTED_TASKS = [Tasks.ASPECT_BASED_SENTIMENT_ANALYSIS]
|
68 |
|
69 |
_SOURCE_VERSION = "1.0.0"
|
70 |
+
_SEACROWD_VERSION = "2024.06.20"
|
71 |
|
72 |
|
73 |
class LocalIDAbusive(datasets.GeneratorBasedBuilder):
|
|
|
75 |
Sundanese words."""
|
76 |
|
77 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
78 |
+
SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
|
79 |
|
80 |
BUILDER_CONFIGS = [
|
81 |
+
SEACrowdConfig(
|
82 |
name="local_id_abusive_jav_source",
|
83 |
version=SOURCE_VERSION,
|
84 |
description="local_id_abusive source schema Javanese",
|
85 |
schema="source",
|
86 |
subset_id="local_id_abusive_jav",
|
87 |
),
|
88 |
+
SEACrowdConfig(
|
89 |
name="local_id_abusive_sun_source",
|
90 |
version=SOURCE_VERSION,
|
91 |
description="local_id_abusive source schema Sundanese",
|
92 |
schema="source",
|
93 |
subset_id="local_id_abusive_sun",
|
94 |
),
|
95 |
+
SEACrowdConfig(
|
96 |
+
name="local_id_abusive_jav_seacrowd_text_multi",
|
97 |
+
version=SEACROWD_VERSION,
|
98 |
description="local_id_abusive Nusantara schema Javanese",
|
99 |
+
schema="seacrowd_text_multi",
|
100 |
subset_id="local_id_abusive_jav",
|
101 |
),
|
102 |
+
SEACrowdConfig(
|
103 |
+
name="local_id_abusive_sun_seacrowd_text_multi",
|
104 |
+
version=SEACROWD_VERSION,
|
105 |
description="local_id_abusive Nusantara schema Sundanese",
|
106 |
+
schema="seacrowd_text_multi",
|
107 |
subset_id="local_id_abusive_sun",
|
108 |
),
|
109 |
]
|
|
|
119 |
"hs": datasets.Value("bool"),
|
120 |
}
|
121 |
)
|
122 |
+
elif self.config.schema == "seacrowd_text_multi":
|
123 |
features = schemas.text_multi_features([0, 1])
|
124 |
|
125 |
return datasets.DatasetInfo(
|
|
|
151 |
if self.config.schema == "source":
|
152 |
example = {"isi_tweet": row.isi_tweet, "uk": row.uk, "hs": row.hs}
|
153 |
yield i, example
|
154 |
+
elif self.config.schema == "seacrowd_text_multi":
|
155 |
example = {
|
156 |
"id": str(i),
|
157 |
"text": row.isi_tweet,
|