Dialogflow - Components



Dialogflow is a technology that Google provides for building chatbots or virtual assistants. It makes it easier to hear what others have to say and respond correctly. When combined the components create smart chatbots that can have natural-way conversations with users.

Components of Dialogflow

  1. Agents

  2. Intents

  3. Entities

  4. Invocation

  5. Fulfillment Request

  6. Response

  7. Context

  8. User says

  9. Training Phrases

Now let us discuss each point in detail in the below section −

Agents

Dialogflow agents are virtual agents that handle many conversations with your end users simultaneously. It is a natural language interpretation module that can recognize differences in spoken language. Dialogflow transforms end-user text or audio during a conversation into structured data that your services and apps can understand. You design and build a Dialogflow agent to handle the many types of dialogues your system needs.

Dialogflow agents are similar to real-world call center agents. They both receive instruction on how to handle common debate cases, this instruction need not be in-depth.

Agents also serve as a top-level container for data and settings:

  • To see which language, machine learning, and other preferences influence how your agent acts, check out the agent settings.

  • Tries to classify end-user intentions throughout the entire conversation.

  • Entities to identify and extract specific information from user spoken words.

  • The capacity to read written content like FAQs and recognize prepared responses.

  • Programs running on hardware or services that handle end-user interactions directly (like Google Assistant) can be integrated.

  • When connecting your services using integrations, use fulfillment.

Prebuilt Agents

Dialogflow offers a collection of agents known as prebuilt agents for common use cases. You can start a conversation about getting delivery, making hotel bookings, getting directions and other things with these agents.

Prebuilt agents provide with intents and entities for some use cases but you still need to provide intent responses. Reactions often depend on your specific situations or need satisfaction in order to be met.

Limitations of Agents

The following limitations are apply −

  • There are only prebuilt agents available for the worldwide area.

  • All Dialogflow languages are supported by a subset of the prebuilt agents. Only pre-built agents that support the active agent's default language are displayed when you browse the pre-built agents.

Import a Prebuilt Agent

Here is the way you can import a prebuilt agent to your project:

  • Go to the Dialogflow ES console.

  • Choose Prebuilt agents from the sidebar menu on the left.

  • Point the mouse cursor over an existing agent.

  • Click View details.

  • Choose Import.

  • Choose from an active GCP project or launch a brand-new one.

  • Choose "Create Agent From Template."

Multilingual Agents

Dialogflow is supported in several languages. The language you choose when creating an agent becomes the default and you can add more languages. There are two categories for languages:

  • Root languages: Root languages are those that lack a location specification, like English (en).

  • Locale-specific languages: Location-specific languages include English-US (en-US), which identifies a locality as a certain country or area.

Intents

An intent categorizes an end-user's intention for a single turn of the conversation. You describe many intentions for every agent and the whole of your intentions can manage a whole conversation. Dialogflow matches the best intentions of your agent with an end-user's written or spoken language, also referred to as an end-user expression. Matching an intent is also known as classifying intentions.

Creating a weather agent that can recognize and respond to user inquiries about the weather is a typical use case. If the question was about the weather prediction, you would most likely specify a goal. Dialogflow would match the forecast intent to an end-user's expression like "What's the forecast?" You may also specify whether you want to extract particular information from the end-user expression like the intended weather forecast's location or time. This extracted data is required for your system to provide a weather inquiry to the end user.

Intents of Dialogflow

The basic intent includes the following items −

  • Training Phrases: End users can use training phrases as representative terms. If any of these sentences sound like an expression that the end user would use, then the Dialogflow matches the intent. There is no need to identify every possible situation because Dialogflow's built-in machine learning expands to fit more relevant phrases on your list.

  • Action: We are able to provide an action to the agent. The Dialogflow gives the system actions when we match an intent. These actions can be used to start different pre-defined system operations.

  • Parameters: End user expressions are accepted as an argument by Dialogflow if you want to march an intent at runtime. An entity type or a type that describes precisely how data is retrieved and assigned to each argument. The settings differ from the end user's raw input. The word "parameter" describes arranged data that is used to provide responses or perform logic.

  • Responses: You can offer the user audio, visual, or text responses. These have the capacity to respond to queries from the end user, get more data from them and wrap up the conversation.

Here is the figure which displays the fundamental flow for intent matching and also how it is responding to the end-user.

Intent Matching

Actions

The action field is a simple utility feature that improves the logic of your service. When building an agent you can enter any useful text you find .

When an intent matches at runtime, Dialogflow provides the action value to your fulfillment webhook request or the API interaction response. It can be used to start certain logic in your service.

Parameters

