Friday, December 12, 2008

HTK Chapter 3 - Section 1 - Step 1

Below paragraphs are belong to 
  • HTKBooks, 
  • 苏统华, 哈尔滨工业大学人工智能研究室, 2006年10月30日, 
  • Howard Hung-Ju Chou, Intelligence Information Retrieval Lab., NCKU, Taiwan(R.O.C.).

Environment: 
  • HTK 3.4 
  • Cygwin NT-5.1 1.5.25
Section 1 is Data Preparation - 資料準備
  • Step 1 - the Task Grammer 辨識模型要用的文法資料(gram->wdnet)
The tutorial is the task that building a recognizer for phone call.
此練習是建立一個可辨識電話撥打語音指令的模型。
Typical example is 
一般語音指令如下,
  • Dial 3323654
  • Dial 9045109
  • Phone Woodland
  • Call Steve Young
So we can build a model of grammar for voice dialling according to the human speaking rules.
所以我們可以依據我們說話的模式去建立文法模型。

For example, we won't speak "9045108 call" or "199 Steve Young".
So we can make a grammar graph like the Fig. 3.1 in HTKBook.
We can define the grammar graph by simple symbols.
================================================

$digit = ONE | TWO | THREE | FOUR | FIVE |

       SIX | SEVEN | EIGHT | NINE | OH | ZERO;

$name = [ SUE ] LAW |

       [ JULIAN ] TYLER |

       [ DAVE ] WOOD |

       [ PHIL ] LEE |

       [ STEVE ] YOUNG;

( SENT-START ( DIAL <$digit> | (PHONE|CALL) $name) SENT-END )

=================================================
vertical bars, "|", are alternatives.
square brackets, "[" and "]", are optional items.
angle braces, "<" and ">", are one or more repetitions.

That's why the Fig. 3.1 look like that. 
Because of "<$digit>", the digit allow repeat once or more.
Because of the rad vertical bars in "DIAL <$digit> | (PHONE|CALL) $name", DIAL XXXX is alternative of PHONE someone or CALL someone.
Because of [ PHIL] LEE, we can say Call LEE or Call PHIL LEE.

Now , we can use HTK tool, HParse, to build a word network in HTK Standard Lattice Format (SLF).
HParse Usage - 
  • Without parameters. 
------------------------
$ HParse gram wdnet
------------------------
wdnet file will be like follwoing,
======================
VERSION=1.0
N=31   L=62   
I=0    W=SENT-END            
I=1    W=YOUNG               
I=2    W=!NULL               
I=3    W=STEVE               
I=4    W=LEE                 
I=5    W=PHIL                
I=6    W=WOOD                
I=7    W=DAVE                
I=8    W=TYLER               
I=9    W=JULIAN              
I=10   W=LAW                 
I=11   W=SUE                 
I=12   W=CALL                
I=13   W=!NULL               
I=14   W=PHONE               
I=15   W=ZERO                
I=16   W=!NULL               
I=17   W=OH                  
I=18   W=NINE                
I=19   W=EIGHT               
I=20   W=SEVEN               
I=21   W=SIX                 
I=22   W=FIVE                
I=23   W=FOUR                
I=24   W=THREE               
I=25   W=TWO                 
I=26   W=ONE                 
I=27   W=DIAL                
I=28   W=SENT-START          
I=29   W=!NULL               
I=30   W=!NULL               
J=0     S=2    E=0    
J=1     S=16   E=0   
...omitted
======================
The word network contains 31 nodes and # of arc is 61.
So we have I=0~I=30, 31 nodes.
J=0 S=2 E=0, means arc ID=0, start from Node 2, !NULL, end to Node 0, SENT-END.
The is lower-level description for HTK. gram is high-level description for users.
  • -l, include LM log probs in lattice. 
---------------------------
$ HParse -l gram wdnet
---------------------------
wdnet file will be like following,
Each enteries will have log probability.
======================
Omitted....
J=0     S=2    E=0    l=0.00 
J=1     S=16   E=0    l=-2.48 
Omitted....
======================
How to calculate log probability?

