Code Monkey home page Code Monkey logo

tacotron's Introduction

Tacotron for research on Chinese speech synthesis and Taiwanese speech synthesis from Chinese input text sequence with different granularities

Train the Tacotron speech synthesis model to synthesize Chinese or Taiwanese speech conditioned on Chinese input text sequence with different granularities

Prerequisites

  1. Python packages:

    • python 3.4 or higher
    • tensorflow r1.8 or higher
    • numpy
    • librosa
    • scipy
    • tqdm
    • matplotlib
    • zhon
    • pypinyin
    • bopomofo
  2. Clone this repository:

 https://github.com/HappyBall/tacotron.git

Dataset

  1. Lecture record Chinese dataset Download

  2. DaAiSermon Taiwanese dataset Download

Usage

After downloading the correspond dataset, you can directly train Tacotron model to synthesize Chinese or Taiwanese speech.

Training

Set up the correct path of the dataset and other hyperparameters in hyperparams.py.

Run: python train.py --keep_train False

Parameter --keep_train determines either start a new training or continue training with the existed model which the path should be correctly set up in hyperparams.py.

Synthesis

  1. Set up the correct path of the existed model in hyperparams.py.

  2. Add Chinese input sequences you want to synthesize into test_sentences.txt.

Run: python synthesize.py

Evaluate

Set up the output file path in evaluate.py.

Run: python evaluate.py

The program will automatically calculate the mean square error between the mel scale spectrogram of synthesized speech and the ground truth then output as a text file.

Hyperparameters of the hyperparams.py

--data: the path of the data directory which contains the wav files
--prepro_path: the path of the preprocessed data directory
--test_data: the path of the text file which contains input text sequences to synthesize speech
--logdir: the path of the directory to save or load models
--logfile: the path of the training log file
--sampledir: the path of the directory to save speech files when synthesizing
--input_mode: mode of the input granularity (word, bopomofo, pinyin, phoneme)
--withtone: input with tone or not, only bopomofo or pinyin input mode use this hyperparameter (True, False)
--n_iter: iteration number of Griffin Lim algorithm
--guided_attention: use guided attention or not when training (True, False)
--schedule_prob: probability of schedule sampling using the ground truth as input
--lr: initial learning rate

Files in this project

data_load.py: data loader for training data and testing data
evaluate.py: calculate the mean square error between the mel scale spectrogram of synthesized speech and the ground truth from testing data
graph.py: define model graph
hyperparams.py: set up training hyperparameters and directory for saving models
modules.py: define modules like gru, convolution layers ...etc
networks.py: define networks like encoder, decoder ...etc
prepro.py: preprocess data
synthesize.py: synthesize speech conditioned on input text sequences in the test sentence file
train.py: train models

tacotron's People

Contributors

happyball avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.