Upload kamus_alay.py with huggingface_hub
Browse files- kamus_alay.py +12 -12
kamus_alay.py
CHANGED
@@ -3,9 +3,9 @@ from typing import Dict, List, Tuple
|
|
3 |
|
4 |
import datasets
|
5 |
|
6 |
-
from
|
7 |
-
from
|
8 |
-
from
|
9 |
|
10 |
import pandas as pd
|
11 |
|
@@ -45,14 +45,14 @@ _SUPPORTED_TASKS = [Tasks.MORPHOLOGICAL_INFLECTION]
|
|
45 |
|
46 |
# Dataset does not have versioning
|
47 |
_SOURCE_VERSION = "1.0.0"
|
48 |
-
|
49 |
|
50 |
|
51 |
class KamusAlay(datasets.GeneratorBasedBuilder):
|
52 |
"""Kamus Alay is a dataset of lexicon for text normalization of Indonesian colloquial word"""
|
53 |
|
54 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
55 |
-
|
56 |
|
57 |
label_classes = [
|
58 |
"abreviasi",
|
@@ -75,18 +75,18 @@ class KamusAlay(datasets.GeneratorBasedBuilder):
|
|
75 |
]
|
76 |
|
77 |
BUILDER_CONFIGS = [
|
78 |
-
|
79 |
name="kamus_alay_source",
|
80 |
version=SOURCE_VERSION,
|
81 |
description="Kamus Alay source schema",
|
82 |
schema="source",
|
83 |
subset_id="kamus_alay",
|
84 |
),
|
85 |
-
|
86 |
-
name="
|
87 |
-
version=
|
88 |
description="Kamus Alay Nusantara schema",
|
89 |
-
schema="
|
90 |
subset_id="kamus_alay",
|
91 |
),
|
92 |
]
|
@@ -104,7 +104,7 @@ class KamusAlay(datasets.GeneratorBasedBuilder):
|
|
104 |
"categories": datasets.Sequence(datasets.Value("string")),
|
105 |
}
|
106 |
)
|
107 |
-
elif self.config.schema == "
|
108 |
features = schemas.pairs_multi_features(self.label_classes)
|
109 |
|
110 |
return datasets.DatasetInfo(
|
@@ -147,7 +147,7 @@ class KamusAlay(datasets.GeneratorBasedBuilder):
|
|
147 |
}
|
148 |
yield row.id, ex
|
149 |
|
150 |
-
elif self.config.schema == "
|
151 |
for row in df.itertuples():
|
152 |
ex = {
|
153 |
"id": str(row.id),
|
|
|
3 |
|
4 |
import datasets
|
5 |
|
6 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
7 |
+
from seacrowd.utils.constants import Tasks
|
8 |
+
from seacrowd.utils import schemas
|
9 |
|
10 |
import pandas as pd
|
11 |
|
|
|
45 |
|
46 |
# Dataset does not have versioning
|
47 |
_SOURCE_VERSION = "1.0.0"
|
48 |
+
_SEACROWD_VERSION = "2024.06.20"
|
49 |
|
50 |
|
51 |
class KamusAlay(datasets.GeneratorBasedBuilder):
|
52 |
"""Kamus Alay is a dataset of lexicon for text normalization of Indonesian colloquial word"""
|
53 |
|
54 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
55 |
+
SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
|
56 |
|
57 |
label_classes = [
|
58 |
"abreviasi",
|
|
|
75 |
]
|
76 |
|
77 |
BUILDER_CONFIGS = [
|
78 |
+
SEACrowdConfig(
|
79 |
name="kamus_alay_source",
|
80 |
version=SOURCE_VERSION,
|
81 |
description="Kamus Alay source schema",
|
82 |
schema="source",
|
83 |
subset_id="kamus_alay",
|
84 |
),
|
85 |
+
SEACrowdConfig(
|
86 |
+
name="kamus_alay_seacrowd_pairs_multi",
|
87 |
+
version=SEACROWD_VERSION,
|
88 |
description="Kamus Alay Nusantara schema",
|
89 |
+
schema="seacrowd_pairs_multi",
|
90 |
subset_id="kamus_alay",
|
91 |
),
|
92 |
]
|
|
|
104 |
"categories": datasets.Sequence(datasets.Value("string")),
|
105 |
}
|
106 |
)
|
107 |
+
elif self.config.schema == "seacrowd_pairs_multi":
|
108 |
features = schemas.pairs_multi_features(self.label_classes)
|
109 |
|
110 |
return datasets.DatasetInfo(
|
|
|
147 |
}
|
148 |
yield row.id, ex
|
149 |
|
150 |
+
elif self.config.schema == "seacrowd_pairs_multi":
|
151 |
for row in df.itertuples():
|
152 |
ex = {
|
153 |
"id": str(row.id),
|