How to train a bot using chatterbot

0

This is my first time developing a bot and following the instructions in the chatterbot manual I came up with the following code:

from chatterbot import ChatBot

bot = ChatBot(
"Terminal",
storage_adapter="chatterbot.storage.SQLStorageAdapter",
logic_adapters=[
"chatterbot.logic.MathematicalEvaluation",
"chatterbot.logic.TimeLogicAdapter",
"chatterbot.logic.BestMatch"
],

input_adapter="chatterbot.input.TerminalAdapter",
output_adapter="chatterbot.output.TerminalAdapter",
database_uri="../database.db"
)

print("Type something to begin...")

while True:
    try:
        bot_input = bot.get_response(None)
    except (KeyboardInterrupt, EOFError, SystemExit):
        break

It works in the terminal as it should, but has no training at all. How do I train my chatbot? Is there somewhere I can just import a corpus from outside and already train it?

    
asked by anonymous 01.11.2018 / 14:21

1 answer

0

According to the documentation, you can build your own corpus, in YAML or JSON format. Once created, use the command below for CHATTERBOT to point to it: chatterbot.train ("./ data / greetings_corpus / custom.corpus.json", "./data/my_corpus/"). The documentation is available at link

    
09.11.2018 / 00:29