bambocher / pocketsphinx-python

Python interface to CMU Sphinxbase and Pocketsphinx libraries
https://pypi.python.org/pypi/pocketsphinx
Other
373 stars 187 forks source link

Creating a "Decoder" object takes much longer than usual #7

Closed rcbyron closed 8 years ago

rcbyron commented 8 years ago

Using this configuration,

config = Decoder.default_config()
config.set_string('-logfn', os.path.join(settings.LOGS_DIR, 'passive-listen.log'))
config.set_string('-hmm', os.path.join(settings.MODEL_DIR, 'en-us\en-us'))
config.set_string('-lm', os.path.join(settings.MODEL_DIR, 'en-us\en-us.lm.dmp'))
config.set_string('-dict', os.path.join(settings.MODEL_DIR, 'en-us\cmudict-en-us.dict'))
config.set_string('-kws_threshold', '1e-50')

decoder = Decoder(config) # This line takes quite a few seconds

Any idea why? On Python 3.4 using pocketsphinx 0.0.8 this line ran in less than 1 second.

nshmyrev commented 8 years ago

It is probably loading dmp language model. In new versions a different binary format for lm is used, it takes time to convert dmp to binary. You can load latest binary lm instead.

rcbyron commented 8 years ago

Thanks for the quick response! That fixed the issue :)