Wednesday, July 30, 2008

安裝HTK3.4在Microsoft Windows上,

http://www.co.it.pt/~aveiga/htk/
  1. 下載好HTK3.4,解壓縮。例如D:/HTK_win。
  2. 下載mytools,解開後HMMIRest.c和HTK34Compile.bat放到HTK_win資料夾。
  3. 執行HTK34Compile.bat,等待compile完畢。
  4. 完成
注意你的電腦要有Visual Studio 6 (VC6), Visual Studio .NET 2003 (VC7) and Visual Studio 2005 (VC8)。

HTK rundemo

After I have successfully installed the HTK 3.4 in cygwin environment, I follow the instructions in the README and run the instruction
./runDemo configs/monPlainM1S1.dcf
But I don't get the following results,
(雖然成功安裝了HTK3.4在cygwin上,可是按照HTKDemo裡面的說明執行
./runDemo configs/monPlainM1S1.dcf
沒有跑出)
On the training set:
------------------------ Overall Results --------------------------
SENT: %Correct=0.00 [H=0, S=7, N=7]
WORD: %Corr=77.63, Acc=74.89 [H=170, D=37, S=12, I=6, N=219]
===================================================================

On the test set:
------------------------ Overall Results --------------------------
SENT: %Correct=0.00 [H=0, S=3, N=3]
WORD: %Corr=63.91, Acc=59.40 [H=85, D=35, S=13, I=6, N=133]
===================================================================
Instead I get the error messages,
(反而跑出)
Can't open proto at ./MakeProtoHMMSet line 101, <> line 21.
Can't open hmms/hmm.0
I check the README. I found that I don't have the folder "hmms" and "proto" under the HTKDemo. So I create the folder "proto" then run the instruction once again, and then I pass the first error message. Because the instruction "./MakeProtoHMMSet" will create five files, S, C V,N, and L under the "proto" after read the file "lists/bcplist/hmmlist".
(看了readme,發現我根本沒有hmms資料夾和proto資料夾在HTKDemo下,
所以自己建立了proto資料夾後,就順利過了第一個錯誤。
並在proto資料夾產生S, C, V, N, L五個檔案。
因為./MakeProtoHMMSet參考了lists/bcplist這個hmmlist。)

Therefore, for successfully running the demo, I have to create the following folder manually.
(所以,在HTKDemo總共要產生以下資料夾,)
HTKDemo/hmms/ (給HRest用)
HTKDemo/test/ (給HVite用)
HTKDemo/proto/ (給./MakeProtoHMMSet用)
and then,
<然後是>
HTKDemo/hmms/hmm.0/ (給HInit用)
HTKDemo/hmms/hmm.1/ (給HRest用)
HTKDemo/hmms/hmm.2/ (給HRest,HVite用)
Finally, the correct demo message is avaiable.
(如此一來,就可順利得到./runDemo configs/monPlainM1S1.dcf的正確結果。)

Tuesday, July 29, 2008

輸出eps檔案,以利用在插入latex檔案

關鍵字:設定PostScript printer,轉成eps檔案,latex

1. 安裝好Adobe PostScript Driver (PS印表機)
2. 列印的ppt或是任何文件檔成prn檔時,選擇Generic PostScript Printer,並勾選"列印至檔案"
3. 設定好Postscipt Printer,按下"內容",選擇"進階",展開"PostScript選項"
4. 選擇PostScript輸出選項為"壓縮式PostScript(EPS)"
5. 按下列印後,打開輸出好的XXX.prn,使用GSview打開。
6. Orientation選擇"Portrait",Media看輸出圖片大小可選擇"A4"或"A3"。
7. 打開"File",選擇"PS to EPS",選擇輸出檔案名稱和位置。
8. XXX.eps就可以用囉!
例如,
\begin{figure}
\centering
\includegraphics[width=0.3\textwidth]{XXX.eps}
\caption{This is test!}
\label{fig:test}
\end{figure}

Friday, July 25, 2008

安裝htk 3.4在cygwin上

網路上的說明大多是英文的,提供個翻譯的中文版本給大家。
參考自http://www.phon.ucl.ac.uk/resource/sfs/howto/htk.htm
參考自http://www.llaisdy.com/blog/2007/07/30/compiling-htk-34-on-windows-xp/

