- We have used
tensorflow
in the backend so you will have to run it in python 3.6 environment (since tensorflow is not availible in python 3.7 yet). - Install keras, nltk, json, pickle and tensorflow in the 3.6 environment.
- Download wordnet and punkt by nltk.download('wordnet') and nltk.download('punkt')
- Run the file
python train_chatbot.py
to train the model from 'intents.json' to create 3 layer neural network - Now run the file named
python chatgui.py
and the chatbot will be on your screen and u can start interacting with it.
The GUI components have been made by making the use of tkinter module -- base = Tk()
It is titled 'Hello', is not resizable and has the fixed geometry 400 x 500 -- base.title(), base.geometry(), base.resizable()
It has the fixed height 8 and width 50 -- Chatlog = Text(base,...)
It is used for scrolling the chatlog -- scrollbar = Scrollbar(base,command=ChatLog.yview,...)
It is a text box used to take input entry from the user. The default font is set to Arial -- EntryBox = Text(base,.,font='Arial',.)
It is used to submit/send the text inserted in the Entry box. On clicking on this button, the text in entry box is cleared to take new input from user -- SendButton = Button(base,...,command= send,...)