RASA – an Open Source Chatbot Solution

Maruvada Deepti

Ever wondered if the agent you are chatting with online is a human or a robot? The answer would be the latter for an increasing number of industries. Conversational agents or chatbots are being employed by organizations as their first-line of support to reduce their response times.

The first generation of bots were not too smart, they could understand only a limited set of queries based on keywords. However, commoditization of NLP and machine learning by Wit.ai, API.ai, Luis.ai, Amazon Alexa, IBM Watson, and others, has resulted in intelligent bots.

What are the different chatbot platforms?

There are many platforms out there which are easy to use, like DialogFlow, Bot Framework, IBM Watson etc. But most of them are closed systems, not open source. These cannot be hosted on our servers and are mostly on-premise. These are mostly generalized and not very specific for a reason.

DialogFlow vs.  RASA

DialogFlow

  • Formerly known as API.ai before being acquired by Google.
  • It is a mostly complete tool for the creation of a chatbot. Mostly complete here means that it does almost everything you need for most chatbots.
  • Specifically, it can handle classification of intents and entities. It uses what it known as context to handle dialogue. It allows web hooks for fulfillment.
  • One thing it does not have, that is often desirable for chatbots, is some form of end-user management.
  • It has a robust API, which allows us to define entities/intents/etc. either via the API or with their web based interface.
  • Data is hosted in the cloud and any interaction with API.ai require cloud related communications.
  • It cannot be operated on premise.

Rasa NLU + Core

  • To compete with the best Frameworks like Google DialogFlow and Microsoft Luis, RASA came up with two built features NLU and CORE.
  • RASA NLU handles the intent and entity. Whereas, the RASA CORE takes care of the dialogue flow and guesses the “probable” next state of the conversation.
  • Unlike DialogFlow, RASA does not provide a complete user interface, the users are free to customize and develop Python scripts on top of it.
  • In contrast to DialogFlow, RASA does not provide hosting facilities. The user can host in their own sever, which also gives the user the ownership of the data.

What makes RASA different?

Rasa is an open source machine learning tool for developers and product teams to expand the abilities of bots beyond answering simple questions. It also gives control to the NLU, through which we can customize accordingly to a specific use case.

Rasa takes inspiration from different sources for building a conversational AI. It uses machine learning libraries and deep learning frameworks like TensorFlow, Keras.

Also, Rasa Stack is a platform that has seen some fast growth within 2 years.

RASA terminologies

  • Intent: Consider it as the intention or purpose of the user input. If a user says, “Which day is today?”, the intent would be finding the day of the week.
  • Entity: It is useful information from the user input that can be extracted like place or time. From the previous example, by intent, we understand the aim is to find the day of the week, but of which date? If we extract “Today” as an entity, we can perform the action on today.
  • Actions: As the name suggests, it’s an operation which can be performed by the bot. It could be replying something (Text, Image, Video, Suggestion, etc.) in return, querying a database or any other possibility by code.
  • Stories: These are sample interactions between the user and bot, defined in terms of intents captured and actions performed. So, the developer can mention what to do if you get a user input of some intent with/without some entities. Like saying if user intent is to find the day of the week and entity is today, find the day of the week of today and reply.

RASA Stack

Rasa has two major components:

  • RASA NLU: a library for natural language understanding that provides the function of intent classification and entity extraction. This helps the chatbot to understand what the user is saying. Refer to the below diagram of how NLU processes user input.
RASA Chatbot

  • RASA CORE: it uses machine learning techniques to generalize the dialogue flow of the system. It also predicts next best action based on the input from NLU, the conversation history, and the training data.

RASA architecture

This diagram shows the basic steps of how an assistant built with Rasa responds to a message:

RASA Chatbot

The steps are as follows:

  • The message is received and passed to an Interpreter, which converts it into a dictionary including the original text, the intent, and any entities that were found. This part is handled by NLU.
  • The Tracker is the object which keeps track of conversation state. It receives the info that a new message has come in.
  • The policy receives the current state of the tracker.
  • The policy chooses which action to take next.
  • The chosen action is logged by the tracker.
  • A response is sent to the user.

Areas of application