Dialogflow returns the values it collected from the end-user expression as parameters when an intent matches at runtime. The entity type, which relates to each parameter specifies the precise manner in which the data is extracted. Parameters are organized data that can be easily used to carry out logic or produce replies that compared to unstructured end-user input.

By labeling specific sections of your training phrases and setting the associated parameters you can manage the collection process of data while creating an agent.

Responses

Responses can be given by an integrated response handler in the intent when it matches. This feature only permits static responses, but you can use parameter references to make these responses more dynamic. For presenting data that the end user has given, this is helpful. To answer the query for example, say- "Okay, I booked a room for you on 20 October".

Default intents

When you create an agent, two intents are set up automatically −

  • Default greeting intent: Matched as soon as an end-user starts speaking with your representative.

  • Default fallback intent: When your agent is unable to match an end-user input to another intent, it will match the default fallback intent.

Entities

An entity is defined as a repository of knowledge that the agent uses to answer questions from users. There are many different types of system entities like the weather, location, date and so forth.

Entities help Dialogflow understand specific parts of the statement of the user. For an example, try the sentence "What is the weather like in New Delhi?" "New Delhi" is an entity (a location).

Entity options

Many entity parameters can change how data extraction and entity matching behave. These parameters are pre-configured for system entities so you cannot change them. But you can modify them to fit your own custom entities. Depending on the settings you choose, you can create multiple types of entities:

  • Map entity: For every reference value, map entities offer a map from synonyms to reference values. A list of synonyms and a single reference value are included in every map entity item.

  • List entity: List entities give a list of single value entity items. They have reference values and synonyms.

  • Composite entity: A composite entity is one specific type of list entity. While more entity types may also be included, entity entries for list entities typically contain simple words or sentences. A reference to one entity type that can be found in another entity type is called an alias. When a list object has synonyms to other entity types, it is called a composite entity.

  • Regexp entity: You can offer regular expressions for matching using regexp entities.

Also, there are two options that modify the behavior of entity matching but do not specify the type of entity:

  • Automated expansion

  • Fuzzy matching

Fulfillment Request

When an intent is matched, your agent's default response is a static one. You can use fulfillment to give a more dynamic answer if you are using one of the integration options. When an intent is enabled for fulfillment, Dialogflow calls a service that you specify in response to the intent. If an end-user wants to book a haircut for Friday, for example- your service can look up the information in your database and get back to them with Friday's availability.

To allow fulfillment, there is a setting for every intent. You should allow intent fulfillment whenever an intent calls for a dynamic response or some sort of action from your system. Dialogflow uses the static response you provide for the intent if it matches an intent without fulfillment enabled.

Dialogflow informs your webhook service about a matched intent by sending a request with the matched intent's details when an intent with fulfillment enabled matches. Your system is capable of performing any necessary tasks and providing Dialogflow with instructions on what to do next. The static response you provide for the intent is used only in the event that your webhook service fails when fulfillment is enabled. The fulfillment processing flow is shown in the following diagram.

Dialogflow Fulfillment Request

Here is how the process works when a user interacts with a Dialogflow agent −

  • The final user speaks or enters a statement.

  • Dialogflow extracts parameters and evaluates the end-user expression to an intent.

  • Your webhook service receives a webhook request message from Dialogflow. This message has details about the action, parameters, defined response for the intent and matched intent.

  • When necessary your service runs commands like database queries or external API calls.

  • Dialogflow receives a webhook response message from your service. The reply that has to be delivered to the end user is given in this message.

  • The end-user receives the response from Dialogflow.

  • The answer is visible or audible to the end user.

Context

Dialogflow's context works much like a chatbot's memory. It helps the bot remember the user's previous comments made during the conversation. This improves the chatbot's understanding and makes it possible for it to give precise answers predicated on previous sentences.

For example, if a user says, "I want to book a flight," the chatbot would keep track of it. When the user would say, "To New Delhi," later on, the bot would understand that they were referring to making travel arrangements to New Delhi.

There are settings, which enables more natural conversation. The image below shows how a banking agent would use context.

Dialogflow Context

Here is an illustration of how Dialogflow works with contexts in a conversation −

  • Dialogflow makes an effort to match the words a user uses to ask for information about their checking account with the right intent. If the two match the system enters the "checking" context.

  • The agent then asks the user directly what information they want to know about their checking account. If the user says something like "my balance," Dialogflow providing the "checking" context is still active, matches the user's response with the "checking balance" purpose.

  • In a similar way the "SavingsBalance" intent can be used if the user asked for their savings account while the "savings" context was active.

  • After the system has confirmed the needed database the agent will respond with the checking account balance.

Advertisements