A chatbot is an artificial intelligence (AI) software that can simulate a conversation (or a chat) with a user in natural language through messaging applications, websites, mobile apps or through the telephone. This software is used to do duties such as replying swiftly to users, informing them, assisting with product purchases, and delivering better customer support. Business groups are increasingly using chatbots because they may minimize customer support costs and handle several consumers at once. However, in order to complete various jobs, chatbots must be as efficient as possible. In this project, we provide the architecture of a chatbot, which provides a human like and accurate response for any questions raised by users using Natural Language ToolKit(NLTK) and PyTorch with python language.
Introduction
I. INTRODUCTION
A chatbot is a computer program that communicates with humans. A chatbot is essentially a computer program that mimics human communication.
An artificial neural network inspired by the neural nodes of the human brain ,powers a chatbot that uses AI and machine learning. Chatbots are computer programs that can readily mimic human discussions. IBM , for example, provides a machine learning chatbot that allows businesses to communicate with their customers through the IBM Watson Assistant API. Chatbots got overly popular in 2016.
As a result of the implications, 2016 has been called "the year of chatbots." Chatbots are the major focus of the software sector. Thousands of chatbots are created by startups and deployed by businesses to improve their customer service. As a result, it was the right time to consider chatbots as a new communication tool. Various businesses are already adopting chatbots to swiftly and efficiently respond to frequently asked queries from their clients.
NLTK and PyTorch are used in this chatbot creation. NLTK is a toolkit designed to work with NLP on Python. It provides us with various word processing libraries with many test datasets. PyTorch is a machine learning (ML) open source framework based on the Python programming language and the Torch library primarily used in natural language processing. This application is built with Flask, Visual Studio code, and JSON data are utilized to form the PyTorch model.
II. LITERATURE SURVEY
A. An e-business chatbot using AIML and LSA:
Author: N. Thomas
In this paper, he emphasized on using LSA for giving accurate responses to the users avoiding random non accurate responses.
B. A Web-based Platform for Collection of Human Chatbot Interactions
Author: Lue Lin, Luis Fdo. D’Haro, and Rafael Banchs
The paper presents a chatbot design which is a work on the web-based framework. Lue Line, Luis Fernando D’Haro and Rafael E. Banchs in HAI 2016 proposed the Web Chat which was a crowd-sourced initiative that could collect and annotate human chatbot interactions.
C. Development of Intelligent Telegram Chatbot Using Natural Language Processing
The motive of this paper is to create an human like chat bot with the help of natural language processing and Telegram API. First, text processing using Telegram API on Python was developed.
III. NLTK
Natural Language Processing (NLP) is a process of manipulating or understanding the text or speech by any software or machine. An analogy is that humans interact and understand each other’s views and respond with the appropriate answer. In NLP, this interaction, understanding, and response are made by a computer instead of a human.
The area of study that emphasizes interactions between human language and computers is referred to as natural language processing, or NLP for short. It is in the point where information, AI and language are mixed up together. The NLP enables computers to intelligently and usefully analyze, and interpret human language. Developers collaborate and built knowledge to perform tasks such as automatic synthesis, translation, recognition of named entities, extraction of relationships, analysis of feelings, speaking recognition and segmentation of subjects.
IV. System Design
The process of establishing the architecture, components, modules, interfaces, and data for a particular system in order to meet defined requirements is known as systems design. The application of various systems theories to product development is known as systems design. A chatbot is a computer software that uses patterns to replicate human-to-human communication, particularly over the internet. They are our online assistants who provide a variety of services via internet chat.
A. Chatbot’s Working Process
Pattern Matching:Robots classify the text using appropriate templates and respond appropriately to customers. The "Artificial Intelligence Markup Language" is a standardized format for these models (AIML). All entries are matched to a pattern by the bot..
Natural Language Understanding (NLU):Entities, intents, and context are three ideas used by NLU Chatbots. The original user conversation is not stored when an NLU algorithm analyzes an input. An NLU Chatbot forgets the query asked by the user after providing an answer. Instead, it groups conversational elements into contexts that are then linked to intents.
Natural Language Processing (NLP):NLP is a method used by computers to intelligently analyse, comprehend and deduce the meaning of human language. Developers can use NLP to learn how to do things like machine synthesis, translation, relationship retrieval, emotion analysis, and speech recognition.
V. PROPOSED SYSTEM
In this paper, we aimed at developing an intuitive chatbot with help of the Flask API and the process flow of the system is shown in Fig-5.1. User inquiries are first taken care of by NLTK check, to check whether the entered inquiry is present as a pattern in intents.JSON file or not.
.
This paper consists of the following steps:
Text Pre-processing:The fact that text data is in string format is a huge concern. To complete the task, machine learning algorithms require a numerical vector. As a result, text pre-processing is required. It includes all text conversion to uppercase or lowercase. This is done to ensure that the algorithm does not identify anomalous behavior and treats the same words differently in different capitalizations.
Tokenization:The NLP filters a set of words in the form of tokens. It refers to the process of transforming ordinary text strings into a list of tokens, or the words we actually want. Sentence tokenizer and Word tokenizer can be used to find a list of sentences and words in strings, respectively.
Stemming:It is the process of reduction of resultant words to their basic or root form. For instance, “Reduction”, “Reducing”, “Reduced” can be stemmed to just “Reduce”.
Lemmatization:Lemmas, on the other hand, are real words. Some terms have different spellings yet are connected to one another. Consider the words "excellent," "better," and "best," which are all part of the same category or lemma. They do not, however, share similar spellings.
Bag of Words:After the initial preprocessing phase, we need to transform text into a meaningful vector (or array) of numbers. Collection of words that are repeatedly occurring within a document is called as bag-of-words. It involves two things:
a. A vocabulary of known words.
b. A measure of the presence of known words.
The Bag of Words is based on the idea that texts with similar content are similar. We can also learn something about the document's significance just by looking at it.
For example, if our dictionary contains the words {Learning, makes, the, man, great}, and we want to vectorize the text “Learning makes great”, we would have the following vector: (1, 1, 0, 0, 1).
A. PyTorch Model
Here we will be making a class to implement our custom neural network. It will be a feed forward neural Network which will have 3 Linear Layers and we will be using activation function “ReLU”.
B. Feed Forward Neural Network
A neuronal feedforward network is an artificial neuronal network in which the connections between the nodes do not form a cycle.
The feedforward neural network was the first and most straightforward type of artificial neural network designed in this network, the information moves in a single direction — forward — from the input nodes, through the hidden nodes (if any) and towards the output nodes. The network does not have cycles or loops.
C. Activation Function
An activation function is a function used in artificial neural networks that generates a small value for small entries, and a higher value if its entries exceed a threshold. In other words, an activation function is like a door that checks that an input value is superior to a critical number.
D. ReLU Function
There are a number of activation features commonly used in deep learning today. One of the most straightforward is the rectified linear unit, or ReLU function. which is a linear function at the part which produces zero if its input is negative, and which directly produces the input otherwise:
f(x)=max(x,0)
Figure V-3:Graph of the ReLU function, showing its flat gradient for negative x
Accessing Chat-bot: - Library files included while coding the GUI are: HTML, CSS, JSON.
VI. IMPLEMENTATION
This section covers the design and implementation of a different module of the bot, which contains the design of the PYTHON module, the website integration using FLASK and JS and the PyTorch model for training.
Conclusion
In this project, we have introduced a chatbot that is able to interact with users. This chatbot may respond to questions submitted as text. This was accomplished using NLTK and PyTorch model. The chatbot can only respond to inquiries for which it has answer in dataset. To expand the chatbot\'s expertise, we can use APIs from Wikipedia, the Weather Forecasting Department, Sports, News, Government, and many more sources. Currently, we have implemented this chatbot in our college website for ease of use of users to find the required information.
References
[1] T. S. Gunawan, A. B. Falelmula Babiker, N. Ismail and M. R. Effendi, \"Development of Intelligent Telegram Chatbot Using Natural Language Processing,\" 2021 7th International Conference on Wireless and Telematics (ICWT), 2021, pp. 1-5, doi: 10.1109/ICWT52862.2021.9678471.
[2] Kar Rohan and Haldar Rishin 2016 Applying Chatbots to the Internet of Things: Opportunities and Architectural Elements International Journal of Advanced Computer Science and Applications 7 147-154
[3] Kang Minjeong 2018 A Study of Chatbot Personality based on the Purposes of Chatbot The Journal of the Korea Contents Association 18 319-329
[4] Ouerhani, N., Maalel, A. & Ben Ghézela, H. SPeCECA: a smart pervasive chatbot for emergency case assistance based on cloud computing. Cluster Comput 23, 2471–2482 (2020).
[5] G. K. Vamsi, A. Rasool and G. Hajela, \"Chatbot: A Deep Neural Network Based Human to Machine Conversation Model,\" 2020 11th International Conference on Computing, Communication and Networking Technologies (ICCCNT), 2020, pp. 1-7, doi: 10.1109/ICCCNT49239.2020.9225395.
[6] H. K. K., A. K. Palakurthi, V. Putnala and A. Kumar K., \"Smart College Chatbot using ML and Python,\" 2020 International Conference on System, Computation, Automation and Networking (ICSCAN), 2020, pp. 1-5, doi: 10.1109/ICSCAN49426.2020.9262426.
[7] B. Kohli, T. Choudhury, S. Sharma and P. Kumar, \"A Platform for Human-Chatbot Interaction Using Python,\" 2018 Second International Conference on Green Computing and Internet of Things (ICGCIoT), 2018, pp. 439-444, doi: 10.1109/ICGCIoT.2018.8753031
[8] Abu Shawar, BA and Atwell, “A chat-bot system as a tool to animate a corpus” , ICAME Journal: International Computer Archive of Modern and Medieval English Journal , October 2005, 29. 5 - 24. ISSN 0801-5775.
[9] Kumar, M Naveen, PC Linga Chandar, A Venkatesh Prasad, and K Sumangali (2016). “Android based educational Chatbot for visually impaired people”. In: International Conference on Computational Intelligence and Computing Research (ICCIC), 2016 IEEE. IEEE, pp. 1–4
[10] N. Thomas, “An e-business chatbot using aiml and lsa,” in Advances in Computing, Communications and Informatics (ICACCI), 2016 International Conference on. IEEE, 2016, pp. 2740–2742.
[11] S. Nithuna and C. A. Laseena, \"Review on Implementation Techniques of Chatbot,\" 2020 International Conference on Communication and Signal Processing (ICCSP), 2020, pp. 0157-0161, doi: 10.1109/ICCSP48568.2020.9182168.
[12] E. Handoyo, M. Arfan, Y. A. A. Soetrisno, M. Somantri, A. Sofwan and E. W. Sinuraya, \"Ticketing Chatbot Service using Serverless NLP Technology,\" 2018 5th International Conference on Information Technology, Computer, and Electrical Engineering (ICITACEE), 2018, pp. 325-330, doi: 10.1109/ICITACEE.2018.8576921.
[13] S. Das and E. Kumar, \"Determining Accuracy of Chatbot by applying Algorithm Design and Defined process,\" 2018 4th International Conference on Computing Communication and Automation (ICCCA), 2018, pp. 1-6, doi: 10.1109/CCAA.2018.8777715.