Skip to content
Snippets Groups Projects
Commit 80c307b7 authored by tanel's avatar tanel
Browse files

Not generating lattice if less than 0.1 seconds were processed

parent 1f5faf4a
No related branches found
No related tags found
No related merge requests found
...@@ -588,22 +588,26 @@ static void gst_kaldinnet2onlinedecoder_loop( ...@@ -588,22 +588,26 @@ static void gst_kaldinnet2onlinedecoder_loop(
last_traceback += traceback_period_secs; last_traceback += traceback_period_secs;
} }
} }
GST_DEBUG_OBJECT(filter, "Getting lattice.."); if (num_seconds_decoded > 0.1) {
CompactLattice clat; GST_DEBUG_OBJECT(filter, "Getting lattice..");
bool end_of_utterance = true; CompactLattice clat;
decoder.GetLattice(end_of_utterance, &clat); bool end_of_utterance = true;
GST_DEBUG_OBJECT(filter, "Lattice done"); decoder.GetLattice(end_of_utterance, &clat);
double tot_like = 0.0; GST_DEBUG_OBJECT(filter, "Lattice done");
int64 num_frames = 0; double tot_like = 0.0;
int64 num_frames = 0;
guint num_words = 0;
gst_kaldinnet2onlinedecoder_final_result(filter, clat, &num_frames, guint num_words = 0;
&tot_like, &num_words); gst_kaldinnet2onlinedecoder_final_result(filter, clat, &num_frames,
if (num_words > 0) { &tot_like, &num_words);
// Only update adaptation state if the utterance was not empty if (num_words > 0) {
// We might avoid updating the adaptation state if // Only update adaptation state if the utterance was not empty
// we felt the utterance had low confidence. // We might avoid updating the adaptation state if
feature_pipeline.GetAdaptationState(&adaptation_state); // we felt the utterance had low confidence.
feature_pipeline.GetAdaptationState(&adaptation_state);
}
} else {
GST_DEBUG_OBJECT(filter, "Less than 0.1 seconds decoded, discarding");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment