Commit f161fca4 authored by Guoguo Chen's avatar Guoguo Chen
Browse files

trunk: fixing OTWV calculation in kws_oracle_threshold.pl

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@5195 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent b1560b5e
......@@ -123,17 +123,24 @@ foreach my $kwid (keys %keywords) {
my $local_otwv = 0.0;
my $max_local_otwv = 0.0;
my $local_atwv = 0.0;
my $active_otwv_threshold = "";
foreach my $instance (@instances) {
my @ins = @{$instance};
my $gain = 1.0 / $Ntrue{$kwid};
my $cost = $beta / ($duration - $Ntrue{$kwid});
# OTWV.
if ($local_otwv > $max_local_otwv &&
$active_otwv_threshold ne "" && $active_otwv_threshold != $ins[0]) {
$max_local_otwv = $local_otwv;
}
if ($ins[1] == 1) {
$local_otwv += $gain;
} else {
$local_otwv -= $cost;
}
if ($local_otwv > $max_local_otwv) {
$active_otwv_threshold = $ins[0];
if ($active_otwv_threshold == 1.0) {
# If score = 1.0, we always accept the instance as YES.
$max_local_otwv = $local_otwv;
}
......@@ -153,6 +160,9 @@ foreach my $kwid (keys %keywords) {
}
}
}
if ($local_otwv > $max_local_otwv) {
$max_local_otwv = $local_otwv;
}
$atwv += $local_atwv;
$otwv += $max_local_otwv;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment