jarvis icon indicating copy to clipboard operation
jarvis copied to clipboard

correct the spamDetectorModel.py

Open student-smritipandey opened this issue 1 year ago • 2 comments

ISSUE: #70

This project is a text classification model that detects whether a given SMS/text message is Spam or Ham (Not Spam) using Deep Learning. The model was trained on a labeled dataset of SMS messages and deployed with a user-friendly Streamlit web application.

🔹 Project Workflow

Dataset used: https://www.kaggle.com/datasets/uciml/sms-spam-collection-dataset

Data Preprocessing

Cleaned and tokenized SMS messages

Converted text to sequences using Tokenizer

Applied padding to maintain equal input length (MAX_LEN = 100)

Model Architecture

Built using TensorFlow/Keras

Embedding layer for word representation

LSTM / Dense layers for sequential learning

Final sigmoid output layer for binary classification (Spam vs Ham)

Training & Evaluation

Optimizer: Adam

Loss function: Binary Crossentropy

Metrics: Accuracy

Achieved high classification performance on test data

Deployment

Model saved as spam_classifier.h5 / spam_classifier.keras

Tokenizer saved as tokenizer.pkl

Deployed using Streamlit for real-time predictions

🔹 Features

✅ Detects spam messages with high accuracy ✅ Returns prediction confidence score ✅ Interactive web UI using Streamlit ✅ Supports any user-entered SMS/text message

🔹 Example Predictions

Input: "Congratulations! You have won a $500 gift voucher. Click the link to claim." → 🚨 Spam detected! (Confidence: 99%)

Input: "Hey, are we still meeting tomorrow at 5?" → ✅ Ham (Not Spam) (Confidence: 100%)

🔹 Technologies Used

Python

TensorFlow / Keras

NLTK / Text Preprocessing

Streamlit

Pickle

Working Video 📷

https://github.com/student-smritipandey/Spam-Detector-Model/blob/main/model.mp4

student-smritipandey avatar Aug 23 '25 13:08 student-smritipandey

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE.

github-actions[bot] avatar Aug 23 '25 13:08 github-actions[bot]

@Avdhesh-Varshney add the model + working video, please review it

student-smritipandey avatar Aug 23 '25 14:08 student-smritipandey