Datasets:

Languages:
Indonesian
ArXiv:
holylovenia commited on
Commit
63e25c1
1 Parent(s): c6d8e37

Upload indolem_ud_id_gsd.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. indolem_ud_id_gsd.py +14 -18
indolem_ud_id_gsd.py CHANGED
@@ -28,17 +28,17 @@ To create a dataset loading script you will create a class and implement 3 metho
28
 
29
  TODO: Before submitting your script, delete this doc string and replace it with a description of your dataset.
30
 
31
- [nusantara_schema_name] = (kb, pairs, qa, text, t2t, entailment)
32
  """
33
  from pathlib import Path
34
  from typing import Dict, List, Tuple
35
 
36
  import datasets
37
 
38
- from nusacrowd.utils import schemas
39
- from nusacrowd.utils.common_parser import load_ud_data, load_ud_data_as_nusantara_kb
40
- from nusacrowd.utils.configs import NusantaraConfig
41
- from nusacrowd.utils.constants import Tasks
42
 
43
  _CITATION = """\
44
  @inproceedings{mcdonald-etal-2013-universal,
@@ -112,7 +112,7 @@ _SUPPORTED_TASKS = [Tasks.DEPENDENCY_PARSING]
112
 
113
  _SOURCE_VERSION = "1.0.0"
114
 
115
- _NUSANTARA_VERSION = "1.0.0"
116
 
117
 
118
  # TODO: Name the dataset class to match the script name using CamelCase instead of snake_case
@@ -120,21 +120,21 @@ class IndolemUdIdGsdDataset(datasets.GeneratorBasedBuilder):
120
  """The Indonesian-GSD treebank, part of Universal-Dependency project. Consists of 5598 sentences and 122k words."""
121
 
122
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
123
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
124
 
125
  BUILDER_CONFIGS = [
126
- NusantaraConfig(
127
  name=f"{_DATASETNAME}_source",
128
  version=SOURCE_VERSION,
129
  description=f"{_DATASETNAME} source schema",
130
  schema="source",
131
  subset_id=f"{_DATASETNAME}",
132
  ),
133
- NusantaraConfig(
134
- name=f"{_DATASETNAME}_nusantara_kb",
135
- version=NUSANTARA_VERSION,
136
  description=f"{_DATASETNAME} Nusantara KB schema",
137
- schema="nusantara_kb",
138
  subset_id=f"{_DATASETNAME}",
139
  ),
140
  ]
@@ -163,7 +163,7 @@ class IndolemUdIdGsdDataset(datasets.GeneratorBasedBuilder):
163
  }
164
  )
165
 
166
- elif self.config.schema == "nusantara_kb":
167
  features = schemas.kb_features
168
 
169
  else:
@@ -210,14 +210,10 @@ class IndolemUdIdGsdDataset(datasets.GeneratorBasedBuilder):
210
  try:
211
  generator_fn = {
212
  "source": load_ud_data,
213
- "nusantara_kb": load_ud_data_as_nusantara_kb,
214
  }[self.config.schema]
215
  except KeyError:
216
  raise NotImplementedError(f"Schema '{self.config.schema}' is not defined.")
217
 
218
  for key, example in enumerate(generator_fn(filepath)):
219
  yield key, example
220
-
221
-
222
- # if __name__ == "__main__":
223
- # datasets.load_dataset(__file__)
 
28
 
29
  TODO: Before submitting your script, delete this doc string and replace it with a description of your dataset.
30
 
31
+ [seacrowd_schema_name] = (kb, pairs, qa, text, t2t, entailment)
32
  """
33
  from pathlib import Path
34
  from typing import Dict, List, Tuple
35
 
36
  import datasets
37
 
38
+ from seacrowd.utils import schemas
39
+ from seacrowd.utils.common_parser import load_ud_data, load_ud_data_as_seacrowd_kb
40
+ from seacrowd.utils.configs import SEACrowdConfig
41
+ from seacrowd.utils.constants import Tasks
42
 
43
  _CITATION = """\
44
  @inproceedings{mcdonald-etal-2013-universal,
 
112
 
113
  _SOURCE_VERSION = "1.0.0"
114
 
115
+ _SEACROWD_VERSION = "2024.06.20"
116
 
117
 
118
  # TODO: Name the dataset class to match the script name using CamelCase instead of snake_case
 
120
  """The Indonesian-GSD treebank, part of Universal-Dependency project. Consists of 5598 sentences and 122k words."""
121
 
122
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
123
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
124
 
125
  BUILDER_CONFIGS = [
126
+ SEACrowdConfig(
127
  name=f"{_DATASETNAME}_source",
128
  version=SOURCE_VERSION,
129
  description=f"{_DATASETNAME} source schema",
130
  schema="source",
131
  subset_id=f"{_DATASETNAME}",
132
  ),
133
+ SEACrowdConfig(
134
+ name=f"{_DATASETNAME}_seacrowd_kb",
135
+ version=SEACROWD_VERSION,
136
  description=f"{_DATASETNAME} Nusantara KB schema",
137
+ schema="seacrowd_kb",
138
  subset_id=f"{_DATASETNAME}",
139
  ),
140
  ]
 
163
  }
164
  )
165
 
166
+ elif self.config.schema == "seacrowd_kb":
167
  features = schemas.kb_features
168
 
169
  else:
 
210
  try:
211
  generator_fn = {
212
  "source": load_ud_data,
213
+ "seacrowd_kb": load_ud_data_as_seacrowd_kb,
214
  }[self.config.schema]
215
  except KeyError:
216
  raise NotImplementedError(f"Schema '{self.config.schema}' is not defined.")
217
 
218
  for key, example in enumerate(generator_fn(filepath)):
219
  yield key, example