Documentation
¶
Index ¶
- type RedisStore
- func (rs *RedisStore) AddClass(class string) (err error)
- func (rs *RedisStore) ClassWordCounts(class string, words []string) (mc map[string]int64, err error)
- func (rs *RedisStore) Classes() (a []string, err error)
- func (rs *RedisStore) IncrementClassWordCounts(m map[string]map[string]int64) (err error)
- func (rs *RedisStore) Reset() (err error)
- func (rs *RedisStore) TotalClassWordCounts() (m map[string]int64, err error)
- type Set
- type Shield
- type Store
- type Tokenizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func (*RedisStore) AddClass ¶
func (rs *RedisStore) AddClass(class string) (err error)
func (*RedisStore) ClassWordCounts ¶
func (*RedisStore) Classes ¶
func (rs *RedisStore) Classes() (a []string, err error)
func (*RedisStore) IncrementClassWordCounts ¶
func (rs *RedisStore) IncrementClassWordCounts(m map[string]map[string]int64) (err error)
func (*RedisStore) Reset ¶
func (rs *RedisStore) Reset() (err error)
func (*RedisStore) TotalClassWordCounts ¶
func (rs *RedisStore) TotalClassWordCounts() (m map[string]int64, err error)
type Shield ¶
type Shield interface {
// Learn learns a single document
Learn(class, text string) (err error)
// BulkLearn learns many documents at once
BulkLearn(sets []Set) (err error)
// Forget forgets the document in the specified class
Forget(class, text string) (err error)
// Score returns the scores for each class normalized from 0 to 1
Score(text string) (scores map[string]float64, err error)
// Classify returns the class with the highest score
Classify(text string) (c string, err error)
// Reset clears the storage
Reset() error
}
Click to show internal directories.
Click to hide internal directories.