一个通用分类器模块,可支持贝叶斯和其他类型的分类。这是 cardmagic/classifier 的一个分支。
Classifier Reborn is a general classifier module to allow Bayesian and other types of classifications. It is a fork of cardmagic/classifier under more active development. Currently, it has Bayesian Classifier and Latent Semantic Indexer (LSI) implemented.
Here is a quick illustration of the Bayesian classifier.
$ gem install classifier-reborn
$ irb
irb(main):001:0> require 'classifier-reborn'
irb(main):002:0> classifier = ClassifierReborn::Bayes.new 'Ham', 'Spam'
irb(main):003:0> classifier.train "Ham", "Sunday is a holiday. Say no to work on Sunday!"
irb(main):004:0> classifier.train "Spam", "You are the lucky winner! Claim your holiday prize."
irb(main):005:0> classifier.classify "What's the plan for Sunday?"
#=> "Ham"Now, let's build an LSI, classify some text, and find a cluster of related documents.
…There is much more that can be done using Bayes and LSI beyond these quick examples. For more information read the following documentation topics.
gem 'classifier-reborn-jruby', platforms: :javaWhile experimental, this gem should work on JRuby without any kind of additional changes. Unfortunately, you will not be able to use C bindings to GNU/GSL or similar performance-enhancing native code. Additionally, we do not use fast_stemmer, but rather an implementation of the Porter Stemming algorithm. Stemming will differ between MRI and JRuby, however you may choose to disable stemming and do your own manual preprocessing (or use some other popular Java library).
If you encounter a problem, please submit your issue with [JRuby] in the title.
In order to have a more open and welcoming community, Classifier Reborn adheres to the Jekyll
code of conduct adapted from the Ruby on Rails code of conduct.
Please adhere to this code of conduct in any interactions you have in the Classifier community.
If you encounter someone violating these terms, please let Chase Gilliam know and we will address it as soon as possible.
The Classifier Reborn library is released under the terms of the GNU LGPL-2.1.
暂无开放 Issues,或尚未同步最近议题。