Bayesian Classification without a lot of fuss
gem install simple_classifier
simple_classifier depends on Martin Porter’s stemmer gem, which should be installed when you run the command above.
require 'simple_classifier' b = Classifier::Bayes.new 'Interesting', 'Uninteresting' b.train_interesting "here are some good words. I hope you love them" b.train_uninteresting "here are some bad words, I hate you" b.classify "I hate bad words and you" # returns 'Uninteresting'
More info on Bayesian Classification
Ben Orenstein [email protected]
Lucas Carlson [email protected]
This library is released under the terms of the GNU LGPL. See LICENSE for more details.