Rasa and Generative AI: The Two-Pronged Approach to Building Chatbots
Abstract
Delve into the mechanics of building chatbots using the two conversational AI technologies, Rasa and Generative AI, understand how they leverage human conversations, and explore their differences to uncover which technology aligns best with your needs.
Introduction
In the ever-evolving Artificial Intelligence (AI) landscape, the quest to create more human-like interactions and generate original content has been a driving force in the creation of conversational AI. Today, we’ll explore two remarkable aspects of conversational AI: Rasa, a rule-based butler, and generative AI or Gen AI, a creative, free-spirited artist. Let’s embark on the journey to understand these two technologies and how they have dynamically changed chatbot usage.
What is Rasa?
Picture this: a world where your chatbot comprehends natural language and takes meaningful actions based on that understanding. Rasa can do this for you, and it’s transforming the landscape of conversational AI, helping developers create chatbots that don’t just decode words but understand the nuances of human language.
Let’s explore the critical components of Rasa:
Rasa NLU: Decoding Natural Language
Rasa Natural Language Understanding (NLU) is the language processing powerhouse that takes user inputs, understands the intent, and extracts entities. For instance, if a user says, “Remind me to buy groceries tomorrow,” Rasa NLU recognizes the intent (“set a reminder”) and extracts the entity (“buy groceries”), laying the foundation for the bot’s subsequent actions.
Rasa Core: Bringing Conversations to Life
Rasa Core takes the conversation to the next level by managing the dialog flow and deciding when and how to respond based on the user’s input and the bot’s capabilities. This means your chatbot can engage in dynamic, context-aware conversations.[i]
Fig 1. Example of a Rasa framework
Let’s break down the framework in Fig 1.
User input: “What’s the weather like tomorrow?”
Intent Recognition (Rasa NLU): User’s intent: “weather_query”
Entity Extraction (Rasa NLU): Extracts entities – Date: “tomorrow”
Entities convey vital user information for the chatbot to understand.
Dialogue Management (Rasa Core):
The user is seeking weather information; Rasa Core confirms intent, checks context, and may seek location and date confirmation if needed.
Bot: “Where are you based?”
Action: “weather_api_call ” or “location_question”
The bot can then respond with: “The weather in Mumbai tomorrow is expected to be sunny with a high of 35°C.”
Now that we have explored the realm of Rasa let’s investigate our next conversational AI topic, which has been buzzing in the industry since the release of ChatGPT in Nov 2022, Gen AI.
What is generative AI?
Generative AI is a field within AI that helps create diverse and original content. Functioning like a supercharged artist, it swiftly produces text, images, sounds, animations, codes, and more, exhibiting remarkable capabilities. The captivating aspect lies in its ability to generate content that feels original and humane, sparking curiosity for the limitless possibilities of AI.
Example: DALL-E and the art of image generation
OpenAI’s DALL-E, a powerhouse of generative AI models, can generate images from textual descriptions. You throw in a prompt like “sunset at mount fuji with Sakura trees around,” and —DALL-E conjures up a visual representation.
Fig 2. Image generated using Dall-E
Unraveling the mechanism: How does generative AI work?
Fig 3. Gen AI workflow
Generative AI models are versatile learners. During their training, they handle a wide range of techniques, including unsupervised or semi-supervised learning. This adaptability allows them to dive into vast amounts of unlabeled data, laying the groundwork for what we call foundation models. They generate human-like content using neural networks, whether text, images, or more, by predicting and completing sequences based on learned associations and producing coherent and contextual outputs.[ii]
Example: GPT-3 as a foundation model
Consider OpenAI’s GPT-3, a prime example of a foundation model that can comprehend, generate, and even translate text across various languages.
Rasa vs. GenAI: Navigating conversational AI approaches
While talking about conversational AI, both are powerful tools for natural language processing (NLP), they come with distinct strengths and weaknesses, and choosing between them is a matter of use case and specific requirements. Let’s investigate Rasa and Generative AI, comparing their key features and applications.
Rasa: The rule-based framework
- Rule-based intent-entity recognition:
Rasa takes a dual approach to intent and entity recognition, offering developers the best of both worlds by integrating predefined rules and machine learning models.
- Dialog management:
in the world of Conversational AI is its unparalleled control over conversation flows. Tailor-made for applications requiring specific dialog paths, Rasa enables developers to customize dialog flows, interpret user intents, and manage context effectively.
Example: Personalized customer support
- Data-driven training:
Rasa evolves through data-driven training. Over time, the Natural Language Processing (NLP) models can be continuously updated and retrained, refining their performance and adapting to changing user behaviors.
- Customization:
Flexibility is at the core of Rasa, especially when customizing NLP models. Developers can fine-tune models to align with the specific use cases and domains, ensuring that the conversational AI is finely tuned to user expectations.[iii]
Example: Creating personalized chatbot for a restaurant that responds to questions related to menu, ordering process, discount coupons, etc.
- Ease of use:
While Rasa demands proficiency in Python development and NLP, it rewards developers with unparalleled flexibility. The learning curve might be steeper, but the ability to customize conversational AI to unique requirements makes it a preferred choice for those seeking a tailor-made solution.
Generative AI: Contextual text generation
- Models: Unveiling the power of AI
Generative AI impact can be felt with models like GPT-3, which focuses on crafting human-like text based on input prompts. These models, having undergone extensive training on vast amounts of text data, gain the ability to generate innovative responses.
Example: Prompting GPT-3
- Natural language aspect of GenAI:
Generative AI simplifies generating natural language responses within conversational contexts. Its applications extend beyond mere text generation, finding a home in chatbots, content creation, and more.
- Less control over dialog flow:
In contrast to Rasa, generative AI models cannot enforce specific dialog flows. The generated responses are based on training data patterns and the input, introducing an element of unpredictability.
- Limited customization:
While it’s possible to fine-tune certain aspects of generative AI models, they may not match Rasa’s level of customization. Crafting specific conversational flows and behaviors might have limitations, requiring a delicate balance between customization and model constraints.[iv]
- Ease of use:
Generative AI models offer relative ease of use, requiring minimal setup compared to developing a custom conversational AI solution with Rasa. The simplicity extends to accessibility through Application Programming Interfaces (APIs), making them readily available for integration into various applications.
In conclusion
We have uncovered the distinct characteristics that set Rasa’s rule-based precision apart from Generative AI’s impact on chatbots. In this blog, I’ve tried to navigate the landscape of conversational AI, providing a comprehensive understanding of both technologies and their differences. Whether you opt for Rasa’s precision or Gen AI’s creative nature, the choice is yours and should be based on the requirements. As technology progresses, anticipate the emergence of hybrid solutions, blending the best of both worlds for nuanced AI-driven interactions.
To learn more about generative AI, read our latest report here.
[i] Understanding Rasa: A look under the hood of Rasa NLU, Gaurav G, July 7, 2018 – https://medium.com/@gauravgpunjabi/getting-started-with-machine-learning-ea0dc29e3ff6
[ii] What is GenAI, Prajwal Kankate, June 17, 2023 – https://medium.com/@prajwalkankate/what-is-genai-7e10f008e749
[iii] What is RASA? — the open-source AI for building conversational chatbots, AskLua, Nov 6,2020-https://medium.com/@asklua/what-is-rasa-the-open-source-ai-for-building-conversational-chatbots-8a86bef47ec4
[iv] Conversational AI VS. Generative AI: What’s the Difference, Varun Saharawat- https://pwskills.com/blog/conversational-ai-vs-generative-ai-whats-the-difference/#Difference_BW_Conversational_AI_VS_Generative_AI
Latest Blogs
The business world is moving quickly and the only way to make informed decisions is to leverage…
As businesses turn to cloud services to meet their growing technology needs, the promise of…
Clinical trials are at the heart of drug development, producing vast, complex datasets that…
The rise of machine customers introduces essential questions that stretch our technological…