Showing posts with label Sphinx4. Show all posts
Showing posts with label Sphinx4. Show all posts

Tuesday, 1 May 2012

Sphinx4 custom acoustic model files notes.

The whole process of creating custom acoustic model is described here.
Read it thoroughly. If you are still not getting what are the required files and where to get them from this note is for you.

Given that structure is:

  1. etc
    1. your_db.dic - Phonetic dictionary
    2. your_db.phone - Phoneset file
    3. your_db.lm.DMP - Language model
    4. your_db.filler - List of fillers
    5. your_db_train.fileids - List of files for training
    6. your_db_train.transcription - Transcription for training
    7. your_db_test.fileids - List of files for testing
    8. your_db_test.transcription - Transcription for testing
  2. wav
    1. speaker_1
      1. file_1.wav - Recording of speech utterance
    2. speaker_2
      1. file_2.wav


Following files could be built by lmtool web service :
  1. your_db.dic - 
  2. Phonetic dictionary
  3. your_db.phone - Phoneset file
  4. your_db.filler - List of fillers
after you've got those files ready, you'll need .DMP file:
  1. your_db.lm.DMP - Language model
it is generated from .lm file with sphinx_lm_convert programm which is shipped with sphinxbase-7.0 archive. See this section on installation instructions of sphinxbase. You should use following commands to generate this file:

 sphinx_lm_convert -i model.lm -o model.dmp
sphinx_lm_convert -i model.dmp -ifmt dmp -o model.lm -ofmt arpa
After you've got that running, you should list all audio files that you want use for training and their matching phrases in remaining files:
  1. your_db_train.fileids - 
  2. List of files for training 
  3. your_db_train.transcription - Transcription for training

Ubuntu 11.10 install sphinxbase.

Ubuntu 11.10 install sphinxbase.

There is a good manual at http://cmusphinx.sourceforge.net/wiki/tutorialpocketsphinx
Anyways. After you've downloaded and unpacked sphinx-0.7 archive

1. ./autogen.sh (It won't start right away, but will print what software packages are missing)
2. sudo apt-get install autoconf
3. sudo apt-get install libtool
4. sudo apt-get install automake
5. sudo apt-get install bison
6. sudo ./autogen.sh
8. sudo make
9. sudo make install 
10. export LD_LIBRARY_PATH=/usr/local/lib
Now try
sphinx_lm_convert
If you can see following message:
 ERROR: "cmd_ln.c", line 675: No arguments given, available options are:
Arguments list definition:
[NAME] [DEFLT] [DESCR]
-case Ether 'lower' or 'upper' - case fold to lower/upper case (NOT UNICODE AWARE)
-debug Verbosity level for debugging messages
-help no Shows the usage of the tool
-i Input language model file (required)
-ienc Input language model text encoding (no conversion done if not specified)
-ifmt Input language model format (will guess if not specified)
-logbase 1.0001 Base in which all log-likelihoods calculated
-mmap no Use memory-mapped I/O for reading binary LM files
-o Output language model file (required)
-oenc utf8 Output language model text encoding
-ofmt Output language model file (will guess if not specified)
Than everything works fine.
NOTE: this is required step to start training your own acoustic models for CMU Sphinx 4. 

Saturday, 21 April 2012

Ubuntu 11.10 installing CMU Sphinx 4.

Ubuntu 11.10 installing CMU Sphinx 4.

The process is fairly straightforward:

1. Install Oracle JDK (I've used version 1.6)
2. install ant
sudo apt-get install ant
3. install sharutils
sudo apt-get install sharutils
4. navigate to desired folder
cd /usr/share
5. install svn
sudo apt-get install subversion
6. checkout files
sudo svn co https://cmusphinx.svn.sourceforge.net/svnroot/cmusphinx/trunk/sphinx4
7. run jsapi.sh
sudo sh ./sphinx4/lib/jsapi.sh
8. build project
cd sphinx4 sudo ant

Next steps will take you to the journey of creating a real project.