A chatbot is an artificial intelligence (AI) software that can simulate a conversation (or a chat) with a user in natural language.
Many websites and applications now days have embedded chatbot on them to help improve customer experience
On this tutorial you’re going to learn how to build your own simple chatbot using Python Programming .
Note:
Don’t worry if you never had any experience with AI or Machine Learning since our python chatbot that we are about to build just use normal logic.
If you’re in window you don’t need to install anything because every module we are going to use comes automatic with Python Standard Library
However if you’re Linux user you might need to Install Tkinter Libary on your own
Installation
$ pip install python-tk
Also you need to have Dictionary json on your local folder which will act as our Knowledge base for our chatbot .
Download the Below Json Dictionary and put it on your project Directory
Project Directory
Your project directory should look as shown below
.
├── app.py
└── knowledge.json
0 directories, 2 files
Now after you have set everything clear let’s start building our application.
Throughout the project we are going to use the following Python standard modules
Now import all necessary modules ready to start crafting our chatbot
import json
from difflib import get_close_matches
from tkinter import Tk, Label, Entry, Button, Text, Scrollbar,Frame
We now required to create the exoskeleton of our application by designing our User Interface for our chatbot using tkinter Library.
Our chatbot UI will need to have the following features
Using knowledge of tkinter I have crafted the above features into Python code shown below.
#projects #chatbot #nlp #tkinter #python