DialogFlow: A Simple Way to Build your Voicebots & Chatbots

Understanding the basics of DialogFlow

Ashok Sharma
Towards Data Science

--

Nowadays, businesses, whether it is B2B or B2C, are heavily relying on chatbots in order to automate their processes and reducing human workloads. There are various NLP chatbot platforms used by the chatbot development companies to build a chatbot, and one of the best platforms among them is DialogFlow. The Platform was previously called as API.AI. It was acquired by Google in 2016 and renamed as DialogFlow.

DialogFlow is a Google-owned natural language processing platform that can be used to build conversational applications like chatbots and voice bots. It is a platform that provides a use-cHeease specific, engaging voice and text-based conversations, powered by AI. The complexities of human conversations are still an art that machines lack but a domain-specific bot is the closest thing we can build to overcome these complexities. It can be integrated with multiple platforms, including Web, Facebook, Slack, Twitter, and Skype.

DialogFlow Terminology:

Understanding the basics of DialogFlow

1. Agent:

DialogFlow Agent handles conversational flow with end-user. To get started with DialogFlow, first, we need to create an Agent using the Dialogflow console.

It is a top-level container for intents, entities, integrations, and knowledge. Agent translates end-user text or audio during a conversation to structured data that apps and services can understand.

2. Intents:

Intents are used to understand and process the user intentions and contexts to direct the conversation flow with end-users.

An intent contains some training phrases and their corresponding responses.

An intent gets invoked when it’s training phrases get matched with user inputs. And give output to end user’s as defined in its responses. If multiple responses are present for input, then responses will be shown to the user randomly.

If we have multiple intents with the same training phrases, then either the higher priority intent will match, or the intent with active input contexts will match.

Intents priority:

Intents priority can be set if there are chances that user input can match with multiple intents. The intent with higher priority will get invoked.

Fallback Intents:

Fallback intents are invoked when user input did not match with any intent.

When we create, an Agent two default intents get added in the Agent.

Welcome intent and default fallback intent.

Contexts are used to understand natural language user contexts. That is in which context the user wants information.

For example:

A person can give input “orange is my favourite.”

Now this orange can be matched with a colour intent or with a fruit intent. So which intent should be matched in this case.

To solve this problem, contexts are used in DialogFlow.

Contexts lifeSpan:

Contexts have some lifespan for which they remain active. The default lifespan is 5 requests, but it can be changed.

It means that the context will live longer for the next five matched intents.

Contexts are of two types:

a) Input Contexts:

An intent having some input contexts can be matched, only if its all input contexts are active.

For example:

We have two intents with the Same training phrase “Orange is my Favourite.”

But both intents have different input contexts. One contains colour as input Context, whereas others contain fruit as input context.

The intent for which input context is active will match with user input.

b) Output Contexts:

An intent having some output contexts will make its all output contexts active if it matches with user input.

For example:

A colour intent match with user input “Do you know about colours.”

which responds to the user by saying, “what is your favourite colour.”An Output context “colour” can be set active by the intent.

When the user says, “Orange is my favourite,” the intent having input context “colour” will match the user input.

4. Entity:

Entities are used to extract some useful information and parameters from end-user input. Entities can be either system-defined or can be developer-defined.

DialogFlow provides many predefined entities like date, time, colour, temperature known as system entities to handle most popular common concepts.

However, custom entities can also be defined by developers based on their requirements.

The extracted parameters from user inputs can be passed between intents to direct a conversational flow.

5. Responses:

Agents can give two types of responses to end-users.

a) Default responses.

b) Rich responses.

a) Default Responses:

Default responses are also known as Platform Unspecified responses. These responses are simple text responses shown to end-users. These can be used with any platforms including web, Facebook, slack.

b) Rich Responses:

Rich responses are also known as Platform specified responses. Rich responses are used to show buttons, cards, quick replies, links to users via Facebook, slack platforms.

However, to use rich responses with web applications, the chatbot needs to be customized.

Rich responses can be configured either with DialogFlow console or can be sent within webhook responses.

6. Webhook:

A Webhook can be integrated to give responses from our Application. Webhook integration is simple and can be implemented using a fulfilment option. A URL can be configured there, and webhook call needs to be set active for the intent for which you want to call the webhook.

Conclusion:

DialogFlow is a very simple platform to build quick chatbots, voice bots with minimum coding efforts. It can process natural language errors easily and can be integrated with multiple platforms. It is basically a tool that allows in building chatbots that clearly understand the human conversation and reply to them with an appropriate answer after parsing the conversation with relevant parameters. For more understanding, you can refer to this link.

Originally published at https://www.signitysolutions.com/blog/dialogflow-voicebots-chatbots/on October 1, 2019.

--

--

A #DigitalStrategist, Marketing Consultant, #SOCIALMEDIA INFLUENCER, and #GrowthHacker