This project builds a sentiment classifier on Amazon product reviews and serves it as a FastAPI Rest API.
- Python
- Scikit-learn (Naive Bayes Classifier)
- FastAPI( Rest API)
- Docker (containerization)
- Post/Predict -Accepts review text and return sentiment (Positive/negative/neutral)
notebooks/:Model training codeapp/: FastAPI app saved modelDockerfile/: Container for deployment
curl -x Post http://localhost:8000/predict/ -H "Content-Type: application/json" -d '{"text": This product is amazing!}'- Macro ROC-AUC: 0.86
- Model: TF-IDF + Logistic Regression (class_weight=balanced)
- confusion matrix:
- Dataset highly imbalanced ( Positive reviews dominated)
- Addressed via class weights
- Apply oversampling(SMOTE)
- Tray transformer model (DistilBERT/BERT)
