SlideShare a Scribd company logo
A Guide to Rasa and Rasa X
Vasishtha Ingale
Software Engineer
Vasishtha is a Software Engineer at Nitor Infotech. He has a keen interest in
assimilating statistical approaches for Data Science. He is p... Read More
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:> .rasaenvScriptsactivate
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.

More Related Content

PDF
Developing Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in Paris
 
PPTX
[VFS 2019] Building chatbot with RASA
PPTX
Ai chatbot
PPTX
Building bots with rasa
PDF
Rasa Open Source - What's next?
PPTX
Build a chatbot using rasa
PDF
Why Rasa Chatbot - Ideas2IT
PDF
Designing Conversations: How I learned to stop worrying and embraced our new ...
Developing Intelligent Chatbots using RASA, OW2con'19, June 12-13, 2019 in Paris
 
[VFS 2019] Building chatbot with RASA
Ai chatbot
Building bots with rasa
Rasa Open Source - What's next?
Build a chatbot using rasa
Why Rasa Chatbot - Ideas2IT
Designing Conversations: How I learned to stop worrying and embraced our new ...

Similar to a guide to install rasa and rasa x | Nitor Infotech (20)

PDF
Scalable state of-the-art conversational AI
PDF
How to build an AI-powered chatbot.pdf
PDF
How to build an AI-powered chatbot.pdf
PDF
How to build an AI-powered chatbot.pdf
PDF
Mutation testing for DSLs - The case of task-oriented chatbots
PDF
Build Mandarin AI Conversational Agent with Rasa
PDF
Rasa Developer Summit - William Galindez Ariaz, Octesoft - Dial Rasa for Dinner
PDF
PDF
Mutation Testing for Task-Oriented Chatbots
PDF
Rasa Developer Summit - Josh Converse, Dynamic Offset - Three Part Harmony: H...
PDF
How AI can help you build better customer relationships?
PDF
End-to-End Natural Language Understanding Pipeline for Bangla Conversational ...
PDF
Webinar: How to Use Integrated Version Control in Rasa X
PPTX
The Software Challenges of Building Smart Chatbots - ICSE'21
PPTX
5 Level of AI Assistants from the Chatbot Conference
PDF
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
PDF
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
PDF
Ai = your data | Rasa Summit 2021
PDF
Lessons learned from building a commercial bot development platform
PDF
The rise of Chatbots and Virtual Assistants in Customer Experience
Scalable state of-the-art conversational AI
How to build an AI-powered chatbot.pdf
How to build an AI-powered chatbot.pdf
How to build an AI-powered chatbot.pdf
Mutation testing for DSLs - The case of task-oriented chatbots
Build Mandarin AI Conversational Agent with Rasa
Rasa Developer Summit - William Galindez Ariaz, Octesoft - Dial Rasa for Dinner
Mutation Testing for Task-Oriented Chatbots
Rasa Developer Summit - Josh Converse, Dynamic Offset - Three Part Harmony: H...
How AI can help you build better customer relationships?
End-to-End Natural Language Understanding Pipeline for Bangla Conversational ...
Webinar: How to Use Integrated Version Control in Rasa X
The Software Challenges of Building Smart Chatbots - ICSE'21
5 Level of AI Assistants from the Chatbot Conference
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Going beyond “Sorry, I didn’t get that”: building AI assistants that scale us...
Ai = your data | Rasa Summit 2021
Lessons learned from building a commercial bot development platform
The rise of Chatbots and Virtual Assistants in Customer Experience
Ad

More from servicesNitor (19)

PDF
Why Variational Autoencoders Matter in Modern AI
PDF
Unlock Your Dream Career in IT with Nitor Infotech
PDF
Getting Started with Microservices – Part 2
PDF
Nitor Infotech: Future of Product Engineering
PDF
What is hybrid mobile app development? | Nitor Infotech
PDF
Hands-on with Apache Druid: Installation & Data Ingestion Steps
PDF
Cloud Migration Services | Nitor Infotech
PDF
How Mulesoft Enhances Data Connectivity Across Platforms?
PDF
Database Sharding: Complete understanding
PDF
five best practices for technical writing
PDF
How to integrate salesforce data with azure data factory
PDF
substrate: A framework to efficiently build blockchains
PDF
The three stages of Power BI Deployment Pipeline
PDF
IP Centric Solutioning Whitepaper | Nitor Infotech
PDF
Quality engineering Services | Nitor Infotech
PDF
Cloud and devops.pdf
PDF
Product engineering services_seo.pdf
PDF
02.pdf (2).pdf
PDF
Regression Testing How It Works (1).pdf
Why Variational Autoencoders Matter in Modern AI
Unlock Your Dream Career in IT with Nitor Infotech
Getting Started with Microservices – Part 2
Nitor Infotech: Future of Product Engineering
What is hybrid mobile app development? | Nitor Infotech
Hands-on with Apache Druid: Installation & Data Ingestion Steps
Cloud Migration Services | Nitor Infotech
How Mulesoft Enhances Data Connectivity Across Platforms?
Database Sharding: Complete understanding
five best practices for technical writing
How to integrate salesforce data with azure data factory
substrate: A framework to efficiently build blockchains
The three stages of Power BI Deployment Pipeline
IP Centric Solutioning Whitepaper | Nitor Infotech
Quality engineering Services | Nitor Infotech
Cloud and devops.pdf
Product engineering services_seo.pdf
02.pdf (2).pdf
Regression Testing How It Works (1).pdf
Ad

Recently uploaded (20)

PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
Computing-Curriculum for Schools in Ghana
PDF
Classroom Observation Tools for Teachers
PDF
Trump Administration's workforce development strategy
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Lesson notes of climatology university.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
advance database management system book.pdf
PPTX
Introduction to Building Materials
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Practical Manual AGRO-233 Principles and Practices of Natural Farming
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Computing-Curriculum for Schools in Ghana
Classroom Observation Tools for Teachers
Trump Administration's workforce development strategy
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Supply Chain Operations Speaking Notes -ICLT Program
Lesson notes of climatology university.
Final Presentation General Medicine 03-08-2024.pptx
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
Final Presentation General Medicine 03-08-2024.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
advance database management system book.pdf
Introduction to Building Materials
UNIT III MENTAL HEALTH NURSING ASSESSMENT
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Unit 4 Skeletal System.ppt.pptxopresentatiom
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx

a guide to install rasa and rasa x | Nitor Infotech

  • 1. A Guide to Rasa and Rasa X Vasishtha Ingale Software Engineer Vasishtha is a Software Engineer at Nitor Infotech. He has a keen interest in assimilating statistical approaches for Data Science. He is p... Read More
  • 2. 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:> .rasaenvScriptsactivate 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.
  • 3. 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
  • 4. 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
  • 5. 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:
  • 6. 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:
  • 7. 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
  • 8. 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
  • 9. artificial intelligence and machine learning can make a real difference for your products, solutions, and services here.