Popularity
5.2
Stable
Activity
0.0
Stable
156
12
33

Programming language: Go
License: MIT License
Tags: Machine Learning    

shield alternatives and similar packages

Based on the "Machine Learning" category.
Alternatively, view shield alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of shield or a related project?

Add another 'Machine Learning' Package

README

Shield is a bayesian text classifier with flexible tokenizer and backend store support

Currently implemented:

  • Redis backend
  • English tokenizer

Example

package main

import (
  "github.com/eaigner/shield"
)

func main() {
  sh := shield.New(
    shield.NewEnglishTokenizer(),
    shield.NewRedisStore("127.0.0.1:6379", "", 0),
  )

  sh.Learn("good", "sunshine drugs love sex lobster sloth")
  sh.Learn("bad", "fear death horror government zombie god")

  c, _ := sh.Classify("sloths are so cute i love them")
  if c != "good" {
    panic(c)
  }

  c, _ = sh.Classify("i fear god and love the government")
  if c != "bad" {
    panic(c)
  }
}