RASA is all one-stop solution in various industries like:

  • Customer Service: broadly used for technical support, accounts and billings, conversational search, travel concierge.
  • Financial Service: used in many banks for account management, bills, financial advices and fraud protection.
  • Healthcare: mainly used for fitness and wellbeing, health insurances and others

What’s next?

As any machine learning developer will tell you, improving an AI assistant is an ongoing task, but the RASA team has set their sights on one big roadmap item: updating to use the Response Selector NLU component, introduced with Rasa 1.3. “The response selector is a completely different model that uses the actual text of an incoming user message to directly predict a response for it.”

References:

https://rasa.com/product/features/

https://rasa.com/docs/rasa/user-guide/rasa-tutorial/

About the Author –

Deepti is an ML Engineer at Location Zero in GAVS. She is a voracious reader and has a keen interest in learning newer technologies. In her leisure time, she likes to sing and draw illustrations.
She believes that nothing influences her more than a shared experience.

Design Thinking 101

Vasudevan Gopalan

Is the end-user at the center of everything you do? Do you consider human emotions while conceptualizing a product or a solution? Well, let us open the doors of Design Thinking

What is Design Thinking?

  • Design thinking is both an ideology and a process, concerned with solving in a highly user-centric way.
  • With its human-centric approach, design thinking develops effective solutions based on people’s needs.
  • It has evolved from a range of fields – including architecture, engineering, business – and is also based on processes used by designers.
  • Design thinking is a holistic product design approach where every product touch point is an opportunity to delight and benefit our users.

Human Centred Design

With ‘thinking as a user’ as the methodology and ‘user satisfaction’ as the goal, design thinking practice supports innovation and successful product development in organizations. Ideally, this approach results in translating all the requirements into product features.

Part of the broader human centred design approach, design thinking is more than cross-functional; it is an interdisciplinary and empathetic understanding of our user’s needs. Design thinking sits right up there with Agile software development, business process management, and customer relationship management.

5 Stages of Design Thinking

Office 365 Migration
  • Empathize: This stage involves gathering insights about users and trying to understand their needs, desires, and objectives.
  • Define: This phase is all about identifying the challenge. What difficulties do users face? What are the biggest challenges? What do users really need?
  • Ideate: This step, as you may have already guessed, is dedicated to thinking about the way you can solve the problems you have identified with the help of your product. The product team, designers, and software engineers brainstorm and generate multiple ideas.
  • Prototype: The fourth stage brings you to turn your ideas into reality. By creating prototypes, you test your ideas’ fitness.
  • Test: You present the prototype to customers and find out if it solves their problem and provides users with what they need. Note that this is not the end of the journey; you need to get feedback from the users, adjust the product’s functionality, and test it again. This is a continuous process similar to the build-measure-learn approach in the lean start-up methodology.
Design Thinking

Benefits of Design Thinking in Software Development

1. Feasibility check: Design thinking enables software development companies to test the feasibility of the future product and its functionality at the initial stage. It enables them to keep end-user needs in mind, clearly specify all requirements and translate all this into product features.

2. No alarms and no surprises: Once you’ve tested your MVP and gathered feedback from users, the team can confidently proceed to the product development. You can be quite sure that there will be little to no difference between the approved concept and final version.

3. Clarity and transparency: Design thinking approach allow product designers/developers to broaden their vision, understand and empathise with the end-users’ problems and have a detailed blueprint of the solution they should eventually deliver.

4. Continuous improvement: The product can be (and sometimes should be) modified after its release when user feedback is at hand. It becomes clear which features work and which can be done away with. The product can undergo some series enhancements on the basis of feedback. This leaves place for continuous improvement and software development process becomes flexible and smooth.

Real-world Success Stories

1. PepsiCo

During Indra Nooyi’s term as PepsiCo’s CEO, the company’s sales grew 80%. It is believed that design thinking was at the core of her successful run. In her efforts to relook at the company’s innovation process and design experience, she asked her direct reportees to fill an album full of photos of what they considered represents good design. Uninspired by the result, she probed further to realize that it was imperative to hire a designer.

“It’s much more than packaging… We had to rethink the entire experience, from conception to what’s on the self to the post product experience.”, she told the Harvard Business Review.

While other companies were adding new flavours or buttons to their fountain machines, PepsiCo developed a touch screen fountain machine, a whole new interaction between humans and machines.

