Вы находитесь на странице: 1из 10

ABV-Indian Institute of Information Technology and Management

Natural Language Processing Lab Assignment

Submitted To: Dr. Mahua Bhattacharya

Submitted By: Ishan Gupta (2008IPG-37)

Q 5). How do we develop an isolated speech recognizer in HTK? Ans5). The following steps were performed in the development of an isolated speech recognizer in HTK: i. Initially a grammar file was created with the following content and saved with the name grammar $digit = ONE | TWO | THREE | FOUR | FIVE | SIX | SEVEN | EIGHT | NINE | ZERO; ( SENT-START ($digit) SENT-END ) Then this grammar file was used to create a word net by using the command HParse grammar wdnet The snapshot is as given below

ii.

Next we require to create a dictionary in order to identify the words First step in creating a dictionary involves creating a list of words. A file named wlist was created containing the list of words A file named maindict was created which contained words with their pronounciation in order to enable the speech recognizer identify the words based on their pronounciation in the speech. The command used to create a pronounciation dictionary of words given in wlist is HDMan -A -D -T 1 -m -w wlist -n monophones1 -i -l dlog dict maindict This command results in the creation of two files monophones1 and dict. The screenshot of execution of the command is

iii. iv.

In the third step recordings were created In order to create the word level transcription a words.mlf file was created. Next the mkphones0.led script was created in order to facilitate the task of creating phone level transcriptions. The following command was executed to finally perform the task of creating phone level transcriptions HLEd -A -D -T 1 -l '*' -d dict -i phones0.mlf mkphones0.led words.mlf This command results in the creation of phones0.mlf and the screenshot of execution of this command is given below

v.

In the fifth step the conversion of audio file to mfcc file was required. This task was performed by creating the codetrain.scp file and tuning the parameters in the config file. After creating the codetrain.scp file and the config file the following command was executed HCopy -A -D -T 1 -C wav_config -S codetrain.scp The screenshot of execution of this command is given below:

vi.

The sixth step marks the start of training process of the hidden markov model it is pursued by creating flat start monophones. The first step in training to create a prototype model usually referred to as proto. Next another config file named config1 was created followed by the creation of a train.scp file which contains the path of all the mfc files. Next the following command was executed HCompV -A -D -T 1 -C config -f 0.01 -m -S train.scp -M hmm0 proto

This command results in the creation of files proto and vfloors in hmm0 folder. The screenshot of execution of this step is given below:

Next step involves the creation of flat start monophones. This task was performed with the help of following steps. a. Create a new file called hmmdefs in your 'voxforge/manual/hmm0' folder: Copy the monophones1 file to your hmm0 folder; rename the monophones1 file to hmmdefs; b. For each phone in hmmdefs:

put the phone in double quotes; add '~h ' before the phone (note the space after the '~h'); and copy from line 5 onwards (i.e. starting from "<BEGINHMM>" to "<ENDHMM>") of the hmm0/proto file and paste it after each phone. Leave one blank line at the end of your file.

Creation of a file named macros was also required which involved performing the following steps:

create a new file called macros in hmm0; copy vFloors to macros copy the first 3 lines of hmm0/proto (from ~o to <DIAGC>) and add them to the top of the macros file

Next nine folders hmm1 to hmm9 were created in the project directory i.e.htk1 and the following command which resulted in creation of hmm1/hmmdefs and hmm1/macros folder HERest -A -D -T 1 -C config -I phones0.mlf -t 250.0 150.0 1000.0 -S train.scp -H hmm0/macros -H hmm0/hmmdefs -M hmm1 monophones1 The screenshot of execution is given below

Similarly the following two commands were executed to create files in folder hmm2 and hmm3 respectively HERest -A -D -T 1 -C config1 -I phones0.mlf -t 250.0 150.0 1000.0 -S train.scp -H hmm1/macros -H hmm1/hmmdefs -M hmm2 monophones1 HERest -A -D -T 1 -C config1 -I phones0.mlf -t 250.0 150.0 1000.0 -S train.scp -H hmm2/macros -H hmm2/hmmdefs -M hmm3 monophones1 vii. In the next step the main task was of fixing the silence model. This was done by creating a sp model. Initially the contents of folder hmm3 were copied to folder hmm4 and the following steps were performed

copy and paste the sil model from hmmdefs and rename the new one sp(don't delete your old "sil" model, you will need it - just make a copy of it) remove state 2 and 4 from new sp model (i.e. keep 'centre state' of old sil model in new sp model) change <NUMSTATES> to 3 change <STATE> to 2 change <TRANSP> to 3 change matrix in <TRANSP> to 3 by 3 array change numbers in matrix as follows: 0.0 1.0 0.0 0.0 0.9 0.1 0.0 0.0 0.0

Then the sil.hed file was created and the following command was executed: HHEd -A -D -T 1 -H hmm4/macros -H hmm4/hmmdefs -M hmm5 sil.hed monophones1 This command resulted in the creation of files hmmdefs and macros in the folder hmm5. The screenshot of execution of this command is as given below:

Next the following commands were executed to create hmmdefs and macros file in hmm6 and hmm7 folders respectively HERest -A -D -T 1 -C config -I phones1.mlf -t 250.0 150.0 3000.0 -S train.scp -H hmm5/macros -H hmm5/hmmdefs -M hmm6 monophones0 $HERest -A -D -T 1 -C config1 -I phones1.mlf -t 250.0 150.0 3000.0 -S train.scp -H hmm6/macros -H hmm6/hmmdefs -M hmm7 monophones1 viii. Realignment of the training data was done with the help of the following command HVite -A -D -T 1 -l '*' -o SWT -b SENT-END -C config -H hmm7/macros -H hmm7/hmmdefs -i aligned.mlf -m -t 250.0 150.0 1000.0 -y lab -a -I words.mlf -S train.scp dict monophones0> HVite_log The snapshot of execution of this command is given below:

Finally the following two commands were executed in order to create hmmdefs and macros files in hmm8 and hmm9 folders respectively. HERest -A -D -T 1 -C config1 -I aligned.mlf -t 250.0 150.0 3000.0 -S train.scp -H hmm7/macros -H hmm7/hmmdefs -M hmm8 monophones1 HERest -A -D -T 1 -C config1 -I aligned.mlf -t 250.0 150.0 3000.0 -S train.scp -H hmm8/macros -H hmm8/hmmdefs -M hmm9 monophones1

Вам также может понравиться