SpamShield is a web-based application designed to detect spam messages using a machine learning model. It leverages Flask for the web framework and a Naive Bayes classifier for the spam detection model. The application provides an easy-to-use interface where users can input their messages and receive instant feedback on whether the message is spam or not.
- User-Friendly Interface: Clean and intuitive design for easy interaction.
- Real-Time Spam Detection: Immediate results upon message submission.
- Advanced AI Technology: Utilizes a Naive Bayes classifier for accurate spam detection.
- Privacy Assurance: No data is stored or shared; user inputs are processed in real-time and discarded.
SpamShield/
│
├── app.py # Main application file
├── templates/
│ ├── index.html # Home page template
│ └── predict.html # Result page template
├── models/
│ ├── Spam_Model.joblib # Pre-trained model
│ └── Vectorizer.joblib # Vectorizer for text transformation
├── README.md # Project README file
└── requirements.txt # Python dependencies
-
Clone the repository:
git clone https://github.com/GoldSharon/SpamShield.git cd SpamShield
-
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Download the pre-trained model and vectorizer:
- Place
Spam_Model.joblib
andVectorizer.joblib
in themodels/
directory.
- Place
-
Run the application:
python app.py
-
Access the web interface: Open your web browser and navigate to
http://127.0.0.1:5000/
. -
Check for spam:
- Enter the message you want to check in the provided text box.
- Click the "Check" button to get the result.
- Flask
- scikit-learn
- joblib
- numpy
Install dependencies using:
pip install -r requirements.txt
Contributions are welcome! Please submit a pull request or open an issue to discuss improvements or suggestions.
This project is licensed under the MIT License. See the LICENSE file for details.
The Naive Bayes model and TF-IDF vectorizer were trained using the scikit-learn library. Flask framework for the web application.