holylovenia commited on
Commit
9e806a6
1 Parent(s): 93da01a

Upload indo4b_plus.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. 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 nusacrowd.utils import schemas
22
- from nusacrowd.utils.configs import NusantaraConfig
23
- from nusacrowd.utils.constants import (DEFAULT_NUSANTARA_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_NUSANTARA_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
- _NUSANTARA_VERSION = "1.0.0"
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
- NusantaraConfig(
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
- NusantaraConfig(
114
- name="indo4b_plus_nusantara_ssp",
115
- version=_NUSANTARA_VERSION,
116
  description="Indo4B-Plus Nusantara schema",
117
- schema="nusantara_ssp",
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 == "nusantara_ssp":
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 == "nusantara_ssp":
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 (