The ChatterBot python library is a great introduction to machine learning. It is very easy to create and train your own custom data by creating a YAML file. Luckily, ChatterBot has a custom corpus file and folder where you can add the content you want for the chat bot.
You want to start off naming the corpus category. It can be any topic you want.
categories: - Hello
Added dialog is important if you want the chat bot to reply with a specific answer. Your input is denoted by - - while the response for the bot is starts with - . After when you are done save the file in the custom folder.
conversations: # Your input - - hello # Bot response - world
You can now train the bot with the custom corpus that you created.
trainer = ChatterBotCorpusTrainer(bot) trainer.train('chatterbot.corpus.custom')
That's it for the quick introduction. For more information visit ChatterBot for documentation.