Build Your Own Chatbot Using Python
Build Your Own Chatbot Using Python
using Python
Anirudh Rao
Great Learning
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Session Takeaways
Build your own chatbot using Python
● Introduction to chatbots
● Types of chatbots
● Top applications of chatbots
● Architecture of chatbots
● How does a chatbot work?
● Practical demonstration in Python
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Did you know?
Python is the world’s most popular programming language!
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to Chatbots
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to Chatbots
What are chatbots?
● The first chatbot was created by Joseph Wiesenbaum in 1966, named Eliza.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to Chatbots
History of chatbots
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Introduction to Chatbots
History of chatbots
Eliza – 1966
Parry – 1972
A.L.I.C.E – 1995
Smarter Child – 2001
SIRI – 2010
Google Now – 2012
Alexa - 2015
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Types of Chatbots
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Types of Chatbots
Important types:
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Types of Chatbots
Chatbots are designed using these approaches:
Self-learning Chatbot: Bot that learns how to communicate using the result
of a machine learning model to learn and assess current situation.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Top applications
of chatbots
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Top applications of chatbots
Hundreds of applications today
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Top applications of chatbots
Hundreds of applications today
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Architecture
of chatbots
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Architecture of chatbots
A typical chatbot architecture should consist of:
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How does a chatbot work?
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How does a chatbot work?
Very important steps:
1. Import corpus
2. Preprocess the data
3. Text case handling
4. Tokenization
5. Stemming
6. Bag of Words (BOW)
7. One hot encoding
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How does a chatbot work?
Corpus:
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How does a chatbot work?
Data preprocessing - text case handling:
● Convert all the data coming as an input to either upper or lower case.
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How does a chatbot work?
Tokenization:
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How does a chatbot work?
Stemming:
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
How does a chatbot work?
Generating Bag Of Words (BOW):
Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.