holylovenia commited on
Commit
729e28a
1 Parent(s): a00ff80

Upload bible_su_id.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. bible_su_id.py +12 -12
bible_su_id.py CHANGED
@@ -4,13 +4,13 @@ from typing import List
4
  import datasets
5
  import json
6
 
7
- from nusacrowd.utils import schemas
8
- from nusacrowd.utils.configs import NusantaraConfig
9
- from nusacrowd.utils.constants import Tasks, DEFAULT_SOURCE_VIEW_NAME, DEFAULT_NUSANTARA_VIEW_NAME
10
 
11
  _DATASETNAME = "bible_su_id"
12
  _SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
13
- _UNIFIED_VIEW_NAME = DEFAULT_NUSANTARA_VIEW_NAME
14
 
15
  _LANGUAGES = ["ind", "sun"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
16
  _LOCAL = False
@@ -54,25 +54,25 @@ _URLs = {"indonlg": "https://storage.googleapis.com/babert-pretraining/IndoNLG_f
54
  _SUPPORTED_TASKS = [Tasks.MACHINE_TRANSLATION]
55
 
56
  _SOURCE_VERSION = "1.0.0"
57
- _NUSANTARA_VERSION = "1.0.0"
58
 
59
 
60
  class BibleSuId(datasets.GeneratorBasedBuilder):
61
  """Bible Su-Id is a machine translation dataset containing Indonesian-Sundanese parallel sentences collected from the bible.."""
62
 
63
  BUILDER_CONFIGS = [
64
- NusantaraConfig(
65
  name="bible_su_id_source",
66
  version=datasets.Version(_SOURCE_VERSION),
67
  description="Bible Su-Id source schema",
68
  schema="source",
69
  subset_id="bible_su_id",
70
  ),
71
- NusantaraConfig(
72
- name="bible_su_id_nusantara_t2t",
73
- version=datasets.Version(_NUSANTARA_VERSION),
74
  description="Bible Su-Id Nusantara schema",
75
- schema="nusantara_t2t",
76
  subset_id="bible_su_id",
77
  ),
78
  ]
@@ -82,7 +82,7 @@ class BibleSuId(datasets.GeneratorBasedBuilder):
82
  def _info(self):
83
  if self.config.schema == "source":
84
  features = datasets.Features({"id": datasets.Value("string"), "text": datasets.Value("string"), "label": datasets.Value("string")})
85
- elif self.config.schema == "nusantara_t2t":
86
  features = schemas.text2text_features
87
 
88
  return datasets.DatasetInfo(
@@ -122,7 +122,7 @@ class BibleSuId(datasets.GeneratorBasedBuilder):
122
  for row in data:
123
  ex = {"id": row["id"], "text": row["text"], "label": row["label"]}
124
  yield row["id"], ex
125
- elif self.config.schema == "nusantara_t2t":
126
  for row in data:
127
  ex = {
128
  "id": row["id"],
 
4
  import datasets
5
  import json
6
 
7
+ from seacrowd.utils import schemas
8
+ from seacrowd.utils.configs import SEACrowdConfig
9
+ from seacrowd.utils.constants import Tasks, DEFAULT_SOURCE_VIEW_NAME, DEFAULT_SEACROWD_VIEW_NAME
10
 
11
  _DATASETNAME = "bible_su_id"
12
  _SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
13
+ _UNIFIED_VIEW_NAME = DEFAULT_SEACROWD_VIEW_NAME
14
 
15
  _LANGUAGES = ["ind", "sun"] # We follow ISO639-3 language code (https://iso639-3.sil.org/code_tables/639/data)
16
  _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 BibleSuId(datasets.GeneratorBasedBuilder):
61
  """Bible Su-Id is a machine translation dataset containing Indonesian-Sundanese parallel sentences collected from the bible.."""
62
 
63
  BUILDER_CONFIGS = [
64
+ SEACrowdConfig(
65
  name="bible_su_id_source",
66
  version=datasets.Version(_SOURCE_VERSION),
67
  description="Bible Su-Id source schema",
68
  schema="source",
69
  subset_id="bible_su_id",
70
  ),
71
+ SEACrowdConfig(
72
+ name="bible_su_id_seacrowd_t2t",
73
+ version=datasets.Version(_SEACROWD_VERSION),
74
  description="Bible Su-Id Nusantara schema",
75
+ schema="seacrowd_t2t",
76
  subset_id="bible_su_id",
77
  ),
78
  ]
 
82
  def _info(self):
83
  if self.config.schema == "source":
84
  features = datasets.Features({"id": datasets.Value("string"), "text": datasets.Value("string"), "label": datasets.Value("string")})
85
+ elif self.config.schema == "seacrowd_t2t":
86
  features = schemas.text2text_features
87
 
88
  return datasets.DatasetInfo(
 
122
  for row in data:
123
  ex = {"id": row["id"], "text": row["text"], "label": row["label"]}
124
  yield row["id"], ex
125
+ elif self.config.schema == "seacrowd_t2t":
126
  for row in data:
127
  ex = {
128
  "id": row["id"],