Datasets:

Languages:
Indonesian
ArXiv:
holylovenia commited on
Commit
4f3f0bb
·
verified ·
1 Parent(s): 55d5a0c

Upload posp.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. posp.py +13 -13
posp.py CHANGED
@@ -2,11 +2,11 @@ from pathlib import Path
2
  from typing import Dict, List, Tuple
3
 
4
  import datasets
5
- from nusacrowd.utils import schemas
6
- from nusacrowd.utils.common_parser import load_conll_data
7
 
8
- from nusacrowd.utils.configs import NusantaraConfig
9
- from nusacrowd.utils.constants import Tasks
10
 
11
  _CITATION = """\
12
  @inproceedings{hoesen2018investigating,
@@ -51,7 +51,7 @@ _URLS = {
51
  _SUPPORTED_TASKS = [Tasks.POS_TAGGING]
52
 
53
  _SOURCE_VERSION = "1.0.0"
54
- _NUSANTARA_VERSION = "1.0.0"
55
 
56
 
57
  class POSPDataset(datasets.GeneratorBasedBuilder):
@@ -87,21 +87,21 @@ class POSPDataset(datasets.GeneratorBasedBuilder):
87
  ]
88
 
89
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
90
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
91
 
92
  BUILDER_CONFIGS = [
93
- NusantaraConfig(
94
  name="posp_source",
95
  version=SOURCE_VERSION,
96
  description="POSP source schema",
97
  schema="source",
98
  subset_id="posp",
99
  ),
100
- NusantaraConfig(
101
- name="posp_nusantara_seq_label",
102
- version=NUSANTARA_VERSION,
103
  description="POSP Nusantara schema",
104
- schema="nusantara_seq_label",
105
  subset_id="posp",
106
  ),
107
  ]
@@ -117,7 +117,7 @@ class POSPDataset(datasets.GeneratorBasedBuilder):
117
  "pos_tags": [datasets.Value("string")],
118
  }
119
  )
120
- elif self.config.schema == "nusantara_seq_label":
121
  features = schemas.seq_label_features(self.label_classes)
122
 
123
  return datasets.DatasetInfo(
@@ -169,7 +169,7 @@ class POSPDataset(datasets.GeneratorBasedBuilder):
169
  }
170
  yield i, ex
171
 
172
- elif self.config.schema == "nusantara_seq_label":
173
  for i, row in enumerate(conll_dataset):
174
  ex = {
175
  "id": str(i),
 
2
  from typing import Dict, List, Tuple
3
 
4
  import datasets
5
+ from seacrowd.utils import schemas
6
+ from seacrowd.utils.common_parser import load_conll_data
7
 
8
+ from seacrowd.utils.configs import SEACrowdConfig
9
+ from seacrowd.utils.constants import Tasks
10
 
11
  _CITATION = """\
12
  @inproceedings{hoesen2018investigating,
 
51
  _SUPPORTED_TASKS = [Tasks.POS_TAGGING]
52
 
53
  _SOURCE_VERSION = "1.0.0"
54
+ _SEACROWD_VERSION = "2024.06.20"
55
 
56
 
57
  class POSPDataset(datasets.GeneratorBasedBuilder):
 
87
  ]
88
 
89
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
90
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
91
 
92
  BUILDER_CONFIGS = [
93
+ SEACrowdConfig(
94
  name="posp_source",
95
  version=SOURCE_VERSION,
96
  description="POSP source schema",
97
  schema="source",
98
  subset_id="posp",
99
  ),
100
+ SEACrowdConfig(
101
+ name="posp_seacrowd_seq_label",
102
+ version=SEACROWD_VERSION,
103
  description="POSP Nusantara schema",
104
+ schema="seacrowd_seq_label",
105
  subset_id="posp",
106
  ),
107
  ]
 
117
  "pos_tags": [datasets.Value("string")],
118
  }
119
  )
120
+ elif self.config.schema == "seacrowd_seq_label":
121
  features = schemas.seq_label_features(self.label_classes)
122
 
123
  return datasets.DatasetInfo(
 
169
  }
170
  yield i, ex
171
 
172
+ elif self.config.schema == "seacrowd_seq_label":
173
  for i, row in enumerate(conll_dataset):
174
  ex = {
175
  "id": str(i),