https://github.com/aditya-ranjan1234/sms-spam-detector
Checks whether a message is spam or not
https://github.com/aditya-ranjan1234/sms-spam-detector
beginner ml spam-detection
Last synced: 7 months ago
JSON representation
Checks whether a message is spam or not
- Host: GitHub
- URL: https://github.com/aditya-ranjan1234/sms-spam-detector
- Owner: Aditya-Ranjan1234
- License: gpl-3.0
- Created: 2024-06-01T13:42:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-02T09:11:19.000Z (over 1 year ago)
- Last Synced: 2025-03-16T07:44:45.818Z (7 months ago)
- Topics: beginner, ml, spam-detection
- Language: Jupyter Notebook
- Homepage:
- Size: 687 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMS Spam Detector
SMS Spam Detector is a simple Python script that checks whether a given message is spam or not. It utilizes machine learning techniques to classify messages based on their content.
## Installation
Clone the repository:
```
git clone https://github.com/Aditya-Ranjan1234/SMS_Spam_Detector.git
```## Usage
To use the SMS Spam Detector, follow these steps:
1. Prepare your message data.
2. Enter the message you want to classify in the end of jupyter notebook.
3. The script will output whether the message is spam or not.Example:
```
# Enter SMS Message
sms = 'Aft i finish my lunch then i go str down lor. Ard 3 smth lor. U finish ur lunch already?'transformed_sms = tfidf.transform([transform_text(sms)]).toarray()
for name,clf in clfs.items():
answer=clf.predict(transformed_sms)
print("For ",name)
print("Result",answer)if(answer[0]==0):
print("ham")
else:
print("spam")
```## Dataset
The SMS Spam Detector is trained on the [SMS Spam Collection Dataset](https://archive.ics.uci.edu/ml/datasets/SMS+Spam+Collection) available from the UCI Machine Learning Repository. This dataset contains a collection of SMS messages that are labeled as spam or ham (not spam).
## Dependencies
Python 3.x
pandas
numpy
scikit-learn
Installation## Credits
This code was originally created by CampusX (@campusx-official). \
Many lines of code have been added and modified.