Skip to content

LetsPlayNow/Speech_AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speech_AI

image

Simple speech linguistic AI with Python

It supports any natural language (Russian by default). To change the language, change the settings of recognizer and synthesizer and retrain bot with your language sources (corpus, Twitter, etc.).

Main script is speech_ai. It requires internet connection to run. It recognizes your speech, looks for an answer using chatterbot library and replies you with a speech synthesized by GTTS library.

This script uses:

You can use this idea in you video game or Smart House project.
Enjoy!

Installation

Debian-based linux

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

Windows XP and older

In Windows OS we have several methods to install packages:

  • We can install compiler suggested for our Python version
  • Or we can easily use Wheel.
    On windows it's bit difficult to install pyaudio and pygame. So, easy way to use Wheel. This package versions for Python 3.4.x, but you can download versions what you need
  1. Install Python 3.4.x standalone or in Anaconda
  2. Download wheels depending on your architecture (x86 or amd64) and Python version:
  1. Install packages (install wheel if you haven't did it yet).
pip install --upgrade pip
pip install wheel

pip install pygame-1.9.3-cp34-cp34m-win32.whl
pip install PyAudio-0.2.11-cp34-cp34m-win32.whl

pip3 install gTTS
pip3 install SpeechRecognition
pip3 install chatterbot

Run

python3 speech_ai.py