Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Classifier ¶
type Classifier struct { Model Model LearningResults map[string]map[Class]int PriorProbabilities map[Class]float64 NDocumentByClass map[Class]int NFrequencyByClass map[Class]int NAllDocument int }
Classifier is object for classifying document
func NewClassifier ¶
func NewClassifier(model Model) Classifier
NewClassifier returns new Classifier
func NewClassifierFromFile ¶
func NewClassifierFromFile(path string) (Classifier, error)
NewClassifierFromFile returns new Classifier with configuration loaded from file in path
func (*Classifier) Learn ¶
func (classifier *Classifier) Learn(docs ...Document)
Learn executes learning process for this classifier
func (Classifier) SaveClassifierToFile ¶
func (classifier Classifier) SaveClassifierToFile(path string) error
SaveClassifierToFile saves Classifier config to file in path
type Document ¶
Document is a group of tokens with certain class
func NewDocument ¶
NewDocument return new Document func NewDocument(class Class, tokens ...string) Document {
Click to show internal directories.
Click to hide internal directories.