Commit
•
6a2c25f
1
Parent(s):
9b2c75a
Upload indo_general_mt_en_id.py with huggingface_hub
Browse files- indo_general_mt_en_id.py +11 -11
indo_general_mt_en_id.py
CHANGED
@@ -3,9 +3,9 @@ from typing import List
|
|
3 |
|
4 |
import datasets
|
5 |
|
6 |
-
from
|
7 |
-
from
|
8 |
-
from
|
9 |
|
10 |
_CITATION = """\
|
11 |
@inproceedings{guntara-etal-2020-benchmarking,
|
@@ -48,25 +48,25 @@ _URLS = {
|
|
48 |
_SUPPORTED_TASKS = [Tasks.MACHINE_TRANSLATION]
|
49 |
# Dataset does not have versioning
|
50 |
_SOURCE_VERSION = "1.0.0"
|
51 |
-
|
52 |
|
53 |
|
54 |
class IndoGeneralMTEnId(datasets.GeneratorBasedBuilder):
|
55 |
"""Indonesian General Domain MT En-Id is a machine translation dataset containing English-Indonesian parallel sentences collected from the general manuscripts."""
|
56 |
|
57 |
BUILDER_CONFIGS = [
|
58 |
-
|
59 |
name="indo_general_mt_en_id_source",
|
60 |
version=datasets.Version(_SOURCE_VERSION),
|
61 |
description="Indonesian General Domain MT En-Id source schema",
|
62 |
schema="source",
|
63 |
subset_id="indo_general_mt_en_id",
|
64 |
),
|
65 |
-
|
66 |
-
name="
|
67 |
-
version=datasets.Version(
|
68 |
description="Indonesian General Domain MT Nusantara schema",
|
69 |
-
schema="
|
70 |
subset_id="indo_general_mt_en_id",
|
71 |
),
|
72 |
]
|
@@ -82,7 +82,7 @@ class IndoGeneralMTEnId(datasets.GeneratorBasedBuilder):
|
|
82 |
"tgt": datasets.Value("string"),
|
83 |
}
|
84 |
)
|
85 |
-
elif self.config.schema == "
|
86 |
features = schemas.text2text_features
|
87 |
|
88 |
return datasets.DatasetInfo(
|
@@ -154,7 +154,7 @@ class IndoGeneralMTEnId(datasets.GeneratorBasedBuilder):
|
|
154 |
"tgt": tgt,
|
155 |
}
|
156 |
yield id, row
|
157 |
-
elif self.config.schema == "
|
158 |
for id, (src, tgt) in enumerate(zip(data_en, data_id)):
|
159 |
row = {
|
160 |
"id": str(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
|
9 |
|
10 |
_CITATION = """\
|
11 |
@inproceedings{guntara-etal-2020-benchmarking,
|
|
|
48 |
_SUPPORTED_TASKS = [Tasks.MACHINE_TRANSLATION]
|
49 |
# Dataset does not have versioning
|
50 |
_SOURCE_VERSION = "1.0.0"
|
51 |
+
_SEACROWD_VERSION = "2024.06.20"
|
52 |
|
53 |
|
54 |
class IndoGeneralMTEnId(datasets.GeneratorBasedBuilder):
|
55 |
"""Indonesian General Domain MT En-Id is a machine translation dataset containing English-Indonesian parallel sentences collected from the general manuscripts."""
|
56 |
|
57 |
BUILDER_CONFIGS = [
|
58 |
+
SEACrowdConfig(
|
59 |
name="indo_general_mt_en_id_source",
|
60 |
version=datasets.Version(_SOURCE_VERSION),
|
61 |
description="Indonesian General Domain MT En-Id source schema",
|
62 |
schema="source",
|
63 |
subset_id="indo_general_mt_en_id",
|
64 |
),
|
65 |
+
SEACrowdConfig(
|
66 |
+
name="indo_general_mt_en_id_seacrowd_t2t",
|
67 |
+
version=datasets.Version(_SEACROWD_VERSION),
|
68 |
description="Indonesian General Domain MT Nusantara schema",
|
69 |
+
schema="seacrowd_t2t",
|
70 |
subset_id="indo_general_mt_en_id",
|
71 |
),
|
72 |
]
|
|
|
82 |
"tgt": datasets.Value("string"),
|
83 |
}
|
84 |
)
|
85 |
+
elif self.config.schema == "seacrowd_t2t":
|
86 |
features = schemas.text2text_features
|
87 |
|
88 |
return datasets.DatasetInfo(
|
|
|
154 |
"tgt": tgt,
|
155 |
}
|
156 |
yield id, row
|
157 |
+
elif self.config.schema == "seacrowd_t2t":
|
158 |
for id, (src, tgt) in enumerate(zip(data_en, data_id)):
|
159 |
row = {
|
160 |
"id": str(id),
|