You can build different gram file to generate different wdnet file.

For more detail about HParse, please refer Section 17.16 in HTKBook.
What's going on in wdnet file, please refer Section12.2 in HTKBook.
Know more Standard Lattice Format(SLF), please refer Secion 20 in HTKBook.

Tuesday, December 9, 2008

Good HTK Tutorial in Chinese

I found a good resource for HTK demo.
All of materials are belong to the author of the blog and HTK team.
Author is 苏统华, 哈尔滨工业大学人工智能研究室, 2006年10月30日

According to the Chapter 3 of HTKBook, above 4 URLs is following the below steps.

Section 1 is Data Preparation - 資料準備
  • Step 1 - the Task Grammer 辨識模型要用的文法資料(gram->wdnet)
  • Step 2 - the Dictionary 辨識模型要用的字典資料 (利用字典將wlist裡的單字翻譯為phones字串, one -> w ah n)
  • Step 3 - Recording the Data 錄製辨識用的語音檔 (產生劇本並依照劇本錄製*.wav)
  • Step 4 - Creating the Transcription Files 建立翻譯檔 (根據字典翻譯實驗資料)
  • Step 5 - Coding the Data 將語音檔編碼 (*.wav->*.mfcc)
Section 2 is Creating Monophone HMMs
  • Step 6 - Creating Flat Start Monophones
  • Step 7 - Fixing the Slience Models
  • Step 8 - Realigning the Training Data
Section 3 is Creating Tied-State Triphones
  • Step 9 - Making Triphones from Monophones
  • Step 10 - Making Tied-State Triphones
Section 4 is Recogniser Evaluation
  • Step 11 - Recognising the Test Data
... so on.
It's very useful. Really appreciate the author to save a lot's time for me.
I plan to write a new one following the tutorial with my discoveries, my questions, and my opinions.
I am a freshman of using HTK. Please feel free to give me comments or suggestions. 

Wednesday, December 3, 2008

From U District to Microsof Building 99

I took the bus # 48, transfered to #545, and then transfered to #221.
The first bus stop to get #48,


Exit to the bus stop in Montlake Blvd E & EB SR-520 ON RAMP.

There are two stairs to down. One is on West side and another is on East side. Going to East side is walking to the cross the Montlake Blvd and go down the stairs. It's not convience because you have to wait for signals twice.
West side is more convience. Just pass the Ramp join intersection. The location of stair is neat to the bus stop and in the  center of  below picture.

View Larger Map

U will see the bus stop of 545.
Then take 545 over 520 bridge and go to Overlake Tranmission Center
Take 221 to Eastgate. 221 has two way. Don't take wrong bus.

And exit 221 here or here.


Or Walk for 15~20 minutes to Bldg 99.

Back to U District.
You can take 221 to Overlake Transfer center. Or Walk to bus stop of 545.
The stop of 545 is here.
And take 545 again to Downtown.
Exit bus on this stop.

And go up following a lane. You will come up like the truck in the google street view. The stop is for 25, 43, 44, 48.

檢視較大的地圖

Monday, December 1, 2008

HTK3.4 runDemo on Windows

Download the perl distribution first.
Here is the collection webstie and all perl distributions are all win-based.

I use ActivePerl the best recommendation for beginner.
Then input the perl command for running the HTKdemo.
perl rundemo.pl configs\monPlainM1S1.dcf

If there are error messages, you can refer http://jrgemini.blogspot.com/2008/07/htk-rundemo.html

Tuesday, November 25, 2008

西雅圖三角洲真面目 by Google Street View

Microsoft Research Building #99長甚麼樣子?長這樣子!
左邊那棟就是啦!右邊是停車場!

住的地方,正面

系統生物學中心,ISB
我的位置大概就在這裡的三樓

Clicky

Clicky Web Analytics