Skip to content

End-to-end SMS spam classifier built with Python, sklearn, and Flask – features a web interface for predictions.

Notifications You must be signed in to change notification settings

iamalishayan/SMS-SpamClassifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMS Spam Classifier

This is a simple SMS Spam Classifier that predicts whether a given text message is spam or ham (not spam). It demonstrates the full machine learning pipeline — from preprocessing to deployment.


Dataset

  • Source: UCI SMS Spam Collection Dataset (via Kaggle)
  • The dataset is imbalanced, with a higher number of ham messages compared to spam.
  • As a result, prediction performance is reasonable but not highly optimized due to class imbalance.

Libraries Used

  • pandas, numpy – data manipulation and analysis
  • nltk – text preprocessing (tokenization, stopword removal, stemming)
  • sklearn – model training, evaluation, and vectorization (TF-IDF)
  • matplotlib, seaborn – data visualization
  • flask – for creating a simple web interface for user interaction

Model Used

  • After testing various models, Multinomial Naive Bayes was selected for its simplicity and effectiveness in text classification tasks.

Deployment

  • A basic Flask web app was created so users can enter an SMS message and receive a real-time prediction.
  • This improves usability and demonstrates how a machine learning model can be integrated into a web interface.

Notes

  • The classifier performs reasonably well but may be improved by addressing the data imbalance (e.g., using SMOTE or class weighting).
  • Future improvements could include better evaluation metrics, model tuning, and UI enhancements.

Author


Feel free to fork the repo, suggest improvements, or report issues!

About

End-to-end SMS spam classifier built with Python, sklearn, and Flask – features a web interface for predictions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages