Difference between Rasa core and Rasa nlu
Rasa core is used to guide the flow of conversation while Rasa nlu is to understand and process the text to extract information (entities)
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.
Could you please help me to understand in a better way.
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.
A very layman description for starters: Rasa NLU: Its the interpreter which understands the input. Basically 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.
eg: 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.
PS*: The reply back would be a greeting if you train your bot for it or it might be anything else as well.
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.