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

Experimenting with confidence threshold for updating adaptation state

parent 80c307b7
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "./gstkaldinnet2onlinedecoder.h" #include "./gstkaldinnet2onlinedecoder.h"
#include "fstext/fstext-lib.h" #include "fstext/fstext-lib.h"
#include "lat/confidence.h"
namespace kaldi { namespace kaldi {
...@@ -604,7 +605,15 @@ static void gst_kaldinnet2onlinedecoder_loop( ...@@ -604,7 +605,15 @@ static void gst_kaldinnet2onlinedecoder_loop(
// Only update adaptation state if the utterance was not empty // Only update adaptation state if the utterance was not empty
// We might avoid updating the adaptation state if // We might avoid updating the adaptation state if
// we felt the utterance had low confidence. // we felt the utterance had low confidence.
int32 num_paths;
std::vector<int32> best_sentence,second_best_sentence;
BaseFloat confidence = SentenceLevelConfidence(clat, &num_paths,
&best_sentence,
&second_best_sentence);
// FIXME: is 1.0 a good value?
if (confidence > 1.0) {
feature_pipeline.GetAdaptationState(&adaptation_state); feature_pipeline.GetAdaptationState(&adaptation_state);
}
} }
} else { } else {
GST_DEBUG_OBJECT(filter, "Less than 0.1 seconds decoded, discarding"); 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