Tensorflowtts: Tacotron 2 and phonemes

Created on 22 Oct 2020  ·  4Comments  ·  Source: TensorSpeech/TensorFlowTTS

Hi, @dathudeptrai, thanks for the great TTS.
Is it sufficient just insert phoneme text in .csv file for phonetic training Tacotron2?
Thanks in advance.

question ❓

All 4 comments

Hi, @dathudeptrai, thanks for the great TTS.
Is it sufficient just insert phoneme text in .csv file for phonetic training Tacotron2?
Thanks in advance.

no :D. You should write ur own processor like here (https://github.com/TensorSpeech/TensorFlowTTS/tree/master/tensorflow_tts/processor)

@dathudeptrai @RuslanSel sorry for reopening the issue.
I see that ids directory is where we save text id's. Each file is a numpy array of integers (id's) and i'm dealing with non-English text mapped to phoneme using my g2p model. What i'm thinking to do is creating ids directory without writing my own processor by mapping my phonemes to id's, dump and save them in numpy array.
example:

import numpy as np
wav = '22-1'
phn-txt = ' ZH AE HH AE N E - H AE SS N '
pho_ids = {'-':0, ' ZH':1, 'AE':2, 'SS':3, 'AE':4,'IY':5,.....,'eos': 55}
l = [ pho_ids[i] for i in phn-txt.split()]
l.append(pho_ids['eos'])
l = np.array(l,dtype='int32')
np.save(l, wav + '-ids')

Is it correct @dathudeptrai ?

@ahmedalbahnasawy You don't need to to do that. The LJSpeech processor can take ARPA input if you wrap it in { }, so if you wanted to type Hello!, you'd do {H AH L OW} !
See https://github.com/TensorSpeech/TensorFlowTTS/blob/f6721a737aaa80214ba9907061513481660c5a63/tensorflow_tts/processor/ljspeech.py#L182-L200

@dathudeptrai @RuslanSel sorry for reopening the issue.
I see that ids directory is where we save text id's. Each file is a numpy array of integers (id's) and i'm dealing with non-English text mapped to phoneme using my g2p model. What i'm thinking to do is creating ids directory without writing my own processor by mapping my phonemes to id's, dump and save them in numpy array.
example:

import numpy as np
wav = '22-1'
phn-txt = ' ZH AE HH AE N E - H AE SS N '
pho_ids = {'-':0, ' ZH':1, 'AE':2, 'SS':3, 'AE':4,'IY':5,.....,'eos': 55}
l = [ pho_ids[i] for i in phn-txt.split()]
l.append(pho_ids['eos'])
l = np.array(l,dtype='int32')
np.save(l, wav + '-ids')

Is it correct @dathudeptrai ?

yes, you can do that, you can only replace feature folder to training, but in the inference step, you need a processor or a function to convert from text -> ur phoneme. You can also do as @ZDisket suggesstion.

Was this page helpful?
0 / 5 - 0 ratings