Skip to content

Latest commit

 

History

History
78 lines (48 loc) · 1.27 KB

README.md

File metadata and controls

78 lines (48 loc) · 1.27 KB

Sentiment Analysis Flask API

About

This is a flask API for the restaurant review sentiment analysis model.

Working

  1. Loading the model and tfidf vectorizer: Using the load class of joblib library the classification model and tfidf vectorizer is loaded.

  2. Text Preprocessing function: This function takes a text and cleans it and returns a text free from punctuations ,stopwords and which is stemmed using porter stemmer.

  3. Predict function: This function recieves the input text after hitting the submit button on browser i.e. it acts as an API endpoint where the endpoint location is /predict. It recieves a request in form of json object and returns predicted value to the web browser in the form of json.

Dependencies

  1. Flask
  pip install Flask
  1. Joblib
  pip install joblib
  1. NLTK
  pip install nltk
  1. Scikit Learn
  pip install scikit-learn
  1. Flask CORS
  pip install flask-cors

Run Locally

Clone the project

  git clone https://github.com/KaleAtharva/sentiment-analysis-flask-api.git

Go to the project directory

  cd my-project

Install dependencies

Run Python File

  python3 filename.py

Authors