From 3d9f094e9652d4b84894c6fd4eae39a4a753b0f0 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 16 五月 2023 23:48:00 +0800
Subject: [PATCH] train
---
funasr/utils/wav_utils.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/funasr/utils/wav_utils.py b/funasr/utils/wav_utils.py
index 590ccdb..ebb80d2 100644
--- a/funasr/utils/wav_utils.py
+++ b/funasr/utils/wav_utils.py
@@ -299,17 +299,17 @@
wav_dict = {}
for line in wav_lines:
parts = line.strip().split()
- if len(parts) < 2:
+ if len(parts) != 2:
continue
sample_name, wav_path = parts
wav_dict[sample_name] = wav_path
text_dict = {}
for line in text_lines:
- parts = line.strip().split(" ", 1)
+ parts = line.strip().split()
if len(parts) < 2:
continue
- sample_name, txt = parts
- text_dict[sample_name] = txt
+ sample_name = parts[0]
+ text_dict[sample_name] = " ".join(parts[1:]).lower()
filter_count = 0
with open(wav_file, "w") as f_wav, open(text_file, "w") as f_text:
for sample_name, wav_path in wav_dict.items():
@@ -318,4 +318,4 @@
f_text.write(sample_name + " " + text_dict[sample_name] + "\n")
else:
filter_count += 1
- print("{}/{} samples in {} are filtered because of the mismatch between wav.scp and text".format(len(wav_lines), filter_count, dataset))
\ No newline at end of file
+ print("{}/{} samples in {} are filtered because of the mismatch between wav.scp and text".format(len(wav_lines), filter_count, dataset))
--
Gitblit v1.9.1