Versions in this module Expand all Collapse all v1 v1.0.2 Nov 18, 2021 Changes in this version + type CORPUS_TYPE int + const CORPUS_CORPUS + const CORPUS_REQUIREMENT + type ChatBot struct + Config Config + LogicAdapter logic.LogicAdapter + PrintMemStats bool + StorageAdapter storage.StorageAdapter + Trainer Trainer + func (chatbot *ChatBot) AddCorpusToDB(corpus *Corpus) error + func (chatbot *ChatBot) AddFeedbackToDB(feedback *Feedback) error + func (chatbot *ChatBot) FindCorporaFiles(dir string) []string + func (chatbot *ChatBot) GetResponse(text string, context ...string) []logic.Answer + func (chatbot *ChatBot) Init() + func (chatbot *ChatBot) LoadCorpusFromDB() (map[string][][]string, error) + func (chatbot *ChatBot) LoadCorpusFromFiles(filePaths []string) (map[string][][]string, error) + func (chatbot *ChatBot) RemoveCorpusFromDB(corpus *Corpus) error + func (chatbot *ChatBot) SaveCorpusToDB(corpuses map[string][][]string) + func (chatbot *ChatBot) Train(data interface{}) error + func (chatbot *ChatBot) TrainWithDB() error + type ChatBotFactory struct + func NewChatBotFactory(config Config) *ChatBotFactory + func (chatbot *ChatBotFactory) UpdateCorpusCounter(id int, isOk bool) error + func (f *ChatBotFactory) AddChatBot(project string, chatBot *ChatBot) + func (f *ChatBotFactory) AddProject(name, config string) (*Project, error) + func (f *ChatBotFactory) GetChatBot(project string) (*ChatBot, bool) + func (f *ChatBotFactory) GetCorpusById(id int) *Corpus + func (f *ChatBotFactory) GetProject(name string) (bool, error) + func (f *ChatBotFactory) Init() + func (f *ChatBotFactory) ListCorpus(corpus Corpus, start int, limit int) []Corpus + func (f *ChatBotFactory) ListProject() []Project + func (f *ChatBotFactory) Refresh() + type Config struct + DataSource string + DirCorpus string + Driver string + PrintMemStats bool + Project string + StoreFile string + type ConversationTrainer struct + func NewConversationTrainer(storage storage.StorageAdapter) *ConversationTrainer + func (trainer *ConversationTrainer) Train(data interface{}) error + type Corpus struct + AcceptCount int + Answer string + Class string + Context string + Contextual bool + CreatTime time.Time + Data CorpusData + Id int + Principal string + Project string + Qtype int + Question string + RejectCount int + Reviser string + UpdateTime time.Time + type CorpusData struct + Data map[string]interface{} + func (corpusData *CorpusData) FromDB(data []byte) error + func (corpusData *CorpusData) ToDB() ([]byte, error) + type CorpusTrainer struct + func NewCorpusTrainer(storage storage.StorageAdapter) *CorpusTrainer + func (trainer *CorpusTrainer) Train(data interface{}) error + func (trainer *CorpusTrainer) TrainWithCorpus(corpuses map[string][][]string) error + type Feedback struct + AcceptCount int + Answer string + Cid int + Class string + CreatTime time.Time + Creator string + Id int + Principal string + Project string + Qtype int + Question string + RejectCount int + Reviser string + UpdateTime time.Time + type Project struct + Config string + Id int + Name string + type Trainer interface + Train func(interface{}) error + TrainWithCorpus func(corpuses map[string][][]string) error