Speech:Lm create.pl

Summary
Title: lm_create.pl

Author: unknown

Location: mnt/main/scripts/user/lm_create.pl

Usage:

Description
Creates a Sphinx Language Model from a text file.

Code
if( $#ARGV != 0 ) { print "Creates a Sphinx Language Model from a text file\n"; print "usage: lm_create.pl inFile\n"; exit -1; } $folder = "/usr/local/bin/"; $inFilename = $ARGV[0]; print "$inFilename \n"; print "Generating a word Frequency file . . .\n"; system( $folder."text2wfreq <$inFilename> tmp.wfreq" ); print "Generating Vocab file . . .\n"; system( $folder."wfreq2vocab  tmp.vocab" ); print "Generating ID 3 Gram file . . .\n"; system( $folder."text2idngram -vocab tmp.vocab -n 3 <$inFilename> tmp.idngram" ); print "Generating Language Model ( arpa Format )\n"; system( $folder."idngram2lm -idngram tmp.idngram -vocab tmp.vocab -arpa tmp.arpa" ); print "Generating Language Model ( binary Format )\n"; system( $folder."idngram2lm -idngram tmp.idngram -vocab tmp.vocab -binary tmp.binlm" ); print "Generating the CMU binary form (DMP)\n"; system( "sphinx_lm_convert -i tmp.arpa -o tmp.lm.DMP" );
 * 1) !/usr/bin/perl