holylovenia commited on
Commit
f2315a4
1 Parent(s): 6a13770

Upload jv_id_tts.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. jv_id_tts.py +15 -15
jv_id_tts.py CHANGED
@@ -5,14 +5,14 @@ from typing import List
5
 
6
  import datasets
7
 
8
- from nusacrowd.utils import schemas
9
- from nusacrowd.utils.configs import NusantaraConfig
10
- from nusacrowd.utils.constants import (DEFAULT_NUSANTARA_VIEW_NAME,
11
  DEFAULT_SOURCE_VIEW_NAME, Tasks)
12
 
13
  _DATASETNAME = "jv_id_tts"
14
  _SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
15
- _UNIFIED_VIEW_NAME = DEFAULT_NUSANTARA_VIEW_NAME
16
 
17
  _LANGUAGES = ["jav"]
18
  _LOCAL = False
@@ -38,7 +38,7 @@ This dataset was collected by Google in collaboration with Gadjah Mada Universit
38
 
39
  _HOMEPAGE = "http://openslr.org/41/"
40
 
41
- _LICENSE = "See https://www.openslr.org/resources/41/LICENSE file for license information. Attribution-ShareAlike 4.0 (CC BY-SA 4.0)."
42
 
43
  _URLs = {
44
  _DATASETNAME: {
@@ -50,25 +50,25 @@ _URLs = {
50
  _SUPPORTED_TASKS = [Tasks.TEXT_TO_SPEECH]
51
 
52
  _SOURCE_VERSION = "1.0.0"
53
- _NUSANTARA_VERSION = "1.0.0"
54
 
55
 
56
  class JvIdTTS(datasets.GeneratorBasedBuilder):
57
  """jv_id_tts contains high-quality Multi-speaker TTS data for Javanese (jv-ID)."""
58
 
59
  BUILDER_CONFIGS = [
60
- NusantaraConfig(
61
  name="jv_id_tts_source",
62
  version=datasets.Version(_SOURCE_VERSION),
63
  description="JV_ID_TTS source schema",
64
  schema="source",
65
  subset_id="jv_id_tts",
66
  ),
67
- NusantaraConfig(
68
- name="jv_id_tts_nusantara_sptext",
69
- version=datasets.Version(_NUSANTARA_VERSION),
70
  description="JV_ID_TTS Nusantara schema",
71
- schema="nusantara_sptext",
72
  subset_id="jv_id_tts",
73
  ),
74
  ]
@@ -86,7 +86,7 @@ class JvIdTTS(datasets.GeneratorBasedBuilder):
86
  "text": datasets.Value("string"),
87
  }
88
  )
89
- elif self.config.schema == "nusantara_sptext":
90
  features = schemas.speech_text_features
91
 
92
  return datasets.DatasetInfo(
@@ -114,7 +114,7 @@ class JvIdTTS(datasets.GeneratorBasedBuilder):
114
 
115
  def _generate_examples(self, male_filepath: Path, female_filepath: Path):
116
 
117
- if self.config.schema == "source" or self.config.schema == "nusantara_sptext":
118
  tsv_file = os.path.join(male_filepath, "jv_id_male", "line_index.tsv")
119
  with open(tsv_file, "r") as file:
120
  tsv_data = csv.reader(file, delimiter="\t")
@@ -135,7 +135,7 @@ class JvIdTTS(datasets.GeneratorBasedBuilder):
135
  "text": transcription_text,
136
  }
137
  yield audio_id, ex
138
- elif self.config.schema == "nusantara_sptext":
139
  ex = {
140
  "id": audio_id,
141
  "speaker_id": speaker_id,
@@ -168,7 +168,7 @@ class JvIdTTS(datasets.GeneratorBasedBuilder):
168
  "text": transcription_text,
169
  }
170
  yield audio_id, ex
171
- elif self.config.schema == "nusantara_sptext":
172
  ex = {
173
  "id": audio_id,
174
  "speaker_id": speaker_id,
 
5
 
6
  import datasets
7
 
8
+ from seacrowd.utils import schemas
9
+ from seacrowd.utils.configs import SEACrowdConfig
10
+ from seacrowd.utils.constants import (DEFAULT_SEACROWD_VIEW_NAME, Licenses,
11
  DEFAULT_SOURCE_VIEW_NAME, Tasks)
12
 
13
  _DATASETNAME = "jv_id_tts"
14
  _SOURCE_VIEW_NAME = DEFAULT_SOURCE_VIEW_NAME
15
+ _UNIFIED_VIEW_NAME = DEFAULT_SEACROWD_VIEW_NAME
16
 
17
  _LANGUAGES = ["jav"]
18
  _LOCAL = False
 
38
 
39
  _HOMEPAGE = "http://openslr.org/41/"
40
 
41
+ _LICENSE = Licenses.CC_BY_SA_4_0.value
42
 
43
  _URLs = {
44
  _DATASETNAME: {
 
50
  _SUPPORTED_TASKS = [Tasks.TEXT_TO_SPEECH]
51
 
52
  _SOURCE_VERSION = "1.0.0"
53
+ _SEACROWD_VERSION = "2024.06.20"
54
 
55
 
56
  class JvIdTTS(datasets.GeneratorBasedBuilder):
57
  """jv_id_tts contains high-quality Multi-speaker TTS data for Javanese (jv-ID)."""
58
 
59
  BUILDER_CONFIGS = [
60
+ SEACrowdConfig(
61
  name="jv_id_tts_source",
62
  version=datasets.Version(_SOURCE_VERSION),
63
  description="JV_ID_TTS source schema",
64
  schema="source",
65
  subset_id="jv_id_tts",
66
  ),
67
+ SEACrowdConfig(
68
+ name="jv_id_tts_seacrowd_sptext",
69
+ version=datasets.Version(_SEACROWD_VERSION),
70
  description="JV_ID_TTS Nusantara schema",
71
+ schema="seacrowd_sptext",
72
  subset_id="jv_id_tts",
73
  ),
74
  ]
 
86
  "text": datasets.Value("string"),
87
  }
88
  )
89
+ elif self.config.schema == "seacrowd_sptext":
90
  features = schemas.speech_text_features
91
 
92
  return datasets.DatasetInfo(
 
114
 
115
  def _generate_examples(self, male_filepath: Path, female_filepath: Path):
116
 
117
+ if self.config.schema == "source" or self.config.schema == "seacrowd_sptext":
118
  tsv_file = os.path.join(male_filepath, "jv_id_male", "line_index.tsv")
119
  with open(tsv_file, "r") as file:
120
  tsv_data = csv.reader(file, delimiter="\t")
 
135
  "text": transcription_text,
136
  }
137
  yield audio_id, ex
138
+ elif self.config.schema == "seacrowd_sptext":
139
  ex = {
140
  "id": audio_id,
141
  "speaker_id": speaker_id,
 
168
  "text": transcription_text,
169
  }
170
  yield audio_id, ex
171
+ elif self.config.schema == "seacrowd_sptext":
172
  ex = {
173
  "id": audio_id,
174
  "speaker_id": speaker_id,