holylovenia commited on
Commit
16b7891
·
verified ·
1 Parent(s): c010e6d

Upload indspeech_news_tts.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. indspeech_news_tts.py +14 -14
indspeech_news_tts.py CHANGED
@@ -19,9 +19,9 @@ from typing import Dict, List, Tuple
19
 
20
  import datasets
21
 
22
- from nusacrowd.utils import schemas
23
- from nusacrowd.utils.configs import NusantaraConfig
24
- from nusacrowd.utils.constants import Tasks
25
 
26
  _CITATION = """\
27
  @inproceedings{sakti-tts-cocosda-2008,
@@ -80,16 +80,16 @@ _SUPPORTED_TASKS = [Tasks.TEXT_TO_SPEECH]
80
 
81
  _SOURCE_VERSION = "1.0.0"
82
 
83
- _NUSANTARA_VERSION = "1.0.0"
84
  _LOCAL = False
85
 
86
 
87
- def nusantara_config_constructor(schema, version, train_task, test_task):
88
 
89
- if schema != "source" and schema != "nusantara_sptext":
90
  raise ValueError(f"Invalid schema: {schema}")
91
 
92
- return NusantaraConfig(
93
  name="indspeech_news_tts_{tr_task}_{ts_task}_{schema}".format(schema=schema, tr_task=train_task, ts_task=test_task),
94
  version=datasets.Version(version),
95
  description="indspeech_news_tts {schema} schema for {tr_task} train and {ts_task} test task".format(schema=schema, tr_task=train_task, ts_task=test_task),
@@ -106,13 +106,13 @@ class INDspeechNEWSTTS(datasets.GeneratorBasedBuilder):
106
  """
107
 
108
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
109
- NUSANTARA_VERSION = datasets.Version(_NUSANTARA_VERSION)
110
 
111
  BUILDER_CONFIGS = (
112
- [nusantara_config_constructor("source", _SOURCE_VERSION, train, test) for train in ["12", "30", "60", "120"] for test in ["MOS"]]
113
- + [nusantara_config_constructor("nusantara_sptext", _NUSANTARA_VERSION, train, test) for train in ["12", "30", "60", "120"] for test in ["MOS"]]
114
- + [nusantara_config_constructor("source", _SOURCE_VERSION, "ZR", "ZR")]
115
- + [nusantara_config_constructor("nusantara_sptext", _NUSANTARA_VERSION, "ZR", "ZR")]
116
  )
117
 
118
  DEFAULT_CONFIG_NAME = "indspeech_news_tts_120_MOS_source"
@@ -129,7 +129,7 @@ class INDspeechNEWSTTS(datasets.GeneratorBasedBuilder):
129
  "gender": datasets.Value("string"),
130
  }
131
  )
132
- elif self.config.schema == "nusantara_sptext":
133
  features = schemas.speech_text_features
134
 
135
  return datasets.DatasetInfo(
@@ -194,7 +194,7 @@ class INDspeechNEWSTTS(datasets.GeneratorBasedBuilder):
194
  "gender": gender,
195
  }
196
  yield key, example
197
- elif self.config.schema == "nusantara_sptext":
198
  example = {
199
  "id": str(id),
200
  "speaker_id": spk_id,
 
19
 
20
  import datasets
21
 
22
+ from seacrowd.utils import schemas
23
+ from seacrowd.utils.configs import SEACrowdConfig
24
+ from seacrowd.utils.constants import Tasks
25
 
26
  _CITATION = """\
27
  @inproceedings{sakti-tts-cocosda-2008,
 
80
 
81
  _SOURCE_VERSION = "1.0.0"
82
 
83
+ _SEACROWD_VERSION = "2024.06.20"
84
  _LOCAL = False
85
 
86
 
87
+ def seacrowd_config_constructor(schema, version, train_task, test_task):
88
 
89
+ if schema != "source" and schema != "seacrowd_sptext":
90
  raise ValueError(f"Invalid schema: {schema}")
91
 
92
+ return SEACrowdConfig(
93
  name="indspeech_news_tts_{tr_task}_{ts_task}_{schema}".format(schema=schema, tr_task=train_task, ts_task=test_task),
94
  version=datasets.Version(version),
95
  description="indspeech_news_tts {schema} schema for {tr_task} train and {ts_task} test task".format(schema=schema, tr_task=train_task, ts_task=test_task),
 
106
  """
107
 
108
  SOURCE_VERSION = datasets.Version(_SOURCE_VERSION)
109
+ SEACROWD_VERSION = datasets.Version(_SEACROWD_VERSION)
110
 
111
  BUILDER_CONFIGS = (
112
+ [seacrowd_config_constructor("source", _SOURCE_VERSION, train, test) for train in ["12", "30", "60", "120"] for test in ["MOS"]]
113
+ + [seacrowd_config_constructor("seacrowd_sptext", _SEACROWD_VERSION, train, test) for train in ["12", "30", "60", "120"] for test in ["MOS"]]
114
+ + [seacrowd_config_constructor("source", _SOURCE_VERSION, "ZR", "ZR")]
115
+ + [seacrowd_config_constructor("seacrowd_sptext", _SEACROWD_VERSION, "ZR", "ZR")]
116
  )
117
 
118
  DEFAULT_CONFIG_NAME = "indspeech_news_tts_120_MOS_source"
 
129
  "gender": datasets.Value("string"),
130
  }
131
  )
132
+ elif self.config.schema == "seacrowd_sptext":
133
  features = schemas.speech_text_features
134
 
135
  return datasets.DatasetInfo(
 
194
  "gender": gender,
195
  }
196
  yield key, example
197
+ elif self.config.schema == "seacrowd_sptext":
198
  example = {
199
  "id": str(id),
200
  "speaker_id": spk_id,