/flask-ml-app

Flask Machine Learning app for text classification

Primary LanguagePythonMIT LicenseMIT

Flask ML App

Flask Machine Learning app for text classification.

The purpose was to build an app that solves a Big data related problem. The dataset used for the project is this link. It contains reviews from the Amazon Prime Video's platform. In summary, I've processed the dataset, built an off-line classifier, and created an app with Flask. Inside Flask I've included also Flassgger, in this way is possible to expose the model as an Api.

The solution implemented includes a set of stages and technologies:

  1. Pre-processing with PySpark, the result of this stage is a csv dataset (final_movie_reviews.csv);
  2. Building an off-line classifier (Naive Bayes) with Scikit-learn;
  3. Creation of a Flask web app that allows users to use the classifier for new predictions;
  4. Web app Dockerization.

Clone and try the app in your local env!

  • python3 -m venv venv
  • . venv/bin/activate
  • pip install -r requirements.txt
  • python app.py

You can also use the docker-compose file.