Skip to content

KaleAtharva/Restaurant-review-sentiment-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Restaurant-review-sentiment-analysis

About the project

Sentiment analysis is the process of analyzing digital text to determine if the emotional tone of the message is positive, negative, or neutral. This model focuses on restaurant reviews and classify it into two categories satisfactory or unsatisfactory.

Working

1. Model Training phase

  1. Importing the dataset Using pandas the restaurant reviews dataset is imported and stored in dataset variable

  2. Text cleaning The text is cleaned by first dividing it into tokens then removing the stopwords and perform stemming and lemmatization

  3. Tfidf Vectorization Using the tfidf vectorizer create a matrix representation of the given textual data which will be an essential part of model creation.

  4. Training the model Use the train_test_split from scikit-learn library to split data into training and testing datasets. Train the classification model using RandomForestClassifier.

2. Model Testing phase

  1. Calculating the evalutaion metrics Calculate the confusion matrix and accuracy score.

  2. Make Prediction Provide a sample review for prediction and check prediction accuracy.

3. Saving the model

Use the joblib libraryto save the weights of classification model and also save the weights of tfidf vectorizer

Getting Started

Dependencies

Numpy

  pip install numpy

Pandas

  pip install pandas

Matplotlib

  pip install matplotlib

Scikit-learn

  pip install scikit-learn

NLTK

  pip install nltk

Joblib

  pip install joblib

Installation

  1. Clone the repository
    git clone https://github.com/KaleAtharva/Restaurant-review-sentiment-analysis.git

Frontend

Frontend implemented using ReactJS.

  1. Link to the Frontend React repository.
    https://github.com/KaleAtharva/mini-project

Flask API

API implemented using python flask.

  1. Link to the Flask repository
    https://github.com/KaleAtharva/sentiment-analysis-flask-api

Authors