Skip to content

This simple web app uses Azure for text translation, text-to-speech conversion, and sentiment analysis of input text and translations.

License

Notifications You must be signed in to change notification settings

lordserch/flask-azure-cognitive-services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Flask app with Azure Cognitive Services

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

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

* 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"
```

Installing

  1. Clone this repository to your local machine
  2. Create a virtual environment on the top directory

Windows

virtualenv venv

MacOs / Linux

virtualenv venv --python=python3
  1. 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
  1. Install requests module pip install requests

  2. Install Flask pip install Flask

  3. Define the start file of the Flask app

In Windows

set FLASK_APP=app.py

MacOS / Linux

export FLASK_APP=app.py
  1. Run the flask app flask run

  2. 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.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Supracortical

About

This simple web app uses Azure for text translation, text-to-speech conversion, and sentiment analysis of input text and translations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published