02 — PROBLEM
Problem
Turn large-scale short-form text into a deployable sentiment classification service while keeping preprocessing consistent between training and inference.
PROJECT / 02
A sentiment classification system using the Sentiment140 dataset. Bernoulli Naive Bayes and Logistic Regression were compared, with Logistic Regression selected for production after evaluation.
01 — SYSTEM ARCHITECTURE
The case study keeps architecture data-driven too. Each project can describe a different system path without changing the renderer.
Sentiment140 · 1.6M tweets
40K balanced training subset
NLP preprocessing pipeline
TF-IDF · 500K max features
Model comparison → Logistic Regression
FastAPI → Docker → Docker Hub
02 — PROBLEM
Turn large-scale short-form text into a deployable sentiment classification service while keeping preprocessing consistent between training and inference.
03 — APPROACH
Build a reusable NLP preprocessing pipeline covering stopword, URL, punctuation removal, tokenisation, stemming, and lemmatisation, then vectorize text with TF-IDF using unigrams and bigrams.
04 — RESULTS
Logistic Regression was selected for production at 76.60% accuracy and 0.840 ROC-AUC after comparison with Bernoulli Naive Bayes.
05 — IMPLEMENTATION
Preprocessing is shared between model training and inference to keep input handling consistent.
TF-IDF represents unigrams and bigrams with a 500K feature cap.
Confusion matrix and ROC curve analysis were used for evaluation.
The selected model is exposed with FastAPI and containerized with Docker for Docker Hub publication and AWS EC2 deployment.
06 — STACK & DEPLOYMENT
FastAPI + Docker + Docker Hub; prepared for AWS EC2 deployment