https://github.com/prasadhiremath1/spam-classifier
Classifies messages and emails as spam or not spam
https://github.com/prasadhiremath1/spam-classifier
naive-bayes-classifier python3 scikit-learn streamlit
Last synced: about 1 month ago
JSON representation
Classifies messages and emails as spam or not spam
- Host: GitHub
- URL: https://github.com/prasadhiremath1/spam-classifier
- Owner: PrasadHiremath1
- Created: 2025-04-05T18:36:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-05T18:46:42.000Z (about 1 year ago)
- Last Synced: 2025-04-05T19:29:09.488Z (about 1 year ago)
- Topics: naive-bayes-classifier, python3, scikit-learn, streamlit
- Language: Python
- Homepage: https://spam-classifier-j5dwyghvpewtbsgpgkman8.streamlit.app/
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📧 Spam Classifier - Email/SMS Detection App
This project is a **Streamlit-based web application** that classifies a given message as **SPAM** or **NOT SPAM** using a machine learning model trained on SMS data.
🚀 **Live Demo**: [Click here to use the app](https://spam-classifier-j5dwyghvpewtbsgpgkman8.streamlit.app/)
---
## 🧠 Features
- Preprocessing with NLTK (stopword removal, stemming, tokenization)
- Vectorization using **TF-IDF**
- Spam classification using a **trained machine learning model**
- Simple and interactive **Streamlit UI**
- Model and vectorizer are stored using `.pkl` for fast loading
---
## 🛠 Tech Stack
- **Frontend**: Streamlit
- **Backend**: Python, Scikit-learn
- **NLP Tools**: NLTK
- **Model Persistence**: Pickle
- **Hosting**: Streamlit Cloud
---
## 🔧 How It Works
1. **User inputs** a message (email or SMS).
2. The message is **cleaned and tokenized** using NLTK.
3. The message is transformed into TF-IDF features.
4. The **trained classifier** predicts whether it is SPAM or NOT SPAM.
5. The result is displayed on the screen.
---
## 🖥️ Local Setup
# 1. Clone the repo
git clone https://github.com/PrasadHiremath1/Spam-Classifier.git
cd Spam-Classifier
# 2. Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Run the Streamlit app
streamlit run app.py