17 KiB
Executable File
Profiles
A Rhasspy profile contains all of the necessary files for wake word detection, speech transcription, intent recognition, and training.
Each profile is a directory contained in the top-level profiles directory. The profiles/defaults.json file contains the default configuration for all profiles. The profile.json file inside each individual profile directory (e.g., profiles/en/profile.json) overrides settings in defaults.json.
When starting Rhasspy, you must specify a profile name with --profile <NAME> where <NAME> is the name of the profile directory (en, nl, etc.).
Profile Directories
Rhasspy looks for profile-related files in two directories:
- The system profile directory (read only)
- Override with
--system-profiles <DIR>
- Override with
- The user profile directory (read/write)
- Override with
--user-profiles <DIR>
- Override with
Files in the user profile directory override system files, and Rhasspy will only ever write to the user profile directory. The default location for each of these directories is:
- Virtual Environment
- System profile location is
$PWD/profileswhere$PWDis Rhasspy's root directory (whererun-venv.shis located) - User profile location is
$HOME/.config/rhasspy/profiles
- System profile location is
- Docker
- System profile location is either
/usr/share/rhasspy/profiles(ALSA) or/home/rhasspy/profiles(PulseAudio) - User profile location must be explicity set and mapped to a volume:
docker run ... -v /path/to/profiles:/profiles synesthesiam/rhasspy-server --user-profiles /profiles
- System profile location is either
Example
Assume you are running Rhasspy in a virtual environment, and you add some new sentences to the en (English) profile in the web interface. When saving the sentences.ini file, Rhasspy will create $HOME/.config/rhasspy/profiles/en (if it doesn't exist), and write sentences.ini in that directory. If you adjust and save your settings, you will find them in $HOME/.config/rhasspy/profiles/en/profile.json.
Downloading Profiles
The first time Rhasspy loads a profile, it needs to download the required binary artifacts (acoustic model, base dictionary, etc.) from the internet. After the initial download, Rhasspy can function completely offline.
If you need to install Rhasspy onto a machine that is not connected to the internet, you can simply download the artifacts yourself and place them in a download directory inside the appropriate profile directory. For example, the fr (French) profile has three artifacts:
cmusphinx-fr-5.2.tar.gzfr-g2p.tar.gzfr-small.lm.gz
If your user profile directory is $HOME/.config/rhasspy/profiles, then you should download/copy all three artifacts to $HOME/.config/rhasspy/profiles/fr/download on the offline machine. Now, when Rhasspy loads the fr profile and you click "Download", it will extract the files in the download directory without going out to the internet.
If you want to know precisely which files Rhasspy is looking for for a given profile, visit the profiles directory in the source code and examine these scripts in that profile's directory:
download-profile.sh- Downloads and extracts all required binary artifacts. Uses cache in
downloaddirectory unless--deleteoption is given.
- Downloads and extracts all required binary artifacts. Uses cache in
check-profile.sh- Verifies that required binary artifacts are present. Returns non-zero exit code if download is required.
Available Settings
All available profile sections and settings are listed below:
rhasspy- configuration for Rhasspy assistantpreload_profile- true if speech/intent recognizers should be loaded immediately for default profile (default:true)listen_on_start- true if Rhasspy should listen for wake word at startup (default:true)load_timeout_sec- number of seconds to wait for internal actors before proceeding with start up
home_assistant- how to communicate with Home Assistant/Hass.iourl- Base URL of Home Assistant server (no/api)access_token- long-lived access token for Home Assistant (Hass.io token is used automatically)api_password- Password, if you have that enabled (deprecated)pem_file- Full path to your CA_BUNDLE file or a directory with certificates of trusted CAsevent_type_format- Python format string used to create event type from intent type ({0})
speech_to_text- transcribing voice commands to textsystem- name of speech to text system (pocketsphinx,remote,command, ordummy)pocketsphinx- configuration for Pocketsphinxcompatible- true if profile can use pocketsphinx for speech recognitionacoustic_model- directory with CMU 16Khz acoustic modelbase_dictionary- large text file with word pronunciations (read only)custom_words- small text file with words/pronunciations added by userdictionary- text file with all words/pronunciations needed for example sentencesunknown_words- small text file with guessed word pronunciations (from phonetisaurus)language_model- text file with trigram ARPA language model built from example sentencesmllr_matrix- MLLR matrix from acoustic model tuningmix_weight- how much of the base language model to mix in during training (0-1)mix_fst- path to save mixed ngram FST model
kaldi- configuration for Kaldicompatible- true if profile can use Kaldi for speech recognitionkaldi_dir- absolute path to Kaldi root directorymodel_dir- directory where Kaldi model is stored (relative to profile directory)graph- directory where HCLG.fst is located (relative tomodel_dir)base_dictionary- large text file with word pronunciations (read only)custom_words- small text file with words/pronunciations added by userdictionary- text file with all words/pronunciations needed for example sentencesunknown_words- small text file with guessed word pronunciations (from phonetisaurus)mix_weight- how much of the base language model to mix in during training (0-1)mix_fst- path to save mixed ngram FST model
remote- configuration for remote Rhasspy serverurl- URL to POST WAV data for transcription (e.g.,http://your-rhasspy-server:12101/api/speech-to-text)
command- configuration for external speech-to-text programprogram- path to executablearguments- list of arguments to pass to program
sentences_ini- Ini file with example sentences/JSGF templates grouped by intentg2p_model- finite-state transducer for phonetisaurus to guess word pronunciationsg2p_casing- casing to force for g2p model (upper,lower, or blank)dictionary_casing- casing to force for dictionary words (upper,lower, or blank)grammars_dir- directory to write generated JSGF grammars from sentences ini filefsts_dir- directory to write generated finite state transducers from JSGF grammars
intent- transforming text commands to intentssystem- intent recognition system (fsticuffs,fuzzywuzzy,rasa,remote,adapt,command, ordummy)fsticuffs- configuration for OpenFST-based intent recognizerintent_fst- path to generated finite state transducer with all intents combinedignore_unknown_words- true if words not in the FST symbol table should be ignored
fuzzywuzzy- configuration for simplistic Levenshtein distance based intent recognizerexamples_json- JSON file with intents/example sentencesmin_confidence- minimum confidence required for intent to be converted to a JSON event (0-1)
remote- configuration for remote Rhasspy serverurl- URL to POST text to for intent recognition (e.g.,http://your-rhasspy-server:12101/api/text-to-intent)
rasa- configuration for rasaNLU based intent recognizerurl- URL of remote rasaNLU server (e.g.,http://localhost:5000/)examples_markdown- Markdown file to generate with intents/example sentencesproject_name- name of project to generate during training
adapt- configuration for Mycroft Adapt based intent recognizerstop_words- text file with words to ignore in training sentences
command- configuration for external speech-to-text programprogram- path to executablearguments- list of arguments to pass to program
text_to_speech- pronouncing wordssystem- text to speech system (espeak,flite,picotts,marytts,command, ordummy)espeak- configuration for eSpeakphoneme_map- text file mapping CMU phonemes to eSpeak phonemes
flite- configuration for flitevoice- name of voice to use (e.g.,kal16,rms,awb)
picotts- configuration for PicoTTSlanguage- language to use (default if not present)
marytts- configuration for MaryTTSurl- address:port of MaryTTS server (port is usually 59125)voice- name of voice to use (e.g.,cmu-slt). Default if not present.locale- name of locale to use (e.g.,en-US). Default if not present.
phoneme_examples- text file with examples for each CMU phoneme
training- training speech/intent recognizersdictionary_number_duplicates- true if duplicate words in dictionary should be suffixed by(2),(3), etc.tokenizer- system used to break sentences into words (regexonly for now)regex- configuration for regex tokenizerreplace- list of dictionaries with patterns/replacements used on each example sentencesplit- pattern used to break sentences into words
unknown_words- configuration for dealing with words not in base/custom dictionariesfail_when_present- true if Rhasspy should halt training when unknown words are foundguess_pronunciations- true if Phonetisaurus should be used to guess how an unknown word is pronounced
speech_to_text- training for speech decodersystem- speech to text training system (auto,pocketsphinx,kaldi,command, ordummy)command- configuration for external speech-to-text training programprogram- path to executablearguments- list of arguments to pass to program
intent- training for intent recognizersystem- intent recognizer training system (auto,fsticuffs,fuzzywuzzy,rasa,adapt,command, ordummy)command- configuration for external intent recognizer training programprogram- path to executablearguments- list of arguments to pass to program
wake- waking Rhasspy up for speech inputsystem- wake word recognition system (pocketsphinx,snowboy,precise,command, ordummy)pocketsphinx- configuration for Pocketsphinx wake word recognizerkeyphrase- phrase to wake up on (3-4 syllables recommended)threshold- sensitivity of detection (recommended range 1e-50 to 1e-5)chunk_size- number of bytes per chunk to feed to Pocketsphinx (default 960)
snowboy- configuration for snowboymodel- path to model file (in profile directory)sensitivity- model sensitivity (0-1, default 0.5)audio_gain- audio gain (default 1)chunk_size- number of bytes per chunk to feed to snowboy (default 960)
precise- configuration for Mycroft Preciseengine_path- path to the precise-engine binarymodel- path to model file (in profile directory)sensitivity- model sensitivity (0-1, default 0.5)trigger_level- number of events to trigger activation (default 3)chunk_size- number of bytes per chunk to feed to Precise (default 2048)
command- configuration for external speech-to-text programprogram- path to executablearguments- list of arguments to pass to program
microphone- configuration for audio recordingsystem- audio recording system (pyaudio,arecord,hermes, ordummy)pyaudio- configuration for PyAudio microphonedevice- index of device to use or empty for default deviceframes_per_buffer- number of frames to read at a time (default 480)
arecord- configuration for ALSA microphonedevice- name of ALSA device (seearecord -L) to use or empty for default devicechunk_size- number of bytes to read at a time (default 960)
hermes- configuration for MQTT "microphone" (Hermes protocol)- Subscribes to WAV data from
hermes/audioServer/<SITE_ID>/audioFrame - Requires MQTT to be enabled
- Subscribes to WAV data from
sounds- configuration for feedback sounds from Rhasspysystem- which sound output system to use (aplay,hermes, ordummy)wake- path to WAV file to play when Rhasspy wakes uprecorded- path to WAV file to play when a command finishes recordingaplay- configuration for ALSA speakersdevice- name of ALSA device (seeaplay -L) to use or empty for default device
hermes- configuration for MQTT "speakers" (Hermes protocol)- WAV data published to
hermes/audioServer/<SITE_ID>/playBytes/<REQUEST_ID> - Requires MQTT to be enabled
- WAV data published to
commandsystem- which voice command listener system to use (webrtcvad,oneshot,hermes, ordummy)webrtcvad- configuration for webrtcvad systemsample_rate- sample rate of input audiochunk_size- bytes per buffer (must be 10,20,30 ms)vad_mode- sensitivity ofwebrtcvad(0-3)min_sec- minimum number of seconds in a commandsilence_sec- number of seconds of silences after voice command before stoppingtimeout_sec- maximum number of seconds before stoppingthrowaway_buffers- number of buffers to drop when recording startsspeech_buffers- number of buffers with speech before command starts
oneshot- configuration for voice command system that takes first audio frame as entire commandtimeout_sec- maximum number of seconds before stopping
command- configuration for external voice command programprogram- path to executablearguments- list of arguments to pass to program
hermes- configuration for MQTT-based voice command system that listens betweensstartListeningandstopListeningcommands (Hermes protocol)timeout_sec- maximum number of seconds before stopping
handlesystem- which intent handling system to use (hass,command, ordummy)forward_to_hass- true if intents are always forwarded to Home Assistant (even ifsystemiscommand)command- configuration for external speech-to-text programprogram- path to executablearguments- list of arguments to pass to program
mqtt- configuration for MQTT (Hermes protocol)enabled- true if MQTT client should be startedhost- MQTT hostport- MQTT portusername- MQTT username (blank for anonymous)password- MQTT passwordreconnect_sec- number of seconds before client will reconnectsite_id- ID of site (Hermes protocol)publish_intents- true if intents are published to MQTT
tuning- configuration for acoustic model tuningsystem- system for tuning (currently onlysphinxtrain)sphinxtrain- configuration for sphinxtrain based acoustic model tuningmllr_matrix- name of generated MLLR matrix (should matchspeech_to_text.pocketsphinx.mllr_matrix)