RASA Chatbot Using AI

: The growth of technologies like Artificial Intelligence (AI), Big Data & Internet of Things (IoT), etc. has marked many advancements in the technological world since the last decade. These technologies have a wide range of applications. One such application is “Chatterbot or “Chatbot”. Chatbots are conversational AIs, which mimics the human while conversing & eliminates the need of human by automating mundane tasks. In the study undertaken, we have created a chatbot in education domain & it is named as “College Enquiry Chatbot”, This chatbot is a web-based application that analyses and understands user's queries and provides an instant and accurate response. Rasa technology is used to construct this chatbot. It's an open-source technology, which uses its two main packages i.e., Rasa Core & Rasa Natural Language Understanding (NLU) in order to build a Contextual AI Chatbot. NLU is used to infer the intent and to extract the necessary entities from user input & the Rasa Core provides the output by building a probabilistic model with the help of Recurrent Neural Network (RNN). Evaluation of the model is done by getting a confusion matrix and performance measures like Precision, Accuracy & F1 Score which come out to be 0.628, 0.725 and 0.669 respectively on average basis. This chatbot's accuracy, lack of dependability on human resources, 24 x 7 accessibility and low maintenance creates various opportunities for its implementation. This conversational agent can not only be used in educational institutions but also in places where enquiry becomes a tedious task


I. INTRODUCTION
These days, we see the talk bots wherever Chatbots are the wellspring of answers to the client's inquiries in a specific space where it is working.Visit bots are the wellspring of answers to the client's inquiries.The requirement for school request framework emerges because of different reasons which include: the moderate idea of school site, an outcast would not realize where to look for a specific snippet of data, hard for the individual external school's area to remove data.The school enquiry framework will give the reaction by summing up the question and afterward yield answers, it additionally gives particular data what the client needs.Rasa is an open-source system for building AI bots which comprise of two parts: Rasa NLU and Rasa center.Rasa center is the segment which handles the exchange motor for the system and helps in making more unpredictable chatbots with customization.Rasa's NLU assists the engineers with the innovation and the apparatuses essential for catching and understanding client input, deciding the purpose and substances.

Contribution
In this paper, we proposed the method in which we can get the answer to the query given by the student .The algorithm presented here is extended by previous works by [1],[2],[3].Our contribution works, compared to previous work can be summarized as: In our system we will compare the query in our database and then give the output to the user.

Structure
This paper is organized as follows: Section 2 presents Related Work.Section 3 summarizes our Proposed Work which consists of our base algorithm which presented in [1],[2],[3].We will evaluate our methods & compare with existing work in Section 3 Results.Finally, in Section 4 we conclude and present suggestion for future work.

II. RECENT WORK
Chatbots are software that behaves like human answering the question which are asked, Now a days , development in this field going to scale up , now chatbots not only answer simple questions but can perform complex task like fetching the results from api, booking tickets and various management tasks.For the development of a chatbot, it requires a team of many experts but to overcome the scarcity of time and resources, re-use of open source software is done.
In this paper[1], Bocklisch, T et al introduced the rasa NLU and core for the first time with open source license.The aim of this study was to provide a dialogue system based on machine learning and understanding the language to the enthusiast whoare no such expert in technology.The package[2] they developed was of minimal size and advancement is done in the package.With the efforts of 344 contributers , 244 releases of rasa have been released with total of 18023 commits.In his work [3], Lacerda used the core of rasa and presented a new software stack called as Rasa-ptbr-boilerplate for the non specialist who doesn't much about the internals of the chatbot , considering the chatbot as blackbox.Now, chatbots are intelligent systems which can perform complex task and has many application in robotics and natural language processing.In the recent time, there is development in the field of artificial intelligence, so the chatbots are acting as customer service agents.In this study [4], Jiao designed a functional framework which implements the principle of RASA NLU and further more he integrated the RASA NLU with the neural network methods resulting into an entity extraction system and later on recognizes the intents and related entities.This study showed that Neural network outperforms in with RASA NLU.
In the study[5], rasa chatbot is compared with Microsoft Bot, RASA, and Google Dialogflow and the various performance metrics have been tested, the extensibility and open source license makes RASA more versatile than other enterprise softwares.
This paper examines [6],the available technologies and implemented the use case prototype to give up insight that chatbot can be used with social networks so that smart chat system can be employed.In the study[7], a social chatbot for the football has been designed which answer the questions to the Spanish football league.Chatbot is deployed with slack client, having text based interaction.It extracts the information about football players, team and their trainers.

III. METHODOLOGY
Here, we will be seeing the mathematical model , System Architecture and the data flow of the project.

Mathematical Model
Module 1: Bag of words BoW is basically the way of extracting the characteristics/features from text so that it can be used in building models for example machine learning algorithm.The approach is very easy and flexible.BoW is a representation of words which includes two main things, document of known words and frequency of known words.The BoW can be simple or complex, the complexity comes in how we handle both creating the vocabulary of known words andoccurrence of known words.Which has three important steps first collecting the data, seconddesigning the vocabulary and the last step is creating the document vector.
Step 1: Collecting the data: It can be any data given by the user, we can treat each and every line as different document.
Step 2: Designing the vocabulary: Here we can collect the list of all the unique words ignoring case sensitive and punctuation and put that into the model vocabulary.
Step 3: Creating the document vector Here we check the frequency of words in each document and the main goal of this step is to turn each word in the document into the vector form so that it can be easily used as an input to the other machine learning algorithms.The easiest way of scoring is to mark the presence of words as a Boolean value, 0 for absent and 1for present and then convert it into a binary vector.IV.FLOWCHART 1.The message from the end user is fed to the Rasa NLU (Interpreter) whose output is structured output containing the original text, the intent and entities if any, shown in Fig. 2. The tracker maintains the conversation state and receives the structured output from interpreter.3. The output from tracker fed to the Policy, which acts on the current state of tracker.4. The policy decides which appropriate next action is to be performed.5.The log of selected action is maintained by tracker.6.The appropriate response is provided to the user, using intents defined in nlu.md, like utter_response The first step is to split an utterance into smaller chunks of text, known as tokens.This must happen before text is featurized for machine learning, which is why you'll usually have a tokenizer listed first at the start of a pipeline.
Step 3: Intent Classifiers: Once we've generated features for all of the tokens and for the entire sentence, we can pass it to an intent classification model.We recommend using Rasa's DIET model which can handle both intent classification as well as entity extraction.It is also able to learn from both the token-as well as sentence features.
Step 4: Entity Extraction: Even though DIET is capable of learning how to detect entities, we don't necessarily recommend using it for every type of entity out there.For example, entities that follow a structured pattern, like phone numbers, don't really need an algorithm to detect them.You can just handle it with a RegexEntityExtractor instead  From the study it is concluded that rasa core features like slots, forms, supervised interactive learning, api integration, and database makes it a complete framework that can be used to perform highly complex tasks.The chatbot based on rasa has more capabilities than any open source alternative.Further, in this paper, internals of rasa has been modified to carry out custom data logging of client ip and port.All internals and custom action has been studied which further states that rasa is a complete open source framework for the development of chatbots and for the developers who don't want to dig into the internals of natural language processing.
The future scope of this study, voice and face recognition engines can be integrated for more complex task like ATM cash withdrawal.Performance may be enhanced with use of various learning procedures of machine learning.Chatbots are turning into a basic piece of the computerized world.

Figure
Figure 3: Rasa architecture flow chart

Figure
Figure 5: API Communication Procedure