It supports almost any natural language. By default it works in russian language. if you want to change it, please check documentation of libraries below. It can be done easily in 3 fixes:
- Change comments
- Change language of recognizer and synthesizer and train bot with your language sources (corpus, Twitter, etc.).
Main script is speech_ai. It recognizes your speech, looking for answer by chatterbot library and replies you with speech synthesized by GTTS library. Because of Libraries specials, it needs internet connection.
This script uses:
You can use this idea in you video game or maybe with Smart House.
Enjoy!
At first you need to install libraries, listed above. For this I recommend use of python environments (like conda environments)
conda create --name speech_ai
source activate speech_ai
conda install python=3.5
# Install pyaudio
# You can try pip3 command with sudo if errors appears
sudo apt-get install python-pyaudio python3-pyaudio
pip3 install pyaudio
pip3 install gTTS
pip3 install SpeechRecognition
pip3 install chatterbot
pip3 install pygame
python3 speech_ai.py