very simple python wrapper for kaldi-decoder in nnet3 setup.
- Add nnet2/nnet3 online-decoder wrappers using Cython
- Add tools parsing BNF description into a text file in the AT&T FSM format
- python2.7
- openfst 1.6.1 (official supported)
- Cython 0.26
- numpy
- directory
conf
is generated bysteps/online/prepare_online_decoding.sh
- kaldi-command parameters should be configured in corresponding file, for example, add decoding configure in
conf/online.conf
# decode config
--min-active=200
--max-active=7000
--beam=11.0
--lattice-beam=6.0
--acoustic-scale=0.1
--frames-per-chunk=20
--extra-left-context-initial=0
- resources needed by pydecoder listed here:
├── conf
│ ├── ivector_extractor.conf
│ ├── mfcc.conf
│ ├── online_cmvn.conf
│ ├── online.conf
│ ├── online_pitch.conf
│ └── splice.conf
├── final.mdl
├── HCLG.fst
├── ivector_extractor
│ ├── final.dubm
│ ├── final.ie
│ ├── final.mat
│ ├── global_cmvn.stats
│ ├── online_cmvn.conf
│ └── splice_opts
└── words.txt
import pydecoder
# import ...
# args setting...
# config the decoder
decoder = pydecoder.PyOnlineNnet3Decoder(args.config, args.model, args.graph)
# decode whole file
decoder.decode_wavefile(args.wave)
# and get result sequence
print decoder.get_decode_sequence(args.words)
more see decoder_test