Documentation
¶
Index ¶
- Constants
- func Arrange(text string) string
- func LogResults(entry string, results []Result)
- func RandomizeResponse(entry string, tag string, userId string) string
- type Document
- type Intent
- type Result
- type Sentence
- func (sentence Sentence) Calculate(cache gocache.Cache, network gonn.NeuralNetwork, userId string) (string, string)
- func (sentence Sentence) PredictTag(n gonn.NeuralNetwork) string
- func (sentence Sentence) Tokenize() (tokenizedWords []string)
- func (sentence Sentence) WordsBag(words []string) (bag []float64)
Constants ¶
View Source
const DontUnderstand = "don't understand"
Variables ¶
This section is empty.
Functions ¶
func Arrange ¶
Arrange check the format of a string to normalize it, put the string to lower case, remove ignored characters
func LogResults ¶
LogResults print in the console the sentence and its tags sorted by prediction
Types ¶
type Intent ¶
type Intent struct {
Tag string `json:"tag"`
Patterns []string `json:"patterns"`
Responses []string `json:"responses"`
Context string `json:"context"`
}
func SerializeIntents ¶
func SerializeIntents() []Intent
func SerializeModulesIntents ¶
func SerializeModulesIntents() []Intent
SerializeModulesIntents retrieves all the registered modules and returns an array of Intents
type Sentence ¶
type Sentence struct {
Content string
}
func NewSentence ¶
NewSentence returns a Sentence object where the content has been arranged
func (Sentence) Calculate ¶
func (sentence Sentence) Calculate(cache gocache.Cache, network gonn.NeuralNetwork, userId string) (string, string)
Calculate send the sentence content to the neural network and returns a response with the matching tag
func (Sentence) PredictTag ¶
func (sentence Sentence) PredictTag(n gonn.NeuralNetwork) string
Classify the sentence with the model
Click to show internal directories.
Click to hide internal directories.