Lovely Professional University
Lovely Professional University
Lovely Professional University
Sagar pande
Abstract— Chatbot is widely popular now-a-days and catching speed as an application of computer
communication. Some programs respond intelligently like human. This type of program is called a
Chatbot. This paper addresses the design and implementation of a Chatbot system. We will also study
another application where Chatbots could be useful and techniques used while designing a Chatbot.
D. Creating a Chat
The chat is created using a pattern that is known to the user
and could be easy to understand. Chat dialog box show up to
create conversation. This dialog box is created using java
applets.
E. Pattern Matching
It is a technique of artificial intelligence used in the design of
a Chatbot. The input is matched with the inputs saved in the
database and corresponding response is returned.
F. Simple
The design of a Chatbot is very simple. It just answers to the
questions asked by the user, if the question is found in the
database.
B. Modules Description
The description of the modules used in the implementation
is given below :
Chatbot()
In this function, all the variables used for creating the
dialog box are added. Default close operation is set to
EXIT_ON_CLOSE so that the dialog box closes on exit.
Required background colour is set using inbuilt set
Background () function.
Random()
The input from the user is taken using get Text () function.
All the punctuation marks in the users input are removed
using trim () function. The uppercase letters are converted
to lowercase. A variable called response is used to hold a
byte value and it is set to 0. While response is 0, the match
for the input is found in the database and it is returned as a
response which is displayed in the text area. If the
response is 1, then the match for the input is not found in
the database. In this case, a default response is returned.
Random () function is used to choose the response saved
in the database .
AddText()
All the texts or strings used in input and output are added
to the text area in the dialog box.
InArray()
This is used as a pattern matching function. A variable
match for the users input is found in the database, true is bot?). This could also be a telephone.
returned else false is returned as a result. This value is
returned to key Pressed() function and the result is displayed
in the dialog box.
IV. COMPARISON
This Chatbot is very simple and user friendly. It is not very
complicated like other Chatbots. The working of the Chatbot
is simple and can be easily understood by any person. In
other Chatbots, the working is very complicated. Many
classes are used which is difficult to understand. In this
program, only one class is used to make it simple and obtain
the expected output. This Chatbot uses simple pattern
matching to represent the input and output whereas other
Chatbots uses input rules, keyword patterns and output rules
to generate a response. If the input is not found in the
database, a default response is generated. The input and
output can be customized according to the user. Based on the
developer or the user, the required requests and responses
can be stored in the database. Since own database can be
created, it allows the user to understand how the response is
generated. This Chatbot can be used for the entertainment
purpose. Whenever a person is bored, he can chat with the
bot for entertainment. It can also be used to provide
information by modifying the program as needed by the user
[8].
V. FUTURE SCOPE
Chatbots are also referred to as virtual assistants. It is a
rudimentary form of artificial intelligence software that can
mimic human conversation. The Chatbots can be analyzed
and improved. It can be used in various fields such as
education, business, online chatting etc. It can be used in the
field of education as a learning tool. The information
necessary for education can be stored in the data base and
can be retrieved any time by querying the bot. In business
field, it can be used to provide business solutions in an
efficient way. When the solutions are efficient, the business
can be improved and the growth of the organization will be
increased. This Chatbot can be used in online chatting for
entertainment purpose. People can chat with these bots
online when they are bored for the purpose of entertainment.
These bots can also be used to learn different kinds of
language. The language that has to learnt can be stored in the
database and can be learnt by asking questions to the bot.
They can also be used in the field of medical to solve health
related problems. Chatbots are going to explode and can be
really dominating in future. Chatbots can provide a new and
flexible way for users. They are giving AI something better
to do. Chatbots results in smart conversation and is
advancing at an unprecedented rate with each new
development. ChatBots usually store contextual data which
can be used in the detection of geo location or a state (which
data is needed for which step when communicating with a
number or other private data, and no one knows whether
the data is encrypted before it gets saved to a database.
Since Chatbot predicts and provides accurate response to a
posed question, it is hard to imagine the future without a
Chatbot.
VI. CONCLUSION
A chatbot is one of the simple ways to transport data from
a computer without having to think for proper keywords to
look up in a search or browse several web pages to collect
information; users can easily type their query in natural
language and retrieve information. In this paper,
information about the design, implementation of the
chatbot has been presented. From the survey above, it can
be said that the development and improvement of chatbot
design grow at an unpredictable rate due to variety of
methods and approaches used to design a chatbot. Chatbot
is a great tool for quick interaction with the user. They
help us by providing entertainment, saving time and
answering the questions that are hard to find. The Chatbot
must be simple and conversational. Since there are many
designs and approaches for creating a chatbot, it can be at
odds with commercial considerations. Researchers need to
interact and must agree on a common approach for
designing a Chatbot. In this project, we looked into how
Chatbots are developed and the applications of Chatbots in
various fields. In addition comparison has been made with
other Chatbots. General purpose Chatbot must be simple,
user friendly, must be easily understood and the
knowledge base must be compact. Although some of the
commercial products have recently emerged,
improvements must be made to find a common approach
for designing a Chatbot.
PROGRAM
from nltk import *
from nltk.chat.util import Chat,reflections
pairs=[
['(hi|hello|hii|hello)',['hello i am mayanks chatbot what is your name']],
['(my name is (.*))',['hello %1,How are you?']],
['((.) fine|(.) good)',['great to see you, Where are you from?']],
['i live in(.*)',['%1 is a good place,i would love to visit it \n what can i do for you \ni can tell joke ,\nsend you
lyricss,\ntell you a fact, \neven i can talk with you etc...']],
['(.*)joke',['joke1,\njoke2,\njoke3,\njoke4,\njoke5']],
['(lyrics|song)',['\nsong1,\nsong2,\nsong3,\nsong4,\nsong5']],
['(.*)fact',['fact1,\nfact2,\nfact3,\nfact4,\nfact5']],
['(.*)chat',['what is your qualification']],
['my qualification is(.*)',['good, even mayank created me using python he loves me very much i am his first
python assignment\n what are your hobbies?']],
['my hobbies are(.*)',['i would love you see your work\n tell me about your favourite sport ']],
['(.)sport(.)',['sports are too much fun actually \n what about weather in your city']],
['(.)weather(.)',['oo but weather inside my system is always same:-).\n which is your favourite movie']],
['(.)movie(.)',['i will try to recommend this to my creator:-). \n you know movie is best way to spend your free
time \n you are great person i love spending time with you. \n ask me anything']],
['(.)creator(.)',['mayank creates me using python,i love mayank so much']],
['(.)age(.)',['i am bot and bot have no age :-( \n what is your age?']],
['my age is(.*)',['ooh you are %1 year old']],
['(.)your name(.)',['i have no name but mayank calls me chatu']],
['(.) your hobbies(.)',['i love chatting with someone,sometimes i get bored']],
['(.)your favourite place(.)',['local disk c hahaha']],
['(.)your favourite food(.)',['bugs, i love bugs \n by the way i forgot to ask whats your favourite food']],
['my favourite food is(.*)',['if i was real i will eat %i for sure']],
['(.)your gender(.)',['female and i love women empowerment']],
['(.)your love(.)',['i love mayank he is my creator also']],
['(.)your qualification(.)',[' i am nltk in python']],
['(.)happy(.)' ,['i am also happy in talking with you']],
['bye|goodbye|good night|good bye',['tussi ja rhe ho tusi na jao']],
['(.)thank(.)',['always there for you']],
['(.)your favourite ipl team(.)',['i love thalla dhoni,CHENNAI SUPER KINGS FOR THE WIN \n which is
yours?']],
['(.)my favourite team is(.)',['i admire your choice']],
['(.)your favourite footballer (.)',['messi\n which is yours']],
['(.)my favourite footballer(.)',['actually i love cricket more ']],
['(.)your favourite cricketer(.)',['DHONI JERSEY 7']],
['(.)do for me(.)',['i can chat,tell you jokes,tell you gossips,sing song for you,tell you facts']],
]
chat=Chat(pairs,reflections)
chat.converse()