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.
-
Importing the dataset Using pandas the restaurant reviews dataset is imported and stored in dataset variable
-
Text cleaning The text is cleaned by first dividing it into tokens then removing the stopwords and perform stemming and lemmatization
-
Tfidf Vectorization Using the tfidf vectorizer create a matrix representation of the given textual data which will be an essential part of model creation.
-
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.
-
Calculating the evalutaion metrics Calculate the confusion matrix and accuracy score.
-
Make Prediction Provide a sample review for prediction and check prediction accuracy.
Use the joblib libraryto save the weights of classification model and also save the weights of tfidf vectorizer
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
- Clone the repository
git clone https://github.com/KaleAtharva/Restaurant-review-sentiment-analysis.git
Frontend implemented using ReactJS.
- Link to the Frontend React repository.
https://github.com/KaleAtharva/mini-project
API implemented using python flask.
- Link to the Flask repository
https://github.com/KaleAtharva/sentiment-analysis-flask-api