NaiveText is a text classifier gem written in ruby and made to be easily integratable in your Rails app.
Text classifier are used in many areas of IT. The filter spam, predict what a user wants to buy, detect which language a text is written in, ...
The kind of classifier included in NaiveText, uses existing text examples (junk-makrde e-mails, already bought products, texts in different languages, ...) to calculate in which category (spam/e-mail, interesting_product/not_interesting_product, ...) a unknown text belongs.
Add this line to your application's Gemfile:
gem 'NaiveText'
And then execute:
$ bundle
Or install it yourself as:
$ gem install NaiveText
The algorithm needs some examples for training. An example is a object with an id that responds to the text message with a string (i.e. ActiveRecord models with an text attribute will do). You can also use local files as examples (via ExamplesFactory.from_files('path/to/dir')).
Can be found on the projects homepage.
- Fork it ( https://github.com/RicciFlowing/NaiveText/fork )
- 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 a new Pull Request