A Guide to Rasa and Rasa X
Send me Nitor Infotech's Monthly Blog Newsletter!
×
Software Product Engineering Services Company
  • Company
    • About
    • Leadership
    • Partnership
  • Resource Hub
  • Blog
  • Contact
Software Product Engineering Services Company
Add more content here...
Artificial intelligence Big Data Blockchain and IoT
Business Intelligence Cloud and DevOps Digital Transformation
Healthcare IT Manufacturing Mobility
Product Modernization Software Engineering Thought Leadership
Aastha Sinha Abhijeet Shah Abhishek Suranglikar
Abhishek Tanwade Ajinkya Pathak Amol Jadhav
Ankita Kulkarni Antara Datta Anup Manekar
Chandra Gosetty Chandrakiran Parkar Dr. Girish Shinde
Gaurav Rathod Harshali Chandgadkar Madhavi Pawar
Mohit Agarwal Mohit Borse Nalini Vijayraghavan
Neha Garg Omkar Ingawale Omkar Kulkarni
Pranit Gangurde Priya Patole Ravi Agrawal
Robin Pandita Rohini Wwagh Sachin Saini
Sadhana Sharma Sambid Pradhan Sanjeev Fadnavis
Shailesh Banaeet Shardul Gurjar Shravani Dhavale
Shubham Hedau Shubham Kamble Shubham Muneshwar
Sidhant Naveria Sujay Hamane Tejbahadur Singh
Tushar Sangore Vasishtha Ingale Veena Metri
Vidisha Chirmulay
Artificial intelligence | 15 Apr 2022 |   11 min

A Guide to Rasa and Rasa X

I hope you read and enjoyed my previous blog titled ‘Introduction to Rasa X’ since it is a precursor to this one. In case you haven’t, you can read it here.

In this blog, I am going to lead you through the installation, folder structure, controls, and features of Rasa as well as Rasa X to develop an assistant.

Let’s first dive into installing Rasa.

Installation of Rasa

To install Rasa, you require Python 3.7 or Python 3.8. Firstly, you need to create and activate a new virtual environment by giving this command:

C:\> python3 -m venv ./rasaenv

Activate it with: C:\> .\rasaenv\Scripts\activate

Once the installation is done, generate a folder structure for the Rasa project by typing rasa init in command prompt.

After initializing the structure, a developer can start customizing the basic chatbot that is included in the initialized folder.

Training Data in Different Files of Rasa Folder

1. NLU File: Intent is a class for a given set of examples which helps the assistant identify the user query. These examples are specified in the nlu.yml file. For example, if a user wants to stop a conversation, then you can define the examples as follows.

2. Domain file: The file domain.yml includes the following things:

  1. Entities and slots: These are examples like City, Size of Pizza, Email Addresses, etc.
  2. Form: This includes a structure to fill information automatically from user input
  3. Responses: Here all the possible responses are defined, and a name is given to each one of them. Responses are named starting with utter for e.g. If a response is ‘order’, then conventionally it is written as utter_order.

3. Stories file: This file includes all the conversational flows designed and developed by a developer which helps the chatbot to make decisions in accordance with the stories. Stories are some ideal paths which illustrate the flow of the conversation can be. By gaining expertise in writing these stories, you can improve the performance of an assistant.

4. Rules file: The rules.yml file has rules for a specific conversation. For example, if a user wants something which is out of scope for the bot to answer, then any rule can handle the situation. Once the training data is updated, you must train the model on top of it which is saved in the folder.

The following image shows the folder structure of a Rasa chatbot. Every time the training is done, the new model is saved so all the past models can also be utilized.

Now it’s time to explore the second tool in our arsenal – Rasa X!

Installation of Rasa X

For Rasa X installation in Windows OS, we need to first install the Microsoft Visual C++ compiler. After that, we can go to the command prompt, activate the virtual environment created while installing Rasa and type the following command:

To check whether it has been installed correctly or not, navigate to the chatbot folder, open the command prompt and type rasa x. It will open a window in your default browser with GUI.

Features of Rasa X

1. Easy writing of training data:

Instead of writing the training examples in a code editor or IDE, you can directly specify your data using GUI. In the above example, we defined the book_flight intent and gave an example of what a user can say. You can add as many examples as you want and save them.

2. Interactive learning:

Interactive learning involves looking into what the intent was (identified by the bot) and then correcting it and manually guiding the bot to give responses. This way the bot creates automatic stories and can train itself further.

3. Records all previous conversations:

To analyze earlier conversations and their flow and performance, Rasa X stores all conversations. In a live deployment monitoring user response and accordingly making changes in the training stories is a crucial step to have a successful chatbot in place.

4. Visualizes what’s going on in backend:

The above image shows the Rasa X chatbot in the image. When the user said ‘Hello’, you can see that the bot identified the user intent as ‘greet’ which can be seen through this beautiful UI. Also, the next intent is to book a flight and then at the end you can see that a form is initialized to ask the user about the city from which he wants to book a flight and so on.

