Chatbot in Python
Chatbot in Python
Submitted in partial fulfilment of the requirement for the award of the degree of
BACHELOR OF SCIENCE
IN
Submitted by:
Sumit Singh
i
DECLARATION
Date:
The examination of past present and future as archived in this task is along these lines the
copyrights of the creator. This report ought not be imitated without the consent of the
creator. As far as I could possibly know and conviction the topic here is unique and has not
been submitted to some other college till date.
SUMIT SINGH
(2300214)
B.sc(cs) {2021-2024}
ii
ACKNOWLEDGEMENTS
A successful project is the result of consistency and good guidance that includes not only the
student but the mentor who put forth the ideas, logic, and efforts in guiding them. So, at the
completion of the project, I feel obliged to extend my gratitude to all those who made valuable
contributions throughout my project.
I would like to express the most profound thankfulness to my Mentor Mr. SANJIV KUMAR,
who has the disposition and the substance of a virtuoso: he consistently and convincingly
passed on a soul of experience with respect to look into, and an energy as to instructing.
Without his direction and determined help this exposition would not have been conceivable.
iii
LIST OF TABLES
iv
LIST OF ABBREVIATIONS
v
CONTENTS
Page No.
CHAPTER 1: INTRODUCTION
1.1 Abstract 1
1.2 Chatbot and Machine Learning 2
1.3 Artificial Intelligence 3-5
1.4 AI application 5-6
vi
CHAPTER 6: IMPLIMENTATION 22-24
CHAPTER 8: TECHNOLOGY
8.1 About Python 29-33
REFERENCES
vii
CHAPTER 1
INTRODUCTION
1.1 ABSTRACT
A chatbot is a computer program that can converse with humans using artificial intelligence in
messaging platforms. The goal of the project is to add a chatbot feature and API for Yioop.
discussion groups, blogs, wikis etc. Yioop provides all the basic features of web search portal. It
has its own account management system with the ability to set up groups that have discussions
boards. Groups are collections of users that have access to a group feed. The user who creates a
group is set as the initial group owner. Posts are grouped by thread in a group containing the most
recent activity at the top. The chatbot API for Yioop will allow developers to create new
chatbots, powered by rules or artificial intelligence, that can interact like a human with users in a
groups feed page. Example chatbots that can be developed with this API is weather chatbots or
book flight chatbots. Over past few years, messaging applications have become more popular
than Social networking sites. People are using messaging applications these days such as
Facebook Messenger, Skype, Viber, Telegram, Slack etc. This is making other businesses
available on messaging platforms leads to proactive interaction with users about their products.
To interact on such messaging platforms with many users, the businesses can write a computer
program that can converse like a human which is called a chatbot.
1|Page
1.2 Chatbot and Machine learning
Machine learning chatbots works using artificial intelligence. User need not to be more specific
while talking with a bot because it can understand the natural language, not only commands. This
kind of bots get continuously better or smarter as it learns from past conversations it had with
people.
Here is a simple example which illustrate how they work. The following is a conversation between
a human and a chatbot: Human: “I need a flight from San Jose to New York.” Bot: “Sure! When
would you like to travel?” Human: “From Dec 20, 2016 to Jan 28, 2017.” Bot: “Great! Looking
for flights.”
In order to achieve the ultimate goal, I have taken an iterative approach and divided my work into
four major deliverables. These deliverables not only helped me in understanding the code structure
of Yioop but also enhances Yioop’s functionality. In the rest of the report, I will be discussing
about the four deliverables. To understand more on chatbot service, I had implemented a Facebook
Messenger Weather Bot in deliverable 1, which is discussed in next section. The purpose of
deliverable 2 is to introduce chatbots to the Yioop. I have added Bot Configuration settings which
is used to add bot users in Yioop. In the next deliverable, I have added a functionality where the
user will be able to call bots in a group thread. Activation of bots will happen by calling respective
callback URL which is already configured that helps bots to have a conversation with users. More
details on this is discussed in deliverable 3 section. As a deliverable 4, I have created a weather
bot i.e, a web application in php that calls yahoo API to get weather information. The last section
of the report contains the conclusion and future work.
I have implemented a Facebook Messenger Bot to get an overview of how chatbot is build. During
this implementation, I understood the flow of control for a chatbot service with other services
which is explained below.
In order to create a Facebook Messenger Bot, a developer needs to be authenticated and approved
by Facebook to converse with the public and the web server for security reasons. For a Facebook
Messenger Bot, I have created a simple web application using Node.js by installing the necessary
dependencies using npm. I ran this locally. I also downloaded and installed ngrok and started it -
npm run ngrok. This launched a Forwarding URL to the local running server, that means any
2|Page
requests to Forwarding URL will hit the locally running server. This url is used as a Callback URL
in Facebook App which will be explained further. To set up the Facebook App, I have created a
Facebook Page and Facebook App using my Facebook account. While setting up a Webhook in
the app settings, I have given the Forwarding URL as Callback URL and added code for
verification.The access token in page settings is stored as environment variable as it will be used
in integration. In order to make webhook to receive messages from this page, the app is subscribed
to the page created. To set up the bot to handle the POST calls at webhook, I have created a
webhook endpoint in the sample application.
AI was coined by John McCarthy, an American computer scientist, in 1956 at The Dartmouth
Conference where the discipline was born. Today, it is an umbrella term that encompasses
everything from robotic process automation to actual robotics. It has gained prominence recently
due, in part, to big data, or the increase in speed, size and variety of data businesses are now
collecting. AI can perform tasks such as identifying patterns in the data more efficiently than
humans, enabling businesses to gain more insight out of their data.
3|Page
from the kind of AI systems that exist today to sentient systems, which do not yet exist.
His categories are as follows:
Examples of AI technology
Automation is the process of making a system or process function automatically. Robotic process
automation, for example, can be programmed to perform high-volume, repeatable tasks normally
performed by humans. RPA is different from IT automation in that it can adapt to changing
circumstances.
Machine learning is the science of getting a computer to act without programming. Deep learning
is a subset of machine learning that, in very simple terms, can be thought of as the automation of
4|Page
predictive analytics. There are three types of machine learning algorithms: supervised learning, in
which data sets are labeled so that patterns can be detected and used to label new data sets;
unsupervised learning, in which data sets aren't labeled and are sorted according to similarities or
differences; and reinforcement learning, in which data sets aren't labeled but, after performing an
action or several actions, the AI system is given feedback.
Machine vision is the science of making computers see. Machine vision captures and analyzes
visual information using a camera, analog-to-digital conversion and digital signal processing. It is
often compared to human eyesight, but machine vision isn't bound by biology and can be
programmed to see through walls, for example. It is used in a range of applications from signature
identification to medical image analysis. Computer vision, which is focused on machine-based
image processing, is often conflated with machine vision.
Natural language processing (NLP) is the processing of human -- and not computer -- language by
a computer program. One of the older and best known examples of NLP is spam detection, which
looks at the subject line and the text of an email and decides if it's junk. Current approaches to
NLP are based on machine learning. NLP tasks include text translation, sentiment analysis and
speech recognition.
Pattern recognition is a branch of machine learning that focuses on identifying patterns in data. The
term, today, is dated.
Robotics is a field of engineering focused on the design and manufacturing of robots. Robots are
often used to perform tasks that are difficult for humans to perform or perform consistently. They
are used in assembly lines for car production or by NASA to move large objects in space. More
recently, researchers are using machine learning to build robots that can interact in social settings.
1.4 AI applications
AI in healthcare. The biggest bets are on improving patient outcomes and reducing costs.
Companies are applying machine learning to make better and faster diagnoses than humans. One
of the best known healthcare technologies is IBM Watson. It understands natural language and is
capable of responding to questions asked of it. The system mines patient data and other available
data sources to form a hypothesis, which it then presents with a confidence scoring schema. Other
AI applications include chatbots, a computer program used online to answer questions and assist
5|Page
customers, to help schedule follow-up appointments or aiding patients through the billing process,
and virtual health assistants that provide basic medical feedback.
AI in business. Robotic process automation is being applied to highly repetitive tasks normally
performed by humans. Machine learning algorithms are being integrated into analytics and CRM
platforms to uncover information on how to better serve customers. Chatbots have been
incorporated into websites to provide immediate service to customers. Automation of job positions
has also become a talking point among academics and IT consultancies such as Gartner and
Forrester.
AI in education. AI can automate grading, giving educators more time. AI can assess students and
adapt to their needs, helping them work at their own pace. AI tutors can provide additional support
to students, ensuring they stay on track. AI could change where and how students learn, perhaps
even replacing some teachers.
AI in finance. AI applied to personal finance applications, such as Mint or Turbo Tax, is upending
financial institutions. Applications such as these could collect personal data and provide financial
advice. Other programs, IBM Watson being one, have been applied to the process of buying a
home. Today, software performs much of the trading on Wall Street. AI in law. The discovery
process, sifting through of documents, in law is often overwhelming for humans. Automating this
process is a better use of time and a more efficient process. Startups are also building question-
and-answer computer assistants that can sift programmed-to-answer questions by examining the
taxonomy and ontology associated with a database.
AI in manufacturing. This is an area that has been at the forefront of incorporating robots into the
workflow. Industrial robots used to perform single tasks and were separated from human workers,
but as the technology advanced that change
6|Page
CHAPTER 2
Background And Literature Review
7|Page
computers. For example, in Linux systems, all commands must be precise. A single replace of one
character or even a space can have significant difference. However, the emergence of NLP is
changing the way of interacting. Apple Siri and Microsoft Cortana have made it possible to give
command in everyday languages and is changing the way of interacting.
8|Page
Background :
In recent years, chatbots have gained significant popularity as virtual assistants designed to simulate
human conversation. These AI-powered agents offer various functionalities, including answering
questions, providing recommendations, and executing tasks. Personal assistant chatbots,
specifically, are tailored to assist users with day-to-day activities, such as managing schedules,
retrieving information, and automating simple tasks.
The development of personal assistant chatbots has been driven by advancements in natural
language processing (NLP), machine learning, and artificial intelligence (AI). These technologies
enable chatbots to understand and respond to user inquiries in natural language, enhancing user
interaction and convenience. Additionally, the proliferation of messaging platforms and virtual
assistants in smartphones and smart devices has contributed to the growing demand for personal
assistant chatbots.
9|Page
CHAPTER 3
PROBLEM IDENTIFICATION
• Lacking of training data. The quantity and quality of training data is critical to the
performance to a machine learning model. However, because some
confidential and privacy reasons, the business team cannot provide enough data for us,
and we had to make up data by our own. For the machine learning model, we generate
some fake data based on our daily life experience, which is really biased, although with a
good accuracy on the fake dat.
• Unstable API version. Because API service we are using are still under development,
and we cannot fix to a version for the API, the API may changes overtime. Moreover,
there are inconsistencies between the APIs and their documents or sample codes.
• Not familiar with the PHP language and .NET framework. None of the three of us
has previous knowledge with PHP language. Programming in a new language in such
a huge framework is quite challenging for us at the beginning of the project. However,
when we comes to the later phases, we are more used to that.
10 | P a g e
• User Interaction Complexity:
Issue: Users may struggle to interact naturally with the chatbot, leading to frustration and reduced
user satisfaction.
Cause: Complex user queries, ambiguous language, and misunderstanding of user intent contribute
to interaction challenges.
Impact: Poor user experience, increased abandonment rates, and limited adoption of the chatbot
.
• Limited Task Automation:
Issue: The chatbot may have limited capabilities in automating tasks beyond basic inquiries and
responses.
Cause: Lack of integration with external systems, limited functionality in executing complex tasks,
and inability to handle multi-step processes.
Impact: Inefficiency in assisting users with task completion, increased reliance on manual
intervention, and reduced utility of the chatbot.
• Contextual Understanding:
Issue: The chatbot may struggle to understand the context of user queries, leading to inaccurate or
irrelevant responses.
Cause: Limited contextual awareness, inability to retain conversation history, and challenges in
recognizing user intent changes.
Impact: Miscommunication, loss of user trust, and decreased effectiveness of the chatbot in
providing relevant assistance.
11 | P a g e
• User Privacy and Security:
Issue: Concerns regarding the privacy and security of user data stored and processed by the chatbot.
Cause: Inadequate data encryption, vulnerabilities in data storage, and potential breaches of user
confidentiality.
Impact: Loss of user trust, regulatory compliance issues, and reputational damage to the
organization deploying the chatbot.
12 | P a g e
CHAPTER 4
Software:
Software’s : - Python 3.6 or high version
IDLE : - Visual Studio .
13 |
Tasks requested by the user (e.g., sending an email, setting a reminder) are
completed successfully.
Main Success Scenario:
User: Initiates interaction with the chatbot by sending a greeting.
Example: "Hi"
Chatbot: Responds with a greeting.
Example: "Hello"
User: Asks about the chatbot’s name.
Example: "What is your name?"
Chatbot: Responds with its name.
Example: "You can call me Boss!"
User: Inquires about the current date or an upcoming date.
Example: "What's the date on coming Monday?"
Chatbot: Provides the date for the specified day.
Example: "The date on coming Monday is [date]."
User: Requests information about upcoming events or reminders.
Example: "Do I have any plans on Friday?"
Chatbot: Checks the user's calendar and provides relevant information.
Example: "You have a meeting scheduled on Friday at 3 PM."
User: Asks the chatbot to take notes.
Example: "Can you make a note?"
Chatbot: Acknowledges and records the note.
Example: "Sure, what would you like me to note down?"
User: Inquires about the chatbot’s capabilities (e.g., age, hobbies, work).
Example: "What is your age?"
Chatbot: Responds with a predefined answer.
Example: "I am a computer programme. How am I supposed to have an age!"
User: Requests to search something on Google or Wikipedia.
Example: "Search this on Google."
14 |
Chatbot: Acknowledges and performs the search.
Example: "Sure, let me search!"
User: Asks about the current weather.
Example: "What is the current weather condition?"
Chatbot: Calls a weather API and provides the current weather details.
Example: "Sure, let me find out."
User: Requests to open an application or play music.
Example: "Open VS Code."
Chatbot: Acknowledges and opens the application.
Example: "Sure, opening Visual Studio Code, please wait!"
User: Asks the chatbot to send an email.
Example: "Send an email."
Chatbot: Acknowledges and prompts for further details to compose and send the
email.
Example: "Sure sir!"
Extensions:
User's Inquiry is Unclear:
Chatbot: Requests clarification.
Example: "I didn't understand that. Could you please rephrase?"
External API is Unavailable:
Chatbot: Notifies the user and suggests trying later.
Example: "Sorry, I can't retrieve the weather information right now. Please try again
later."
User Requests Unsupported Action:
Chatbot: Informs the user of its limitations.
Example: "I’m sorry, I can’t do that yet. Is there something else I can help with?"
Special Requirements:
The chatbot must handle natural language processing to understand various user
inputs.
Secure integration with external services (e.g., weather API, email servers).
15 |
Data privacy and security measures to protect user information.
Frequency of Use:
Daily, depending on the user's needs for personal assistance and task automation.
Open Issues:
Ensure seamless integration with user-specific data (calendars, emails).
Continuously update the chatbot to handle new types of inquiries and tasks.
16 |
CHAPTER 5
PROPOSED SOLUTION
17 | P a g e
Natural language processing algorithms: To interpret user queries and generate accurate responses.
Knowledgeable database: To store information about college programs, courses, and admission
requirements.
Recommendation engine: To suggest suitable programs based on the user's interests and qualifications.
User interface: To provide a user-friendly and intuitive interface for users to interact with the chatbot.
Data collection and processing: To gather and organize information about college programs, courses,
and admission requirements.
Algorithm development: To develop natural language processing algorithms that can interpret user
queries and generate accurate responses.
Database design and implementation: To design and implement a knowledgeable database that can
store and retrieve information about college programs, courses, and admission requirements.
User interface design and implementation: To design and implement a user interface that is intuitive
and user-friendly.
Testing and evaluation: To test the chatbot system for accuracy, usability, and performance.
Knowledge graph creation: The first step is to create a knowledge graph that contains all the relevant
information about college programs, courses, and admission requirements. This can be done using
existing ontologies or by manually curating the knowledge graph.
5.2.1. To develop the problem under consideration and justify feasibility using concept of
knowledge canvas and IDEA matrix.
I D E A
18 | P a g e
• Learn IDEA matrix
• Knowledge canvas IDEA Matrix:
IDEA matrix is nothing but a matrix representation of characteristic requirement of the project.
The IDEA matrix of our project can be thus represented as:
I D E A
19 | P a g e
Decrease: The extra visit to unwanted result will be decreased by using Smart Crawler and profession
login option also provided on the smart crawler.
Educate: We are trying to make the management authority and efficiency of search engine aware of
technical advancements around.
Evaluate: By considering the searching on internet reviews and requirements which needs to be
satisfied given by the users we are evaluating the technology to be used along with algorithms needs
to reduce efforts.
Eliminate: By implementation of smart crawler need for massive number of system processing is
eliminated which leads to efficiency.
Accelerate: Searching is done at much higher speed as there would be we are using smart technologies
and algorithms so that it removes unwanted results.
Associate: Here we are associating or linking database with the inventory so that if the sites go below
threshold level inventory must make required arrangements so that the sides should not be unavailable.
Avoid: If any irrelevant search result in updating database goes may lead to wrong search result in the
system. This needs to be avoided. Hence an updating mechanism is added with help of smart crawler.
KNOWLEDGE CANVAS:
Knowledge canvas is a graphical representation of knowledge gap between any two components of the
project considered.
20 | P a g e
Fig .1 Knowledge Canvas Diagram
21 | P a g e
CHAPTER 6
IMPLEMENTATION
To initialize the chatbot, several key steps are undertaken. Initially, necessary libraries are imported,
including those for handling data, natural language processing (NLP), and machine learning models.
Following this, NLTK data is downloaded to facilitate text processing tasks, and a WordNet lemmatize
is initialized for word normalization.
Subsequently, the chatbot loads intent data from a JSON file, which contains predefined intents along
with their associated responses. Additionally, pre-processed data such as words, classes, and a trained
model are loaded using the pickle module. These pre-processed components are essential for the
chatbot's functioning, enabling it to understand user inputs and provide appropriate responses.
In the text pre-processing stage, the chatbot defines functions for cleaning up user sentences. The
clean_up_sentence function tokenizes and lemmatizes user input, ensuring consistency and
normalization for better understanding. Additionally, the bag_of_words function converts pre-
processed sentences into a bag-of-words representation, a common technique used in text classification
tasks.
Intent prediction is a crucial component of the chatbot's functionality. Here, the predict_class function
is defined to predict the intent of the user input using the trained model. This function utilizes the bag-
of-words representation of the user input to make predictions. An error threshold is set to filter out low-
confidence predictions, ensuring more accurate responses.
Once the intent is predicted, the chatbot proceeds to generate a response based on the predicted intent.
The get_response function is responsible for selecting an appropriate response from the predefined
intents based on the predicted intent. Responses are retrieved from the JSON file and randomly selected,
adding an element of variability to the chatbot's interactions.
Finally, the chatbot enters into an interactive loop to continuously engage with the user. It prompts the
user to input a message, predicts the intent of the input using predict_class, generates a response using
22 | P a g e
get_response based on the predicted intent, and displays it to the user. This iterative process forms the
backbone of the chatbot's interaction with users, allowing for dynamic and responsive conversations.
23 | P a g e
Fig 6.4 Chatbot Conversation
24 | P a g e
CHAPTER 7
ADVANTEGES & DISADVANTEGES
7.1 Advantages
1. Accessible anytime:
I’m sure most of you are always kept on hold while operators connect you to a customer care
executive. On an average people spend around 7 minutes until they are assigned to a person.
Gone are the frustrating days of waiting in a queue for the next available operative. They are
replacing live chat and other forms of slower contact methods such as emails and phone calls.
Since chatbots are basically virtual robots they never get tired and continue to obey your
command. They will continue to operate every day throughout the year without requiring to
take a break. This improves your customer UX and helps you rank highly in your sector.
Another advantage of this instant response is that you can also skillfully craft your chatbot to
maintain your image and brand.
2. Handling Capacity:
Unlike humans who can only communicate with one human at a time, chat bots can
simultaneously have conversations with thousands of people. No matter what time of the day
it is or how many people are contacting you, every single one of them will be answered
immediately.
Imagine you own a restaurant, and you have a good reputation for your food of which most of
your revenues come from delivery. As the demand keeps rising, you will have more customers
to take orders from but very few staff to attend them all. Having a chatbot would eliminate such
problem and cater to each and every person and ensure that no order is missed. Companies like
Taco Bell and Dominos are already using chatbots to arrange delivery of parcels.
3. Flexible attribute:
Chatbots have the benefit that it can quite easily be used in any industry. Unlike other products
where you have to do a lot of development and testing to change platforms, chatbots are
relatively easy to switch. One has to just train the bot by giving the right conversation structure
and flow to switch its current field or industry.
25 | P a g e
Or if there is a lot of back and forth between two sections of the industry say customer support
and sales, then you could have custom built presents which would already have the
conversation flow and structure to carry out the interactions with the user.
4. Customer Satisfaction:
Humans are bound to change of emotions. Chatbots, on the other hand, are bound by some
rules and obey them as long as they’re programmed to. They will always treat a customer in
the perfect way no matter how rough the person is or how foul language the person uses. Not
everyone orders the same food everyday, people’s choices may change everyday. In this case,
it can use your order history to make suggestions for the next order, learn your address details
and much more. Customers love this smooth interaction and want all their transactions to be as
simple as possible.
5. Cost Effective:
Hiring a human for a job is never a cheap affair, and it will be expensive if your revenue are
not high or sales targets are not met and would create havoc in the business. Due to the
boundaries of human beings, a single human can only handle one or two people at the same
time. More than that would be extremely tough for the employee.
Chatbots could help solve this age-old problem. As one chatbot is equal to loads of employees,
it can easily communicate with thousands of customers at the same time. We would only need
a handful of people to jump into conversations sometimes when necessary. Hence, it would
drastically bring down the expenses and bring about a steep rise in revenue and customer
satisfaction.
6. Faster Onboarding:
Before you want to accomplish a task, you first must learn how to work on the task and
complete it. Only then will they be considered fit for the job. There is a continuous teaching
involved in every level of hierarchy the employee will go through. Also, there will be a lot of
change in the employees, some stay, some get fired, some more join in etc.
What we want to say is, employees will change; it’s a fact. And this would require you to allot
a lot time of your employees into grooming the new joinees. Chatbots could eliminate that time
to almost zero, but provide a very clean and easy to understand conversation flow and structure
26 | P a g e
that needs to be maintained by the chatbot. No doubt there will be changes in this too, but it
will rather take a fraction of your time to resolve as compared to human employees.
7.2 Disadvantages-
2.Primitive algorithms
There are two types of bots: based on artificial intelligence, being able to learn in
the process of communication; programmed for specific behavior scenarios.
Artificial intelligence chatbots are considered to be better, as they can respond depending on
the situation and context. But the development of complex algorithms is required for this
purpose. Meanwhile, only IT giants and few developers possess such powerful technological
base.
Therefore, it would be better for ordinary companies to focus on the second variant of bots, as
they are more reliable and simpler. Namely for the reason they do not possess intelligence, they
will not be able to adopt rude communication patterns and get beyond the control of creators.
3.Complex interface
Talking to a bot implies talking in a chat, meaning that a user will have to write a lot. And in
case a bot cannot understand the user’s request, he will have to write even more. It takes time
to find out which commands a bot can respond to correctly, and which questions are better to
avoid. Thus, talking to a chatbot does not save time in the majority of cases.
27 | P a g e
Perhaps the efficiency of virtual assistants will increase due to the implementation of voice
recognition function in the future. But for the time being their functional capabilities are very
restricted, and they can be truly useful only in a few business areas.
28 | P a g e
CHAPTER 8
TECHNOLOGY
ABOUT PYTHON:
Dating from 1991, Python is a relatively new programming language. From the start, Python
was considered a gap-filler, a way to write scripts that “automate the boring stuff” (as one
popular book on learning Python put it) or to rapidly prototype applications that will be
implemented in one or more other languages.
However, over the past few years, Python has emerged as a first-class citizen in modern
software development, infrastructure management, and data analysis. It is no longer a
backroom utility language, but a major force in web application development and systems
management and a key driver behind the explosion in big data analytics and machine Perfect
for IT, Python simplifies many kinds of work, from system automation to working in cutting-
edge fields like machine learning.
Python is easy to learn. The number of features in the language itself is modest, requiring
relatively little investment of time or effort to produce one’s first programs. Python syntax is
designed to be readable and straightforward. This simplicity makes Python an ideal teaching
language, and allows newcomers to pick it up quickly. Developers spend more time thinking
about the problem they’re trying to solve, and less time thinking about language complexities
or deciphering code left by others.
Python is broadly used and supported. Python is both popular and widely used, as the high
rankings in surveys like the Tiobe Index and the large number of GitHub projects using Python
attest. Python runs on every major operating system and platform, and most minor ones too.
Many major libraries and API-powered services have Python bindings or wrappers, allowing
Python to interface freely with those services or make direct use of those libraries. Python may
not be the fastest language, but what it lacks in speed, it makes up for in versatility.
29 | P a g e
Python is not a “toy” language. Even though scripting and automation cover a large chunk of
Python’s use cases (more on that below), Python is also used to build robust,
professionalquality software, both as standalone applications and as web services.
The most basic use case for Python is as a scripting and automation language. Python isn’t just
a replacement for shell scripts or batch files, but is also used to automate interactions with web
browsers or application GUIs or system provisioning and configuration in tools such as Ansible
and Salt. But scripting and automation represent only the tip of the iceberg with Python.
• Python is used for general application programming. Both CLI and cross-platform GUI
applications can be created with Python and deployed as self-contained executables.
Python doesn’t have the native ability to generate a standalone binary from a script, but
third-party packages like cx_Freeze or PyInstaller can be used to accomplish that.
• Python is used for data science and machine learning. Sophisticated data analysis has
become one of fastest moving areas of IT and one of Python’s star use cases. The vast
majority of the libraries used for data science or machine learning have Python
interfaces, making the language the most popular high-level command interface to for
machine learning libraries and other numerical algorithms.
• Python is used for web services and RESTful APIs. Python’s native libraries and third-
party web frameworks provide fast and convenient ways to create everything from
simple REST APIs in a few lines of code, to full-blown, data-driven sites. Python’s
latest versions have powerful support for asynchronous operations, allowing sites to
handle up to tens of thousands of requests per second with the right libraries.
30 | P a g e
manipulate their own functions and have the kind of extensibility that would be difficult
or impossible to pull off in other languages.
• Python is used for glue code. Python is often described as a “glue language,” meaning
it can allow disparate code (typically libraries with C language interfaces) to
interoperate. Its use in data science and machine learning is in this vein, but that’s just
one incarnation of the general idea.
Also worth noting are the sorts of tasks Python is not well-suited for. Python is a high-level
language, so it’s not suitable for system-level programming—device drivers or OS kernels are
straight out. It’s also not ideal for situations that call for cross-platform standalone binaries.
You could build a standalone Python app for Windows, Mac, and Linux, but not elegantly or
simply. Finally, Python is not the best choice when speed is an absolute priority in every aspect
of the application. For that you’re better off with C/C++ or another language of that caliber.
Python syntax is meant to be readable and clean, with little pretense. A standard “hello world”
in Python 3.x is nothing more than:
• print(“Hello world!”)
• Python provides many syntactical elements that make it possible to concisely express
many common program flows. Consider a sample program for reading lines from a text
file into a list object, stripping each line of its terminating newline character along the
way:
31 | P a g e
• The [x … for x in my_file] construction is another Python idiosyncrasy, the “list
comprehension.” It allows a given item that contains other items (here, my_file and the
lines it contains) to be iterated through, and to allow each iterated element (that is, each
x) to be processed and automatically appended into a list.
• You could write such a thing as a formal for… loop in Python, much as you would in
another language. The point is that Python has a way to economically express things
like loops that iterate over multiple objects and perform some simple operation on each
element in the loop, or work with things that require explicit instantiation and disposal.
Constructions like this allow Python developers to balance terseness and readability.
• Python’s other language features are meant to complement common use cases. Most
modern object types—Unicode strings, for instance—are built directly into the
language. Data structures—like lists, dictionaries (i.e., hashmaps), tuples (for storing
immutable collections of objects), and sets (for storing collections of unique objects)—
are available as standard-issue items.
• Like C#, Java, and Go, Python has garbage-collected memory management, meaning
the programmer doesn’t have to implement code to track and release objects.
Normally garbage collection happens automatically in the background, but if that poses
a performance problem, it can be triggered manually or disabled entirely.
• Python’s use of significant whitespace has been cited as both one of Python’s best and
worst attributes. The indentation on the second line shown above isn’t just for
32 | P a g e
readability; it is part of Python’s syntax. Python interpreters will reject programs that
don’t use proper indentation to indicate control flow.
• Syntactical white space might cause noses to wrinkle, and some people do reject Python
out of hand for this reason. But strict indentation rules are far less obtrusive in practice
than they might seem in theory, even with the most minimal of code editors, and the
end result is code that is cleaner and more readable.
• Python 3 adoption was slowed for the longest time by the relative lack of third-party
library support. Many Python libraries supported only Python 2, making it difficult to
switch. But over the last couple of years, the number of libraries supporting only Python
2 has dwindled; most are now compatible with both versions. Today, there are few
reasons against using Python 3.
33 | P a g e
CHAPTER 9
CONCLUSION AND FUTURE SCOPE
9.1 Conclusions
The chatbot’s role as a virtual assistant is reinforced through robust task automation
capabilities. By handling tasks such as setting reminders, scheduling appointments, sending
emails, and managing to-do lists, the chatbot significantly enhances user productivity.
Additionally, emotion detection features enable the chatbot to respond empathetically,
fostering a more human-like interaction and deepening user trust. Information retrieval and
integration with third-party services expand the chatbot’s functionality, making it a versatile
tool that can provide comprehensive assistance beyond basic conversational capabilities. The
implementation of a feedback mechanism ensures that the chatbot continuously evolves,
improving its performance and user experience based on real-world interactions.
Security and privacy are paramount, and the chatbot’s robust measures ensure that user data is
protected, providing peace of mind to users. Effective error handling and recovery mechanisms
further enhance the reliability and robustness of the chatbot, ensuring seamless user interactions
even in the face of unexpected inputs or errors. Continuous learning and adaptation capabilities
34 | P a g e
position the chatbot to improve over time, leveraging user interactions to refine its responses
and functionality. Integration with e-commerce platforms and social media further extends the
chatbot’s utility, enabling users to perform a wide range of actions seamlessly within the
chatbot interface. Finally, the commitment to accessibility ensures that the chatbot is inclusive,
providing features that accommodate users with disabilities and making the technology
accessible to a broader audience. In conclusion, the personal assistant chatbot stands as a
testament to the potential of artificial intelligence in enhancing daily life. Its comprehensive
feature set, user-centric design, and continuous improvement mechanisms ensure that it
remains a valuable tool for users, providing efficient, personalized, and secure assistance in an
increasingly digital world. The development of this chatbot marks a significant step forward in
the integration of AI into everyday tasks, setting the stage for future innovations in this field.
There are limitations to what has been currently achieved with chatbots. The limitations of data
processing and retrieval are hindering chatbots to reach their full potential. It is not that we lack
the computational processing power to do so. However, there is a limitation on “How” we do
it. One of the biggest examples is the retail customer market. Retail customers are primarily
interested in interacting with humans because of nature of their needs. They don’t want bots to
process their needs and respond accord. The feature scope of the chatbot encompasses a
comprehensive array of functionalities designed to enrich user experience, bolster
functionality, and amplify versatility. By incorporating a multitude of features, the chatbot aims
to transcend conventional boundaries and cater to diverse user needs. At its core, the chatbot
boasts Multilingual Support, empowering it to seamlessly engage with users across various
linguistic backgrounds, thereby fostering inclusivity and widening its user base. Additionally,
the integration of Voice Recognition technology facilitates effortless interaction through
speech inputs, fostering accessibility and user-friendliness.
35 | P a g e
engagement. The chatbot transcends mere conversational prowess by doubling up as a Virtual
Assistant through Task Automation functionalities. From setting reminders and scheduling
appointments to sending emails and managing to-do lists, the chatbot streamlines everyday
tasks, thereby optimizing productivity and efficiency. Furthermore, the integration of Emotion
Detection capabilities enables the chatbot to gauge the user's emotional state and respond
empathetically, thereby fostering a deeper connection and rapport. Harnessing the power of
Information Retrieval, the chatbot serves as a gateway to a vast repository of knowledge,
effortlessly retrieving and presenting information from external sources such as databases,
APIs, or websites. Additionally, its seamless Integration with Third-party Services augments
its utility manifold, providing users with access to a plethora of additional functionalities from
popular platforms like Google Calendar, Spotify, Wikipedia, and weather APIs. The chatbot
operates within a feedback-driven ecosystem, where user input serves as the catalyst for
continuous improvement. A robust Feedback Mechanism ensures that user feedback is gathered
and analyzed systematically, thereby facilitating iterative enhancements to the chatbot's
performance, responses, and overall user satisfaction.
Moreover, stringent Security and Privacy Features safeguard user information and interactions,
ensuring confidentiality and peace of mind. In the event of errors or unexpected inputs, the
chatbot exhibits graceful Error Handling and Recovery mechanisms, providing informative
messages and guiding users towards resolution seamlessly. Furthermore, the chatbot is
designed to evolve continuously through Continuous Learning and Adaptation, leveraging
machine learning and natural language processing techniques to glean insights from user
interactions and refine its understanding, responses, and performance over time. Facilitating
seamless interactions with E-commerce Platforms and Social Media, the chatbot empowers
users to perform a myriad of actions such as product searches, order placements, social updates,
and messaging, thereby blurring the lines between virtual assistance and real-world utility.
Lastly, Accessibility Features ensure that the chatbot is inclusive and accessible to users with
disabilities, incorporating features such as screen reader compatibility, keyboard navigation,
and voice commands. In essence, the feature scope of the chatbot is as expansive as it is
transformative, positioning it as a versatile and indispensable tool for modern-day users seeking
convenience, efficiency, and personalized assistance in their digital interactions.
36 | P a g e
References
1. Bayan Abu Shawar and Eric Atwell, 2007 “Chatbots: Are they Really Useful?”
2. LDV Forum - GLDV Journal for Computational Linguistics and Language Technology.
3. http://www.ldv-forum.org/2007_Heft1/Bayan_Abu-Shawar_and_Eric_Atwell.pdf
4. Bringing chatbots into education: Towards natural language negotiation of open learner
models. Know.-Based Syst. 20, 2 (Mar. 2007), 177-185.
5. Intelligent Tutoring Systems: Prospects for Guided Practice and Efficient Learning.
Whitepaper for the Army's Science of Learning Workshop, Hampton, VA. Aug 1-3,
2006.
6. http://en.wikipedia.org/wiki/Chatterbot
7. ALICE. 2002. A.L.I.C.E AI Foundation, http://www.alicebot.org/
8. Chatbot Utilizing a Knowledge in Database at the 2016 7th International Conference
on Intelligent Systems, Modelling and Simulation by Bayu Setiaji and Ferry Wibowo.
9. Chatbot, https://en.wikipedia.org/wiki/Chatbot.Schantz, Herbert F., The History of
OCR, Recognition Technologies Users Association, Manchester Center,Vermont,
1982.
10. P. Chenna, T. Rao, et al (2018). HFSS software is used to design a twin inverted L
microstrip antenna for sustainable systems. International Journal of ComputerAided
Engineering Technology (IJCAET).
11. J. Quintero, an IEEE student member, and R. Asprilla, an IEEE member Proceedings
of the 2020 IEEE Thirty-Fifth Central American and Panama Convention: Towards an
Efficient Voice-Based Chatbot (concapan xxxv).
12. Rao, P.T., and Kumar, P.P. (2015,January). Twin microstrip patch antenna in the form
of a staircase. 2015 saw the ICPC (International Conference on Pervasive Computing)
(pp. 1-5). The Technical Writer's Handbook by IEEE M. Young. University Science,
Mill Valley, California, 1989.
13. Rao, P. T., and Kumar, P. P. (2021). dual dual folded inverted-L antenna with a
frequency-tunable circular polarisation and varactor-loaded split-ring resonator
constructions. Global Journal of Communication Systems, e4715.
14. Ly Pichponreay and Chi-Hwan Choi created the Chungbuk National University Smart
Responding Chatbot based on OCR and Overgenerating Transformations and Rating.
15. Trinatha Rao, P., and Praveen Kumar, P. C. (2020). Using HFSS, a double folded
inverted-L antenna with a rectangular ground plane is designed to be reconfigurable.
IETNetworks,9(5),229-234.
37 | P a g e
16. Automated Question Answering System Utilizing Ontology and Semantic Role
International Conference on Innovative Mechanisms for Industrial Applications
(ICIMIA2017) by S. Jayalakshmi and Dr. Ananthi Sheshasaayee.
17. Yuriy Dyachenko and Nayden Nenkov Articial Intelligence Technologies For
Personnel Learning Management Systems 2019 IEEE 8th Internatignal Conference on
Intelligent Systems Volodymyr DahlEast Ukrainian National University
Severodonetsk, Ukrainev.
38 | P a g e