Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Train ¶
func Train(td TrainingData, d *dict.Dictionary) *bayes.NaiveBayes
Train performs the training process
Types ¶
type BayesF ¶
type BayesF struct {
// contains filtered or unexported fields
}
BayesF implements bayes.Featurer
func (BayesF) Value ¶
func (b BayesF) Value() bayes.FeatureValue
Value is required by bayes.Featurer
type FeatureSet ¶
FeatureSet splits features into Uninomial, Species, Ifraspecies groups
func NewFeatureSet ¶
func NewFeatureSet(ts []token.Token) FeatureSet
BayesFeatures creates slices of features for a token that might represent genus or other uninomial
func (*FeatureSet) Flatten ¶
func (fs *FeatureSet) Flatten() []bayes.Featurer
type NamesPositions ¶
type NamesPositions []NameData
type TextData ¶
type TextData struct { Text []rune NamesPositions }
type TrainingData ¶
func NewTrainingData ¶
func NewTrainingData(path string) TrainingData
NewTrainingData assembles text and name occurance information from several files that contain no names at all, or are botanical and zoological research papers that do contain names.
type TrainingLanguageData ¶
type TrainingLanguageData map[lang.Language]TrainingData
TrainingLanguageData associates a Language with training data
func NewTrainingLanguageData ¶
func NewTrainingLanguageData(dir string) TrainingLanguageData
LoadTrainingData loads TrainingData from a file.
Click to show internal directories.
Click to hide internal directories.