Detect spam messages with a simple and elegant web interface powered by machine learning.
- π Real-time spam detection using a trained LSTM + GRU neural network
- π§ Built with TensorFlow and Keras
- π Interactive frontend with Tailwind CSS
- π Flask API for backend prediction
- π Live result display with modern UI
/spam-detector
βββ app.py # (Optional) Model training script
βββ predict_spam.py # Flask API for serving predictions
βββ tokenizer.pickle # Saved tokenizer used during training
βββ spam_detection_model.h5 # Trained spam detection model
βββ SpamTrain.csv # Training data
βββ SpamTest.csv # Test data
βββ templates/
β βββ index.html # Frontend input page
β βββ result.html # Result display page
βββ static/ # Optional styles/scripts
-
Install dependencies
pip install flask tensorflow flask-cors
-
Start the Flask server
python predict_spam.py
-
Launch the frontend
python -m http.server 8000
-
Visit in browser
http://localhost:8000/index.html
- User types a message into the frontend
- The input is sent to the Flask API via a POST request
- The server tokenizes and classifies the message as "Spam" or "Not Spam"
- The result is shown on a separate result page
- Frontend: HTML, Tailwind CSS, JavaScript
- Backend: Python, Flask, TensorFlow
- Model: LSTM + GRU hybrid for spam classification
- Deployment Ready: Can be served locally or hosted via Flask + frontend hosting (Netlify, Vercel, etc.)