Posts

Showing posts from August, 2022

Understanding kaldi lattice-prune and beam

Introduction For a long time, I have been thinking that Kaldi lattice-prune  uses a beam which keeps the specified number of candidates alive. How dare me. I finally took a time to properly understand this.  There are several excellent Kaldi notes (for example Josh Meyer's blog ), but I could not find information specifically about  lattice-prune . My intension of this blog post is to leave information about Kaldi lattice-prune and --beam (assuming that someone uses Kaldi or hybrid ASR systems in 2022). TL;DR  lattice-prune --beam=4  for example deletes all paths of a lattice that exceed <best_path_cost> + 4, as can be seen in this line of the source code . Explanation To understand how Kaldi beam works, I took one of the utterances in the LibriSpeech dev set: 1272-128104-0000 . The lattice of this utterance should be in  exp/chain_cleaned/tdnn_1d_sp/decode_dev_clean_tgsmall/lat.1.gz  once the ...