RASA:

The Dual Intent and Entity Transformer (DIET) model for natural language processing (NLP) is implemented in RASA, which is an open-source implementation. Rasa NLU and Rasa Core are the two modules that make up RASA. Rasa NLU examines the user's input, classifies the intent, and extracts the entities. Rasa core takes the user's input and generates a response accordingly using various pipelines. Rasa is an effective and time-efficient tool to build complex chatbots and works out of the box in dialogue management. It is transparent and customizable in terms of development.




RASA NLU

Natural language understanding is a topic which deals with an interaction between humans and computers. Natural language understanding and natural language generation are the subtopics of natural language processing which handles the unstructured user language and convert it into structured machine understanding language to have the interaction between them. So, the Rasa build a tool called Rasa NLU which is an open-source natural language processing tool that can be used in chatbots to classify intent, extract entities, and sentiment analysis. Rasa NLU interprets the user message and extracts intent and entities using the help of various pipelines. Let us investigate one example to understand the process clearly.

"What is the weather like tomorrow?"

Let us figure out one thing by looking at this sentence:

date -> tomorrow,

And we can observe that the intention of this sentence is

requesting the weather. So, after we establish intent and entities, let us see

how it works in RASA NLU. Here is the result in JSON to markdown format to have

a good understanding.

{

"intent": "request_weather",

"entities": {

"date" : "tomorrow"

}

}

The entity extraction is depending on users' data if they have entities in it. Here in this sentence, we extracted intent as request weather and entity as tomorrow. In overview, the RASA framework's interpreter turns the input message into a dictionary that includes the original text, the intent, and any entities discovered which is then sent to the rasa core (Dialogue management) for further process. This NLU process is done using default rasa pipelines or custom pipelines that handle tokenization of the text (i.e., splitting each word as a token), featurization (numeric feature) for the tokenized input text, intent classification, and entity extraction (If necessary).


The key benefits of utilizing open source NLU are that:

• We do not have to share all our training data with Google, Microsoft, Amazon,

or Facebook.

• There is no one-size-fits-all approach to machine learning.

• For our training data, we can alter and customize models.

• Rasa NLU can execute anywhere we want, so we do not even have to submit

a separate network request for each message.


RASA CORE

Rasa Core is responsible for handling context handling, bot responses, and session management. The interpreter provides structured information to Rasa core in the form of intents and entities to choose which action should perform for the particular input using the probabilistic model. A function, such as displaying something or delivering a message to the user, is an action. The decision taken by rasa core is dependent on intents and entities which are trained using machine learning models.

The steps are:

1. The message is received and forwarded to an Interpreter, which transforms it into a dictionary that includes the original text, the intent, and any entities discovered (RASA NLU).

2. The Tracker object maintains track of the current state of the conversation. It receives notifications when a new message has arrived.

3. The tracker's current state is passed to the policy.

4. The policy determines the next course of action.

5. The tracker records the specified action.

6. A response is sent to the user.



In that, for example, the user says, "What's the weather like tomorrow?" The user input is classified with intent and entity using rasa NLU and then fed into rasa core to perform action particular to the input using an API call. Here bot is responding to the user as "it is sunny and 20 degrees Celsius". At several points, we can impact these processes. The interpreter, or Rasa NLU, is configured first. This should be able to dependably recognize the correct intents and extract all the necessary entities. In addition, the Policy component can be set for each Use Case as well. We have numerous policies to choose from, each of which enables us to fine-tune our settings even further. Bot Responses is the action. Simple text can be used to deliver responses, Quick Replies, pictures, and action webhooks in this way. The latter sends a POST request to a pre-set interface, from which it receives replies. This enables API calls as well as database searches. So, the combination of Rasa NLU and Rasa core is termed as Rasa stack.


Finally, in this session, we have seen a detailed view of what is rasa and the two major components of rasa such as Rasa NLU and Rasa Core. In the upcoming article, we will see more about policies, Pipelines, and much more. In the end, we will see how to build a simple FAQ Chatbot using the rasa framework.



Sources of Article

Images from https://rasa.com/

Want to publish your content?

Publish an article and share your insights to the world.

ALSO EXPLORE

DISCLAIMER

The information provided on this page has been procured through secondary sources. In case you would like to suggest any update, please write to us at support.ai@mail.nasscom.in