From b91d6d8cb584e206b4a6bcc981bdb63bfe531897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stardust=C2=B7=E5=87=8F?= <2225664821@qq.com> Date: Thu, 3 Aug 2023 18:19:37 +0800 Subject: [PATCH] Update preprocess_text.py --- preprocess_text.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/preprocess_text.py b/preprocess_text.py index ec54c5d..c56d148 100644 --- a/preprocess_text.py +++ b/preprocess_text.py @@ -17,7 +17,8 @@ if 1 in stage: with open( transcription_path+'.cleaned', 'w', encoding='utf-8') as f: for line in tqdm.tqdm(open(transcription_path, encoding='utf-8').readlines()): try: - utt, spk, language, text = line.strip().split('|') + utt, spk, text = line.strip().split('|') + language = "ZH" norm_text, phones, tones, word2ph = clean_text(text, language) f.write('{}|{}|{}|{}|{}|{}|{}\n'.format(utt, spk, language, norm_text, ' '.join(phones), " ".join([str(i) for i in tones]), @@ -62,4 +63,4 @@ if 3 in stage: config = json.load(open(config_path)) config["data"]['spk2id'] = spk_id_map with open(config_path, 'w', encoding='utf-8') as f: - json.dump(config, f, indent=2, ensure_ascii=False) \ No newline at end of file + json.dump(config, f, indent=2, ensure_ascii=False)