Plugins You can find out about all the publicly available Grails plugins.

Classify text using bayesian classifiers

  • Authors: Philip Stehlik
1 vote
compile ":bayes:0.4"





The bayes grails plugin provides services and data model to classify arbitrary text using bayes classifiers.

The plugin brings very easy to use text classification via bayes classifiers to Grails. By default the plugin runs with a simple set up that contains one classifier for all trained text but allows to configure multiple classifiers, word listers (stemmers) by a grouping key. It uses ci-bayes under the hood. ci-bayes allows using different implementation of classifiers (the algorithms on which the classification is based) and word listers (splitting up text into single parts that are the building blocks for the data collection for the classification). The plugin uses the FisherClassifierImpl as the default classifier and the SimpleWordLister as the default word lister.


Install as any plugin with
grails install-plugin bayes


The simplified usage of the plugin is by working with the pre-configured classifer using a default word-lister. You can use the plugin via the bayesClassifierService.
class MyController {
  def bayesClassifierService
   * Trains 'someText' to be of 'someCategory'
  def train = {
    bayesClassifierService.train(params.someText, params.someCategory)

/** * Determine the classification of 'someText' */ def classifyText = { def classification = bayesClassifierService.classifyText(params.someText) ['classification':classification] } }