O'Reilly logo

Hands-On Natural Language Processing with Python by Rajalingappaa Shanmugamani, Rajesh Arumugam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Training and testing

After the previous steps, training and testing can be achieved through 3_train.py and 4_test.py.

The first script trains a Tacotron model on the prepared training set across the NB_EPOCHS epochs, and then saves the model in the /results folder. 

The second script allows the user to apply the previously saved model on any transcript of testing dataset. The selection of the audio to predict is done through a  variable, item_index, which should contain the index (in the testing dataset) of the wanted item. 

The estimated spectrogram is then converted to a waveform through the Griffin-Lim algorithm. The conversion function, from_spectro_to_waveform, is defined in the  /processing/proc_audio.py file.

We strongly encourage ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required