5. Slots identification:

In the above example, once the user has confirmed that he wants to book a flight and the form has started to fill, the assistant asks about the departing city and automatically extracts the city from user input text with a confidence of (1.0) which means 100 percent sure.

6. Buttons:

In the above image, you can see that once the user gives all the details about cities that he wants to depart and land at, the assistant gives a query in backend and communicates the dates available and shows the buttons of available dates and asks the user to select a suitable date which makes the conversation very easy. In case the user is not interested in these dates, then the bot can identify it and will recommend some new flights or just close the conversation as per the story.

7. Actions:

actions.py is a Python file which handles connection with external sources like database, csv file or API. It tracks the slots and can read or write to files in accordance.

All the actions are defined as a class in the file. The above code snippet is an example of saving all the slot information in a csv file once the conversation is done.

I hope that after reading this blog, you are quite familiar with the controls and features of Rasa and Rasa X, and a sample as well. Now once you have understood the structure, you can develop and customize a chatbot according to your use case.

Do read this case study about how we came up with an AI-based chatbot solution to efficiently log, track, and monitor compliance requests for a leading European business management solutions company.

Feel free to get in touch with us at Nitor Infotech if you’d like to share your experience and suggestions. You can also discover more about how artificial intelligence and machine learning can make a real difference for your products, solutions, and services here.

Related Topics

Artificial intelligence   Big Data   Blockchain and IoT   Business Intelligence   Cloud and DevOps   Digital Transformation   Healthcare IT   Manufacturing   Mobility   Product Modernization   Software Engineering   Thought Leadership  
<< Previous Blog Next Blog >>

Vasishtha Ingale

Trainee Software Engineer

Vasishtha is a Trainee Software Engineer at Nitor Infotech. He has a keen interest in assimilating statistical approaches for Data Science. He is passionate about Python programming. He has worked mainly in domains like NLP, Data Analysis, Machine Learning modelling, Model Explainability, and Object Detection and has hands-on experience in libraries like Scikit Learn and MLlib. He likes to explore Machine Learning modelling. Experienced in handling data related to BFSI, healthcare and investment portfolios, he has a deep understanding of core concepts behind any open-source conversational AI platform and likes to derive compelling use cases for different industries. Apart from work, he is interested in human psychology, history as well as different ethnic cultures and their lifestyles.

   

You may also like

AWS Machine Learning: Part 1

Machine learning has grown to be quite the popular trendsetter in recent years for different organizations. Hence, it is unsurprising to see major cloud companies coming up with custom cloud sol...
Read Blog


The Three Cornerstones of Enterprise Transformation

Heightened customer expectations and the need to survive in volatile markets have set businesses on a quest to become more agile, resilient, and relevant. To achieve these goals, it is crucial for ...
Read Blog


Insights on Diving into Data Analytics

As I begin writing this blog, I am pulled down memory lane where these famous lines from the poem ‘The Rime of the Ancient Mariner’ penned by Coleridge echo: ‘Water, water everywhere but not a d...
Read Blog


Subscribe to Our Blog

Services

    Modern Software Engineering


  • Idea to MVP
  • Quality Engineering
  • Product Engineering
  • Product Modernization
  • Reliability Engineering
  • Product Maintenance

    Enterprise Solution Engineering


  • Idea to MVP
  • Strategy & Consulting
  • Enterprise Architecture & Digital Platforms
  • Solution Engineering
  • Enterprise Cognition Engineering

    Digital Experience Engineering


  • UX Engineering
  • Content Engineering
  • Peer Product Management
  • RaaS
  • Mobility Engineering

    Technology Engineering


  • Cloud Engineering
  • Cognitive Engineering
  • Blockchain Engineering
  • Data Engineering
  • IoT Engineering

    Industries


  • Healthcare
  • Retail
  • Manufacturing
  • BFSI

    Company


  • About
  • Leadership
  • Partnership
  • Contact Us

    Resource Hub


  • White papers
  • Brochures
  • Case studies
  • Datasheet

    Explore More


  • Blog
  • Career
  • Events
  • Press Releases

About


With more than 15 years of experience in handling multiple technology projects across industries, Nitor Infotech has gained strong expertise in areas of technology consulting, solutioning, and product engineering. With a team of 700+ technology experts, we help leading ISVs and Enterprises with modern-day products and top-notch services through our tech-driven approach. Digitization being our key strategy, we digitally assess their operational capabilities in order to achieve our customer's end- goals.

Get in Touch


  • +1 (224) 265-7110
  • marketing@nitorinfotech.com

We are Social 24/7


© 2022 Nitor Infotech All rights reserved

  • Terms of Usage
  • Privacy Policy
  • Cookie Policy
x
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Accept Cookie policy