Documentation ¶
Index ¶
Constants ¶
View Source
const UnableToClassifyIntent = "Backtalk_MetaIntent_UnableToClassifyIntent"
UnableToClassifyIntent is a meta-intent for which a Replyer can be registered to react to unclassifiable inputs.
Variables ¶
View Source
var ( // ErrUnknownIntent indicates that an intent was claimed in training // that wasn't provided to the classifier at construction time. ErrUnknownIntent = errors.New("unknown intent") // ErrIntentUnclear indicates that the model is unable to provide a // classification with high enough confidence to clear the minimum // threshold. ErrIntentUnclear = errors.New("unable to classify intent") )
Functions ¶
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
type Classifier ¶
type IntentMux ¶
type IntentMux struct {
// contains filtered or unexported fields
}
func NewIntentMux ¶
func NewIntentMux(c Classifier) (*IntentMux, error)
type NaiveBayesClassifier ¶
type NaiveBayesClassifier struct {
// contains filtered or unexported fields
}
func NewNaiveBayesClassifier ¶
func NewNaiveBayesClassifier(intents []string, threshold float64) *NaiveBayesClassifier
func NewNaiveBayesClassifierFromModel ¶
func NewNaiveBayesClassifierFromModel(model []byte) (*NaiveBayesClassifier, error)
NewNaiveBayesClassifierFromModel restores a serialized NaiveBayes model.
func (*NaiveBayesClassifier) Classify ¶
func (nbc *NaiveBayesClassifier) Classify(input string) (string, error)
func (*NaiveBayesClassifier) DoneTraining ¶
func (nbc *NaiveBayesClassifier) DoneTraining() error
func (*NaiveBayesClassifier) Train ¶
func (nbc *NaiveBayesClassifier) Train(intent, input string) error
type Replyer ¶
type Replyer interface { // Reply responds to an RTM event. // // Returning an error from a handler will kill the bot. Reply(rtm *slack.RTM, evt *slack.MessageEvent) error }
func DirectFilterReplyer ¶
DirectFilterReplyer is a filtering Replyer that excludes all messages that aren't explicitly directed at the bot (i.e., @bot).
Click to show internal directories.
Click to hide internal directories.