Open yotam319 opened 4 years ago
Hi @yotam319, thanks a lot for your advice and code sample. Yes, what you said definitely makes sense. Previously, I only did a vanilla version of LF-MMI in the toolbox, and planed to revisit later to improve the efficiency. I noticed the code change in the pykaldi lib, but have not been able to squeeze my time to work on it. Our internal tools are not built on Kaldi, so I have very limited time to work on this toolkit. Will try to integrate your dataloader into the code base soon. Thanks again!
Hi, I have a few suggestions on using LF-MMI: I noticed you are looping over the batch, creating the supervision and calculating the criterion. you can use MergeSupervision function I added to pykaldi in-order to create the supervision to the whole batch and run the criterion only once.
here is my collate function for the data-loader:
To add the MergeSupervision I made a pull request to pykaldi (https://github.com/pykaldi/pykaldi/pull/182), but you can use my fork that already have the change (https://github.com/yotam319/pykaldi)
also, using phone_ali gives a small supervision, you should consider using lattices and phone_lattice_to_proto_supervision instead of alignment_to_proto_supervision.
and finally, you can save your supervision as bytes and read them again. here are the functions I used for doing this:
hope this helps :)