Changes between Version 1 and Version 2 of HMMVoiceCreationMary4.1.0


Ignore:
Timestamp:
08/31/10 17:40:27 (14 years ago)
Author:
marcela_charfuelan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HMMVoiceCreationMary4.1.0

    v1 v2  
    1  
    2 = '''Voice Import Tools Tutorial : How to build a HMM-based voice for the MARY 4.1.0 platform''' = 
    3  
    4 For creating HMM-based voices we use a version of the speaker dependent training scripts provided by [http://hts.sp.nitech.ac.jp/ HTS] that was adapted to the MARY 4.1.0 platform. The steps for building a HMM voice for the MARY platform can be summarised in:[[BR]] 
    5  
    6 I) Download MARY TTS including Voice import tools[[BR]] 
    7 II) Check necessary programs and files[[BR]] 
    8 III) Check data: audio and text files[[BR]] 
    9 IV) Run the Voice import tools [[BR]] 
    10 V) Creating other voice in a language different from German or English (US). 
    11  
    12 The training scripts used here are the latest versions, that is, it is required HTS_2.1 and SPTK-3.2. Some scripts have been added-modified to:[[BR]] 
    13 - Use MARY instead of festival as text analyzer.[[BR]] 
    14 - Train bandpass voicing strengths and Fourier magnitudes for mixed excitation.[[BR]] 
    15  
    16 '''MARY requirements:'''[[BR]] 
    17 - Operating System - Linux (tested on Ubuntu 9.04) [[BR]] 
    18 - MARY TTS 4.1.0 including Voice import tools during installation - link: [http://mary.dfki.de/download/4.0/openmary-standalone-install-4.0.0.jar MARY TTS 4.1.0] [[BR]] 
    19  
    20  
    21 ''' 
    22 == I) Download MARY TTS including Voice import tools == 
    23 ''' 
    24  
    25 Click on the latest MARY release [http://mary.dfki.de/download/4.0/openmary-standalone-install-4.0.0.jar MARY download] or download the file and run it with: 
    26 {{{ 
    27 java -jar openmary-standalone-install-4.1.0.jar 
    28 }}} 
    29  
    30  
    31 ''' 
    32 == II) Check the necessary programs and files: == 
    33 ''' 
    34  
    35 We provide an script to facilitate the checking and installation of the necessary external programs, once installed MARY TTS open a command line shell in your voice building directory and run the shell script: 
    36 {{{ 
    37 $MARY_BASE/lib/external/check_install_external_programs.sh 
    38 }}} 
    39  
    40 With the option '''-check''', this script will check if the necessary programs and versions are installed (that is, the programs can be found in the PATH or in the paths provided by the user).[[BR]] 
    41 With the option '''-install''' this script will try to download and install the necessary programs in: $MARY_BASE/lib/external/bin (if problems, it will suggest how to install manually the programs). 
    42  
    43 If you have already installed some of the required programs, '''please include their paths in the PATH variable or provide the paths''', for example: 
    44 {{{ 
    45 $MARY_BASE/lib/external/check_install_external_programs.sh -check /your/path/to/htk/bin /your/path/to/Festival/festvox/src/ehmm/bin 
    46 }}} 
    47  
    48 This script generates a '''$MARY_BASE/lib/external/externalBinaries.config''' file that will be used by the Voice import tools to locate the necessary external programs. 
    49  
    50 The necessary programs that this script checks are:[[BR]] 
    51  
    52 '''HTS requirements:'''[[BR]] 
    53 - [http://hts.sp.nitech.ac.jp/archives/2.1/HTS-2.1_for_HTK-3.4.tar.bz2 HTS-2.1_for_HTK-3.4.patch] [[BR]] 
    54 - HTK-3.4 and HDecode patched with HTS-2.1_for_HTK-3.4.patch links: 
    55     * [http://htk.eng.cam.ac.uk/ftp/software/HTK-3.4.tar.gz HTK-3.4] (you will need to register first) [[BR]]  
    56     * [http://htk.eng.cam.ac.uk/prot-docs/hdecode.shtml HDecode] (you will need to register first) [[BR]] 
    57 - [http://downloads.sourceforge.net/sp-tk/SPTK-3.2.tar.gz SPTK-3.2] [[BR]] 
    58 - [http://downloads.sourceforge.net/hts-engine/hts_engine_API-1.01.tar.gz hts_engine_API-1.01] [[BR]] 
    59  
    60 '''Other requirements:'''[[BR]] 
    61 - awk normally available in linux [[BR]] 
    62 - perl normally available in linux [[BR]] 
    63 - bc normally available in linux [[BR]] 
    64 - sox, v13.0 or greater [http://sox.sourceforge.net/ SoX], normally available in linux.  [[BR]] 
    65 - tcl supporting snack, for example  [http://www.activestate.com/Products/ActiveTcl/ ActiveTcl.] Note that only ActiveTcl 8.4 includes snack; 8.5+ requires manual installation. [[BR]] 
    66 - [http://www.speech.kth.se/snack/download.html snack] library for tcl.  [[BR]] 
    67 - EHMM for automatic labeling, available with [http://festvox.org/download.html festvox-2.1] [[BR]] 
    68  
    69  
    70  
    71  
    72 ''' 
    73 == III) Check data: audio and text files[[BR]] == 
    74 ''' 
    75  
    76 In your voice building directory execute the step-by-step procedure in [http://mary.opendfki.de/wiki/VoiceImportToolsTutorial VoiceImportToolsTutorial] to make 
    77 sure that the data, sound (wav) and text files are in the correct place and format.[[BR]] 
    78  
    79 As a result of this step your voice building directory should contain a wav and text directories. 
    80  
    81  
    82 ''' 
    83 == IV) Run the Voice Import tools == 
    84 ''' 
    85  
    86 In your voice building directory run the voice import tools: 
    87 {{{ 
    88 export MARY_BASE="/your/path/to/MARY TTS/" 
    89 java -Xmx1024m -jar $MARY_BASE/java/voiceimport.jar 
    90 }}} 
    91  
    92 After starting the Voice Import Tools check the global settings of the voice, make sure that the allophones file is provided and exists: 
    93 {{{ 
    94 db.alophonesSet = $MARY_BASE/lib/modules/xx/lexicon/allophones.xx.xml  (where xx is the corresponding language) 
    95 }}} 
    96  
    97  
    98 And run the following components: 
    99  
    100  
    101 '''1-''' Run the HMMVoiceDataPreparation of the HMM Voice Trainer group to set up the environment to create a HMM voice and check if required external programs and text and wav files are available and in the correct paths.  
    102  
    103 '''2-''' Run the AllophonesExtractor of the Automatic Labeling group to create the '''prompt_allophones''' directory required in the next step. This component requires the MARY server. [[BR]] 
    104  
    105 '''3-''' Run the EHMMlabeler component of the Automatic Labeling group to label automatically the wav files using the corresponding transcriptions. This procedure might 
    106 take several hours. For running EHMMLabeler, please use the settings editor of this component to set, according to your festvox installation, the variable: 
    107 {{{ 
    108    EHMMLabeler.ehmm  = ../festvox/src/ehmm/bin/ 
    109 }}} 
    110 The result of this step is a '''ehmm/lab''' directory. 
    111  
    112 '''4-''' Run the LabelPauseDeleter component of the Automatic Labeling group. Please use the settings editor of this component to set the variable: 
    113 {{{ 
    114    LabelPauseDeleter.threshold  =  10 
    115 }}} 
    116 The result of this step is a '''lab''' directory. 
    117  
    118 '''5-''' Run the TranscriptionAligner component of the Label-Transcript Alignment group.  This program will create the '''allophones''' directory. 
    119  
    120 '''6-''' Run the PhoneUnitLabelComputer component of the Label-Transcript Alignment group. This procedure has as input the '''lab''' directory and will create as an output the  '''phonelab''' directory.  
    121  
    122 '''7-''' Run the FeatureSelelection component of the Feature Extraction group. This program will create a '''mary/features.txt''' file, it requires the MARY server running. Select here all the features and save the file. 
    123  
    124 '''8-''' Run the PhoneUnitFeatureComputer component of the Feature Extraction group to extract context feature vectors from the text data. This procedure will create a '''phonefeatures''' directory. For running this component the MARY server should be running as well.  
    125  
    126 '''9-''' Run the PhonelabelFeatureAligner component of the Verify Alignment group. This procedure will verify alignment between "phonefeatures" and "phonelabels".[[BR]] 
    127  
    128 As a result of previous steps we should have:[[BR]] 
    129 - phonefeatures directory [[BR]] 
    130 - phonelab directory [[BR]] 
    131 - mary/features.txt file [[BR]] 
    132 - $MARY_BASE/lib/external/externalBinaries.config 
    133  
    134  
    135 ''' 
    136 === HMM models training: === 
    137 ''' 
    138  
    139 '''10-''' Run the HMMVoiceConfigure component of the HMM Voice trainer group. The default setting values are already fixed for the arctic slt voice, some path settings depend on your installation, and will be taken from $MARY_BASE/lib/external/externalBinaries.config 
    140  
    141 If running configure for other voice, for example a male German voice, please use the settings editor of this component to set the variables: 
    142 {{{ 
    143   HMMVoiceConfigure.dataSet      =  german_set_name 
    144   HMMVoiceConfigure.speaker      =  speaker_name  
    145   HMMVoiceConfigure.lowerF0      =  40  (male=40,  female=80)   
    146   HMMVoiceConfigure.upperF0      =  280 (male=280, female=350) 
    147 }}} 
    148  
    149 Using the settings editor of this component you can also change other variables like using LSP instead og MGC, sampling frequency, etc., the same as you would do when running "make configure + parameters" with the original HTS scripts. 
    150  
    151 '''11-''' Run the HMMVoiceFeatureSelection component of the HMM Voice trainer group. This program reads the '''mary/features.txt''' file (created in step 11), and generates the file '''mary/hmmFeatures.txt'''. This file contains extra features, apart from phone and phonological features, that will be used to train HMMs. When running this program a small set of features will be presented on top, separated by an empty line:[[BR]] 
    152 {{{ 
    153    pos_in_syl 
    154    syl_break 
    155    prev_syl_break 
    156    position_type 
    157     
    158    accented 
    159    accented_syls_from_phrase_end 
    160    accented_syls_from_phrase_start 
    161    breakindex 
    162    edge 
    163    ... 
    164 }}} 
    165 If you are not sure about using other features, use the first four, delete the others and save the file. 
    166  
    167 '''12-''' Run the HMMVoiceMakeData component of the HMM Voice trainer group to run the HTS procedure "make data". This procedure require the following files: 
    168 {{{ 
    169    HMMVoiceMakeData.allophonesFile   = allophones.en_US.xml  # allophones set (language dependent) 
    170    HMMVoiceMakeData.featureListFile  = mary/hmmFeatures.txt  # extra context features used for training HMMs. 
    171 }}} 
    172  
    173 The allophones set file is language dependent, it can be found in $MARY_BASE/lib/modules/en/us/lexicon/allophones.en_US.xml[[BR]] 
    174 The hmmFeatures.txt is the file created in step 15 and contains additional context features, apart from phone and phonological features, used for training HMMs.[[BR]] 
    175  
    176 The HMMVoiceMakeData procedure is similar to the original HTS scripts with additional sections for calculating strengths, Fourier magnitudes (for mixed excitation), global variance and composing training data files from mgc, lf0, str and mag files. This component will execute in the hts/data/ directory:  
    177 {{{ 
    178   make all-mary  or 
    179   make mgc lf0 str-mary mag-mary cmp-mary gv-mary gv list scp  
    180 }}} 
    181 The '''label''' directory and the '''mlf''' files in MARY are done with the Voice Import Tools: HMMVoiceMakeData.makeLabels()[[BR]] 
    182 The '''questions''' file in MARY is done with the Voice Import Tools: HMMVoiceMakeData.makeQuestions()  
    183  
    184  
    185 Particular procedures can be repeated isolated fixing the particular settings for this component. For example, if the procedure that creates strengths (in the str directory) has to be repeated with a different set of filters (data/filters/), set: 
    186 {{{ 
    187   HMMVoiceMakeData.makeSTR       =  1 
    188   HMMVocieMakeData.makeCMPMARY   =  1 
    189 }}} 
    190 all the other variables in 0, and run again the component. (In this case you need to run makeCMPMARY again because you need to compose again the vectors mgc+lf0+str+mag). 
    191  
    192 The procedures can be repeated manually as well, going to the hts/data directory and running "make str-mary" and "make cmp-mary". 
    193  
    194 NOTE: the Makefile in data/ includes a gv: section to calculate global variance files. In MARY, these files are generated little endian and contain a header of size one short to indicate the size of the vectors it contains. 
    195  
    196  
    197 '''13-''' Run the HMMVoiceMakeVoice component of the HMM Voice trainer group, here again particular training steps can be repeated selecting them (setting in 1, all the others in 0) from the settings of this component. This is equivalent to run again: 
    198 {{{ 
    199    perl scripts/Training.pl scripts/Config.pm > logfile & 
    200 }}} 
    201 after modifying the Config.pm file, as is normally done with the original HTS scripts. 
    202   
    203 This component will generate general information about the execution of the training steps. Detailed information about the training status can be found in the logfile in the current directory. 
    204  
    205 The training procedure can take several hours, please check the log file time to time to check progress. 
    206  
    207  
    208 ''' 
    209 === Adding a new voice in the MARY platform: === 
    210 ''' 
    211  
    212 '''14-''' Run the HMMVoicePackager component of the Install Voice group. The default setting values of this component are already fixed for the HTS-demo_CMU-ARCTIC-SLT voice. Some settings of the voice can be changed here, for example: 
    213 {{{ 
    214   HMMVoicePackager.useMixExc   =  true 
    215                                    set this variable to true if using mixed excitation 
    216   HMMVoicePackager.useGV       =  true  
    217                                    set this variable to true if using global variance in parameter generation. 
    218   HMMVoicePackager.useAcousticModels = true 
    219                                        set this variable to true to allow prosody modification specified in MARYXML 
    220 }}} 
    221  
    222 The HMMVoicePackager will pack in a zip file located in MARY_BASE/download:  [[BR]] 
    223 - A mary config file: german-hsmm-voice.config [[BR]] 
    224 - HMM files corresponding to this voice: [[BR]] 
    225   - one example of phonefeatures for testing the synthesiser: data/phonefeatures/cmu_us_arctic_slt_xxxx.pfeats  [[BR]] 
    226   - the HTS trees: voices/qst001/ver1/*.inf  [[BR]] 
    227   - the HTS PDF models: voices/qst001/ver1/*.pdf [[BR]] 
    228   - global variance models (if useGV is set to true): data/gv/gv-*-littend.pdf [[BR]] 
    229   - filter taps for mixed excitation: data/filters/mix_excitation_filters.txt [[BR]] 
    230   - trickyPhones.txt file, if one was created during training [[BR]] 
    231  
    232 After successfully packing a new voice, you must run the MARY Component Installer to install the voice! 
    233  
    234  
    235 ''' 
    236 === V) Creating other voice in a language different from German or English (US). === 
    237 ''' 
    238  
    239 If you are creating a voice in other language you will need to specify: 
    240  
    241 - '''Minimal NLP components''': if you are creating a new voice from scratch, for example following the steps in [http://mary.opendfki.de/wiki/NewLanguageSupport NewLanguageSupport], you will need to create Minimal NLP components for the new language. These minimal components are necessary to run the MARY server in the new language and extract context features ('''phonefeatures''' directory). 
    242  
    243 - '''Phoneme set''':  contained in $MARY_BASE/lib/modules/xx/lexicon/allophones.xx.xml , where xx corresponds to the new language. 
    244  
    245 - After creating the minimal components, you will need wav files (in a wav directory) and the corresponding transcriptions (one file per wav file in a text directory). [[BR]] 
    246 Afterwards follow the instructions as normal from step 1. Provide general settings for: 
    247 {{{ 
    248    db.gender    =  male  (or female) 
    249    db.locale    =  new_language locale (according to your minimal NLP components, ex. tr for Turkish, te for Telugu, etc.) 
    250    db.marybase  =  /path/to/mary/base/ 
    251    db.voicename =  new_language_voice_name 
    252 }}} 
    253  
    254  
    255    
    256  
    257 [[BR]] 
    258 [[BR]] 
    259  
    260 Marcela Charfuelan[[BR]] 
    261 Tue Aug 31 16:27:09 CEST 2010 
     1This page has been redirected to [wiki:HMMVoiceCreation HMMVoiceCreation]