holylovenia
commited on
Upload indspeech_news_tts.py with huggingface_hub
Browse files- 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
|
23 |
-
from
|
24 |
-
from
|
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 |
-
|
84 |
_LOCAL = False
|
85 |
|
86 |
|
87 |
-
def
|
88 |
|
89 |
-
if schema != "source" and schema != "
|
90 |
raise ValueError(f"Invalid schema: {schema}")
|
91 |
|
92 |
-
return
|
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 |
-
|
110 |
|
111 |
BUILDER_CONFIGS = (
|
112 |
-
[
|
113 |
-
+ [
|
114 |
-
+ [
|
115 |
-
+ [
|
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 == "
|
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 == "
|
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,
|