mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
add wav/text mismatch process
This commit is contained in:
parent
f79b6decc9
commit
66a8235fbf
@ -298,11 +298,17 @@ def filter_wav_text(data_dir, dataset):
|
|||||||
os.rename(text_file, "{}.bak".format(text_file))
|
os.rename(text_file, "{}.bak".format(text_file))
|
||||||
wav_dict = {}
|
wav_dict = {}
|
||||||
for line in wav_lines:
|
for line in wav_lines:
|
||||||
sample_name, wav_path = line.strip().split()
|
parts = line.strip().split()
|
||||||
|
if len(parts) < 2:
|
||||||
|
continue
|
||||||
|
sample_name, wav_path = parts
|
||||||
wav_dict[sample_name] = wav_path
|
wav_dict[sample_name] = wav_path
|
||||||
text_dict = {}
|
text_dict = {}
|
||||||
for line in text_lines:
|
for line in text_lines:
|
||||||
sample_name, txt = line.strip().split(" ", 1)
|
parts = line.strip().split(" ", 1)
|
||||||
|
if len(parts) < 2:
|
||||||
|
continue
|
||||||
|
sample_name, txt = parts
|
||||||
text_dict[sample_name] = txt
|
text_dict[sample_name] = txt
|
||||||
filter_count = 0
|
filter_count = 0
|
||||||
with open(wav_file) as f_wav, open(text_file) as f_text:
|
with open(wav_file) as f_wav, open(text_file) as f_text:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user