holylovenia
commited on
Commit
•
56a1497
1
Parent(s):
4866293
Upload indolem_nerui.py with huggingface_hub
Browse files- indolem_nerui.py +17 -17
indolem_nerui.py
CHANGED
@@ -2,11 +2,11 @@ from pathlib import Path
|
|
2 |
from typing import Dict, List, Tuple
|
3 |
|
4 |
import datasets
|
5 |
-
from
|
6 |
-
from
|
7 |
|
8 |
-
from
|
9 |
-
from
|
10 |
|
11 |
_CITATION = """\
|
12 |
@INPROCEEDINGS{8275098,
|
@@ -84,7 +84,7 @@ _URLS = {
|
|
84 |
_SUPPORTED_TASKS = [Tasks.NAMED_ENTITY_RECOGNITION]
|
85 |
|
86 |
_SOURCE_VERSION = "1.0.0"
|
87 |
-
|
88 |
|
89 |
|
90 |
class IndolemNERUIDataset(datasets.GeneratorBasedBuilder):
|
@@ -101,22 +101,22 @@ class IndolemNERUIDataset(datasets.GeneratorBasedBuilder):
|
|
101 |
]
|
102 |
|
103 |
BUILDER_CONFIGS = [
|
104 |
-
|
105 |
name=f"indolem_nerui_source",
|
106 |
version=datasets.Version(_SOURCE_VERSION),
|
107 |
description="Indolem NER UI source schema",
|
108 |
schema="source",
|
109 |
subset_id=f"indolem_nerui",
|
110 |
),
|
111 |
-
|
112 |
-
name=f"
|
113 |
-
version=datasets.Version(
|
114 |
description="Indolem NER UI Nusantara schema",
|
115 |
-
schema="
|
116 |
subset_id=f"indolem_nerui",
|
117 |
)
|
118 |
] + [
|
119 |
-
|
120 |
name=f"indolem_nerui_fold{i}_source",
|
121 |
version=datasets.Version(_SOURCE_VERSION),
|
122 |
description="Indolem NER UI source schema",
|
@@ -125,11 +125,11 @@ class IndolemNERUIDataset(datasets.GeneratorBasedBuilder):
|
|
125 |
)
|
126 |
for i in range(5)
|
127 |
] + [
|
128 |
-
|
129 |
-
name=f"indolem_nerui_fold{i}
|
130 |
-
version=datasets.Version(
|
131 |
description="Indolem NER UI Nusantara schema",
|
132 |
-
schema="
|
133 |
subset_id=f"indolem_nerui_fold{i}",
|
134 |
)
|
135 |
for i in range(5)
|
@@ -146,7 +146,7 @@ class IndolemNERUIDataset(datasets.GeneratorBasedBuilder):
|
|
146 |
"tags": [datasets.Value("string")],
|
147 |
}
|
148 |
)
|
149 |
-
elif self.config.schema == "
|
150 |
features = schemas.seq_label_features(self.label_classes)
|
151 |
|
152 |
return datasets.DatasetInfo(
|
@@ -198,7 +198,7 @@ class IndolemNERUIDataset(datasets.GeneratorBasedBuilder):
|
|
198 |
}
|
199 |
yield i, ex
|
200 |
|
201 |
-
elif self.config.schema == "
|
202 |
for i, row in enumerate(conll_dataset):
|
203 |
ex = {
|
204 |
"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{8275098,
|
|
|
84 |
_SUPPORTED_TASKS = [Tasks.NAMED_ENTITY_RECOGNITION]
|
85 |
|
86 |
_SOURCE_VERSION = "1.0.0"
|
87 |
+
_SEACROWD_VERSION = "2024.06.20"
|
88 |
|
89 |
|
90 |
class IndolemNERUIDataset(datasets.GeneratorBasedBuilder):
|
|
|
101 |
]
|
102 |
|
103 |
BUILDER_CONFIGS = [
|
104 |
+
SEACrowdConfig(
|
105 |
name=f"indolem_nerui_source",
|
106 |
version=datasets.Version(_SOURCE_VERSION),
|
107 |
description="Indolem NER UI source schema",
|
108 |
schema="source",
|
109 |
subset_id=f"indolem_nerui",
|
110 |
),
|
111 |
+
SEACrowdConfig(
|
112 |
+
name=f"indolem_nerui_seacrowd_seq_label",
|
113 |
+
version=datasets.Version(_SEACROWD_VERSION),
|
114 |
description="Indolem NER UI Nusantara schema",
|
115 |
+
schema="seacrowd_seq_label",
|
116 |
subset_id=f"indolem_nerui",
|
117 |
)
|
118 |
] + [
|
119 |
+
SEACrowdConfig(
|
120 |
name=f"indolem_nerui_fold{i}_source",
|
121 |
version=datasets.Version(_SOURCE_VERSION),
|
122 |
description="Indolem NER UI source schema",
|
|
|
125 |
)
|
126 |
for i in range(5)
|
127 |
] + [
|
128 |
+
SEACrowdConfig(
|
129 |
+
name=f"indolem_nerui_fold{i}_seacrowd_seq_label",
|
130 |
+
version=datasets.Version(_SEACROWD_VERSION),
|
131 |
description="Indolem NER UI Nusantara schema",
|
132 |
+
schema="seacrowd_seq_label",
|
133 |
subset_id=f"indolem_nerui_fold{i}",
|
134 |
)
|
135 |
for i in range(5)
|
|
|
146 |
"tags": [datasets.Value("string")],
|
147 |
}
|
148 |
)
|
149 |
+
elif self.config.schema == "seacrowd_seq_label":
|
150 |
features = schemas.seq_label_features(self.label_classes)
|
151 |
|
152 |
return datasets.DatasetInfo(
|
|
|
198 |
}
|
199 |
yield i, ex
|
200 |
|
201 |
+
elif self.config.schema == "seacrowd_seq_label":
|
202 |
for i, row in enumerate(conll_dataset):
|
203 |
ex = {
|
204 |
"id": str(i),
|