Hidden Markov Toolkit (HTK) 3.4.1
Use of this software is governed by a license agreement, the terms and conditions of which are set forth in the file LICENSE in the top-level HTK installation directory. Please read this file carefully as use of this software implies acceptance of the conditions described therein.
HTK is a toolkit for use in research into automatic speech recognition and has been developed by the Machine Intelligence Laboratory (formerly know as the Speech Vision Robotics Group) at the Cambridge University Engineering Department (http://mi.eng.cam.ac.uk) and Entropic Ltd (http://www.entropic.com).
Please visit the HTK homepage at the following address for more information about HTK:
http://htk.eng.cam.ac.uk/
A number of mailing lists have been established to help users build and understand HTK, for details see
http://htk.eng.cam.ac.uk/mailing/subscribe_mail.shtml
HTK is made available free of charge and can be downloaded from the website mentioned above. However it may not be redistributed, i.e. you must register at the website and download it from there. Details about the terms under which HTK is made available can be found in the LICENSE file.
Why Docker? I have added docker
support since the HTK source code is out of date and does not compile on modern x86_64 architectures due to minor issues.
To build this docker image
git clone https://github.com/loretoparisi/htk.git \
cd htk/ \
docker build -t htk-docker . \
docker run --rm -it htk-docker
After unpacking the sources, cd to the htk directory.
There are now two ways to install HTK, the "traditional" and the "new". Up to now HTK has always installed its tools as they were built, and installed them to a directory such as "bin.linux" so that binaries for different architectures can be installed in a home directory say. If you want to install in this way, please add the option "--enable-trad-htk" when you run configure.
The "new" method installs by default into /usr/local/bin (equivalent to a configure option of "--prefix=/usr/local").
- decide which of the above methods you wish to use
- cd to htk, then run ./configure (with appropriate options, run "./configure --help" if unsure). If you don't want to build the programs in HLMTools add the --disable-hlmtools option.
- make all
- make install
Running "make install" will install them. This step may need to be done as root, if you are not installing them in your home directory.
Notes for particular Unix variants: Solaris: if "make" isn't installed you may need to add /opt/sfw/bin and /usr/ccs/bin to your path and run "./configure MAKE=gmake" with any other options you require. Then run "gmake" instead of "make", alternatively you can create a symbolic link called "make" somewhere it your path to /opt/sfw/bin/gmake
If you are also building HDecode (available from the HTK website, under a different licence from HTK), you will firstly need to unpack the HDecode source code (in the same directory in which you unpacked the HTK sources). Follow the steps above for building HTK first, then add these steps to the build process:
- make hdecode
- make install-hdecode
Prerequisites:
* HTK has been verified to compile using Microsoft Visual Studio.
* For testing, you will require a Perl interpreter such as
ActivePerl.
* You will need a tool such as 7-zip or winzip (commercial) for unpacking
the HTK source code archive.
* It is helpful if you have some familiarity with using the DOS
command line interface, as you will need to interact with it in
order to compile, install and run HTK.
* Ensure that your PATH contains
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
Or if you are using older versions:
C:\Program Files\Microsoft Visual Studio\VC98\bin
Compilation:
-
Unpack the HTK sources using 7-zip.
-
Open a DOS command window: Click Start, select Run type cmd at the prompt and click OK.
-
cd into the directory in which you unpacked the sources.
-
cd into the htk directory. Type:
cd htk
-
Create a directory for the library and tools. Type:
mkdir bin.win32
-
Run VCVARS32 (it should be in your path, see prerequisites above)
-
Build the HTK Library, which provides the common functionality used by the HTK Tools. Enter the following commands:
cd HTKLib nmake /f htk_htklib_nt.mkf all cd ..
-
Build the HTK Tools
cd HTKTools nmake /f htk_htktools_nt.mkf all cd .. cd HLMLib nmake /f htk_hlmlib_nt.mkf all cd .. cd HLMTools nmake /f htk_hlmtools_nt.mkf all cd ..
Installation: The HTK tools have now been built and are in the bin.win32 directory. You should add this directory to your PATH, so that you can run them easily from the command line in future.
Among the samples on the HTK website you'll find the HTKDemo package that can be used to test your installation. See http://htk.eng.cam.ac.uk/download.shtml for download instructions.
As an initial test of the installation please run the HTK demonstration using the configuration file HTKDemo/configs/monPlainM1S1.dcf. There is a README file in the HTKDemo directory explaining the operation of the demonstration in detail but, in short, you need to run the demonstration script passing it the configuration file configs/monPlainM1S1.dcf as input. To test the language modelling tools you should follow the tutorial in the HTK book, using the files in the LMTutorial/ directory.
Before running the demo make sure you have compiled all the HTK tools and the executables are in your PATH, i.e. just typing 'HInit' at the commandline prints a short usage summary. To run the demonstration type:
$ cd HTKDemo $ ./runDemo configs/monPlainM1S1.dcf
The recognition results obtained should match the following.
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]
===================================================================
NB to run this demo under Windows you must have perl installed and you need to invoke perl explicitly. See http://www.perl.org/ to download the perl distribution. The script runDemo.pl should be used in place of runDemo i.e. to run the test above type
perl runDemo.pl configs\monPlainM1S1.dcf