holylovenia
commited on
Upload bible_jv_id.py with huggingface_hub
Browse files- bible_jv_id.py +12 -12
bible_jv_id.py
CHANGED
@@ -5,13 +5,13 @@ import datasets
|
|
5 |
import json
|
6 |
import pandas as pd
|
7 |
|
8 |
-
from
|
9 |
-
from
|
10 |
-
from
|
11 |
|
12 |
_DATASETNAME = "bible_jv_id"
|
13 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
14 |
-
_UNIFIED_VIEW_NAME =
|
15 |
|
16 |
_LANGUAGES = ["ind", "jav"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
|
17 |
_LOCAL = False
|
@@ -58,24 +58,24 @@ _SUPPORTED_TASKS = [
|
|
58 |
]
|
59 |
|
60 |
_SOURCE_VERSION = "1.0.0"
|
61 |
-
|
62 |
|
63 |
class BibleEnId(datasets.GeneratorBasedBuilder):
|
64 |
"""Bible Jv-Id is a machine translation dataset containing Indonesian-Javanese parallel sentences collected from the bible.."""
|
65 |
|
66 |
BUILDER_CONFIGS = [
|
67 |
-
|
68 |
name="bible_jv_id_source",
|
69 |
version=datasets.Version(_SOURCE_VERSION),
|
70 |
description="Bible Jv-Id source schema",
|
71 |
schema="source",
|
72 |
subset_id="bible_jv_id",
|
73 |
),
|
74 |
-
|
75 |
-
name="
|
76 |
-
version=datasets.Version(
|
77 |
description="Bible Jv-Id Nusantara schema",
|
78 |
-
schema="
|
79 |
subset_id="bible_jv_id",
|
80 |
)
|
81 |
]
|
@@ -91,7 +91,7 @@ class BibleEnId(datasets.GeneratorBasedBuilder):
|
|
91 |
"label": datasets.Value("string")
|
92 |
}
|
93 |
)
|
94 |
-
elif self.config.schema == "
|
95 |
features = schemas.text2text_features
|
96 |
|
97 |
return datasets.DatasetInfo(
|
@@ -137,7 +137,7 @@ class BibleEnId(datasets.GeneratorBasedBuilder):
|
|
137 |
"label": row['label']
|
138 |
}
|
139 |
yield row['id'], ex
|
140 |
-
elif self.config.schema == "
|
141 |
for row in data:
|
142 |
ex = {
|
143 |
"id": row['id'],
|
|
|
5 |
import json
|
6 |
import pandas as pd
|
7 |
|
8 |
+
from seacrowd.utils import schemas
|
9 |
+
from seacrowd.utils.configs import SEACrowdConfig
|
10 |
+
from seacrowd.utils.constants import Tasks, DEFAULT_SOURCE_VIEW_NAME, DEFAULT_SEACROWD_VIEW_NAME
|
11 |
|
12 |
_DATASETNAME = "bible_jv_id"
|
13 |
_SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
|
14 |
+
_UNIFIED_VIEW_NAME = DEFAULT_SEACROWD_VIEW_NAME
|
15 |
|
16 |
_LANGUAGES = ["ind", "jav"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
|
17 |
_LOCAL = False
|
|
|
58 |
]
|
59 |
|
60 |
_SOURCE_VERSION = "1.0.0"
|
61 |
+
_SEACROWD_VERSION = "2024.06.20"
|
62 |
|
63 |
class BibleEnId(datasets.GeneratorBasedBuilder):
|
64 |
"""Bible Jv-Id is a machine translation dataset containing Indonesian-Javanese parallel sentences collected from the bible.."""
|
65 |
|
66 |
BUILDER_CONFIGS = [
|
67 |
+
SEACrowdConfig(
|
68 |
name="bible_jv_id_source",
|
69 |
version=datasets.Version(_SOURCE_VERSION),
|
70 |
description="Bible Jv-Id source schema",
|
71 |
schema="source",
|
72 |
subset_id="bible_jv_id",
|
73 |
),
|
74 |
+
SEACrowdConfig(
|
75 |
+
name="bible_jv_id_seacrowd_t2t",
|
76 |
+
version=datasets.Version(_SEACROWD_VERSION),
|
77 |
description="Bible Jv-Id Nusantara schema",
|
78 |
+
schema="seacrowd_t2t",
|
79 |
subset_id="bible_jv_id",
|
80 |
)
|
81 |
]
|
|
|
91 |
"label": datasets.Value("string")
|
92 |
}
|
93 |
)
|
94 |
+
elif self.config.schema == "seacrowd_t2t":
|
95 |
features = schemas.text2text_features
|
96 |
|
97 |
return datasets.DatasetInfo(
|
|
|
137 |
"label": row['label']
|
138 |
}
|
139 |
yield row['id'], ex
|
140 |
+
elif self.config.schema == "seacrowd_t2t":
|
141 |
for row in data:
|
142 |
ex = {
|
143 |
"id": row['id'],
|