Development of Virtual Assistants Made Simpler with RASA

Mohit Bansal | 26th November 2019

The age of chatbots is revolutionizing the way businesses interact with their customers. Herein, open-source chatbot development framework, RASA, is proving its mettle at par with human intelligence. Virtual Assistants with RASA demonstrate cognitive abilities to undertake contextual conversations with diverse audiences. With underlying machine learning algorithms, RASA assistants are becoming the prime choice for every leading Chatbot App Development Company. 

 

This blog post highlights how RASA is simplifying customer interactions with AI-powered virtual assistants.

 

Understanding RASA

Rasa is an open-source framework for developing artificially intelligent chatbots.

It breaks down the working of a virtual assistant in following simple steps:

  • Understanding what the user wants to express.
  • Decide what to do after getting user input.
  • Provide the user with an appropriate response.

The above steps are fulfilled by the following components of RASA:

 

  • RASA NLU 

NLU stands for natural language understanding. In this part, a sequence of components processes the incoming message and classify user intent. Incoming messages can also contain specific information which is also extracted using this sequence of components called “pipeline”. This specific information in the incoming message is called entity. The entities can be saved as slot values that can be used later. There are pre-trained pipelines available for general use which are ready to use with very little training like Spacy. Custom pipelines can also be created by combining various components and can be trained with examples specific to the use case. 

 

  • RASA CORE 

It is a dialogue engine that uses a machine learning model trained on example conversations to decide what to do next. The example conversations are termed as stories. What to do next can vary with the situation, it can be anything from replying to the user with a simple text response to perform a complex task which can be written as a custom action.

 

  • RASA NLG 

NLG stands for Natural Language Generation. This part of RASA responds to the user in natural language which can also contain pieces from structured data available. In RASA, the responses are created using utterances. The utterances can be in the form of predefined templates or can be generated from the scope of custom actions. Rasa NLG also comes under Rasa Core only.

 

Code Examples:

  • Pipeline (config.yml file): 

language: en

pipeline:

– name: “WhitespaceTokenizer”

 case_sensitive: false

– name: “RegexFeaturizer”

– name: “CRFEntityExtractor”

– name: “EntitySynonymMapper”

– name: “CountVectorsFeaturizer”

– name: “CountVectorsFeaturizer”

 analyzer: “char_wb”

 min_ngram: 1

 max_ngram: 4

– name: “EmbeddingIntentClassifier”

In this, various components have been used to create a pipeline.

 

  • Training data for NLU pipeline (NLU.md file):

## intent:inform_name

– my name is [Sikander](name)

– my name is [Mohit](name)

inform_name is the intent following which is the examples. Parentheses contain the entity name and square brackets hold the entity values.

 

  • Training data for Rasa core (stories.md file)

## capture name

* inform_name

  – action_save_name

            

## bot introduction

* bot_introduction

  – utter_bot_introduction

 

The story’s name starts with ## after which intent name is mentioned starting with *.  Following the intent name can be a custom action name or an utterance template that is defined in domain.yml file.

 

  • Custom action (Actions.py file)

            class ActionServiceList(Action):

 

               def name(self) -> Text:

                     return “action_service_list”

 

               def run(self, dispatcher, tracker, domain):

                   Please choose a service name to know more: \n”

                     for data in range(len(service_list)):

                             response += str(data + 1) + ‘.’ + str(service_list[data]) + ‘.\n’

                             dispatcher.utter_message(response)

 

                return []

 

In customs actions, we can define what to do when the RASA NLU core predicts this action. 

 

Developing Virtual Assistants with RASA

 

Before running, we need to train the RASA core and NLU pipeline with our training examples. All that can be done with command – RASA train. Whenever changes are made to RASA core or NLU data, this command needs to be run to reflect the changes. 

RASA run actions command is used to run the RASA action server to provide custom action functionality. RASA shell can be used to talk to the chatbot in the terminal. 

 

RASA framework has really simplified the process of creating a text-based virtual assistant as it handles machine learning efficiently. The developer is only required to define the training examples and custom functionality. The training and running part is very easy as it requires a few simple commands. RASA is open-source and free of cost chatbot development framework that ensures data security and cost-effective development.

 

Build Engaging Virtual Assistants with RASA and Oodles AI

 

The AI team at Oodles has experiential knowledge in building Python-based chatbots, virtual assistants, and conversational AI models. We train RASA chatbot’s machine learning algorithms with real-world conversations and natural languages to power enhanced customer experience. We have hands-on experience in deploying NLP and computer vision technologies to build intelligent chatbots for retail, healthcare, and other global businesses. 

 

Talk to our Artificial Intelligence team to know more about our Chatbot app development services.

About Author

Mohit Bansal

I am a tech enthusiast and always ready to learn new things. I have good skill in Python language.

No Comments Yet.


Leave a Comment

Name is required

Comment is required




Request For Proposal

[contact-form-7 404 "Not Found"]

Ready to innovate ? Let's get in touch

Chat With Us