What is RASA?
What is RASA?
Rasa is an open source machine learning framework for building AI assistants and chat bots.
Its incredibly powerful and used worldwide by developers to create amazing chat bots.
So Why RASA???

As you can see, there are many frameworks to develop chat bots in the market but RASA has several advantages over the others as given below ..
- Open Source:
Most of the above frameworks are closed systems whereas Rasa is an open source platform which means that developers can integrate features and functionalities as per their requirements. Rasa is also free to use.
2. Deploy everywhere:
After the creation of the chat bot, there comes the question of where to deploy the bot. Most of the above frameworks cannot be hosted in our favourite servers and are mostly on Premise but with RASA the problem is solved as we can deploy the bot on all platforms.
3. Connect with other messaging channels:
Generally there are teams for answering queries of customers on different normal messaging channels. After creating a chat bot using Rasa it may need to be launched on a new channel, but the advantage with Rasa is that it enables AI assistants to integrate seamlessly with other messaging channels such as Slack, Facebook messenger, telegram etc thus eliminating the need to have it’s own channel.
4. Not a state machine:
Rasa is not a state machine, it uses the conversations with real people as data for the chat bot and it will learn from these conversations.
5. Language Agnostic:
Most of the above frameworks make provision for a set of languages. With Rasa you can train the bot in any language of your choice.
6. Conversation-Driven Development:
Rasa has a very unique approach towards the continuous improvement of chat bots. They have a special tool called RASA X which is used to listen to the users and then use those insights to improve the assistant.
Getting started with RASA:
Initially I spent a couple of days learning about the framework .
Rasa Open Source:
The main components of RASA are:
1) Rasa NLU:
Rasa NLU is the tool which allows rasa to understand user messages in order to detect the Intents and Entities. All the users messages are given here.
2) Rasa Core:
This is the place where rasa predicts the dialogue as a reply based on the users message.It helps us with the contextual message flow.
Installing RASA and setting up the first project:
Rasa can be installed using the “pip install rasa” command.
After installing RASA , we can create a new project by running the “rasa init” command. This automatically creates a default bot for us with all the necessary files required.
The bot can be run with the “rasa shell” command.
Guess what, this bot returns the picture of a cute tiger whenever we say something sad. Exciting right!!!

RASA X:

Rasa X is a tool for conversation driven development (CDD) which uses the process of listening to users and using those insights to improve your AI assistant.
The pre-requisite to use Rasa X is a bot built on Rasa Open Source which is what we have discussed above.
With the help of Rasa X we can share our bot to testers. One really cool thing is that all of those conversations are recorded and we can go through and add them as stories to our bot.
Project:
So it was time to get working on the project.
The project I worked on was to create a chat bot so that new immigrants to Ontario, Canada can get to know about their workplace rights. Sounds cool right!!!
The chat bot was created using Rasa Open Source and Rasa X was used to share the bot with testers so that I can further improve my bot.
After the creation of the bot, comes the crucial deployment part. So I containerised my bot using Docker and deployed it in Heroku.
The front end for the bot (i.e chat UI) was created using HTML, CSS, Java script, Flask and it was deployed separately in Heroku. In order to access the bot , an api call was made from java script to the rasa back end.

Accelerate Chatbot development using RASA X?
Often it’s a great struggle for the developers to train the chatbot to answer a different set of questions and stories which is quite a laborious work. Even after this, there is no guarantee that there are no queries from the user to which the bot might struggle to respond to. There might be numerous tedious ways to overcome this, however, RASA X provides a very good means to expedite the development of the bot.

How Rasa X helps in achieving this?
Rasa X provides us with 2 ways of interacting with the assistant.
- Rasa X talk to your bot UI
- Rasa X share your bot link
Rasa X interactive bot UI

- The above UI is used to interact with the bot. It is really detailed as it shows the intents, entities, actions, slots that are present in the conversations.
- The stories can be corrected here, new training data can be added and saved.
- It also helps us in understanding the accuracy with which the responses are being given by the Bot.
Generating the Bot Link for local usage:

- The link to the Bot can be generated and sent to the real users in order to gain insights on how they are interacting with the chatbot.
- All the conversations that the testers or users have with the bot will be recorded.
- All of the entities, slots, actions, and intents are all hidden as the real user doesn't need any knowledge of that.
- The developer can then review all the conversations from the conversations tab in the Rasa X chatbot UI and save all the stories where conflicts occur and improve the bot.
Sharing your Assistant with ngrok for global usage:
What if you want to share the link to real users worldwide…
- The above link generated can only be run locally in our system. In order to share it with users worldwide, NGROK comes into the picture.
- ngrok is a cross-platform application that enables developers to expose a local development server to the Internet with minimal effort.
- Here we use ngrok to create a local port on our machine publicly available on the internet.
Run a ngrok instance for port 5005:
ngrok http 5005

Replace the https://<host>:<port> part of the share your bot link with the randomly generated URL displayed in the terminal window.
Ex replace with this part: https://772ed281.ngrok.io
Share this link with anyone across the world so that they can interact with the assistant.
Author - Atul
References - https://medium.com/
Comments
Post a Comment