Django Spam Classifier
This is an implementation of a naive bayesian classifier and a fisher classifier based on algorithms found in Programming Collective Intelligence.
This implementation uses django models to persist training data, and allows for simple classification of input text.
Grab spamclassifier from bitbucket.
e.g.
from spamclassifier.classifier import NaiveBayesClassifier, get_words
classifier = NaiveBayesClassifier([get_words])
classifier.train('Nobody owns the water.', 'good')
classifier.train('the quick rabbit jumps fences', 'good')
classifier.train('buy pharmaceuticals now', 'bad')
classifier.train('make quick money at the online casino', 'bad)
classifier.train('the quick brown fox jumps', 'good')
classifier.prob('quick rabbit', 'good')
classifier.prob('quick rabbit', 'bad')
from spamclassifier.classifier import FisherClassifier, get_words
classifier = FisherClassifier([get_words])
classifier.train('Nobody owns the water.', 'good')
classifier.train('the quick rabbit jumps fences', 'good')
classifier.train('buy pharmaceuticals now', 'bad')
classifier.train('make quick money at the online casino', 'bad)
classifier.train('the quick brown fox jumps', 'good')
classifier.classify('quick rabbit')
classifier.classify('buy pharmaceuticals')