Lais Piai
commited on
Commit
·
7337320
1
Parent(s):
640b01c
test
Browse files- NURC-SP_ENTOA_TTS.py +60 -3
- test/test.csv +30 -0
- test/test.zip +3 -0
NURC-SP_ENTOA_TTS.py
CHANGED
@@ -17,6 +17,10 @@ _PROMPTS_AUTOMATIC_URLS = {
|
|
17 |
"train": "automatic/nurc_cm_automatic_all_segments.csv",
|
18 |
}
|
19 |
|
|
|
|
|
|
|
|
|
20 |
_ARCHIVES_PROSODIC = {
|
21 |
"dev": "prosodic/audios.tar.gz",
|
22 |
"train": "prosodic/audios.tar.gz",
|
@@ -31,9 +35,14 @@ _ARCHIVES_AUTOMATIC = {
|
|
31 |
"train": "automatic/nurc_cm_automatic_segmented_audios.zip",
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
34 |
_PATH_TO_CLIPS = {
|
35 |
"dev": "",
|
36 |
"train": "",
|
|
|
37 |
}
|
38 |
|
39 |
|
@@ -48,6 +57,7 @@ class NurcSPDataset(GeneratorBasedBuilder):
|
|
48 |
NurcSPConfig(name="audioCorpus", description="Audio Corpus audio prompts", prompts_type="audioCorpus"),
|
49 |
NurcSPConfig(name="prosodic", description="Prosodic audio prompts", prompts_type="prosodic"),
|
50 |
NurcSPConfig(name="automatic", description="Automatic audio prompts", prompts_type="automatic"),
|
|
|
51 |
]
|
52 |
|
53 |
def _info(self):
|
@@ -112,6 +122,21 @@ class NurcSPDataset(GeneratorBasedBuilder):
|
|
112 |
}
|
113 |
)
|
114 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
|
116 |
|
117 |
def _split_generators(self, dl_manager):
|
@@ -124,13 +149,16 @@ class NurcSPDataset(GeneratorBasedBuilder):
|
|
124 |
elif self.config.prompts_type == "automatic":
|
125 |
prompts_urls = _PROMPTS_AUTOMATIC_URLS
|
126 |
archive_link = _ARCHIVES_AUTOMATIC
|
|
|
|
|
|
|
127 |
else:
|
128 |
return
|
129 |
|
130 |
prompts_path = dl_manager.download(prompts_urls)
|
131 |
archive = dl_manager.download(archive_link)
|
132 |
|
133 |
-
if self.config.prompts_type
|
134 |
return [
|
135 |
SplitGenerator(
|
136 |
name=Split.VALIDATION,
|
@@ -151,7 +179,7 @@ class NurcSPDataset(GeneratorBasedBuilder):
|
|
151 |
}
|
152 |
),
|
153 |
]
|
154 |
-
|
155 |
return [
|
156 |
SplitGenerator(
|
157 |
name=Split.TRAIN,
|
@@ -163,13 +191,29 @@ class NurcSPDataset(GeneratorBasedBuilder):
|
|
163 |
}
|
164 |
),
|
165 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
def _generate_examples(self, prompts_path, path_to_clips, audio_files, split_name):
|
168 |
examples = {}
|
169 |
csv_paths = []
|
170 |
|
171 |
with open(prompts_path, "r", encoding="utf-8") as f:
|
172 |
-
|
|
|
|
|
|
|
|
|
173 |
if self.config.prompts_type == "prosodic":
|
174 |
for row in csv_reader:
|
175 |
file_path = Path(row['path']).as_posix()
|
@@ -225,6 +269,19 @@ class NurcSPDataset(GeneratorBasedBuilder):
|
|
225 |
"duration": row['duration'],
|
226 |
}
|
227 |
csv_paths.append(file_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
|
229 |
id_ = 0
|
230 |
for path, f in audio_files:
|
|
|
17 |
"train": "automatic/nurc_cm_automatic_all_segments.csv",
|
18 |
}
|
19 |
|
20 |
+
_PROMPTS_TEST_URLS = {
|
21 |
+
"test": "test/test.csv",
|
22 |
+
}
|
23 |
+
|
24 |
_ARCHIVES_PROSODIC = {
|
25 |
"dev": "prosodic/audios.tar.gz",
|
26 |
"train": "prosodic/audios.tar.gz",
|
|
|
35 |
"train": "automatic/nurc_cm_automatic_segmented_audios.zip",
|
36 |
}
|
37 |
|
38 |
+
_ARCHIVES_TEST = {
|
39 |
+
"test": "test/test.zip",
|
40 |
+
}
|
41 |
+
|
42 |
_PATH_TO_CLIPS = {
|
43 |
"dev": "",
|
44 |
"train": "",
|
45 |
+
"test": "",
|
46 |
}
|
47 |
|
48 |
|
|
|
57 |
NurcSPConfig(name="audioCorpus", description="Audio Corpus audio prompts", prompts_type="audioCorpus"),
|
58 |
NurcSPConfig(name="prosodic", description="Prosodic audio prompts", prompts_type="prosodic"),
|
59 |
NurcSPConfig(name="automatic", description="Automatic audio prompts", prompts_type="automatic"),
|
60 |
+
NurcSPConfig(name="test", description="Test audio prompts", prompts_type="test"),
|
61 |
]
|
62 |
|
63 |
def _info(self):
|
|
|
122 |
}
|
123 |
)
|
124 |
)
|
125 |
+
elif self.config.name == "test":
|
126 |
+
return DatasetInfo(
|
127 |
+
features=datasets.Features(
|
128 |
+
{
|
129 |
+
"path": datasets.Value("string"),
|
130 |
+
"name": datasets.Value("string"),
|
131 |
+
"speaker": datasets.Value("string"),
|
132 |
+
"start_time": datasets.Value("string"),
|
133 |
+
"end_time": datasets.Value("string"),
|
134 |
+
"text": datasets.Value("string"),
|
135 |
+
"duration": datasets.Value("string"),
|
136 |
+
"audio": datasets.Audio(sampling_rate=16_000, mono=True),
|
137 |
+
}
|
138 |
+
)
|
139 |
+
)
|
140 |
|
141 |
|
142 |
def _split_generators(self, dl_manager):
|
|
|
149 |
elif self.config.prompts_type == "automatic":
|
150 |
prompts_urls = _PROMPTS_AUTOMATIC_URLS
|
151 |
archive_link = _ARCHIVES_AUTOMATIC
|
152 |
+
elif self.config.prompts_type == "test":
|
153 |
+
prompts_urls = _PROMPTS_TEST_URLS
|
154 |
+
archive_link = _ARCHIVES_TEST
|
155 |
else:
|
156 |
return
|
157 |
|
158 |
prompts_path = dl_manager.download(prompts_urls)
|
159 |
archive = dl_manager.download(archive_link)
|
160 |
|
161 |
+
if self.config.prompts_type == "prosodic" or self.config.prompts_type == "audioCorpus":
|
162 |
return [
|
163 |
SplitGenerator(
|
164 |
name=Split.VALIDATION,
|
|
|
179 |
}
|
180 |
),
|
181 |
]
|
182 |
+
elif self.config.prompts_type == "automatic":
|
183 |
return [
|
184 |
SplitGenerator(
|
185 |
name=Split.TRAIN,
|
|
|
191 |
}
|
192 |
),
|
193 |
]
|
194 |
+
elif self.config.prompts_type == "test":
|
195 |
+
return[
|
196 |
+
SplitGenerator(
|
197 |
+
name=Split.TEST,
|
198 |
+
gen_kwargs={
|
199 |
+
"prompts_path": prompts_path["test"],
|
200 |
+
"path_to_clips": _PATH_TO_CLIPS["test"],
|
201 |
+
"audio_files": dl_manager.iter_archive(archive["test"]),
|
202 |
+
"split_name": "test"
|
203 |
+
}
|
204 |
+
),
|
205 |
+
]
|
206 |
|
207 |
def _generate_examples(self, prompts_path, path_to_clips, audio_files, split_name):
|
208 |
examples = {}
|
209 |
csv_paths = []
|
210 |
|
211 |
with open(prompts_path, "r", encoding="utf-8") as f:
|
212 |
+
if self.config.prompts_type == "test":
|
213 |
+
csv_reader = csv.DictReader(f, delimiter=";") # Explicitly set delimiter
|
214 |
+
else:
|
215 |
+
csv_reader = csv.DictReader(f)
|
216 |
+
|
217 |
if self.config.prompts_type == "prosodic":
|
218 |
for row in csv_reader:
|
219 |
file_path = Path(row['path']).as_posix()
|
|
|
269 |
"duration": row['duration'],
|
270 |
}
|
271 |
csv_paths.append(file_path)
|
272 |
+
elif self.config.prompts_type == "test":
|
273 |
+
for row in csv_reader:
|
274 |
+
file_path = Path(row['path']).as_posix()
|
275 |
+
examples[file_path] = {
|
276 |
+
"path": row['path'],
|
277 |
+
"name": row['name'],
|
278 |
+
"speaker": row['speaker'],
|
279 |
+
"start_time": row['start_time'],
|
280 |
+
"end_time": row['end_time'],
|
281 |
+
"text": row['text'],
|
282 |
+
"duration": row['duration'],
|
283 |
+
}
|
284 |
+
csv_paths.append(file_path)
|
285 |
|
286 |
id_ = 0
|
287 |
for path, f in audio_files:
|
test/test.csv
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
path;name;speaker;start_time;end_time;text;duration
|
2 |
+
segmented_audios/SP_DID_234/0016_SP_DID_234.wav_44.74_46.81.wav;SP_DID_234;SP_DID_234_2;44,744;46,806;Eu quase não vou ao cinema e teatro.;32991
|
3 |
+
segmented_audios/SP_DID_234/0017_SP_DID_234.wav_47.27_48.09.wav;SP_DID_234;SP_DID_234_2;47,266;48,087;Às vezes eu vou.;13136
|
4 |
+
segmented_audios/SP_DID_234/0022_SP_DID_234.wav_57.95_58.92.wav;SP_DID_234;SP_DID_234_2;57,955;58,916;Eu tenho ido ao teatro.;15375
|
5 |
+
segmented_audios/SP_DID_234/0162_SP_DID_234.wav_524.63_525.64.wav;SP_DID_234;SP_DID_234_2;524,635;525,637;Deve ser como na televisão.;16032
|
6 |
+
segmented_audios/SP_DID_234/0176_SP_DID_234.wav_604.75_608.25.wav;SP_DID_234;SP_DID_234_2;604,745;608,249;Então, no teatro, eu acho que é bem mais difícil.;56064
|
7 |
+
segmented_audios/SP_DID_234/0178_SP_DID_234.wav_609.85_612.19.wav;SP_DID_234;SP_DID_234_2;609,851;612,194;A televisão é horrorosa quando eles estão fazendo programa.;37488
|
8 |
+
segmented_audios/SP_DID_234/0210_SP_DID_234.wav_786.57_788.69.wav;SP_DID_234;SP_DID_234_2;786,571;788,694;Eu sei que não há preparação toda.;33968
|
9 |
+
segmented_audios/SP_DID_234/0220_SP_DID_234.wav_829.21_830.99.wav;SP_DID_234;SP_DID_234_2;829,206;830,988;Porque o grupo que trabalha em Ré era enorme.;28512
|
10 |
+
segmented_audios/SP_DID_234/0223_SP_DID_234.wav_836.27_841.04.wav;SP_DID_234;SP_DID_234_2;836,274;841,04;Tem a impressão que ali levou tanto tempo de ensaio?;76256
|
11 |
+
segmented_audios/SP_DID_234/0232_SP_DID_234.wav_876.28_877.74.wav;SP_DID_234;SP_DID_234_2;876,278;877,739;Me chocou tremendamente.;23376
|
12 |
+
segmented_audios/SP_DID_234/0275_SP_DID_234.wav_1034.67_1039.76.wav;SP_DID_234;SP_DID_234_2;1034,673;1039,758;Eu saber que o filme é bom, porque, por exemplo, nós temos tido filmes bons, né?;81360
|
13 |
+
segmented_audios/SP_DID_234/0292_SP_DID_234.wav_1123.84_1124.70.wav;SP_DID_234;SP_DID_234_2;1123,841;1124,702;Eu gostei bastante.;13776
|
14 |
+
segmented_audios/SP_DID_234/0305_SP_DID_234.wav_1213.75_1215.71.wav;SP_DID_234;SP_DID_234_2;1213,751;1215,714;Eu me lembro de vários filmes, não lembro os nomes.;31407
|
15 |
+
segmented_audios/SP_DID_234/0310_SP_DID_234.wav_1224.51_1225.93.wav;SP_DID_234;SP_DID_234_2;1224,511;1225,933;Por isso que eu deixo de ir ao cinema.;22752
|
16 |
+
segmented_audios/SP_DID_234/0316_SP_DID_234.wav_1240.81_1243.82.wav;SP_DID_234;SP_DID_234_3;1240,815;1243,819;Hoje está tudo meio louco, né?;48064
|
17 |
+
segmented_audios/SP_DID_234/0324_SP_DID_234.wav_1256.14_1256.98.wav;SP_DID_234;SP_DID_234_2;1256,139;1256,98;Assisti em Araraquara.;13456
|
18 |
+
segmented_audios/SP_DID_234/0325_SP_DID_234.wav_1257.72_1259.00.wav;SP_DID_234;SP_DID_234_2;1257,721;1259,002;Eu não lembro o nome do filme.;20495
|
19 |
+
segmented_audios/SP_DID_234/0326_SP_DID_234.wav_1259.02_1259.84.wav;SP_DID_234;SP_DID_234_2;1259,022;1259,843;A molecada adorou.;13135
|
20 |
+
segmented_audios/SP_DID_234/0327_SP_DID_234.wav_1260.68_1261.94.wav;SP_DID_234;SP_DID_234_2;1260,684;1261,945;Eles adoraram o filme.;20175
|
21 |
+
segmented_audios/SP_DID_234/0341_SP_DID_234.wav_1303.16_1308.93.wav;SP_DID_234;SP_DID_234_2;1303,164;1308,931;Outro filme, ela... Porque eu saio cansada mesmo, fico numa tensão nervosa.;92272
|
22 |
+
segmented_audios/SP_DID_234/0350_SP_DID_234.wav_1331.95_1332.99.wav;SP_DID_234;SP_DID_234_2;1331,954;1332,995;Nós saímos para ir ao teatro.;16655
|
23 |
+
segmented_audios/SP_DID_234/0351_SP_DID_234.wav_1333.60_1336.26.wav;SP_DID_234;SP_DID_234_2;1333,596;1336,259;Não conseguimos entrar, por causa desse filme.;42608
|
24 |
+
segmented_audios/SP_DID_234/0360_SP_DID_234.wav_1362.73_1365.19.wav;SP_DID_234;SP_DID_234_2;1362,727;1365,191;Eu acho que influi bastante.;39423
|
25 |
+
segmented_audios/SP_DID_234/0404_SP_DID_234.wav_1598.25_1600.35.wav;SP_DID_234;SP_DID_234_2;1598,247;1600,35;Eu acho que teatro está bem mais caro.;33648
|
26 |
+
segmented_audios/SP_DID_234/0408_SP_DID_234.wav_1612.21_1615.57.wav;SP_DID_234;SP_DID_234_3;1612,207;1615,572;Eu acho que o público prefere cinema ainda.;53839
|
27 |
+
segmented_audios/SP_DID_234/0443_SP_DID_234.wav_1823.62_1824.98.wav;SP_DID_234;SP_DID_234_3;1823,616;1824,978; Eu não entendi a pergunta.;21792
|
28 |
+
segmented_audios/SP_DID_234/0481_SP_DID_234.wav_1970.34_1974.36.wav;SP_DID_234;SP_DID_234_2;1970,338;1974,363;Sei lá, eu não tenho... Eu acho que o cinema está perdendo, viu?;64400
|
29 |
+
segmented_audios/SP_DID_234/0497_SP_DID_234.wav_2044.34_2050.79.wav;SP_DID_234;SP_DID_234_2;2044,338;2050,788;O que eu noto é isso.;103200
|
30 |
+
segmented_audios/SP_DID_234/0517_SP_DID_234.wav_2159.16_2160.53.wav;SP_DID_234;SP_DID_234_2;2159,163;2160,525;Principalmente nos fins de semana.;21792
|
test/test.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c052274f11be98f4e813380a220cb4b1762d85d98a1e5fe07ae3d0ddbb33a17d
|
3 |
+
size 1695186
|