kaldi_spotter
wake word spotting with kaldi
Configuration is loaded from the following locations, with each location overriding values from the previous one
"/opt/kaldi_spotter/kaldi_spotter.conf" "~/.kaldi_spotter/kaldi_spotter.conf"
{ "listener": { "default_volume": 150, "default_aggressiveness": 2, "default_model_dir": "/opt/kaldi/model/kaldi-generic-en-tdnn_250", "default_acoustic_scale": 1.0, "default_beam": 7.0, "default_frame_subsampling_factor": 3 }, "hotwords": { # full sentences # CRITERIA # - fairly accurate, # - important enough to want offline functionality # - worth answering even if speech not directed at device "lights on": { "transcriptions": ["lights on"], "intent": "turn on lights", "rule": "equal" }, "lights off": { "transcriptions": ["lights off"], "intent": "turn off lights", "rule": "equal" }, "time": { "transcriptions": ["what time is it"], "intent": "current time", "active": false, "rule": "equal" }, # wake words # PROTIP: just run the live demo and see which transcriptions come up "hey computer": { "transcriptions": ["hey computer", "a computer", "they computer"], "sound": "/home/pi/start_listening.wav", "intent": "listen" } } }
see examples
from kaldi_spotter import KaldiWWSpotter def print_hotword(event): print("HOTWORD:", event)def print_utterance(event): print("LIVE TRANSCRIPTION:", event) listener = KaldiWWSpotter() listener.on("transcription", print_utterance) listener.on("hotword", print_hotword) listener.run()
Start kaldi spotter from cli
python -m kaldi_spotter
pi@raspberrypi:~ $ python -m kaldi_spotter INFO:root:Loading model from /opt/kaldi/model/kaldi-generic-en-tdnn_250 ... INFO:root:audio source: seeed-4mic-voicecard Multichannel INFO:root:Listening ('LIVE TRANSCRIPTION:', '{"data": {"confidence": 0.7698909431952632, "utterance": "hey computer"}, "type": "transcription"}') ('HOTWORD:', '{"data": {"hotword": "hey computer", "utterance": "hey computer", "intent": "listen"}, "type": "hotword"}') ('LIVE TRANSCRIPTION:', '{"data": {"confidence": 0.7663563699360755, "utterance": "what time is it"}, "type": "transcription"}') ('HOTWORD:', '{"data": {"hotword": "time", "utterance": "what time is it", "intent": "current time"}, "type": "hotword"}')
sudo apt-get install libatlas-dev pulseaudio-utils pulseaudio cython
You can install English model kaldi-chain-zamia-speech-en
or german model kaldi-chain-zamia-speech-de
Refered as kaldi-chain-zamia-speech-XX
bellow
echo "deb http://goofy.zamia.org/repo-ai/raspbian/stretch/armhf/ ./" >/etc/apt/sources.list.d/zamia-ai.list wget -qO - http://goofy.zamia.org/repo-ai/raspbian/stretch/armhf/bofh.asc | sudo apt-key add - apt-get update apt-get install kaldi-chain-zamia-speech-XX
apt-get install apt-transport-httpsecho "deb http://goofy.zamia.org/repo-ai/debian/stretch/amd64/ ./" >/etc/apt/sources.list.d/zamia-ai.list wget -qO - http://goofy.zamia.org/repo-ai/debian/stretch/amd64/bofh.asc | sudo apt-key add - apt-get update apt-get install kaldi-chain-zamia-speech-XX
cd /etc/yum.repos.d wget http://goofy.zamia.org/zamia-speech/misc/zamia-ai-centos.repo yum install kaldi-chain-zamia-speech-XX
install from pip
pip install kaldi_spotter
or from source
pip install git+https://github.com/JarbasAl/kaldi_spotter
上一篇:mxnet_kaldi
还没有评论,说两句吧!
热门资源
seetafaceJNI
项目介绍 基于中科院seetaface2进行封装的JAVA...
spark-corenlp
This package wraps Stanford CoreNLP annotators ...
Keras-ResNeXt
Keras ResNeXt Implementation of ResNeXt models...
capsnet-with-caps...
CapsNet with capsule-wise convolution Project ...
shih-styletransfer
shih-styletransfer Code from Style Transfer ...
智能在线
400-630-6780
聆听.建议反馈
E-mail: support@tusaishared.com