SMS Spam Classifier is a machine learning project that classifies SMS messages as either spam or not spam (ham). This project uses natural language processing (NLP) techniques and a supervised machine learning model to make predictions.
-
Clone the repository:
git clone https://github.com/Anshul21107/sms-spam-classifier.git
-
Navigate to the project directory:
cd sms-spam-classifier
-
Install the required dependencies:
pip install -r requirements.txt
-
Train the SMS Spam Classifier model:
python train.py
-
Use the trained model to classify SMS messages:
from sms_spam_classifier import SMSClassifier # Initialize the classifier classifier = SMSClassifier() # Classify an SMS message message = "Congratulations, you've won a free iPhone!" result = classifier.classify(message) print(result)
The SMS Spam Classifier uses a labeled dataset of SMS messages. The dataset is with name spam.csv. It consists of two columns: text and label, where text contains the SMS messages, and label contains the corresponding labels (spam or ham).
The project uses a machine learning model for text classification. The model architecture and hyperparameters can be found in the model.pkl file.
The performance of the SMS Spam Classifier is evaluated using metrics such as accuracy, precision, recall, and F1-score. You can find the evaluation results in the SMS_Spam_detection.ipynb Jupyter Notebook.