ποΈ Flipkart Product Review Sentiment & Rating Predictor (NLP)
An End-to-End Natural Language Processing (NLP) web application that predicts product ratings (Rate: 1 to 5) based on customer reviews and feedback summaries using TF-IDF tokenization and supervised Machine Learning classifiers.
Next-Generation Vocal Acoustic Analytics for Emergency Triage Scoring
πΌοΈ Application Preview
π Live Application
Access the interactive live web application:
π Click Here to Launch Live Application
π‘ Model Selection & Engineering Challenges
During the development and experimental phase, multiple model architectures were evaluated:
β Artificial Neural Network (ANN) Limitations
- High Loss & Accuracy Fluctuations: Training an ANN architecture led to severe epoch-to-epoch instability in both accuracy and training loss.
- Validation Loss Stagnation: The test/validation loss failed to converge effectively, indicating that deep neural layers were struggling to generalize on the sparse TF-IDF text matrix without overfitting.
- Decision: The ANN approach was discarded due to unpredictable performance and poor generalization on unseen test data.
π Machine Learning Approach (Selected Solution)
- Stable Generalization: Transitioned to traditional Machine Learning classification algorithms which provided consistent convergence.
- High Test Performance: The final trained ML model achieved an 83% Test Accuracy, successfully resolving the variance/loss issues observed in the ANN model while ensuring fast, reliable inference for real-time web deployment.
βοΈ Data Preprocessing & NLP Pipeline
The input dataset (flipkart_product.csv) combines Review and Summary into a single feature string Text. Custom text normalization is applied prior to tokenization:
- Punctuation Removal: Cleans standard punctuation marks using
str.maketrans. - Lowercasing: Standardizes characters to lowercase.
- Digit Removal: Strips numeric digits from input text.
- Emoji & Non-ASCII Removal: Filters non-ASCII characters to retain clean English tokens.
- Vectorization: Transforms normalized text into numeric matrices using the serialized
tokenizer.pkl.
π Repository Structure
βββ flipkart_product.csv # Primary Product Reviews Dataset
βββ .gitignore # Git Ignore File
βββ .gitattributes # Git Attributes File
βββ requirements.txt # Python Dependencies
βββ notebook.ipynb # EDA, Text Normalization & Model Experiments
βββ app.py # Interactive Streamlit Web Application
βββ model.pkl # Serialized Trained Machine Learning Classifier (83% Test Acc)
βββ tokenizer.pkl # Fitted TF-IDF / Vectorizer Object
βββ columns.pkl # Feature Column Schema Definitions
βββ UI.png # Application UI Preview
βββ README.md # Documentation
git clone https://github.com/amirsohail100/Flipkart-Product-Review-Sentiment-Rating-Predictor-NLP-.git
cd Flipkart-Product-Review-Sentiment-Rating-Predictor-NLP-
streamlit run app.py
pip install -r requirements.txt
π License
This project is licensed under the MIT License.
π Author
π€ Amir Sohail
End-to-End Flipkart product review rating predictor powered by NLP & Extra Trees Classifier (83.2% test accuracy). Features custom text preprocessing, TensorFlow Tokenizer sequence padding, and an interactive Streamlit UI designed to replace unstable ANN training architectures.