This is a flask API for the restaurant review sentiment analysis model.
-
Loading the model and tfidf vectorizer: Using the load class of joblib library the classification model and tfidf vectorizer is loaded.
-
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.
-
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.
- Flask
pip install Flask
- Joblib
pip install joblib
- NLTK
pip install nltk
- Scikit Learn
pip install scikit-learn
- Flask CORS
pip install flask-cors
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