KINDLE REVIEW ANALYSIS MODEL
This project builds a sentiment analysis model to classify Amazon Kindle reviews as positive or negative based on the text content. It uses NLP preprocessing, Bag-of-Words (BoW) and TF-IDF vectorization, and Gaussian Naive Bayes models for classification.
PROJECT OVERVIEW-------------------------------------------------------------
Goal: Predict sentiment of Kindle reviews from text data.
Dataset: 12,000 Kindle reviews with ratings from 1–5.
Classes:
Positive → rating ≥ 3
Negative → rating < 3
The notebook demonstrates:
Data cleaning and preprocessing
Feature extraction using BoW and TF-IDF
Model training with Gaussian Naive Bayes
Evaluation with accuracy, precision, recall, F1-score, and confusion matrix
DATASET------------------------------------------------------------------------
The dataset is sourced from Krishnaik’s GitHub repository and contains:
Column Description reviewText Text of the Kindle review rating Star rating (1–5) reviewerID Reviewer identifier reviewTime Date of review summary Short review summary helpful Helpfulness votes
For GitHub, only the relevant columns reviewText and rating are used.
DATA PREPROCESSING----------------------------------------------------------------
Lowercasing all text
Removing punctuation, numbers, and special characters
Removing stopwords
Removing HTML tags and URLs
Lemmatization using NLTK's WordNetLemmatizer
Converting ratings into binary sentiment:
Positive (1): rating ≥ 3
Negative (0): rating < 3
FEATURE EXTRACTION--------------------------------------------------------------------
Bag-of-Words (BoW): Represents text as token counts
TF-IDF Vectorization: Represents text with term importance
Both methods are applied to the training and test sets for model training.
MODEL TRAINING-------------------------------------------------------------------------
Algorithm: Gaussian Naive Bayes
Inputs: BoW and TF-IDF features
Outputs: Binary sentiment classification (0 = negative, 1 = positive)
Training is done on 80% of the dataset, and testing on 20%.
EVALUATION-----------------------------------------------------------------------------
The model performance is evaluated using:
Accuracy
Precision
Recall
F1-score
Confusion Matrix