holylovenia
commited on
Commit
•
c222c5a
1
Parent(s):
9fa60db
Upload indocollex.py with huggingface_hub
Browse files- indocollex.py +11 -11
indocollex.py
CHANGED
@@ -19,9 +19,9 @@ from typing import Dict, List, Tuple
|
|
19 |
|
20 |
import datasets
|
21 |
|
22 |
-
from
|
23 |
-
from
|
24 |
-
from
|
25 |
|
26 |
_CITATION = """\
|
27 |
@inproceedings{wibowo-etal-2021-indocollex,
|
@@ -69,7 +69,7 @@ _URLS = {
|
|
69 |
_SUPPORTED_TASKS = [Tasks.MORPHOLOGICAL_INFLECTION]
|
70 |
|
71 |
_SOURCE_VERSION = "1.0.0"
|
72 |
-
|
73 |
|
74 |
|
75 |
class NewDataset(datasets.GeneratorBasedBuilder):
|
@@ -81,18 +81,18 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
81 |
chain(
|
82 |
*[
|
83 |
[
|
84 |
-
|
85 |
name=f"{_DATASETNAME}{suffix}_source",
|
86 |
version=datasets.Version(_SOURCE_VERSION),
|
87 |
description=f"{_DATASETNAME} source schema",
|
88 |
schema="source",
|
89 |
subset_id=f"{_DATASETNAME}{suffix}",
|
90 |
),
|
91 |
-
|
92 |
-
name=f"{_DATASETNAME}{suffix}
|
93 |
-
version=datasets.Version(
|
94 |
description=f"{_DATASETNAME} Nusantara schema",
|
95 |
-
schema="
|
96 |
subset_id=f"{_DATASETNAME}{suffix}",
|
97 |
),
|
98 |
]
|
@@ -115,7 +115,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
115 |
}
|
116 |
)
|
117 |
|
118 |
-
elif self.config.schema == "
|
119 |
features = schemas.pairs_multi_features(self.label_classes)
|
120 |
|
121 |
else:
|
@@ -179,7 +179,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
179 |
for key, ex in enumerate(dataset):
|
180 |
yield key, dict(zip(source_columns, ex))
|
181 |
|
182 |
-
elif self.config.schema == "
|
183 |
for key, ex in enumerate(dataset):
|
184 |
yield key, {
|
185 |
"id": str(key),
|
|
|
19 |
|
20 |
import datasets
|
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{wibowo-etal-2021-indocollex,
|
|
|
69 |
_SUPPORTED_TASKS = [Tasks.MORPHOLOGICAL_INFLECTION]
|
70 |
|
71 |
_SOURCE_VERSION = "1.0.0"
|
72 |
+
_SEACROWD_VERSION = "2024.06.20"
|
73 |
|
74 |
|
75 |
class NewDataset(datasets.GeneratorBasedBuilder):
|
|
|
81 |
chain(
|
82 |
*[
|
83 |
[
|
84 |
+
SEACrowdConfig(
|
85 |
name=f"{_DATASETNAME}{suffix}_source",
|
86 |
version=datasets.Version(_SOURCE_VERSION),
|
87 |
description=f"{_DATASETNAME} source schema",
|
88 |
schema="source",
|
89 |
subset_id=f"{_DATASETNAME}{suffix}",
|
90 |
),
|
91 |
+
SEACrowdConfig(
|
92 |
+
name=f"{_DATASETNAME}{suffix}_seacrowd_pairs_multi",
|
93 |
+
version=datasets.Version(_SEACROWD_VERSION),
|
94 |
description=f"{_DATASETNAME} Nusantara schema",
|
95 |
+
schema="seacrowd_pairs_multi",
|
96 |
subset_id=f"{_DATASETNAME}{suffix}",
|
97 |
),
|
98 |
]
|
|
|
115 |
}
|
116 |
)
|
117 |
|
118 |
+
elif self.config.schema == "seacrowd_pairs_multi":
|
119 |
features = schemas.pairs_multi_features(self.label_classes)
|
120 |
|
121 |
else:
|
|
|
179 |
for key, ex in enumerate(dataset):
|
180 |
yield key, dict(zip(source_columns, ex))
|
181 |
|
182 |
+
elif self.config.schema == "seacrowd_pairs_multi":
|
183 |
for key, ex in enumerate(dataset):
|
184 |
yield key, {
|
185 |
"id": str(key),
|