gooofy / py-kaldi-asr

Some simple wrappers around kaldi-asr intended to make using kaldi's (online) decoders as convenient as possible.
Apache License 2.0
170 stars 56 forks source link

Frame Shift #28

Open sberryman opened 5 years ago

sberryman commented 5 years ago

https://github.com/gooofy/py-kaldi-asr/blob/a4e5b1ed2fc193e957938755b19810cdebe766e3/kaldiasr/nnet3_wrappers.cpp#L199

When using kaldi directly I've been able to pass --frame-shift=0.03 for a chained model to get the correct timestamps for word alignment. Right now it looks like calling get_word_alignment returns arrays of integers which can just be divided by 100 to get the same value as I would get from calling nbest-to-ctm directly. I'm not seeing how I can pass in frame shift value though.

Any thoughts?

gooofy commented 5 years ago

yes, that's correct, a frame_shift argument could be added here. for the implementation, take a look at kaldi's

latbin/nbest-to-ctm.cc

for reference.