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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ccb66da28311591f49265dab4c74b92d498a9bb816deaa39fa0a168267b29d6 |
|
MD5 | f6c98dd90b8913f30840da1774e4ad3a |
|
BLAKE2b-256 | 38cd181fa269ee1844ee9fd692536f543f13bf1cb5c230cfec48b4110d70fc8f |
Hashes for bigram_spam_classifier-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14da8372cf55bc0bf875a2c9cdf4af642f8c88c2655e760fc4fbcde3e4e02761 |
|
MD5 | ff311adc5dc113363a2a4ceab3061a7e |
|
BLAKE2b-256 | 63bf88dce02bdffc400f6a089824a4f057b553623b54f414c742ac1f862021fd |