Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading models #48

Open
jvel07 opened this issue Feb 25, 2020 · 5 comments
Open

Reading models #48

jvel07 opened this issue Feb 25, 2020 · 5 comments

Comments

@jvel07
Copy link

jvel07 commented Feb 25, 2020

Hi, this is one of the best tools for reading ark and scp files! However, wanted to know how can one read models generated by kaldi, e.g. fullUBM models or ivector extractor models, which are usually generated by kaldi with 'ubm' extensions. For example: final.ubm, or final.dubm.

@kamo-naoyuki
Copy link
Contributor

Sorry, basically, this tool is aimed at just loading matrix binary files.

Actually, ivector-model is not implemented in python, then, what do you mean loading model file?
If you mean that just parsing the parameters in the model file into numpy object or float array, then it's not impossible, but, even if so, we may not support it.

@jvel07
Copy link
Author

jvel07 commented Feb 25, 2020

Thanks for your reply, @kamo-naoyuki . Yes, I meant loading them into a numpy, I intend to use the models generated for a specific experiment in computational paralinguistics. Now I understand kaldiio is not supporting this.
So, in the case it's not impossible, are you aware of the way one can read this? or maybe point out someone or some blog that can help, perhaps? Would be really helpful since I am searching for this for several days already. Sorry for the inconvenience.

@kamo-naoyuki
Copy link
Contributor

How about pykaldi?https://pykaldi.github.io/api/kaldi.ivector.html#kaldi.ivector.IvectorExtractor

Direct way is also not hard. If you don't need the python API to read the model, how about directly using kaldi library in c++ and write parameters to your desired format?
Kaldi's code is really simple, so it's not hard to understand to read the source code.

https://github.com/kaldi-asr/kaldi/blob/a2573871ba185b8fd83ec5e66270a9a2301e4300/src/ivector/ivector-extractor.cc#L710-L730

It's also not hard to translate this code to python, if you are familiar to both language.

@kamo-naoyuki
Copy link
Contributor

@jvel07
Copy link
Author

jvel07 commented Feb 26, 2020

Thank you so much, @kamo-naoyuki. I will try this out and see. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants