shield

Bayesian text classifier with flexible tokenizers and storage backends for Go

  • 所有者: eaigner/shield
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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

主要指標

概覽
名稱與所有者eaigner/shield
主編程語言Go
編程語言Ruby (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2013-04-10 19:38:16
推送於2020-03-04 03:41:47
最后一次提交2013-04-15 16:22:53
發布數0
用户参与
星數158
關注者數12
派生數33
提交數32
已啟用問題?
問題數3
打開的問題數2
拉請求數0
打開的拉請求數3
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?