Problem 7 – Using Python to create a chatbot
It's time to create a simple chatbot. You've probably interacted with at least a dozen of these chatbots in the last few years. When you go to some websites, you might get a person who wants to chat with you and asks you a few simple questions, such as how you're doing, and what they can help you with. For most of those sites, the person is not a person, but a chatbot.
In some instances, the chatbots will then direct you to an actual human being. But most of the time, they'll just answer your questions by pointing you in the direction of the available answers on their website.
We're going to create something like those chatbots here. There are some components we'll need before we get started. One of them is an intents
file. That file, which should be a .json
file, contains the greetings and responses that the bot will be using and/or responding to. Here's a sample of what the intents content...