O'Reilly logo

Machine Learning Solutions by Jalaj Thanaki

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the rule-based chatbot

In this section, we will understand the implementation of the chatbot. This implementation is divided into two parts. You can find this code by visiting: https://github.com/jalajthanaki/Chatbot_Rule_Based:

  • Implementing the conversation flow
  • Implementing RESTful APIs using flask

Implementing the conversation flow

In order to implement the conversation logic, we are writing a separate Python script, so that whenever we need to add or delete some logic it will be easy for us. Here, we create one Python package in which we put this conversation logic. The name of the file is conversationengine.py and it uses JSON, BSON, and re as Python dependencies.

In this file, we have implemented each conversation in the form of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required