Speech Recognizer Mini-Course

From SpeechWiki

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 +
==Help blog==
 +
 +
[[htk-group blog]]
 +
 +
==HTK Mini-Course: Course Video and Script Files==
 +
 +
The [http://mickey.ifp.uiuc.edu/speech/HTK/ video of the mini-course] is available.
 +
 +
train.pl and ISLE_03Jan2006.dict are available [http://www.isle.uiuc.edu/courses/htk/ here].
 +
 +
Here are slides describing some of the design decisions, especially the allophone set:
 +
 +
Here is a bash script, so that you can see what the actual HTK commands were: [[train.sh]]
 +
==Dynamic Stop Herest==
==Dynamic Stop Herest==
Here's a perl routine that runs HERest until likelihood improvement falls below some threshold:
Here's a perl routine that runs HERest until likelihood improvement falls below some threshold:
Line 40: Line 54:
print "  herest iterated $itCounter times, eps = ".($nextAvgProb-$lastAvgProb)."\n";
print "  herest iterated $itCounter times, eps = ".($nextAvgProb-$lastAvgProb)."\n";
ecsystem("mv -v $modelDir/tmp/* $out");
ecsystem("mv -v $modelDir/tmp/* $out");
-
}</pre>
+
}
-
[[User:Arthur|Arthur]] 21:45, 14 January 2006 (CST)
+
 
-
565253584401380962427432
+
#error checking system call.  dies if called program fails.
 +
sub ecsystem{
 +
system($_[0]);
 +
confess( "\nprogram failed with $?") if $?;
 +
return $?;
 +
}
 +
</pre>
 +
6366247341826744200521

Revision as of 12:16, 18 June 2006

Help blog

htk-group blog

HTK Mini-Course: Course Video and Script Files

The video of the mini-course is available.

train.pl and ISLE_03Jan2006.dict are available here.

Here are slides describing some of the design decisions, especially the allophone set:

Here is a bash script, so that you can see what the actual HTK commands were: train.sh

Dynamic Stop Herest

Here's a perl routine that runs HERest until likelihood improvement falls below some threshold:


example:

herest("HERest -T 1 -A -D -S $modelDir/timitPLP.scp -I $modelDir/timitCMUPLP.mlf -t 250.0 150.0 1000.0 $modelDir/CMUphonebet.txt","$modelDir/timitMonophonesHRest.hdf", "$modelDir/timitMonophonesHERest1.hdf", .01);

code:

#assumes $modelDir/tmp dir exists, assumes that $in and $out are files
#run until improvment is less than eps
#Arguments:
#1 The HERest command.  It must not have the -H and the -M flags - those are added by herest().
#2 The name of the 'In' MMF-file -what normally goes after the -H flag
#3 The name of the final 'Out' MMF-file -what normally goes after the -M flag
#4 The improvement likelihood (not log-likelihood) threshold 
sub herest{
	(my $cmd, my $in, my $out, my $eps) = @_;
	(my $lastAvgProb, my $nextAvgProb, my $itCounter) = (-1,-1,0);
	#run it once
	my @cmdList = split(/ /, $cmd);
	my $hmmList = pop @cmdList;
	push @cmdList, ("-H", $in, "-M ", "$modelDir/tmp", $hmmList, " | grep '^[^ ].*' | tee $modelDir/herest.log");
	ecsystem(join(' ',@cmdList));
	my $getProbCmd = "cat $modelDir/herest.log  | grep Reestimation | " . 'sed \'s/.*frame = \(.*\)$/\1/\'';
	$nextAvgProb = `$getProbCmd`;
	$itCounter++;

	#run it a few more times
	$cmdList[-5]="$modelDir/tmp/*";
	my $iterCmd = join(' ',@cmdList);
	while ($nextAvgProb-$lastAvgProb > $eps){
		$lastAvgProb = $nextAvgProb;
		ecsystem($iterCmd);
		$nextAvgProb = `$getProbCmd`;
		$itCounter++;
	}
	print "   herest iterated $itCounter times, eps = ".($nextAvgProb-$lastAvgProb)."\n";
	ecsystem("mv -v $modelDir/tmp/* $out");
}

#error checking system call.  dies if called program fails.
sub ecsystem{
	system($_[0]);
	confess( "\nprogram failed with $?") if $?;
	return $?;
}

6366247341826744200521

Personal tools