holylovenia
commited on
Upload indo_religious_mt_en_id.py with huggingface_hub
Browse files- indo_religious_mt_en_id.py +12 -12
indo_religious_mt_en_id.py
CHANGED
@@ -3,13 +3,13 @@ from typing import List
|
|
3 |
|
4 |
import datasets
|
5 |
|
6 |
-
from
|
7 |
-
from
|
8 |
-
from
|
9 |
|
10 |
_DATASETNAME = "indo_religious_mt_en_id"
|
11 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
12 |
-
_UNIFIED_VIEW_NAME =
|
13 |
|
14 |
_LANGUAGES = ["ind", "eng"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
|
15 |
_LOCAL = False
|
@@ -54,25 +54,25 @@ _URLs = {
|
|
54 |
_SUPPORTED_TASKS = [Tasks.MACHINE_TRANSLATION]
|
55 |
|
56 |
_SOURCE_VERSION = "1.0.0"
|
57 |
-
|
58 |
|
59 |
|
60 |
class IndoReligiousMTEnId(datasets.GeneratorBasedBuilder):
|
61 |
"""Indonesian Religious Domain MT En-Id is a machine translation dataset containing English-Indonesian parallel sentences collected from the religious manuscripts."""
|
62 |
|
63 |
BUILDER_CONFIGS = [
|
64 |
-
|
65 |
name="indo_religious_mt_en_id_source",
|
66 |
version=datasets.Version(_SOURCE_VERSION),
|
67 |
description="Bible En-Id source schema",
|
68 |
schema="source",
|
69 |
subset_id="indo_religious_mt_en_id",
|
70 |
),
|
71 |
-
|
72 |
-
name="
|
73 |
-
version=datasets.Version(
|
74 |
description="Bible En-Id Nusantara schema",
|
75 |
-
schema="
|
76 |
subset_id="indo_religious_mt_en_id",
|
77 |
),
|
78 |
]
|
@@ -87,7 +87,7 @@ class IndoReligiousMTEnId(datasets.GeneratorBasedBuilder):
|
|
87 |
"text_2": datasets.Value("string"),
|
88 |
}
|
89 |
)
|
90 |
-
elif self.config.schema == "
|
91 |
features = schemas.text2text_features
|
92 |
|
93 |
return datasets.DatasetInfo(
|
@@ -163,7 +163,7 @@ class IndoReligiousMTEnId(datasets.GeneratorBasedBuilder):
|
|
163 |
"text_2": row_id,
|
164 |
}
|
165 |
yield id, ex
|
166 |
-
elif self.config.schema == "
|
167 |
for id, (row_en, row_id) in enumerate(zip(data_en, data_id)):
|
168 |
ex = {
|
169 |
"id": id,
|
|
|
3 |
|
4 |
import datasets
|
5 |
|
6 |
+
from seacrowd.utils import schemas
|
7 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
8 |
+
from seacrowd.utils.constants import Tasks, DEFAULT_SOURCE_VIEW_NAME, DEFAULT_SEACROWD_VIEW_NAME
|
9 |
|
10 |
_DATASETNAME = "indo_religious_mt_en_id"
|
11 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
12 |
+
_UNIFIED_VIEW_NAME = DEFAULT_SEACROWD_VIEW_NAME
|
13 |
|
14 |
_LANGUAGES = ["ind", "eng"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
|
15 |
_LOCAL = False
|
|
|
54 |
_SUPPORTED_TASKS = [Tasks.MACHINE_TRANSLATION]
|
55 |
|
56 |
_SOURCE_VERSION = "1.0.0"
|
57 |
+
_SEACROWD_VERSION = "2024.06.20"
|
58 |
|
59 |
|
60 |
class IndoReligiousMTEnId(datasets.GeneratorBasedBuilder):
|
61 |
"""Indonesian Religious Domain MT En-Id is a machine translation dataset containing English-Indonesian parallel sentences collected from the religious manuscripts."""
|
62 |
|
63 |
BUILDER_CONFIGS = [
|
64 |
+
SEACrowdConfig(
|
65 |
name="indo_religious_mt_en_id_source",
|
66 |
version=datasets.Version(_SOURCE_VERSION),
|
67 |
description="Bible En-Id source schema",
|
68 |
schema="source",
|
69 |
subset_id="indo_religious_mt_en_id",
|
70 |
),
|
71 |
+
SEACrowdConfig(
|
72 |
+
name="indo_religious_mt_en_id_seacrowd_t2t",
|
73 |
+
version=datasets.Version(_SEACROWD_VERSION),
|
74 |
description="Bible En-Id Nusantara schema",
|
75 |
+
schema="seacrowd_t2t",
|
76 |
subset_id="indo_religious_mt_en_id",
|
77 |
),
|
78 |
]
|
|
|
87 |
"text_2": datasets.Value("string"),
|
88 |
}
|
89 |
)
|
90 |
+
elif self.config.schema == "seacrowd_t2t":
|
91 |
features = schemas.text2text_features
|
92 |
|
93 |
return datasets.DatasetInfo(
|
|
|
163 |
"text_2": row_id,
|
164 |
}
|
165 |
yield id, ex
|
166 |
+
elif self.config.schema == "seacrowd_t2t":
|
167 |
for id, (row_en, row_id) in enumerate(zip(data_en, data_id)):
|
168 |
ex = {
|
169 |
"id": id,
|