holylovenia
commited on
Commit
•
15fe1b8
1
Parent(s):
0c4deaa
Upload indo4b.py with huggingface_hub
Browse files
indo4b.py
CHANGED
@@ -18,15 +18,15 @@ from typing import Dict, List, Tuple
|
|
18 |
|
19 |
import datasets
|
20 |
|
21 |
-
from
|
22 |
-
from
|
23 |
-
from
|
24 |
DEFAULT_SOURCE_VIEW_NAME, Tasks)
|
25 |
import glob
|
26 |
|
27 |
_DATASETNAME = "indo4b"
|
28 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
29 |
-
_UNIFIED_VIEW_NAME =
|
30 |
|
31 |
_LOCAL = False
|
32 |
_LANGUAGES = ["ind"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
|
@@ -96,7 +96,7 @@ _SUPPORTED_TASKS = [Tasks.SELF_SUPERVISED_PRETRAINING]
|
|
96 |
|
97 |
_SOURCE_VERSION = "1.0.0"
|
98 |
|
99 |
-
|
100 |
|
101 |
class Indo4B(datasets.GeneratorBasedBuilder):
|
102 |
"""Indo4B is a large-scale Indonesian self-supervised pre-training corpus
|
@@ -106,18 +106,18 @@ class Indo4B(datasets.GeneratorBasedBuilder):
|
|
106 |
|
107 |
|
108 |
BUILDER_CONFIGS = [
|
109 |
-
|
110 |
name="indo4b_source",
|
111 |
version=_SOURCE_VERSION,
|
112 |
description="Indo4B source schema",
|
113 |
schema="source",
|
114 |
subset_id="indo4b",
|
115 |
),
|
116 |
-
|
117 |
-
name="
|
118 |
-
version=
|
119 |
description="Indo4B Nusantara schema",
|
120 |
-
schema="
|
121 |
subset_id="indo4b",
|
122 |
),
|
123 |
]
|
@@ -130,7 +130,7 @@ class Indo4B(datasets.GeneratorBasedBuilder):
|
|
130 |
"text": datasets.Value("string"),
|
131 |
}
|
132 |
)
|
133 |
-
elif self.config.schema == "
|
134 |
features = schemas.self_supervised_pretraining.features
|
135 |
|
136 |
return datasets.DatasetInfo(
|
@@ -174,7 +174,7 @@ class Indo4B(datasets.GeneratorBasedBuilder):
|
|
174 |
},
|
175 |
)
|
176 |
counter += 1
|
177 |
-
elif self.config.schema == "
|
178 |
for row in f:
|
179 |
if row.strip() != "":
|
180 |
yield (
|
|
|
18 |
|
19 |
import datasets
|
20 |
|
21 |
+
from seacrowd.utils import schemas
|
22 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
23 |
+
from seacrowd.utils.constants import (DEFAULT_SEACROWD_VIEW_NAME,
|
24 |
DEFAULT_SOURCE_VIEW_NAME, Tasks)
|
25 |
import glob
|
26 |
|
27 |
_DATASETNAME = "indo4b"
|
28 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
29 |
+
_UNIFIED_VIEW_NAME = DEFAULT_SEACROWD_VIEW_NAME
|
30 |
|
31 |
_LOCAL = False
|
32 |
_LANGUAGES = ["ind"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
|
|
|
96 |
|
97 |
_SOURCE_VERSION = "1.0.0"
|
98 |
|
99 |
+
_SEACROWD_VERSION = "2024.06.20"
|
100 |
|
101 |
class Indo4B(datasets.GeneratorBasedBuilder):
|
102 |
"""Indo4B is a large-scale Indonesian self-supervised pre-training corpus
|
|
|
106 |
|
107 |
|
108 |
BUILDER_CONFIGS = [
|
109 |
+
SEACrowdConfig(
|
110 |
name="indo4b_source",
|
111 |
version=_SOURCE_VERSION,
|
112 |
description="Indo4B source schema",
|
113 |
schema="source",
|
114 |
subset_id="indo4b",
|
115 |
),
|
116 |
+
SEACrowdConfig(
|
117 |
+
name="indo4b_seacrowd_ssp",
|
118 |
+
version=_SEACROWD_VERSION,
|
119 |
description="Indo4B Nusantara schema",
|
120 |
+
schema="seacrowd_ssp",
|
121 |
subset_id="indo4b",
|
122 |
),
|
123 |
]
|
|
|
130 |
"text": datasets.Value("string"),
|
131 |
}
|
132 |
)
|
133 |
+
elif self.config.schema == "seacrowd_ssp":
|
134 |
features = schemas.self_supervised_pretraining.features
|
135 |
|
136 |
return datasets.DatasetInfo(
|
|
|
174 |
},
|
175 |
)
|
176 |
counter += 1
|
177 |
+
elif self.config.schema == "seacrowd_ssp":
|
178 |
for row in f:
|
179 |
if row.strip() != "":
|
180 |
yield (
|