Classify text using bayesian classifiers

  • Tags : text, bayes, classification, ai
  • Latest : 0.4
  • Last Updated: 23 August 2010
  • Grails version : 1.3.4 > *
  • Authors : Philip Stehlik
1 vote
Dependency :
compile ":bayes:0.4"

Documentation

Summary

Description

Intro

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.

Installation

Install as any plugin with
grails install-plugin bayes

Usage

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] } }