sicada-decode
Decoding an acoustic model's output with sicada.
The inference half of a pair: train on a GPU with k2, then run inference on a
CPU here. It sits outside sicada proper, which is a port of OpenFst's library;
the pieces here come from the Kaldi and k2 side.
densereads the acoustic model'sT × Vscore matrix as an FST, so that composing a decoding graph against it is an ordinary composition.viterbiwalks that composition one frame at a time without building it.latticedoes the same but keeps the alternatives, over a semiring (lattice_weight) that holds the graph cost and the acoustic cost apart.compactcollapses the alignments, so each word sequence appears once with the best one, over a cost with the frames it spanned attached (compact_lattice_weight). Both read and write Kaldi's file formats.nbestreads the answers back out and rescales the two halves against each other without decoding again.ctcbuilds the graph side for a CTC model.alignis forced alignment: the reference is known, so the graph is one chain and the whole band is searched rather than a beam.occupancyis the forward-backward pass over the same chain.
The API is unstable.
License
Apache License 2.0. The lattice semirings and the decoder structure follow Kaldi (Apache License 2.0).