Testing the rule-based chatbot

In this section, we will test the basic version of the chatbot. Let's begin with basic personal information that the chatbot asks for from the user. Here, I will generate the JSON response generated by the flask RESTful API. We need a JavaScript to parse this JSON response if we are integrating these APIs with the frontend. I won't explain the frontend integration part here, so let's analyze the JSON responses.

For the welcome message, refer to the following screenshot:

Testing the rule-based chatbot

Figure 8.13: JSON response for the welcome message

The JSON response when the chatbot is asking for the name of a user is given in the following figure: ...

Get Machine Learning Solutions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.