Ask HN: Non-cloud voice recognition for home use?
440 pointsI'd like a kind of echo dot like thing running on a set of raspberry pi devices each with a microphone and speaker. Ideally they'd be all over the house. I'm happy if they talk back via wifi to a server in my office for whatever real processing. The server might have 16 cores and 128Gb ram. Might even have two of these if required.
What options do I have? What limits? I'd really prefer answers from people who have experiences with the various options.
If it helps I'm happy to reduce vocabulary to a dictionary of words as long as I can add more words as necessary. Training is also ok. I've already analysed my voice conversations with an echo dot and the vocabulary isn't that large.
Please remember: home use, no off-site clouds. I'm not interested in options involving even a free voice speech-to-text cloud. This eliminates google voice recognition, amazon etc. They are great but out of scope.
So far I've identified CMU Sphinx as a candidate but I'm sure there are others.
Ideas?
Comments (127) 36 threads
Show all comments
Showing thread 2 of 36
https://github.com/DragonComputer/Dragonfire
There's a minimal demo app I put together here too: https://github.com/nmstoker/SimpleSpeechLoop
https://github.com/jaxcore/deepspeech-plugin
AFAIK DeepSpeech works by using the neural net to detect characters from speech, and then the language model is used to try to make a sentence out of the character stream, by doing a kind of graph search. Thus if the language model doesn't contain the words you want it to recognize, it'll have a hard time giving good output.
Anyway, I used the following tutorial[1] as a base to build the language model. For the kenlm tools I used Ubuntu WSL, and the generate_trie executable was part of the DeepSpeech native tools package for Windows.
[1]: https://discourse.mozilla.org/t/tutorial-how-i-trained-a-spe...
For my case I just wanted to train it on like 30 different sentences, that took less than a second. But for a general assistant ala Google Home you'll want a large number of sentences and I hear it can take a while (hour or few?).
Due to using probabilities it will match words in other sentences than what you give it, but from my understanding it will be partial to the ones you feed it if DeepSpeech mis-classifies a character or two.
https://youtu.be/LWUBK6PAaxM
This was on a slightly earlier version, and they've made improvements in speed and quality of recognition since then.
I should clarify this. As I mentioned, training the neural net part requires tons of audio and the corresponding text (and people should totally contribute[1], the resulting data sets are released to the public). The neural net in DeepSpeech is then used on an audio stream and outputs a stream of characters.
Turning that stream of characters into sentences is what the language model is for.
Training the neural net is very data and compute intensive, but fortunately Mozilla provides pre-trained models.
Generating the language model is relatively cheap. And if your target language shares sounds with English, you may get away with using the English-trained neural net but with a non-English language model.
[1]: https://voice.mozilla.org/
https://www.researchgate.net/publication/336532830_German_En...
The results are, that adopting works good, but as of writing of the paper somemonths ago, the results were not very good yet. So it takes better trained models for other languages. English seems to be quite good.
What surprised me, is that it works offline very fast even on a rasperry pi!
https://www.hackster.io/dmitrywat/offline-speech-recognition...