A generalized framework for text classifications.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install omnicat
Stand-alone version of omnicat is just a strategy holder for developers. Its aim is providing omnification of methods for text classification gems with loseless conversion of a strategy to another one. End-users should see 'classifier strategies' section and 'changing classifier strategy' sub section.
Changing classifier strategy
OmniCat allows you to change strategy on runtime.
# Declare classifier with Naive Bayes classifier classifier = OmniCat::Classifier.new(OmniCat::Classifiers::Bayes.new()) ... # do some operations like adding category, training, etc... ... # make some classification using Bayes classifier.classify('I am happy :)') ... # change strategy to Support Vector Machine (SVM) on runtime classifier.strategy = OmniCat::Classifiers::SVM.new # now you do not need to re-train, add category and so on.. # just classify with new strategy classifier.classify('I am happy :)')
Here is the classifier list avaliable for OmniCat.
Naive Bayes classifier
- gem 'omnicat-bayes'
- Details: http://github.com/mustafaturan/omnicat-bayes
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
Copyright © 2013 Mustafa Turan. See LICENSE for details.