How lokeshbootu/sentiment-analysis-on-amazon-reviews works
This repository is a product-review sentiment classifier with an interactive Streamlit app and two training tracks: classical ML and RoBERTa. The user workflow runs from review text input through saved-model inference to sentiment, confidence, probabilities, and model comparison. Offline, ratings are converted to labels and reviews are prepared into splits for training and EDA; models are evaluated and their artifacts and reports saved. The README documents capabilities beyond sampled code; unsampled subsystem links are omitted or marked unverified.
Main entry points: app.py Streamlit app · train_ml.py Classical ML training · preprocessing.py Label and split data · data Prepared splits
Components 14
User interface
- Streamlit app
app.py
Data preparation
- Review dataset
reviews.csv - Label and split data
src/preprocessing.py - Prepared splits
data
Modeling and inference
- Classical ML training
src/train_ml.py - RoBERTa training
src/train_roberta.py - Saved models
models - Inference pipelines
src/inference.py
Analysis and shared utilities
- Exploratory analysis
src/eda.py - Model evaluation
src/evaluate.py - Metrics and reports
outputs/reports - Paths and labels
src/config.py - JSON utilities
src/utils.py
Other components
- Review author
Connections 21
- Review author → Streamlit app: enters review
README.md - Streamlit app → Inference pipelines: requests predictions
app.py - Inference pipelines → Label and split data: cleans ML text
src/inference.py - Streamlit app → Saved models: loads saved models
app.py - Review dataset → Label and split data: provides ratings
README.md - Label and split data → Prepared splits: writes splits
src/preprocessing.py - Prepared splits → Classical ML training: supplies training data
src/train_ml.py - Prepared splits → RoBERTa training: supplies training data
src/train_roberta.py - Prepared splits → Exploratory analysis: supplies analysis data
src/eda.py - Classical ML training → Saved models: saves pipelines
src/train_ml.py - RoBERTa training → Saved models: saves trained models
README.md - Classical ML training → Model evaluation: computes metrics
src/train_ml.py - RoBERTa training → Model evaluation: evaluates model
README.md - Model evaluation → Metrics and reports: produces reports
- Streamlit app → Metrics and reports: reads RoBERTa summary
app.py - Streamlit app → Paths and labels: uses model paths
app.py - Label and split data → Paths and labels: uses label definitions
src/preprocessing.py - Classical ML training → Paths and labels: uses paths and seed
src/train_ml.py - RoBERTa training → Paths and labels: uses configured paths
src/train_roberta.py - Classical ML training → JSON utilities: loads and saves JSON
src/train_ml.py - Label and split data → JSON utilities: saves metadata
src/preprocessing.py