April 2024
Beginner to intermediate
500 pages
24h 20m
English
In our first AI-type application, we will create a simple rules-based chatbot. The chatbot can answer questions posed by the user. Session 2.1 shows the finished program in action, assuming that the chatbot function is defined in the file chatbot.py. Each question is sent as a parameter to the chatbot function.
Session 2.1 The chatbot
Can you tell what is going on in this program? At first, it appears that the chatbot is indeed intelligent. But if you look closely, you will see that the bot’s answers depend only on the first word in the question. If the question starts with the word “Who,” the answer is always ...
Read now
Unlock full access