Author Archives: Shohini

fstrandgen

Based on the documentation:

This operation randomly generates a set of successful paths in the input FST. The operation relies on an ArcSelector object for randomly selecting an outgoing transition at a given state in the input FST. The default arc selector, UniformArcSelector, randomly selects a transition using the uniform distribution. LogProbArcSelector randomly selects a transition w.r.t. the weights treated as negative log probabilities after normalizing for the total weight leaving the state. In all cases, finality is treated as a transition to a super-final state.

_____________________________________

Example:

fstrandgen G.fst rand1.fst

fstprint --acceptor --isymbols=words.txt rand1.fst

0 1 WILL
1 2 WABASH
2 3 SEVENTEENTH
3 4 OCTOBER
4 5
5

fstdraw --acceptor --isymbols=words.txt rand1.fst | dot -Tx11

rand2.fst

My demo is under /projects/speech/sys/kaldi-master/egs/rm/s5-sb2295/demo/fstrandgen and you can run it with source demo.sh