使用 cygwin(1.5.25-14)安裝htk 3.4
前置作業
1. 啟動"cygwin_setup.exe,可以從Cygwin首頁下載或是http://cygwin.com/setup.exe
2. 選擇安裝方式。
  • 選擇 "Install from Internet",表示從網路下載套件並安裝,確認電腦的網路是OK的話,就選擇使方式。
  • 另外也可以只下載套件,選擇"Download from Internet"。
  • 或是選擇"Install from Local Directory",只進行安裝已經下載好的套件。
3. 選擇安裝目錄(資料夾),建議選擇預設的"C:/cygwin",除非你是高手,如果你是高手應該也不用看翻譯了吧。
4. 選擇下載後的套件要放在哪個資料夾,例如 "C:/download/cygwin",下次要離線安裝的話,就可以選擇此目錄。
5. 選擇網路連線方式,不需要更改,直接下一步。
6. 選擇下載的網站,當然選自己國家的網站,下載速度會比較快,以台灣為例,有這些可以選擇
  • 台灣大學 ftp://ftp.ntu.edu.tw
  • 元智大學 ftp://ftp.cse.yzu.edu.tw或http://ftp.cse.yzu.edu.tw
7. 選擇下載套件,因為要能夠使用htk,所以需要以下套件
  • 所有在"Base"的套件,如果在NEW的那一欄顯示skip就用滑鼠點選最新的版本來下載。
  • 在Devel分類的BINUTILS: The GNU assembler, linker and binary utilities,點選後,會自動也點選有相依性的套件。
  • 在Devel分類的GCC: C Compiler。
  • 在Devel分類的GCC-G++: GCC C++ compiler。
  • 在Devel分類的MAKE: the GNU version of the 'make' utility 。
8. 等待下載和安裝。
9. 安裝完畢後,可以選擇要在桌面放啟動捷徑或是在程式集顯示Cygwin資料夾。

接下來安裝HTK 3.4

1. 下載HTK原始碼,到http://htk.eng.cam.ac.uk/的Download區下載,下載前要先註冊。
2. 下載HTK source code (tar+gzip archive) 和 HTK samples (tar+gzip archive) ,放到C:\cygwin\home\User_name\資料夾。
3. 啟動cygwin,正常來講起始位置是C:\cygwin\home\User_name\下,沒錯的話輸入ls,會看到剛剛移動過來的HTK-3.4.tar.gz。
4. 解壓縮HTK-3.4.tar.gz,輸入tar xvfz HTK-3.4.tar.gz,完畢後輸入ls,會看到home\User_name\下多了一個htk資料夾。
5. 接下來要修改htk\HTKTools下的Makefile.in文件內容,可以直接在windows下修改或是使用cygwin的編輯器。
6. 打開htk\HTKTools下的Makefile.in,將裡面的某一段程式碼的"-lX11"刪除,如下。

%: %.c $(HTKLIB)
if [ ! -d $(bindir) -a X_ = X_yes ] ; then mkdir -p $(bindir) ; fi
if [ x$@ = xHSLab ] ; then
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) -lX11 ;
else
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) ; fi

變成,

%: %.c $(HTKLIB)
if [ ! -d $(bindir) -a X_ = X_yes ] ; then mkdir -p $(bindir) ; fi
if [ x$@ = xHSLab ] ; then
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) ;
else
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) ; fi

7. 複寫HGraf.c檔。在htk目錄下,輸入以下指令。

$ cd HTKLib \\進入HTKLib資料夾
$ cp HGraf.c HGraf.c.original \\將HGraf.c重新命名為HGraf.c.original
$ cp HGraf.null.c HGraf.c \\將HGraf.null.c重新命名為HGraf.c
$ cd ..\\回到htk資料夾

8. 接下來回到htk資料夾後,依照此目錄的README,依序輸入
$ ./configure
$ make
$ make install

9. 大功告成

如果是安裝3.3.以下的版本,請參考http://speech.ee.nthu.edu.tw/index.php?n=Lab.HtkCygwin

Tuesday, July 15, 2008

讓舊版office可以讀取office2007的相容套件

此套件可以讓Office 2000、Office XP 或 Office 2003可以讀取Office 2007的Word、Excel,或 PowerPoint 2003,下載頁面和注意事項在下面URL中。
http://www.microsoft.com/downloads/details.aspx?displaylang=zh-tw&FamilyID=941b3470-3ae9-4aee-8f43-c6bb74cd1466

Clicky

Clicky Web Analytics