2
votes

I just need a speech recognition library in linux. Then I choose CMU Sphinx, and use pocketSphinx with python. I test that demo. This example runs well in my computer with poor accuracy.


I know that I need a language model, and I have downloaded it. So, How to set my pocketSphinx use that 'lm'. I mean, How to fix that demo file to use that language model. (and acoustic model.)

Thank you very much!

1

1 Answers

2
votes

Language model is configured through the property of the pocketsphinx gstreamer component. Instead of

   gst.parse_launch('gconfaudiosrc ! audioconvert ! audioresample '
                    + '! vader name=vad auto-threshold=true '
                    + '! pocketsphinx name=asr ! fakesink')

Use

   gst.parse_launch('gconfaudiosrc ! audioconvert ! audioresample '
                    + '! vader name=vad auto-threshold=true '
                    + '! pocketsphinx lm=<your_file.lm> name=asr ! fakesink')

You can configure other properties of pocketsphinx component too. Use gst-inspect to read the list.