Skip to main content

A Python package for SMS spam detection.

Project description

SMS Spam Detection

This project is an SMS Spam Detection application built using Flask, Word2Vec, and Extra Trees Classifier. The application provides an API endpoint to predict whether a given SMS message is spam or not.

Features

  • Preprocesses text data by tokenizing, removing punctuation, and filtering out stop words.
  • Generates message embeddings using a pre-trained Word2Vec model.
  • Predicts whether a message is spam or not using an Extra Trees Classifier model.
  • Provides a web interface for users to input messages and get predictions.

Installation

  1. Clone the repository:

    git clone https://github.com/amintaheri23/sms-spam-detection.git
    cd sms-spam-detection
    
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate
    
  3. Install the required packages:

    pip install -r requirements.txt
    
  4. Download NLTK data:

    python -m nltk.downloader punkt stopwords
    

Usage

you can use the predict function directly in your code: ```python from sms_spam_detection import predict

message = "Congratulations! You've won a free ticket to the Bahamas!"
prediction = predict(message)
print(prediction)
```

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Author

Created by Amin Taheri - GitHub

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sms_spam_detection-0.1.6.tar.gz (13.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sms_spam_detection-0.1.6-py3-none-any.whl (13.9 MB view details)

Uploaded Python 3

File details

Details for the file sms_spam_detection-0.1.6.tar.gz.

File metadata

  • Download URL: sms_spam_detection-0.1.6.tar.gz
  • Upload date:
  • Size: 13.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for sms_spam_detection-0.1.6.tar.gz
Algorithm Hash digest
SHA256 73c36425becf70a2b2e2e29485f5003eea5e70db3f298aa8d9b3238ea17e1812
MD5 860a82ce3e1420204ea314e9f834c41f
BLAKE2b-256 3ca70d4deca98e30062f5ef578a301fd7df04491cbfde252098b403f44882f40

See more details on using hashes here.

File details

Details for the file sms_spam_detection-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for sms_spam_detection-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 361840fea3e3947afd2890375923c096f5f59fd031cdf630b659bcc7a4fe6a74
MD5 2f2c6f84bf92fe4a6edda82d22ef90a6
BLAKE2b-256 d27d4cc23b950b2fcfedad76acf742fb0f4288bd1172f4231676264ef9f5ddae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page