diff --git a/demos/style_fs2/style_syn.py b/demos/style_fs2/style_syn.py index 9bd615790000ef8f27be414c401969b3382e766a..0ed87e7cb497314de435ca993d4b21f18b16700a 100644 --- a/demos/style_fs2/style_syn.py +++ b/demos/style_fs2/style_syn.py @@ -36,7 +36,7 @@ def evaluate(args, fastspeech2_config, pwg_config): for line in f: items = line.strip().split() utt_id = items[0] - sentence = ",".join(items[1:]) + sentence = "".join(items[1:]) sentences.append((utt_id, sentence)) with open(args.phones_dict, "r") as f: diff --git a/paddlespeech/t2s/exps/fastspeech2/inference.py b/paddlespeech/t2s/exps/fastspeech2/inference.py index 8ea64b9934b8bfee67fd249b6e9bc7be232f2fcd..1d6ea667a28a8a8bb751f339ab25bd7e6edcff1b 100644 --- a/paddlespeech/t2s/exps/fastspeech2/inference.py +++ b/paddlespeech/t2s/exps/fastspeech2/inference.py @@ -84,7 +84,7 @@ def main(): for line in f: items = line.strip().split() utt_id = items[0] - sentence = ",".join(items[1:]) + sentence = "".join(items[1:]) sentences.append((utt_id, sentence)) for utt_id, sentence in sentences: diff --git a/paddlespeech/t2s/exps/fastspeech2/multi_spk_synthesize_e2e.py b/paddlespeech/t2s/exps/fastspeech2/multi_spk_synthesize_e2e.py index a2f8ada69f3c4e40090e1c7e369418991d387ddf..9dc3ab4b655badb41bcaf16b738bf9a1f3fa1faa 100644 --- a/paddlespeech/t2s/exps/fastspeech2/multi_spk_synthesize_e2e.py +++ b/paddlespeech/t2s/exps/fastspeech2/multi_spk_synthesize_e2e.py @@ -39,7 +39,7 @@ def evaluate(args, fastspeech2_config, pwg_config): for line in f: items = line.strip().split() utt_id = items[0] - sentence = ",".join(items[1:]) + sentence = "".join(items[1:]) sentences.append((utt_id, sentence)) with open(args.phones_dict, "r") as f: diff --git a/paddlespeech/t2s/exps/fastspeech2/synthesize_e2e.py b/paddlespeech/t2s/exps/fastspeech2/synthesize_e2e.py index aac2c054e21332294ffb99b54b7113e1aefbe13f..47c8a5e7af57b0547a1baffe05d8de1d93782160 100644 --- a/paddlespeech/t2s/exps/fastspeech2/synthesize_e2e.py +++ b/paddlespeech/t2s/exps/fastspeech2/synthesize_e2e.py @@ -42,7 +42,7 @@ def evaluate(args, fastspeech2_config, pwg_config): for line in f: items = line.strip().split() utt_id = items[0] - sentence = ",".join(items[1:]) + sentence = "".join(items[1:]) sentences.append((utt_id, sentence)) with open(args.phones_dict, "r") as f: diff --git a/paddlespeech/t2s/exps/fastspeech2/synthesize_e2e_melgan.py b/paddlespeech/t2s/exps/fastspeech2/synthesize_e2e_melgan.py index 527e5d410796c3a881e9d4378f6b6db764b789b1..4d5d1ac413eb9ee512a5bfa4d0d9350744c3f15e 100644 --- a/paddlespeech/t2s/exps/fastspeech2/synthesize_e2e_melgan.py +++ b/paddlespeech/t2s/exps/fastspeech2/synthesize_e2e_melgan.py @@ -42,7 +42,7 @@ def evaluate(args, fastspeech2_config, melgan_config): for line in f: items = line.strip().split() utt_id = items[0] - sentence = ",".join(items[1:]) + sentence = "".join(items[1:]) sentences.append((utt_id, sentence)) with open(args.phones_dict, "r") as f: diff --git a/paddlespeech/t2s/exps/speedyspeech/inference.py b/paddlespeech/t2s/exps/speedyspeech/inference.py index 75f937decdc8d740ccd27524e07c85d23ce540de..0ed2e0bf104e30301ecb20fceace28f9ef26bcad 100644 --- a/paddlespeech/t2s/exps/speedyspeech/inference.py +++ b/paddlespeech/t2s/exps/speedyspeech/inference.py @@ -89,7 +89,7 @@ def main(): for line in f: items = line.strip().split() utt_id = items[0] - sentence = ",".join(items[1:]) + sentence = "".join(items[1:]) sentences.append((utt_id, sentence)) for utt_id, sentence in sentences: diff --git a/paddlespeech/t2s/exps/speedyspeech/synthesize_e2e.py b/paddlespeech/t2s/exps/speedyspeech/synthesize_e2e.py index b0418940528639aa59ecfcfaa37ea7de180c6a74..403d35088276d6ac2270185149f361a5fa1de8ee 100644 --- a/paddlespeech/t2s/exps/speedyspeech/synthesize_e2e.py +++ b/paddlespeech/t2s/exps/speedyspeech/synthesize_e2e.py @@ -42,7 +42,7 @@ def evaluate(args, speedyspeech_config, pwg_config): for line in f: items = line.strip().split() utt_id = items[0] - sentence = ",".join(items[1:]) + sentence = "".join(items[1:]) sentences.append((utt_id, sentence)) with open(args.phones_dict, "r") as f: diff --git a/paddlespeech/t2s/frontend/zh_frontend.py b/paddlespeech/t2s/frontend/zh_frontend.py index 5b69477da6fc0bf9d4a8c2a32df22d1166a7a708..84852b9ce05abf6f65f8b2ba93605598674f0089 100644 --- a/paddlespeech/t2s/frontend/zh_frontend.py +++ b/paddlespeech/t2s/frontend/zh_frontend.py @@ -129,6 +129,8 @@ class Frontend(): # we discriminate i, ii and iii if c and c not in self.punc: phones.append(c) + if c and c in self.punc: + phones.append('sp') if v and v not in self.punc: phones.append(v) # add sp between sentence (replace the last punc with sp) diff --git a/paddlespeech/t2s/frontend/zh_normalization/text_normlization.py b/paddlespeech/t2s/frontend/zh_normalization/text_normlization.py index c3885fb9b4a8703663a25959254c3f3b782d63c3..c68caeeb78e675a69bea501ac33c0c951c5673fa 100644 --- a/paddlespeech/t2s/frontend/zh_normalization/text_normlization.py +++ b/paddlespeech/t2s/frontend/zh_normalization/text_normlization.py @@ -64,6 +64,8 @@ class TextNormalizer(): List[str] Sentences. """ + # Only for pure Chinese here + text = text.replace(" ", "") text = self.SENTENCE_SPLITOR.sub(r'\1\n', text) text = text.strip() sentences = [sentence.strip() for sentence in re.split(r'\n+', text)]