synesthesiam / rhasspy

Rhasspy voice assistant for offline home automation
https://rhasspy.readthedocs.io
MIT License
944 stars 101 forks source link

Speech Recognition with kaldi not possible if profile "de" is selected on first start #152

Closed djusHa closed 4 years ago

djusHa commented 4 years ago

First, big thanks for this great piece of Software, your Time and effort!

At very first start of the docker container, with command: --user-profiles /profiles --profile de, selecting "de" profile.

There is no possibility to select kaldi for Speech Recognition. The Option is grayed out and info field below shows a message that says option is not compatible with that profile..

A workaround is to delete all inside the profiles folder and start docker with "en" profile. command: --user-profiles /profiles --profile en, complete setup and switch afterwards to "de" profile.

timaschew commented 4 years ago

I can confirm this, but I'm not sure anymore if I've deleted the en profile or kept it.

synesthesiam commented 4 years ago

Very odd. The German profile has speech_to_text.kaldi.compatible set to true, so I'm not sure how the web interface is getting confused.

If you see this come up again, can you visit http://localhost:12101/api/profile (replace localhost with your Rhasspy server), and see what speech_to_text.kaldi.compatible is set to?

djusHa commented 4 years ago

Very strange things happens...

On my fresh install (xubuntu 19.10), i can not reproduce the behavior anymore. Rhasspy v2.4.16, image is 7 days old.

But if you look at profile json, there ist no speech_to_text.kaldi.compatible:

