holylovenia commited on
Commit
308447d
1 Parent(s): 2e45e4a

Upload singgalang.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. singgalang.py +13 -13
singgalang.py CHANGED
@@ -18,10 +18,10 @@ from typing import Dict, List, Tuple
18
 
19
  import datasets
20
 
21
- from nusacrowd.utils import schemas
22
- from nusacrowd.utils.common_parser import load_conll_data
23
- from nusacrowd.utils.configs import NusantaraConfig
24
- from nusacrowd.utils.constants import Tasks
25
 
26
  _CITATION = """\
27
  @INPROCEEDINGS{8355036,
@@ -67,14 +67,14 @@ _SUPPORTED_TASKS = [Tasks.NAMED_ENTITY_RECOGNITION]
67
 
68
  _SOURCE_VERSION = "1.0.0"
69
 
70
- _NUSANTARA_VERSION = "1.0.0"
71
 
72
 
73
  class SinggalangDataset(datasets.GeneratorBasedBuilder):
74
  """Rule-based annotation Indonesian NER Dataset of 48,957 sentences with 3 NER tags"""
75
 
76
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
77
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
78
 
79
  label_classes = [
80
  "O",
@@ -84,18 +84,18 @@ class SinggalangDataset(datasets.GeneratorBasedBuilder):
84
  ]
85
 
86
  BUILDER_CONFIGS = [
87
- NusantaraConfig(
88
  name=f"{_DATASETNAME}_source",
89
  version=SOURCE_VERSION,
90
  description=f"{_DATASETNAME} source schema",
91
  schema="source",
92
  subset_id=f"{_DATASETNAME}",
93
  ),
94
- NusantaraConfig(
95
- name=f"{_DATASETNAME}_nusantara_seq_label",
96
- version=NUSANTARA_VERSION,
97
  description=f"{_DATASETNAME} Nusantara schema",
98
- schema="nusantara_seq_label",
99
  subset_id=f"{_DATASETNAME}",
100
  ),
101
  ]
@@ -112,7 +112,7 @@ class SinggalangDataset(datasets.GeneratorBasedBuilder):
112
  }
113
  )
114
 
115
- elif self.config.schema == "nusantara_seq_label":
116
  features = schemas.seq_label_features(self.label_classes)
117
 
118
  return datasets.DatasetInfo(
@@ -146,7 +146,7 @@ class SinggalangDataset(datasets.GeneratorBasedBuilder):
146
  for key, ex in enumerate(dataset):
147
  yield key, ex
148
 
149
- elif self.config.schema == "nusantara_seq_label":
150
  for key, ex in enumerate(dataset):
151
  yield key, {
152
  "id": str(key),
 
18
 
19
  import datasets
20
 
21
+ from seacrowd.utils import schemas
22
+ from seacrowd.utils.common_parser import load_conll_data
23
+ from seacrowd.utils.configs import SEACrowdConfig
24
+ from seacrowd.utils.constants import Tasks
25
 
26
  _CITATION = """\
27
  @INPROCEEDINGS{8355036,
 
67
 
68
  _SOURCE_VERSION = "1.0.0"
69
 
70
+ _SEACROWD_VERSION = "2024.06.20"
71
 
72
 
73
  class SinggalangDataset(datasets.GeneratorBasedBuilder):
74
  """Rule-based annotation Indonesian NER Dataset of 48,957 sentences with 3 NER tags"""
75
 
76
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
77
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
78
 
79
  label_classes = [
80
  "O",
 
84
  ]
85
 
86
  BUILDER_CONFIGS = [
87
+ SEACrowdConfig(
88
  name=f"{_DATASETNAME}_source",
89
  version=SOURCE_VERSION,
90
  description=f"{_DATASETNAME} source schema",
91
  schema="source",
92
  subset_id=f"{_DATASETNAME}",
93
  ),
94
+ SEACrowdConfig(
95
+ name=f"{_DATASETNAME}_seacrowd_seq_label",
96
+ version=SEACROWD_VERSION,
97
  description=f"{_DATASETNAME} Nusantara schema",
98
+ schema="seacrowd_seq_label",
99
  subset_id=f"{_DATASETNAME}",
100
  ),
101
  ]
 
112
  }
113
  )
114
 
115
+ elif self.config.schema == "seacrowd_seq_label":
116
  features = schemas.seq_label_features(self.label_classes)
117
 
118
  return datasets.DatasetInfo(
 
146
  for key, ex in enumerate(dataset):
147
  yield key, ex
148
 
149
+ elif self.config.schema == "seacrowd_seq_label":
150
  for key, ex in enumerate(dataset):
151
  yield key, {
152
  "id": str(key),