Skip to content

Commit

Permalink
Logging for empty hypothesis
Browse files Browse the repository at this point in the history
  • Loading branch information
oplatek committed Dec 20, 2013
1 parent 6153235 commit 49c98cf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions alex/components/asr/kaldi.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def rec_in(self, frame):
"""
start = time.clock()
self.decoder.frame_in(frame.payload)
self.logger.info('frame_in of %d frames' % (len(frame.payload) / 2))
dec_t = self.decoder.decode(max_frames=self.max_dec_frames)
while dec_t > 0:
dec_t = self.decoder.decode(max_frames=self.max_dec_frames)
Expand All @@ -78,4 +79,8 @@ def hyp_out(self):
words = [self.wst[str(i)] for i in word_ids]
nblist.add(w, Utterance(words))
self.logger.info('hyp_out: get_lattice+nbest in %s secs' % str(time.clock() - start))
if len(nbest) == 0:
self.logger.warning('hyp_out: empty hypothesis')
nblist.add(1.0, Utterance('Empty hypothesis: DEBUG'))

return nblist

0 comments on commit 49c98cf

Please sign in to comment.