This is a demo developed using an emotion detector from Watson Studio, and Watson Studio speech to text, translation, and sentiment analysis. This repository contains the project skeleton with the emotion detector, and the watson keys removed. The read me file will explain how to set up watson, and where to learn about the emotion detector.
NOTE: This demo was run on Mac and Ubuntu, with python 3.6.5 or later. You may have different requirements.
Set up your audio drivers:
Mac brew install portaudio
Further instructions here.
Ubuntu sudo apt install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg libav-tools
Upgrade/Get Pip:
sudo pip --upgrade pip
Instructions for installing pip are here
Install dependencies:
sudo pip install -r requirements.txt
Time to set up Watson Studio. Go to https://www.ibm.com/cloud/ and sign up for an account.
Sign up by clicking "Sign up or log in" and follow further prompts.
After you have signed up make sure you are signed in. Go to the top of the page and click on the search bar. Type in Speech to Text and click on the first catalogue result.
Click on Create at the bottom right side of the screen.
After creating the instance you will be redirected to the services getting started page. From here go to the top left of the screen and click on Manage
This page is important to keep open as we will be using the API Key later.
Next click on the search bar at the top of the window, and type in natural language translation. Right click the service to open in a new tab. Now create the resource and navigate to the manage page.
Repeat the above steps by typing in Natural Language Understanding in the search bar.
After creating the above resources open up ESTS.py and SpeechToText.py. We are now going to add your credentials to the program. Start by navigating to the Speech To Text service and clicking on the copy to clipboard button.
Now open SpeechToText.py and go to line 98 and paste your apikey into the userpass variable value.
Next open up the ESTS.py file and copy the apikey from the Language Translator and paste it into the iam_apikey variable value online 29. Repeat the same process for Natural Language Understanding on line 34.
Now you are ready to run the code. Here are some problems to look out for:
- Bluetooth mic/headphones: If you are using bluetooth headphones with a mic, it may interrupt the speech to text feature.
- Webcam connection: If a web cam is not attached to your workstation, the code will not run.
In the terminal navigate to the directory where ESTS.py is located, and enter to command: python ESTS.py -l french -w False
.
Supported languages are: Arabic, Czech, Danish, Dutch, Finnish, French, German, Hindi, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Russian', Simplified Chinese, Spanish, Swedish, Traditional Chinese, Turkish.
That concludes the tutorial and read me, if you would like to contribute to the code in anyway please do.