This simple web app uses Azure for text translation, text-to-speech conversion, and sentiment analysis of input text and translations. It's built with Python and Flask. The frontend is HTML with JavaScript. This project is based on a Microsoft Azure Tutorial
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
* Python 3.5.2 or later
* Git tools
* An IDE or text editor, such as Visual Studio Code or Atom
* Chrome or Firefox
You need the following items from your Azure account
* A Translator Text subscription key
* A Text Analytics subscription key
* A Speech Services subscription key
* A config.py file on the root directory with the following structure
```
synthesize_key = "REPLACE_WITH_YOUR_KEY"
sentiment_key = "REPLACE_WITH_YOUR_KEY"
translate_key = "REPLACE_WITH_YOUR_KEY"
region = "REPLACE_WITH_YOUR_REGION"
```
- Clone this repository to your local machine
- Create a virtual environment on the top directory
Windows
virtualenv venv
MacOs / Linux
virtualenv venv --python=python3
- Activate the virtual environment
Windows - bash
source venv/Scripts/activate
Windows - Command Line
venv\Scripts\activate.bat
Windows - PowerShell
venv\Scripts\Activate.ps1
MacOS / Linux
source venv/bin/activate
-
Install requests module
pip install requests
-
Install Flask
pip install Flask
-
Define the start file of the Flask app
In Windows
set FLASK_APP=app.py
MacOS / Linux
export FLASK_APP=app.py
-
Run the flask app
flask run
-
Check there are no error messages after running the command. Open a browser and go the URL provided (normally is http://127.0.0.1:5000/). You should now be able to see the single page app. Enter some text, select a language to translate, analyze and then convert to speech.
This project is licensed under the MIT License - see the LICENSE.md file for details
- Supracortical