Difference between Rasa core and Rasa nlu
Asked Answered
C

5

32

I tried to understand the difference between Rasa core and Rasa NLU from the official documentation, but I don't understand much. What I understood is that Rasa core is used to guide the flow of the conversation, while Rasa NLU is used to process the text to extract information (entities).

There are examples to build chatbots in Rasa core as well as Rasa NLU. I couldn't understand what the difference in the two approaches is and when to adopt one instead of the other approach.

Could you please help me to understand this better?

Camel answered 14/12, 2017 at 17:5 Comment(0)
H
34

You got it right. Both work together but they have distinct goals. In simple terms, Rasa Core handles the conversation flow, utterances, actions and Rasa NLU extract entities and intents.

About your second question:

The first example shows the entire workflow to create the bot, it shows how to setup the domain and the stories. Those are features from Rasa Core, not Rasa NLU. At item 2 on this example (called Define an interpreter) the author explicitly said he is making use of Rasa NLU as the interpreter (but you could be even using another entity extractor framework).

The second example (the Rasa NLU one) shows how to train the entity and intent extractor only. You don't have any information about domains and stories, no information about the conversational flow, it is a pure NLU example (even though he is using the default run method from Rasa Core to run the bot).

When I started studying Rasa was a bit hard to understand the concepts to develop the bots. But as you start coding it got clear. No matter which platforms you use, NLU will be handling entity and intents while the conversational flow will be something else.

It is even possible to use one library to handle the core of your bot and another one to handle NLU.

I would like to note that different from the most tools you can use to build the core of your bot, Rasa Core use machine learning to better generalize the dialogue flow. Instead of write code for each possible node on your conversation, you can use a dataset of possible conversational paths and train the core to generalize it. This is a very cool and powerful feature :)

Hope it helps.

Hematuria answered 14/12, 2017 at 17:59 Comment(3)
So if I want to create my own chatbot which works similar to LEX, Luis, and DialogFlow which one I have to choose?Odelia
@Odelia - You'll need both to build a full-fledged chatbot application since it requires both parts: understanding what user is trying to say (Rasa NLU - entity and intent extraction) and then taking an appropriate action on it according to contextual information of conversation (Rasa Core).Intonation
What I got from this Rasa NLU : responsible for Entity and Intent Extraction; basically parses the context of the chat message. Rasa Core: Integrates Entities + Respective Reply logics to create a Dialog System for the Chatbot.Unsure
M
5

A very layman description for starters: Rasa NLU is the interpreter which understands the input. Basically, it figures out entities and labels the intent.
Rasa Core does the rest of the work you want your bot to do, the flow of conversation being the most important thing.

For example, you say "Hello" to the bot. Rasa NLU will understand the input's intent as a greeting and Rasa Core will tell the bot to reply with a greeting.
The reply back would be a greeting if you train your bot for it or it might be anything else as well.

Miserable answered 5/3, 2019 at 8:12 Comment(0)
R
3

To explain in simple terms Rasa NLU uses NLP (Natural Language Processing) to understand what you tell the bot.

It understands what you say and matches it to some intent that you have defined.

Rasa Core on the other hand handles the conversation flow. The stories markdown file lists the intents and the actions for them.

Hence when the NLU gives the intent, the Core performs the action corresponding to it and the bot replies with that action.

Rockett answered 7/6, 2019 at 8:46 Comment(1)
The markdown file provided aides Rasa core to link the various possible entities and the respective, appropriate actions or replies to close the Dialog System Loop.Unsure
P
1

@trinca's answer is correct. I just rephrase a bit the points

Second thing, there are examples to build chatbot in Rasa core as well as Rasa nlu both can be used to build chatbot but couldn't understand what's the difference in two approaches and when to follow which one.

No, NLU/Core are not different approaches, rather, these are different components of a dialog manager engine.

  1. RASA NLU is a intent/entities classifier:

    You off-line trains the classifier with a number of examples sentences with attached relative intent (and entities) tags.

    Afterward, at run-time, you submit to the classifier an incoming sentence and you have back an intent tag and a list of possible entities related to the intent, as result of the classification.

  2. RASA Core is a (probabilistic) dialog manager:

    It decides/guess which is the next probable "state" (again just an intent) of the chatbot conversation. It's off-line trained with a RASA specialities: "stories". These are possible sequences of intents, following examples of conversation that developers submit in the train phase.

    Afterward, at run-time, RASA Core, when a user submit a sentence (so a corresponding intent guessed bu previous mentioned NLU component) it guess the "probable" next state of the conversation (an intent).

Notes:

IMMO you can't build a chatbot with just the NLU (an intent classifier) component proposed by many competitors as the "solution" to build bots), because with just the intents classifier (The NLU) you can manage just "stateless" dialogs (single turn volleys without any context of the conversation).

An the end of the day RASA is winner in comparison with other mentioned frameworks (these are often just channel gateways/intente classifiers) because the dialog manager component and the stories way to design/develop a conversation, without hardcoded rules (if/then).

Pindaric answered 30/4, 2020 at 15:38 Comment(0)
C
0

Rasa Core:

Rasa Core is the component in Rasa that handles dialogue management. Dialogue management is responsible for keeping a record of the conversation context and choosing the next actions accordingly.

Rasa NLU:

Rasa NLU is responsible for intent recognition and entity extraction.

Example

For example, if the user input is What's the weather like tomorrow in New York?, Rasa NLU needs to extract that the intent of the user is asking for weather, and the corresponding entity names and type, for example, the date is tomorrow, and the location is New York.

Charin answered 26/10, 2021 at 4:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.