A Machine Learning web application that detects whether an SMS or Email
message is Spam or Not Spam using Natural Language Processing
(NLP) and TF-IDF Vectorization.
The application is built using Python, Scikit-learn, and Streamlit,
allowing users to enter any message and receive instant predictions.
- Real-time spam detection
- Clean NLP preprocessing pipeline
- Interactive web interface using Streamlit
- Lightweight and fast prediction system
-
Algorithms: Bernoulli Naive Bayes + Support Vector Machine + ExtraTree Elassifier using Voting algo.
-
Feature Extraction: TF-IDF Vectorizer
-
Problem Type: Binary Classification (Spam / Not Spam)
-
Accuracy: 0.9845261121856866
-
Precision: 1.0
Text → Preprocessing → TF-IDF Vectorization → Trained ML Model → Prediction
- Convert text to lowercase
- Tokenization using NLTK
- Remove punctuation and special characters
- Remove stopwords
- Apply stemming using SnowballStemmer
- Used TF-IDF Vectorizer to convert text into numerical vectors
- Algorithm: Bernoulli Naive Bayes
- Library: Scikit-learn
- Model serialization using Pickle
-
Built an interactive web app using Streamlit
Streamlit App --> https://sms-spam-classification-app-aiml.streamlit.app/
- Python
- Scikit-learn
- NLTK
- Streamlit
- Pandas
- NumPy
- Pickle
SMS-Spam-Detection/
│
├── app.py # Streamlit web app
├── model.pkl # Trained ML model
├── vectorizer.pkl # TF-IDF vectorizer
├── Sms_spam_detection.ipynb # Model training notebook
├── requirements.txt # Project dependencies
└── README.md # Project documentation
git clone https://github.com/Vinay-Rai/SMS-spam-classification-APP.git
cd SMS-spam-classification-APPpip install -r requirements.txtstreamlit run app.pyApplication runs at:
http://localhost:8501
- "Congratulations! You have won ₹10,000. Claim now."
- "Your bank account will be blocked within 24 hours! Verify your details immediately at www.secure-update-login.com"
- "Are you coming to class today?"
- "Let's meet at 6 pm."
The application is deployed on Streamlit Community Cloud.
- Improve model accuracy using advanced NLP models (Word2Vec, BERT)
- Add prediction confidence score
- Support bulk message classification
- Enhance UI design
- Email spam detection support
Vinay
- Machine Learning Enthusiast
- Interested in NLP and Deep Learning
Github -- > https://github.com/Vinay-Rai
Linkedin--> www.linkedin.com/in/vinay-rai-24vr
If you like this project, please give it a ⭐ on GitHub and share it with others!
