How m-sriram33/nlp-text-classification-pipeline works
This repository is an IMDb review sentiment-classification project. Its main workflow downloads review data, prepares and analyzes it, trains and evaluates a TF-IDF/Linear SVM model, then serves predictions through a CLI or REST API. The README documents validation, preprocessing, EDA, and model comparison, but their implementations are not present in the supplied tree; those stages are shown as documented capabilities, not verified code connections. The sampled training, evaluation, download, and prediction modules support the other relationships shown.
Main entry points: sentiment_model.joblib Serialized pipeline · src Text preprocessing · train.py SVM training · predict.py CLI prediction
Components 15
Review data
- IMDb dataset
- Dataset download
src/download_data.py - Data validation
src - Text preprocessing
src - Exploratory analysis
notebooks/01_exploratory_data_analysis.ipynb
Model workflow
- TF-IDF features
src/train.py - Model comparison
results/model_comparison.csv - SVM training
src/train.py - Model evaluation
src/evaluate.py
Prediction interfaces
- CLI prediction
src/predict.py - REST API
src/api.py - CLI sentiment
src/predict.py - API sentiment
src/api.py
Model artifacts
- Serialized pipeline
models/sentiment_model.joblib
Other components
- Review user
Connections 16
- IMDb dataset → Dataset download: provides reviews
src/download_data.py - Dataset download → Data validation: downloads data
README.md - Data validation → Text preprocessing: checks then cleans
README.md - Text preprocessing → Exploratory analysis: analyzes cleaned data
README.md - Text preprocessing → TF-IDF features: prepares training text
README.md - TF-IDF features → SVM training: extracts features
src/train.py - SVM training → Model comparison: compares models
README.md - SVM training → Serialized pipeline: serializes pipeline
src/train.py - Serialized pipeline → Model evaluation: loads for evaluation
src/evaluate.py - Model evaluation → Review user: reports metrics
README.md - Review user → CLI prediction: submits review
src/predict.py - CLI prediction → Serialized pipeline: loads and predicts
src/predict.py - CLI prediction → CLI sentiment: prints sentiment
src/predict.py - Review user → REST API: posts review
src/api.py - REST API → Serialized pipeline: loads and predicts
src/api.py - REST API → API sentiment: returns sentiment
src/api.py