I just finished setting up my environment including homeassistant pocketsphinx and a deconz interface. However the decoding times of the Pocketspinx Decoder are arround three to five seconds, while the rest just takes milliseconds. Terminating homeassistant and deconz running on the pi doesn’t seem to change much.
I know i could include a home server for these computations for speed up but since I’m trying to do everything on one pi I was wondering if there are any ways of speeding up the process.
Are my times average or unusually high, what about your computation times?
Running on a Pi 3B+ btw…
By my experience I have similar times with Raspberry Pi 3b+ but It could depend from microphone or environment noise and size of wav registration (more seconds, more size).
I am trying two different setups:
Respeaker v1 (low cost) microphone, 2/3 seconds
Respeaker v2 (optimized) microphone, 3/5 seconds (probably slow for built-in algorithms or usb)
I have similar times with Raspberry 2 but I will try with Raspberry 4.
Often It happens that I stop to speak but the registration Is still Active becouse of environment noise. To resolve this I tried to decrease the timeout of the “command” section.
Suggestions are appreciated
PS for good comparation we should specify our environment, I am using docker
Regarding decoding time, are you using Kaldi? Using a smaller acoustic model (TDNN-250 instead of TDNN-F) reduced decoding times for me without any impact on accuracy.
@synesthesiam Maybe the smaller acoustic model can be provided as default?
Online decoding should also help to speed things up when Rhasspy supports it natively.
Until @synesthesiam updates the model provided for Kaldi profiles with smaller ones (as I think he will ) and if your language has such model (english, german and french do), you can simply replace the files in the {profile_dir}/kaldi/model/model folder by the TDNN-250 model files:
There is not much to do I afraid… When your profile is all setup using the Kaldi Rhasspy profile, simply download the model from the link and swap the mentionned files. No config changes necessary (maybe retrain though?).
I pretty sure @synesthesiam will include these models natively in the near future as the narrow and specific language model trained by Rhasspy mitigates the “lightness” of the acoustic model.
Ah I see what you mean… I did not build Kaldi as I’m using the Docker image so Kaldi is already installed with Rhasspy. The model files are downloaded by Rhasspy into the profile folder.
If you are not using Docker, you will have to build Kaldi using the link you provided (can be pretty complex though as Kaldi does not easily build on ARM).
I’m afraid so… If you download the Kaldi profile using the web UI, you’ll have to replace the file again. This is a quick fix to speed up the ASR transcription.
I haven’t found a Kaldi model for Italian yet, unfortunately. If we can get a big enough speech corpus, we can train one. The Zamia English model was trained on about 1200 hours of audio.
Strange, I got very good intent catching with pocketsphinx, near 100%.
wakeword false positive is another story and my main problem with rhasspy actually …
Based on a quick look at the paper, his model was trained on about 10 hours of children’s speech. Mozilla Common Voice has about 91 hours available. Maybe Piero is aware of other Italia speech corpora (preferably adult speech)?
Tried your Suggestion while running in Virtual Environment. Kaldi in general takes arround 8 Seconds for processing. With your tweaks the processing time is 2 Seconds but no text is recognized
Guess I’ll keep using Pocketsphinx (4 Seconds Processing) until the mentioned speed bump for Kaldi is released.
I’ve just tried it and have the same result(( @fastjack could you explain what you did step by step?
Btw, in my original kaldi folder I haven’t found normalization.fst and den.fst… so looks like I’m missing something🤔
The folder where I put the new files is rhasspy/profiles/en/kaldi/model/model
There is nothing special… just select Kladi in Rhasspy settings. Then you will be asked to download files, and after that you will need to train. That’s it
I’ve heard about this bug, but I can’t reproduce it. The German profile definitely supports Kaldi, but the profile setting seems to be flipped in the web interface unless you start with English and then switch over.
i did not start with an english profile and had no problem selecting Kaldi for speech to text on a german profile. It works way better then pocketsphinx and almost always recognizes my senteces correctly. But quite a bit slower then pocketsphinx on a pi4 (nearly immediatly vs 2-3s)
Did you train your profile?
Btw, I have no settings for Kaldi, just the code I posted above.
Try to delete your settings, Rhasspy will use default ones in that case
I’m waiting for Kaldi online encoding option, which I believe will be implemented sometime
Hi @synesthesiam I remember it was on a roadmap, is it still there? all other thing in Rhasspy works absolutely perfect for me
Yes This has been successfully implemented in version 2.5. I’m also switching all the Kaldi models to the faster 250 versions, so this plus online decoding should make things much faster
Basically this is an issue with saving and loading settings I guess. Almost every time I’m saving something in my settings and rhasspy restarts afterwards the en profile is shown and all default settings are set. The only way I’ve figured out to work around is to restart the docker container. At first I thought that my browser is caching something, but opening the webUI using a private mode window, closing it and open a new one isn’t changing anything after the restart.