holylovenia
commited on
Commit
•
d73911d
1
Parent(s):
33738d4
Upload kawat.py with huggingface_hub
Browse files
kawat.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import os
|
2 |
from pathlib import Path
|
3 |
from typing import Dict, List, Tuple
|
4 |
-
from
|
5 |
-
from
|
6 |
|
7 |
import datasets
|
8 |
import json
|
9 |
|
10 |
-
from
|
11 |
|
12 |
_CITATION = """\
|
13 |
@article{kurniawan2019,
|
@@ -44,7 +44,7 @@ _SUPPORTED_TASKS = [Tasks.WORD_ANALOGY]
|
|
44 |
|
45 |
_SOURCE_VERSION = "1.0.0"
|
46 |
|
47 |
-
|
48 |
|
49 |
_PATH_FILE = [
|
50 |
{
|
@@ -72,21 +72,21 @@ _PATH_FILE = [
|
|
72 |
class Kawat(datasets.GeneratorBasedBuilder):
|
73 |
|
74 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
75 |
-
|
76 |
|
77 |
BUILDER_CONFIGS = [
|
78 |
-
|
79 |
name="kawat_source",
|
80 |
version=SOURCE_VERSION,
|
81 |
description="Kawat source schema",
|
82 |
schema="source",
|
83 |
subset_id="kawat",
|
84 |
),
|
85 |
-
|
86 |
-
name="
|
87 |
-
version=
|
88 |
description="Kawat Nusantara schema",
|
89 |
-
schema="
|
90 |
subset_id="kawat",
|
91 |
),
|
92 |
]
|
@@ -106,7 +106,7 @@ class Kawat(datasets.GeneratorBasedBuilder):
|
|
106 |
}
|
107 |
)
|
108 |
|
109 |
-
elif self.config.schema == "
|
110 |
features = schemas.text2text_features
|
111 |
|
112 |
return datasets.DatasetInfo(
|
@@ -179,7 +179,7 @@ class Kawat(datasets.GeneratorBasedBuilder):
|
|
179 |
yield key, example
|
180 |
key+=1
|
181 |
|
182 |
-
elif self.config.schema == "
|
183 |
key = 0
|
184 |
for each_data in data:
|
185 |
example = {
|
|
|
1 |
import os
|
2 |
from pathlib import Path
|
3 |
from typing import Dict, List, Tuple
|
4 |
+
from seacrowd.utils.constants import Tasks
|
5 |
+
from seacrowd.utils import schemas
|
6 |
|
7 |
import datasets
|
8 |
import json
|
9 |
|
10 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
11 |
|
12 |
_CITATION = """\
|
13 |
@article{kurniawan2019,
|
|
|
44 |
|
45 |
_SOURCE_VERSION = "1.0.0"
|
46 |
|
47 |
+
_SEACROWD_VERSION = "2024.06.20"
|
48 |
|
49 |
_PATH_FILE = [
|
50 |
{
|
|
|
72 |
class Kawat(datasets.GeneratorBasedBuilder):
|
73 |
|
74 |
SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
|
75 |
+
SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
|
76 |
|
77 |
BUILDER_CONFIGS = [
|
78 |
+
SEACrowdConfig(
|
79 |
name="kawat_source",
|
80 |
version=SOURCE_VERSION,
|
81 |
description="Kawat source schema",
|
82 |
schema="source",
|
83 |
subset_id="kawat",
|
84 |
),
|
85 |
+
SEACrowdConfig(
|
86 |
+
name="kawat_seacrowd_t2t",
|
87 |
+
version=SEACROWD_VERSION,
|
88 |
description="Kawat Nusantara schema",
|
89 |
+
schema="seacrowd_t2t",
|
90 |
subset_id="kawat",
|
91 |
),
|
92 |
]
|
|
|
106 |
}
|
107 |
)
|
108 |
|
109 |
+
elif self.config.schema == "seacrowd_t2t":
|
110 |
features = schemas.text2text_features
|
111 |
|
112 |
return datasets.DatasetInfo(
|
|
|
179 |
yield key, example
|
180 |
key+=1
|
181 |
|
182 |
+
elif self.config.schema == "seacrowd_t2t":
|
183 |
key = 0
|
184 |
for each_data in data:
|
185 |
example = {
|