shield

Bayesian text classifier with flexible tokenizers and storage backends for Go

  • Owner: eaigner/shield
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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

Main metrics

Overview
Name With Ownereaigner/shield
Primary LanguageGo
Program languageRuby (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2013-04-10 19:38:16
Pushed At2020-03-04 03:41:47
Last Commit At2013-04-15 16:22:53
Release Count0
用户参与
Stargazers Count158
Watchers Count12
Fork Count33
Commits Count32
Has Issues Enabled
Issues Count3
Issue Open Count2
Pull Requests Count0
Pull Requests Open Count3
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private