Chat Bot-1
Chat Bot-1
Project Report On
CHATBOT
SUBMITTED BY
66049
Prof.VAISHALI SHINDEKAR
IN
COMPUTER SCIENCE
SEMESTER-VI
MUMBAI UNIVERSITY
2022-2023
SONOPANT DANDEKAR SHIKSHAN MANDALI’S
PALGHAR-401404.
College Stamp
7 layout 10-14
8 Coding 15-18
9 Result 19
10 Advantages 20
11 Conclusion 21
12 Future Updates 22
13 References 23
ACKNOWLEDGEMENT
Place: Palghar
Date:
to provide you with a personalized and interactive experience. With our chatbot,
you can ask questions, receive helpful tips, and engage in fun conversations.
Our chatbot has been programmed using the Python programming language,
including chatbots. Python's simplicity and versatility make it an ideal choice for
this project.
the chatbot to understand your messages and respond appropriately. The chatbot
We hope you find our chatbot to be a useful and enjoyable tool, and we look
Hardware Requirement:
PC(4GB RAM)
i3/i5 Processer
500 GB/1TB hard disk
Internet Connection (Wi-Fi).
Software Requirement:
Python IDLE 3.7.4 (64 Bits)
PYCharm IDLE 2022 VERSION
INSTALLATION OF THE PYTHON IDLE 3.7.4
Installation of python involves following steps:
1. Download binaries
2. Check the install launcher for all users check box. Further check
the Add python 3.7.4 to path check box to include the interpreter in
4. Documentation
5. Pip
8. Install the global launcher for “.py” files. This makes it easier to
start python.
9. Install for all users.
python. Here, select the install for all users and Add python to
installation.
11. once the installation is over , we will see a python setup successful
window.
Step 3: Add python to environmental variables
The last step in installation process is to add python path to the system
setting the advance options during the installation procedure, you can
different version. Look for a folder whose name starts with python.
You have successfully installed python 3.7.3 on windows 10. You can
installation.
Search for the command prompt and type “python”. You can see that
on IDLE (python 3.7 64-bit). You can start coding in python using the
windows 10 system.
OBJECTIVES
The objectives for our Python-based chatbot project are:
preferences.
games.
learn from user interactions and use that information to improve its
use and navigate, with a clear interface that is intuitive and user-
friendly.
enjoyable for users, while also leveraging the power and flexibility
import nltk
lemmatizer = WordNetLemmatizer()
import pickle
import numpy as np
model = load_model('chatbot_model.h5')
import json
import random
intents = json.loads(open('intents.json').read())
words = pickle.load(open('words.pkl','rb'))
classes = pickle.load(open('classes.pkl','rb'))
def clean_up_sentence(sentence):
sentence_words = nltk.word_tokenize(sentence)
sentence_words = [lemmatizer.lemmatize(word.lower())
return sentence_words
# return bag of words array: 0 or 1 for each word in the
sentence_words = clean_up_sentence(sentence)
bag = [0]*len(words)
for s in sentence_words:
if w == s:
position
bag[i] = 1
if show_details:
return(np.array(bag))
p = bow(sentence, words,show_details=False)
res = model.predict(np.array([p]))[0]
ERROR_THRESHOLD = 0.25
r>ERROR_THRESHOLD]
return_list = []
for r in results:
return_list.append({"intent": classes[r[0]],
"probability": str(r[1])})
return return_list
tag = ints[0]['intent']
list_of_intents = intents_json['intents']
for i in list_of_intents:
if(i['tag']== tag):
result = random.choice(i['responses'])
break
return result
def chatbo
base = Tk()
base.title("Hello")
base.geometry("400x500")
base.resizable(width=FALSE, height=FALSE)
width="50", font="Arial",)
ChatLog.config(state=DISABLED)
cursor="heart")
ChatLog['yscrollcommand'] = scrollbar.set
bd=0, bg="#32de97",
activebackground="#3c9d9b",fg='#ffffff',
command= send )
height="5", font="Arial")
#EntryBox.bind("<Return>", send)
scrollbar.place(x=376,y=6, height=386)
return res
import tkinter
def send():
msg = EntryBox.get("1.0",'end-1c').strip()
EntryBox.delete("0.0",END)
if msg != '':
ChatLog.config(state=NORMAL)
ChatLog.config(foreground="#442265",
font=("Verdana", 12 ))
res = chatbot_response(msg)
ChatLog.config(state=DISABLED)
ChatLog.yview(END)
base = Tk()
base.title("Hello")
base.geometry("400x500")
base.resizable(width=FALSE, height=FALSE)
width="50", font="Arial",)
ChatLog.config(state=DISABLED)
#Bind scrollbar to Chat window
cursor="heart")
ChatLog['yscrollcommand'] = scrollbar.set
base.mainloop()
RESULT
ADVANTAGES
There are several advantages to developing a chatbot using Python:
1. Ease of use: Python is a simple and intuitive language that is easy to learn, even for beginners. It is also
highly readable and easy to maintain, making it an ideal choice for building chatbots.
2. Versatility: Python is a versatile language that can be used to build a wide range of applications, including
chatbots. It has a large and active community of developers who have created many libraries and
3. Natural language processing (NLP) capabilities: Python has several powerful libraries for NLP, including
NLTK and SpaCy, which enable chatbots to understand and interpret user input more accurately.
4. Machine learning capabilities: Python has several popular machine learning libraries, such as TensorFlow
and Keras, that can be used to train chatbots to improve their responses over time.
5. Integration with other technologies: Python can be easily integrated with other technologies, such as web
frameworks like Flask and Django, which can be used to build chatbots that can be accessed via web
6. Scalability: Python is highly scalable, making it possible to build chatbots that can handle a large volume of
Overall, these advantages make Python an ideal choice for building chatbots that are highly capable, flexible, and
In conclusion, developing a chatbot using Python has many advantages, including ease
enable developers to build chatbots that are highly capable, flexible, and scalable, while
also being easy to use and maintain. With the help of Python, we can create chatbots
that provide personalized and interactive experiences for users, offer assistance and
support, engage users in fun and interesting conversations, continuously learn and
improve, and provide a seamless user experience. Overall, Python-based chatbots have
the potential to revolutionize the way we interact with technology, making it easier and
There are several future updates that could be implemented to improve our Python-
based chatbot:
1. More advanced NLP capabilities: As NLP technology continues to evolve, we could integrate
more advanced NLP capabilities into our chatbot to improve its ability to understand and
2. Improved machine learning algorithms: We could also explore new machine learning algorithms
and techniques to improve our chatbot's ability to learn and adapt to changing user needs over
time.
3. Multilingual support: We could add support for multiple languages to enable our chatbot to
4. Voice recognition: We could add support for voice recognition technology, which would enable
5. Integration with other platforms: We could integrate our chatbot with other platforms, such as
social media and messaging apps, to make it more accessible and convenient for users.
6. Emotion detection: We could integrate emotion detection capabilities into our chatbot, which
Overall, these updates would make our chatbot even more capable, flexible, and useful
for users, and would enable us to stay at the forefront of chatbot technology
References:
https://www.google.com
https://www.google.com/search?
q=flowchart+for+chatbot+in+python&rlz=1C1RXQR_enIN1008IN1008&source=l
nms&tbm=isch&sa=X&ved=2ahUKEwjy-M3sw4X-
AhVLSWwGHdgmBh4Q_AUoAXoECAEQAw&biw=1360&bih=600&dpr=1#imgrc
=iHl4cLtBbzAleM