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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cd3e93864fb8872423c73f27d1962889cf699ebb2865507f64a99357edf1131 |
|
MD5 | 7f393d954876a993ecde1f2d5b4df735 |
|
BLAKE2b-256 | cd5569366cc6e3bb20f26f4b3358241f66cd8e3f9bbbcf4a6de433f04c3faade |
Hashes for bigram_spam_classifier-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e65280c19986ff7ce8bf471296bd08b8aa0e799ae1632cd0008467e9f316367 |
|
MD5 | 656e7979e2ea40424f0d88f848c129a5 |
|
BLAKE2b-256 | a117e73727260707de4e0dc0d1bf86fa3d36da92a4ba8ac10218c5644a6a8ce0 |