Create Web Based ChatBot in Python, Django, Flask

30th March 2020 Huzaif Sayyed

Learn how to create Chatbot in Python. I this tutorial, we will use Chatterbot Library for creating the chat bot. We will use Flask Framework for deploying the chatbot on web. This tutorial change be used with Django also.

Every Chatbot has a theme. Our chatbot is going to Answer the Questions of User of Coronavirus Disease. It will greet the user, interact with them and give answers of Covid-19.

In the above code, we are creating a chatterbot instance. Then we are training our chatbot with ListTrainer with our personal question and answers. Then we are using chatterbot corpus english data to train our chatbot.

Creating Web UI for Chatbot using Flask

As we have installed Flask, we will create a app.py file and paste the bellow code inside it.

I was really interested in creatiing the Chatbot following your instruction. Unfortunately it failed for me. I could not install the Chatterbox. Could it be that I have to use a 64bit version of Python. I am using Python v 3.7.3 (32bit)?

Could you please give advice about what versions you use to create the Chatbot?