susi_linux icon indicating copy to clipboard operation
susi_linux copied to clipboard

More models for offline Speech Recognition

Open sansyrox opened this issue 6 years ago • 7 comments

Describe the bug

Currently, offline Speech Recognition only recognizes US English and more languages need to be supported.

Expected behavior

Configure more models from here https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/

Additional context

Reference for installation can be taken from here : https://github.com/Uberi/speech_recognition/blob/master/reference/pocketsphinx.rst#installing-other-languages

sansyrox avatar May 19 '19 08:05 sansyrox

Good!

hongquan avatar May 19 '19 10:05 hongquan

I think this is a very good idea, but we need setup interface for new languages, and isn't it some other service that by default is used for speech recognition?

norbusan avatar May 19 '19 10:05 norbusan

@norbusan , we use google stt when we are online and we use PocketSphinx when we are offline

sansyrox avatar May 22 '19 19:05 sansyrox

Hey @stealthanthrax I want to solve this issue. While using SUSI-AI offline I got following error

Error: missing PocketSphinx language data directory: "/usr/local/lib/python3.6/dist-packages/speech_recognition/pocketsphinx-data/en_US"
Internet Connection not available

and when I checked pocketsphinx-data it contains folder with name en-us not en_US. I want to know is there any mistake done by me while setting up project or a bug.

geekypathak21 avatar Sep 20 '19 19:09 geekypathak21

Hi @himanshupathak21061998 , I think this is a new bug which might have crept in while developing newer features. I'll open an issue and you can work on fixing this first?

sansyrox avatar Sep 20 '19 19:09 sansyrox

Because , I don't think that there is a different way to install SUSI on your system instead.

sansyrox avatar Sep 20 '19 19:09 sansyrox

@stealthanthrax @himanshupathak21061998 interesting. The en_US comes from proper language support, so we use locale names. Back then I changed the invocation of the sphinx recognizer to

recognizer.recognize_sphinx(audio, language=susi_config["language"])

where susi_config["language"] contains a locale style string (ll_LL). We need to convert this to one of the supported languages of pocket sphinx on the fly.

Best would be further to have the code check which languages are installed, and fall back to english if the requested language is not available.

It looks like an easy few line Python hack in susi_linux/main/states/recognizing_state.py, anyone wanting to take that? Otherwise I do it later on.

norbusan avatar Sep 21 '19 03:09 norbusan