Documentation ¶
Index ¶
- type Bayes
- func (b *Bayes) AddWords(cat string, words map[string]float64)
- func (b *Bayes) Classify(words []string) (string, float64)
- func (b *Bayes) GetCategory(cat string) *Probe
- func (b *Bayes) GetSum() float64
- func (b *Bayes) Iter() <-chan *Probe
- func (b *Bayes) Len() int
- func (b *Bayes) Save(w io.Writer) error
- func (b *Bayes) SaveFile(loc string) error
- func (b *Bayes) ToModel() Model
- type Model
- type Probe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bayes ¶
type Bayes struct {
// contains filtered or unexported fields
}
Bayes bayes文本分类
func NewFromReader ¶
NewFromReader 从io.Reader创建Bayes
type Model ¶
type Model struct { Total float64 `json:"total,omitempty"` Data map[string]Probe `json:"d,omitempty"` }
Model bayes model for saving
Click to show internal directories.
Click to hide internal directories.