python - Overriding pre-defined answer in ChatterBot -


i want specify own answer particular question chat bot written using chatterbot library. here code

from chatterbot import chatbot  # create new chat bot named charlie chatbot = chatbot(     'charlie',     trainer='chatterbot.trainers.listtrainer' )  chatbot.train([     "who you?",     "i'm friendly chat bot" ])  # response input text 'who you?' response = chatbot.get_response('who you?')  print(response) 

the output after running piece of code is

who? form following function of what

instead of

i'm friendly chat bot

so looks there pre-specified answer question embedded in library. how can configure bot use answers?

@davidbankom bot train data. code snippet tells same thing source code.

# use specified trainer or fall default trainer = kwargs.get('trainer', 'chatterbot.trainers.trainer') trainerclass = utils.import_module(trainer) self.trainer = trainerclass(self.storage, **kwargs) self.training_data = kwargs.get('training_data') 

i think behavior seeing due pertained database exists in environment.

could please try delete sqlite database file, think in case db.sqlite

default_uri = "sqlite:///db.sqlite3" 

let me know if need help.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -