Пример #1
0
def text_to_sequence(text, p=0.0):
    #print("[Pabz-test] Frontend sin")
    #if p >= 0:
    #    text = mix_pronunciation(text, p)
    from deepvoice3_pytorch.frontend.text import text_to_sequence
    text = text_to_sequence(text, ["english_cleaners"])
    return text
Пример #2
0
def text_to_sequence(text, phonetic=None, p=0.0):
    # 'text' = WordJTrans
    # Called during train.py.
    if (phonetic and p >= 0):
        text = mix_pronunciation(text, phonetic, p)
    from deepvoice3_pytorch.frontend.text import text_to_sequence
    text = text_to_sequence(text, ["french_cleaners"])
    return text
Пример #3
0
def text_to_sequence(text, p=0.0):
    text = normalize_numbers(text)
    text = text.replace('\r', '')
    text = text + '.' if text[-1] not in '!,.:;?' else text
    if p >= 0:
        text = mix_pronunciation(text, p)
    from deepvoice3_pytorch.frontend.text import text_to_sequence
    text = text_to_sequence(text, ["english_cleaners"])
    return text
Пример #4
0
def text_to_sequence(text, p=0.0):
    from deepvoice3_pytorch.frontend.text import text_to_sequence
    text = text_to_sequence(text, ["transliteration_cleaners"])
    return text
def text_to_sequence(text, p=0.0):
    if p >= 0:
        text = mix_pronunciation(text, p)
    from deepvoice3_pytorch.frontend.text import text_to_sequence
    text = text_to_sequence(text, ["english_cleaners"])
    return text
Пример #6
0
def text_to_sequence(text, p=0.0):
    from deepvoice3_pytorch.frontend.text import text_to_sequence
    text = text_to_sequence(text, ["estonian_cleaners"])
    return text
Пример #7
0

def mix_pronunciation(text, p):
    #text = '%'.join(word for word in text.split(', '))
    text = ' '.join(_maybe_get_arpabet(word, p) for word in text.split(' '))
    return text


def text_to_sequence(text, p=0.0):
    text = normalize_numbers(text)
    text = text.replace('\r', '')
    text = text + '.' if text[-1] not in '!,.:;?' else text
    if p >= 0:
        text = mix_pronunciation(text, p)
    from deepvoice3_pytorch.frontend.text import text_to_sequence
    text = text_to_sequence(text, ["english_cleaners"])
    return text


from deepvoice3_pytorch.frontend.text import sequence_to_text

#test
if __name__ == '__main__':
    print('input ratio:')
    p = float(input())
    print('input English sentence:')
    text = input()
    seq = text_to_sequence(text, p)
    print('sequence:{}'.format(seq))
    seq2text = sequence_to_text(seq)
    print('sequence to text:{}'.format(seq2text))
Пример #8
0
def text_to_sequence_original(text, p):
    from deepvoice3_pytorch.frontend.text import text_to_sequence
    text = text_to_sequence(text, ["french_cleaners"])
    return text