HTKInPy, a python wrapper for HTK

· development, HTK

I decided to write a wrapper for HTK, in order notably to be able to launch and use HTK to:

  • Extract features,
  • Train GMM/HMM’s,
  • Classify/Recognize.
  • This is the second time I am trying to use HTK. The first time, I mainly used the tutorial in order to get familiar with it. I ended up with pieces of code in shell scripts, python scripts and many files spread a little bit everywhere.

    This time, I wanted to make a tool that I could run completely from a python interpreter (and potentially interactively, using ipython), automatically doing stuff like creating the monophone lists, the dictionary of used words, the HMM definitions/macros and so forth…

    A useful resource!
    While I am doing this wrapper, I bump into many difficulties which visibly have been troubling other people. On that webpage, I found precious information in order to get over a few of these problems. I warmly recommend anyone running into trouble with HTK to check the HTK book, of course, but also the remarks left by Dr. Heintz.

    Some more tips…
    I could add some of my experience on the matter:

  • About ERROR [+7031] PutTransMat: Row 4 of transition mat sum = 1.064684:
    Heintz advises to split the training set into several blocks, and run HERest with the -p option. I also ran into this issue, with messages about the weights, also. It so happens that another important tip she talks about is to split “evenly” the file list: it seems also important to split such that the content (word/phoneme or labels) is also evenly distributed.