How paragdhomne/email-spam-classifier works
This repository is an email spam classifier, with a batch model-development workflow and two user-facing inference paths: a REST API and a Streamlit demo. The documented workflow covers EDA, preprocessing, TF-IDF, model comparison and tuning, error analysis, and model serialization. The checked-in serialized model is loaded directly by both applications. Notebook implementation details were not sampled, so their documented stages and links are based on the README rather than inspected notebook code.
Main entry points: 02_model_training.ipynb SVM tuning · main.py FastAPI endpoint · streamlit_app.py Streamlit classifier · spam_classifier_svm.joblib Serialized SVM
Components 12
Model Development
- Exploratory analysis
notebooks/01_eda.ipynb - Text preprocessing
notebooks/02_model_training.ipynb - TF-IDF features
notebooks/02_model_training.ipynb - Model comparison
notebooks/02_model_training.ipynb - SVM tuning
notebooks/02_model_training.ipynb - Error analysis
notebooks/02_model_training.ipynb - Serialized SVM
models/spam_classifier_svm.joblib
Classification Serving
- FastAPI endpoint
app/main.py
User Interfaces
- Streamlit classifier
app/streamlit_app.py
Other components
- Enron dataset
- API client
- Demo user
Connections 13
- Enron dataset → Exploratory analysis: analyzed in
README.md - Exploratory analysis → Text preprocessing: informs training
README.md - Text preprocessing → TF-IDF features: transformed into
README.md - TF-IDF features → Model comparison: feeds models
README.md - Model comparison → SVM tuning: best model tuned
README.md - SVM tuning → Error analysis: evaluated by
README.md - SVM tuning → Serialized SVM: serialized as
README.md - API client → FastAPI endpoint: submits email
README.md - FastAPI endpoint → Serialized SVM: loads model
app/main.py - FastAPI endpoint → API client: returns prediction
app/main.py - Demo user → Streamlit classifier: enters email
app/streamlit_app.py - Streamlit classifier → Serialized SVM: loads model
app/streamlit_app.py - Streamlit classifier → Demo user: shows prediction
app/streamlit_app.py