Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheIntents ¶
CacheIntents set the given intents to the global variable intents
Types ¶
type Document ¶
type Document struct { Text string `json:"text"` Summary string `json:"Summary"` Meaning string `json:"meaning"` Sentences []Sentence `json:"sentences"` Tokens []string `json:"tokens"` WordFrequence FreqDist Tokenizer string }
func NewDocument ¶
func (*Document) PrepareSentences ¶
func (d *Document) PrepareSentences()
type FreqDist ¶
A frequency distribution for the outcomes of an experiment. A frequency distribution records the number of times each outcome of an experiment has occurred. For example, a frequency distribution could be used to record the frequency of each word type in a document. Formally, a frequency distribution can be defined as a function mapping from each sample to the number of times that sample occurred as an outcome. Frequency distributions are generally constructed by running a number of experiments, and incrementing the count for a sample every time it is an outcome of an experiment.
func NewFreqDist ¶
func (*FreqDist) B ¶
B returns the total number of sample values (or "bins") that have counts greater than zero.
func (*FreqDist) CumulativeFrequencies ¶
Return the cumulative frequencies of the specified Samples. If no Samples are specified, all counts are returned, starting with the largest.
func (*FreqDist) Freq ¶
Return the frequency of a given sample. The frequency of a sample is defined as the count of that sample divided by the total number of sample outcomes that have been recorded by this FreqDist. The count of a sample is defined as the number of times that sample outcome was recorded by this FreqDist. Frequencies are always real numbers in the range [0, 1].
func (*FreqDist) Max ¶
Return the sample with the greatest number of outcomes in this frequency distribution. If two or more Samples have the same number of outcomes, return one of them; which sample is returned is undefined.
type Intent ¶
type Intent struct { Tag string `json:"tag"` Patterns []string `json:"patterns"` Responses []string `json:"responses"` Context string `json:"context"` }
Intent is a way to group sentences that mean the same thing and link them with a tag which represents what they mean, some responses that the bot can reply and a context
func SerializeIntents ¶
SerializeIntents returns a list of intents retrieved from the given intents file
type Sentence ¶
type Sentence struct { Text string `json:"text"` Summary string `json:"Summary"` Meaning string `json:"meaning"` Words []Word `json:"words"` Tokens []string `json:"tokens"` Tokenizer string `json:"tokenizer"` }
func NewSentence ¶
func (*Sentence) ApplyTokenizer ¶
func (s *Sentence) ApplyTokenizer(tokenizer tokenizers.Tokenizer)
func (*Sentence) PrepareMeaning ¶
func (*Sentence) PrepareSummary ¶
func (*Sentence) PrepareWords ¶
func (s *Sentence) PrepareWords()
type Word ¶
type Word struct { Text string `json:"text"` PosTag string `json:"pos"` Stem string `json:"stem"` Vector float64 `json:"vector"` Meaning string `json:"meaning"` Letters []string `json:"letters"` Synonyms []string `json:"synonyms"` }
func (*Word) ApplyStemmer ¶
Applies a stemmer to turn words like Cats to Cat
func (*Word) AttachPOStag ¶
func (w *Word) AttachPOStag()
func (*Word) PrepareMeaning ¶
func (*Word) PrepareSynonyms ¶
Applies words with similer meaning