Data::Classifier::NaiveBayes
my $classifier = Data::Classifier::NaiveBayes->new; $classifier->train('token', "Some text to train with"); print $classifier->classify("Some text to find a match");
This a Naive Bayes classifer. The code for this project is largely and shamelessly based off of the work done by alexandru's stuff-classifier originally written in Ruby.
https://github.com/alexandru/stuff-classifier
The code was ported over to Perl and Moose.
For more information please see the following:
http://bionicspirit.com/blog/2012/02/09/howto-build-naive-bayes-classifier.html
An access to Data::Classifier::NaiveBayes::Tokenizer.
A string to the tokenizer class name.
A key value pair of word counts by categories
A key value pair of catogory counts.
This will return the highest probable category associated with the phrase.
This will perform a word count and associate words with a category to later be classified.
Moose
Logan Bell, <logie@cpan.org>
<logie@cpan.org>
Copyright 2012, Logan Bell
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Data::Classifier::NaiveBayes, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Classifier::NaiveBayes
CPAN shell
perl -MCPAN -e shell install Data::Classifier::NaiveBayes
For more information on module installation, please visit the detailed CPAN module installation guide.