A bigram approach for classifying Spam and Ham messages
Project description
# bigram-spam-classifier
# A bigram approach for classifying Spam and Ham messages
# install with pip
pip install bigram-spam-classifier
# import in your python file
from bigram_spam_classifier import spamclassifier
# create an object of the classifier and pass your message as the parameter
classifier = spamclassifier.classifier("Customer service annoncement. You have a New Years delivery waiting for you. Please call 07046744435 now to arrange delivery")
# classify the message
cls = classifier.classify()
print(cls)
# If returns 1 message is a Spam, if returns 0 message is a Ham
# find the unigrams and bigrams in the message
unigrams = classifier.inputUnigrams
print(unigrams)
bigrams = classifier.inputBigrams
print(bigrams)
# find the bigram probabilities of Spam and Ham
spam_probability = classifier.bigramPSpam
print(spam_probability)
ham_probability = classifier.bigramPHam
print(ham_probability)
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
Built Distribution
File details
Details for the file bigram_spam_classifier-0.0.6.tar.gz
.
File metadata
- Download URL: bigram_spam_classifier-0.0.6.tar.gz
- Upload date:
- Size: 195.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f629c8a62bf3c3c9fc450c30777b94bf2d209efe0d9b4b542096ac2239e462f |
|
MD5 | f2973414bc812095d21a3fdd62af4c88 |
|
BLAKE2b-256 | 879a40d95e12e20d152f62b7e46c2bff850d0850c768620f2d8ef66476557228 |
File details
Details for the file bigram_spam_classifier-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: bigram_spam_classifier-0.0.6-py3-none-any.whl
- Upload date:
- Size: 196.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 780bd8cb8903e21406f9aeb71e49125cf10e89530cde97283f660f4447a63de4 |
|
MD5 | a532af1e4337e78e92262436467c964a |
|
BLAKE2b-256 | b68cf49761e49e8c465294e529cf3bce15bb84102258bc698a35f447e3b74af7 |