Building Chatbots with Rasa and Python
Learn how to create a Rasa chatbot with a Gradio frontend.
Let’s pick up where we left off. After running rasa init, we are provided with the basic files needed to create a chatbot. We can keep the default functionality for now and add our new features on top. While we'll eventually create an educational chatbot, let’s keep it simple for now. In this lesson, we'll create a chatbot that will answer some simple questions about Educative subscriptions.
Creating intents
Recognizing the user’s intent is key. Rasa stores intents in the nlu.yml file in the data directory. By default, Rasa has some basic intents, such as greet , goodbye, affirm and deny. An intent is created by first defining the intent, followed by a few examples of phrases categorized under that intent. The widget below contains a nlu.yml file with a new subscription intent.
Our examples consist of common questions and phrases with the intent of learning about the subscription details.
Creating stories
Now that we have defined our new intent, we can create our stories. A story in Rasa is a sequence of actions that the chatbot will take in response to a particular intent. For the subscription intent, we want to provide information about subscription plans, pricing, payment options, and perhaps a link to the purchase page. For this, we'll use the stories.yml file in the data directory.
We have created a basic story that will play out if the intent is classified as subscription. We want the chatbot to ...