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)
#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
Hashes for bigram_spam_classifier-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bd403f56914e0e7f2c1aa8e61d43c917fc969a937113a93a02aa6e38b211bbf |
|
MD5 | 7be6553afde22929c6302dc50c7714c6 |
|
BLAKE2b-256 | ed7f99c7ac08b04eca1f5a40e8283138c85a3f3adc4981a3d3ec6fedb5305e8a |
Hashes for bigram_spam_classifier-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2eb7fd6e1b044b82870f9984399fdf8cbaa3ef48dad2f5d78b070b5b5608df01 |
|
MD5 | 718cace47e947d0e5297b0522b85b623 |
|
BLAKE2b-256 | 549c1e69231d8fcdb688c43f97737b6bec1761ab19bccb1b5a3fe226ffa2f303 |