“Now, our teams are pushing design through the entire system, from product creation, to packaging and labelling, to how a product looks on the shelf, to how consumers interact with it,” she said.

2. Airbnb

Back in 2009, Airbnb’s revenue was limping. They realized that poor quality images of rental listings may have something to do with it. They flew some of their employees to a city and got them to take high quality photos and upload it on their website. This resulted in a 100% increase in their revenue.

Instead of focusing on scalability, the team turned inward and asked, ‘what does the customer need?’ This experiment taught them a few big lessons, empathy being just as important as code was one of them.

3. Mint.com

Mint.com is a web-based personal financial management website. Part of their success is attributed to the human-centric design of the website which tracks and visualizes how a person is spending their money. Bank accounts, investments, and credit cards can easily be synchronized on Mint, which then categorizes the expenses to help the user visualize their spending. They built a product that illustrates a core principle of design thinking: truly understanding the position and mindset of the user. They had 1.5 million customers within 2 years.

Design thinking is a human-centred approach to innovation that draws from the designer’s toolkit to integrate the needs of people, the possibilities of technology, and the requirements for business success.

References

https://www.researchgate.net/publication/226141981_Design_Thinking_A_Fruitful_Concept_for_IT_Development

https://blog.brainstation.io/how-5-ceos-used-design-thinking-to-transform-their-companies/

About the Author –

Vasu heads Engineering function for A&P. He is a Digital Transformation leader with ~20 years of IT industry experience spanning across Product Engineering, Portfolio Delivery, Large Program Management etc. Vasu has designed and delivered Open Systems, Core Banking, Web / Mobile Applications etc.
Outside of his professional role, Vasu enjoys playing badminton and focusses on fitness routines.

Observability versus Monitoring

Sri Chaganty

“Observability” has become a key trend in Service Reliability Engineering practice.  One of the recommendations from Gartner’s latest Market Guide for IT Infrastructure Monitoring Tools released in January 2020 says, “Contextualize data that ITIM tools collect from highly modular IT architectures by using AIOps to manage other sources, such as observability metrics from cloud-native monitoring tools.”

Like so many other terms in software engineering, ‘observability’ is a term borrowed from an older physical discipline: in this case, control systems engineering. Let me use the definition of observability from control theory in Wikipedia: “observability is a measure of how well internal states of a system can be inferred from knowledge of its external outputs.”

Observability is gaining attention in the software world because of its effectiveness at enabling engineers to deliver excellent customer experiences with software despite the complexity of the modern digital enterprise.

When we blew up the monolith into many services, we lost the ability to step through our code with a debugger: it now hops the network.  Monitoring tools are still coming to grips with this seismic shift.

How is observability different than monitoring?

Monitoring requires you to know what you care about before you know you care about it. Observability allows you to understand your entire system and how it fits together, and then use that information to discover what specifically you should care about when it’s most important.

Monitoring requires you to already know what normal is. Observability allows discovery of different types of ‘normal’ by looking at how the system behaves, over time, in different circumstances.

Monitoring asks the same questions over and over again. Is the CPU usage under 80%? Is memory usage under 75% percent? Or, is the latency under 500ms? This is valuable information, but monitoring is useful for known problems.

Observability, on the other side, is about asking different questions almost all the time. You discover new things.

Observability allows the discovery of different types of ‘normal’ by looking at behavior, over time, in different circumstances.

Metrics do not equal observability.

What Questions Can Observability Answer?

Below are sample questions that can be addressed by an effective observability solution:

  • Why is x broken?
  • What services does my service depend on — and what services are dependent on my service?
  • Why has performance degraded over the past quarter?
  • What changed? Why?
  • What logs should we look at right now?
  • What is system performance like for our most important customers?”
  • What SLO should we set?
  • Are we out of SLO?
  • What did my service look like at time point x?
  • What was the relationship between my service and x at time point y?
  • What was the relationship of attributed across the system before we deployed? What’s it like now?
  • What is most likely contributing to latency right now? What is most likely not?
  • Are these performance optimizations on the critical path?

About the Author –

Sri is a Serial Entrepreneur with over 30 years’ experience delivering creative, client-centric, value-driven solutions for bootstrapped and venture-backed startups.