From 09c35435fbbdd14953f6ab8318791cb39b7df1b1 Mon Sep 17 00:00:00 2001
From: tanel <alumae@gmail.com>
Date: Sat, 8 Nov 2014 19:06:45 +0200
Subject: [PATCH] Adaptation state is saved for the next utterance regardless
 of the confidence

---
 src/gstkaldinnet2onlinedecoder.cc | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/src/gstkaldinnet2onlinedecoder.cc b/src/gstkaldinnet2onlinedecoder.cc
index 82cfe80..1783797 100644
--- a/src/gstkaldinnet2onlinedecoder.cc
+++ b/src/gstkaldinnet2onlinedecoder.cc
@@ -603,28 +603,18 @@ static void gst_kaldinnet2onlinedecoder_loop(
                                                &tot_like, &num_words);
       if (num_words > 0) {
         // Only update adaptation state if the utterance was not empty
-        // We might avoid updating the adaptation state if
-        // 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);
-       }
       }
     } else {
       GST_DEBUG_OBJECT(filter, "Less than 0.1 seconds decoded, discarding");
     }
   }
 
-  // We should also push out adaptation state now, something like this
-//  bool binary = false;
-//  Output ko("adaptation_state.txt", binary);
-//  adaptation_state.Write(ko.Stream(), binary);
-//  ko.Close();
+  // TODO: write adaptation state to string and push it out
+  // bool binary = false;
+  // Output ko("adaptation_state.txt", binary);
+  // adaptation_state.Write(ko.Stream(), binary);
+  // ko.Close();
 
 
   GST_DEBUG_OBJECT(filter, "Finished decoding loop");
-- 
GitLab