Upload indo4b_plus.py with huggingface_hub
Browse files- indo4b_plus.py +12 -12
indo4b_plus.py
CHANGED
|
@@ -18,14 +18,14 @@ from typing import Dict, List, Tuple
|
|
| 18 |
|
| 19 |
import datasets
|
| 20 |
|
| 21 |
-
from
|
| 22 |
-
from
|
| 23 |
-
from
|
| 24 |
DEFAULT_SOURCE_VIEW_NAME, Tasks)
|
| 25 |
|
| 26 |
_DATASETNAME = "indo4b_plus"
|
| 27 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
| 28 |
-
_UNIFIED_VIEW_NAME =
|
| 29 |
|
| 30 |
_LOCAL = False
|
| 31 |
_LANGUAGES = ["ind", "sun", "jav"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
|
|
@@ -93,7 +93,7 @@ _SUPPORTED_TASKS = [Tasks.SELF_SUPERVISED_PRETRAINING]
|
|
| 93 |
|
| 94 |
_SOURCE_VERSION = "1.0.0"
|
| 95 |
|
| 96 |
-
|
| 97 |
|
| 98 |
class Indo4BPlus(datasets.GeneratorBasedBuilder):
|
| 99 |
"""Indo4B-Plus is a large-scale Indonesian self-supervised pre-training corpus consists
|
|
@@ -103,18 +103,18 @@ class Indo4BPlus(datasets.GeneratorBasedBuilder):
|
|
| 103 |
|
| 104 |
|
| 105 |
BUILDER_CONFIGS = [
|
| 106 |
-
|
| 107 |
name="indo4b_plus_source",
|
| 108 |
version=_SOURCE_VERSION,
|
| 109 |
description="Indo4B-Plus source schema",
|
| 110 |
schema="source",
|
| 111 |
subset_id="indo4b_plus",
|
| 112 |
),
|
| 113 |
-
|
| 114 |
-
name="
|
| 115 |
-
version=
|
| 116 |
description="Indo4B-Plus Nusantara schema",
|
| 117 |
-
schema="
|
| 118 |
subset_id="indo4b_plus",
|
| 119 |
),
|
| 120 |
]
|
|
@@ -127,7 +127,7 @@ class Indo4BPlus(datasets.GeneratorBasedBuilder):
|
|
| 127 |
"text": datasets.Value("string"),
|
| 128 |
}
|
| 129 |
)
|
| 130 |
-
elif self.config.schema == "
|
| 131 |
features = schemas.self_supervised_pretraining.features
|
| 132 |
|
| 133 |
return datasets.DatasetInfo(
|
|
@@ -168,7 +168,7 @@ class Indo4BPlus(datasets.GeneratorBasedBuilder):
|
|
| 168 |
"text": row.strip(),
|
| 169 |
},
|
| 170 |
)
|
| 171 |
-
elif self.config.schema == "
|
| 172 |
for counter, row in enumerate(f):
|
| 173 |
if row.strip() != "":
|
| 174 |
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 |
|
| 26 |
_DATASETNAME = "indo4b_plus"
|
| 27 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
| 28 |
+
_UNIFIED_VIEW_NAME = DEFAULT_SEACROWD_VIEW_NAME
|
| 29 |
|
| 30 |
_LOCAL = False
|
| 31 |
_LANGUAGES = ["ind", "sun", "jav"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
|
|
|
|
| 93 |
|
| 94 |
_SOURCE_VERSION = "1.0.0"
|
| 95 |
|
| 96 |
+
_SEACROWD_VERSION = "2024.06.20"
|
| 97 |
|
| 98 |
class Indo4BPlus(datasets.GeneratorBasedBuilder):
|
| 99 |
"""Indo4B-Plus is a large-scale Indonesian self-supervised pre-training corpus consists
|
|
|
|
| 103 |
|
| 104 |
|
| 105 |
BUILDER_CONFIGS = [
|
| 106 |
+
SEACrowdConfig(
|
| 107 |
name="indo4b_plus_source",
|
| 108 |
version=_SOURCE_VERSION,
|
| 109 |
description="Indo4B-Plus source schema",
|
| 110 |
schema="source",
|
| 111 |
subset_id="indo4b_plus",
|
| 112 |
),
|
| 113 |
+
SEACrowdConfig(
|
| 114 |
+
name="indo4b_plus_seacrowd_ssp",
|
| 115 |
+
version=_SEACROWD_VERSION,
|
| 116 |
description="Indo4B-Plus Nusantara schema",
|
| 117 |
+
schema="seacrowd_ssp",
|
| 118 |
subset_id="indo4b_plus",
|
| 119 |
),
|
| 120 |
]
|
|
|
|
| 127 |
"text": datasets.Value("string"),
|
| 128 |
}
|
| 129 |
)
|
| 130 |
+
elif self.config.schema == "seacrowd_ssp":
|
| 131 |
features = schemas.self_supervised_pretraining.features
|
| 132 |
|
| 133 |
return datasets.DatasetInfo(
|
|
|
|
| 168 |
"text": row.strip(),
|
| 169 |
},
|
| 170 |
)
|
| 171 |
+
elif self.config.schema == "seacrowd_ssp":
|
| 172 |
for counter, row in enumerate(f):
|
| 173 |
if row.strip() != "":
|
| 174 |
yield (
|