{"command":{"command":{"arguments":[],"program":""},"hermes":{"timeout_sec":30},"oneshot":{"timeout_sec":30},"system":"webrtcvad","webrtcvad":{"chunk_size":960,"min_sec":2,"sample_rate":16000,"silence_sec":0.5,"speech_buffers":5,"throwaway_buffers":10,"timeout_sec":30,"vad_mode":0}},"download":{"cache_dir":"download","conditions":{"intent.system":{"flair":{"flair/cache/embeddings/lm-mix-german-backward-v0.2rc.pt":"lm-mix-german-backward-v0.2rc.pt","flair/cache/embeddings/lm-mix-german-forward-v0.2rc.pt":"lm-mix-german-forward-v0.2rc.pt"}},"speech_to_text.kaldi.open_transcription":{"True":{"kaldi/model/base_graph":"de_kaldi-zamia-base_graph.tar.gz:base_graph"}},"speech_to_text.pocketsphinx.mix_weight":{">0":{"base_language_model.txt":"cmusphinx-voxforge-de.lm.gz:cmusphinx-voxforge-de.lm"}},"speech_to_text.system":{"kaldi":{"kaldi":"de_kaldi-zamia.tar.gz:kaldi"},"pocketsphinx":{"acoustic_model":"cmusphinx-de-voxforge-5.2.tar.gz:cmusphinx-cont-voxforge-de-r20171217/model_parameters/voxforge.cd_cont_6000","base_dictionary.txt":"cmusphinx-de-voxforge-5.2.tar.gz:cmusphinx-cont-voxforge-de-r20171217/etc/voxforge.dic","g2p.fst":"de-g2p.tar.gz:g2p.fst"}},"wake.system":{"porcupine":{"porcupine/libpv_porcupine.so":"libpv_porcupine.so","porcupine/porcupine.ppn":"porcupine.ppn","porcupine/porcupine_params.pv":"porcupine_params.pv"},"precise":{"precise/hey-mycroft-2.pb":"hey-mycroft-2.pb","precise/hey-mycroft-2.pb.params":"hey-mycroft-2.pb.params"},"snowboy":{"snowboy/snowboy.umdl":"snowboy.umdl"}}},"files":{"cmusphinx-de-voxforge-5.2.tar.gz":{"url":"https://github.com/synesthesiam/rhasspy-profiles/releases/download/v1.0-de/cmusphinx-de-voxforge-5.2.tar.gz"},"cmusphinx-voxforge-de.lm.gz":{"url":"https://github.com/synesthesiam/rhasspy-profiles/releases/download/v1.0-de/cmusphinx-voxforge-de.lm.gz"},"de-g2p.tar.gz":{"url":"https://github.com/synesthesiam/rhasspy-profiles/releases/download/v1.0-de/de-g2p.tar.gz"},"de_kaldi-zamia-base_graph.tar.gz":{"url":"https://github.com/synesthesiam/rhasspy-profiles/releases/download/v1.0-de/de_kaldi-zamia-base_graph.tar.gz"},"de_kaldi-zamia.tar.gz":{"url":"https://github.com/synesthesiam/rhasspy-profiles/releases/download/v1.0-de/de_kaldi-zamia.tar.gz"},"hey-mycroft-2.pb":{"cache":false,"url":"https://github.com/MycroftAI/precise-data/raw/models/hey-mycroft-2.pb"},"hey-mycroft-2.pb.params":{"cache":false,"url":"https://github.com/MycroftAI/precise-data/raw/models/hey-mycroft-2.pb.params"},"libpv_porcupine.so":{"aarch64":{"url":"https://github.com/Picovoice/Porcupine/raw/master/lib/raspberry-pi/cortex-a53/libpv_porcupine.so"},"armv7l":{"url":"https://github.com/Picovoice/Porcupine/raw/master/lib/raspberry-pi/cortex-a53/libpv_porcupine.so"},"cache":false,"x86_64":{"url":"https://github.com/Picovoice/Porcupine/raw/master/lib/linux/x86_64/libpv_porcupine.so"}},"lm-mix-german-backward-v0.2rc.pt":{"cache":false,"url":"https://github.com/synesthesiam/rhasspy-profiles/releases/download/v1.0-de/lm-mix-german-backward-v0.2rc.pt"},"lm-mix-german-forward-v0.2rc.pt":{"cache":false,"url":"https://github.com/synesthesiam/rhasspy-profiles/releases/download/v1.0-de/lm-mix-german-forward-v0.2rc.pt"},"porcupine.ppn":{"aarch64":{"url":"https://github.com/Picovoice/Porcupine/raw/master/resources/keyword_files/raspberrypi/porcupine_raspberrypi.ppn"},"armv7l":{"url":"https://github.com/Picovoice/Porcupine/raw/master/resources/keyword_files/raspberrypi/porcupine_raspberrypi.ppn"},"cache":false,"x86_64":{"url":"https://github.com/Picovoice/Porcupine/raw/master/resources/keyword_files/linux/porcupine_linux.ppn"}},"porcupine_params.pv":{"cache":false,"url":"https://github.com/Picovoice/Porcupine/raw/master/lib/common/porcupine_params.pv"},"snowboy.umdl":{"cache":false,"url":"https://github.com/Kitt-AI/snowboy/raw/master/resources/models/snowboy.umdl"}}},"handle":{"command":{"arguments":[],"program":""},"forward_to_hass":false,"remote":{"url":"http://my-server:port/endpoint"},"system":"dummy"},"home_assistant":{"access_token":"","api_password":"","event_type_format":"rhasspy_{0}","handle_type":"event","pem_file":"","url":"http://hassio/homeassistant/"},"intent":{"adapt":{"stop_words":"stop_words.txt"},"command":{"arguments":[],"program":""},"conversation":{"handle_speech":true},"error_sound":true,"flair":{"cache_dir":"flair/cache","compatible":true,"data_dir":"flair/data","do_sampling":true,"embeddings":["lm-mix-german-forward-v0.2rc.pt","lm-mix-german-backward-v0.2rc.pt"],"max_epochs":25,"num_samples":10000},"fsticuffs":{"converters_dir":"converters","fuzzy":true,"ignore_unknown_words":true,"intent_fst":"intent.fst","intent_graph":"intent.json"},"fuzzywuzzy":{"examples_json":"intent_examples.json","min_confidence":0},"rasa":{"examples_markdown":"intent_examples.md","project_name":"rhasspy","url":"http://localhost:5005/"},"remote":{"url":"http://my-server:12101/api/text-to-intent"},"replace_numbers":true,"system":"fuzzywuzzy"},"language":"de","locale":"de_DE","microphone":{"arecord":{"chunk_size":960,"device":"","keep_device_open":true},"gstreamer":{"pipeline":"udpsrc port=12333 ! rawaudioparse use-sink-caps=false format=pcm pcm-format=s16le sample-rate=16000 num-channels=1 ! queue ! audioconvert ! audioresample"},"http":{"host":"127.0.0.1","port":12333,"stop_after":"never"},"pyaudio":{"device":"","frames_per_buffer":480,"keep_device_open":true},"stdin":{"auto_start":true,"chunk_size":960},"system":"pyaudio"},"mqtt":{"enabled":true,"host":"192.168.178.229","password":"5gERUNro#HdK","port":1883,"publish_intents":true,"reconnect_sec":5,"site_id":"default","username":"rhasspy"},"name":"de","rhasspy":{"listen_on_start":true,"load_timeout_sec":15,"preload_profile":true},"sounds":{"error":"${RHASSPY_BASE_DIR}/etc/wav/beep_error.wav","recorded":"${RHASSPY_BASE_DIR}/etc/wav/beep_lo.wav","system":"aplay","wake":"${RHASSPY_BASE_DIR}/etc/wav/beep_hi.wav"},"speech_to_text":{"command":{"arguments":[],"program":""},"dictionary_casing":"lower","fsts_dir":"fsts","g2p_casing":"","grammars_dir":"grammars","hass_stt":{"bit_size":16,"channels":1,"language":"en-US","platform":"","sample_rate":16000},"kaldi":{"base_dictionary":"kaldi/base_dictionary.txt","base_graph":"base_graph","base_language_model":"kaldi/base_language_model.txt","base_language_model_fst":"kaldi/base_language_model.fst","compatible":true,"custom_words":"kaldi/custom_words.txt","dictionary":"kaldi/dictionary.txt","g2p_model":"kaldi/g2p.fst","graph":"graph","kaldi_dir":"${KALDI_PREFIX}/kaldi","language_model":"kaldi/language_model.txt","mix_fst":"kaldi/mixed.fst","mix_weight":0,"model_dir":"kaldi/model","open_transcription":false,"phoneme_examples":"kaldi/phoneme_examples.txt","phoneme_map":"kaldi/espeak_phonemes.txt","unknown_words":"kaldi/unknown_words.txt"},"pocketsphinx":{"acoustic_model":"acoustic_model","base_dictionary":"base_dictionary.txt","base_language_model":"base_language_model.txt","compatible":true,"custom_words":"custom_words.txt","dictionary":"dictionary.txt","g2p_model":"g2p.fst","language_model":"language_model.txt","min_confidence":0,"mix_fst":"mixed.fst","mix_weight":0,"mllr_matrix":"acoustic_model_mllr","open_transcription":false,"phoneme_examples":"phoneme_examples.txt","phoneme_map":"espeak_phonemes.txt","unknown_words":"unknown_words.txt"},"remote":{"url":"http://my-server:12101/api/speech-to-text"},"sentences_dir":"intents","sentences_ini":"sentences.ini","slot_programs_dir":"slot_programs","slots_dir":"slots","system":"pocketsphinx"},"text_to_speech":{"command":{"arguments":[],"program":""},"disable_wake":false,"espeak":{},"flite":{"voice":"kal16"},"hass_tts":{"platform":""},"marytts":{"locale":"de-DE","url":"http://localhost:59125"},"picotts":{},"system":"espeak","wavenet":{"cache_dir":"tts/googlewavenet/cache","credentials_json":"tts/googlewavenet/credentials.json","fallback_tts":"espeak","gender":"FEMALE","language_code":"de-DE","sample_rate":22050,"url":"https://texttospeech.googleapis.com/v1/text:synthesize","voice":"Wavenet-C"}},"training":{"dictionary_number_duplicates":true,"grammars":{"delete_before_training":true},"intent":{"command":{"arguments":[],"program":""},"intent_map":"intent_map.json","system":"auto"},"regex":{"split":"\\s+"},"speech_to_text":{"command":{"arguments":[],"program":""},"system":"auto"},"tokenizer":"regex","unknown_words":{"fail_when_present":true,"guess_pronunciations":true}},"wake":{"command":{"arguments":[],"program":""},"hermes":{"wakeword_id":"default"},"pocketsphinx":{"chunk_size":960,"compatible":true,"keyphrase":"okay rhasspy","mllr_matrix":"wake_mllr","threshold":1e-30},"porcupine":{"keyword_path":"porcupine/porcupine.ppn","library_path":"porcupine/libpv_porcupine.so","model_path":"porcupine/porcupine_params.pv","sensitivity":0.5},"precise":{"chunk_delay":0.005,"chunk_size":2048,"engine_path":"precise-engine","model":"precise/hey-mycroft-2.pb","sensitivity":0.5,"trigger_level":3},"snowboy":{"apply_frontend":false,"audio_gain":1,"chunk_size":960,"model":"snowboy/snowboy.umdl","model_settings":{},"sensitivity":0.5},"system":"porcupine"},"webhooks":{}}

synesthesiam commented 4 years ago

Is this a browser caching issue maybe?

djusHa commented 4 years ago

I don't know it for sure and i can't reproduce it anymore. So should we close the issue?