Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Classifier ¶
type Classifier struct {
Feat2cat map[string]map[string]int
CatCount map[string]int
Tokenizer classifier.Tokenizer
// contains filtered or unexported fields
}
Classifier implements a naive bayes classifier
func New ¶
func New() *Classifier
New initializes a new naive Classifier using the standard tokenizer
func (*Classifier) Probabilities ¶
func (c *Classifier) Probabilities(stringToClassify string) (map[string]float64, string)
Probabilities runs the provided string through the model and returns the potential probabilityForCategory for each classification
func (*Classifier) Train ¶
func (c *Classifier) Train(r io.Reader, category string) error
Train provides supervisory training to the classifier
func (*Classifier) TrainString ¶
func (c *Classifier) TrainString(title string, category string) error
TrainString provides supervisory training to the classifier
Click to show internal directories.
Click to hide internal directories.