GuidesRecipesAPI ReferenceChangelogDiscussions
Log In

Sentiment Analysis Web App

How to create a simple web app to run a Modzy hosted model from scratch.

In this tutorial we will walk through creating a simple web application with Python and the Flask framework backed by AI/ML Algorithms from Modzy.

:computer: Environment Set Up

  • Download the project code.
  • Install Python
    • If you already have Python installed, you may skip this step.
    • If you don't have Python installed, install it now. You can download an installer from the Python official website or on a Mac you can install with Homebrew.
    • To verify your Python installation type python3 into your terminal window.
  • Install Flask
    • If you already have Flask installed, you may skip this step.
    • Verify that your terminal is in the Modzy Flask Template folder.
    • First we will create a virtual environment to contain this project. Enter python3 -m venv venv into the terminal and press enter.
    • After the command completes, type source venv/bin/activate and press enter.
    • Now type pip install flask flask-wtf and hit enter.
  • Install Modzy-SDK
    • Type pip install modzy-sdk to your terminal and press enter.
    • Retrieve your Modzy API key. It is a good idea to create a new project and use the project's API key to better organize and monitor activity related to this application.
    • If you are using Linux or Mac, type export API_KEY=yourAPI_key and hit enter. If using a Windows terminal, set API_KEY=yourAPI_key. Alternatively, you may edit the file replacing API_KEY_Public.API_KEY_Private with your downloaded API Key.

:runner: Start up project

  • Start Flask with the command flask run in your terminal
  • Using a web browser of your choice, navigate to
  • You should see this in your brower:

:runner: Submit data to application

  • Enter text into the 'My Text' box and click Analyze.
  • Within a few seconds the sentiment analysis results will be displayed!

You're done! Now click Next Steps and have some fun – or for a more in-depth tutorial on how Modzy works with Flask, walk through the Modzy in a Flask app Tutorial