From ff7258062c93b6321594b2951dfbd66ecccb1b3e Mon Sep 17 00:00:00 2001 From: Eren Golge Date: Wed, 20 Mar 2019 12:22:42 +0100 Subject: [PATCH] skip the alst empty char in phonemes to sequence. It breaks the alingment --- utils/text/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/text/__init__.py b/utils/text/__init__.py index c66bce91..464a7ac9 100644 --- a/utils/text/__init__.py +++ b/utils/text/__init__.py @@ -28,6 +28,7 @@ def text2phone(text, language): #try: punctuations = re.findall(pat, text) ph = phonemize(text, separator=seperator, strip=False, njobs=1, backend='espeak', language=language) + ph = ph[:-2] # skip the last empty character # Replace \n with matching punctuations. if len(punctuations) > 0: for punct in punctuations[:-1]: @@ -50,7 +51,6 @@ def phoneme_to_sequence(text, cleaner_names, language): if phonemes is None: print("!! After phoneme conversion the result is None. -- {} ".format(clean_text)) for phoneme in phonemes.split('|'): - # print(word, ' -- ', phonemes_text) sequence += _phoneme_to_sequence(phoneme) # Append EOS char sequence.append(_phonemes_to_id['~'])