Understanding Entities in Dialogflow

Google Cloud Tech
30 Apr 201905:48

Summary

TLDRIn this episode of 'Deconstructing Chatbots,' Priyanka Vergadia delves into Dialogflow's entities, which are instrumental in extracting data from user inputs. She distinguishes between system entities, developer entities, and session entities, using an appointment scheduler as an example. The tutorial guides viewers on creating entities for DMV services, integrating them into intents, and utilizing slot filling to ensure all necessary information is gathered. Priyanka also introduces session entities, which are unique to each user session and can be dynamically updated. The episode concludes with a teaser for the next installment, which will focus on integrating the scheduler with Twilio Messaging Service.

Takeaways

  • 🤖 Entities are Dialogflow's way of identifying and extracting data from user input.
  • 📚 There are three types of entities: system entities, developer entities, and session entities.
  • 📅 System entities automatically extract common data like dates, times, addresses, emails, currency, and phone numbers.
  • 🔍 Developer entities are custom entities created by developers for specific use cases, like 'Appointment Type' for a DMV scheduler.
  • 📝 Session entities are tied to a specific user session and can be updated dynamically based on the conversation.
  • 🛠️ You can create entities for specific services like 'drivers license' and 'vehicle registration' to tailor your chatbot's understanding.
  • 📑 Dialogflow allows uploading or downloading entities in bulk using CSV or JSON formats for easier management.
  • 🔗 Adding intents and training phrases helps the chatbot understand and respond to user inputs involving the new entities.
  • 🗂️ Slot filling ensures that all necessary information (like appointment type, time, and date) is collected before proceeding.
  • 📝 Modifying responses to include all relevant information (appointment type, date, and time) makes the chatbot's output more informative.
  • 🔄 Always save changes after making updates to intents, entities, or responses to ensure they are implemented correctly.

Q & A

  • What is the main focus of the episode 'Deconstructing Chatbots'?

    -The main focus of the episode is to explore entities in Dialogflow, which are used for identifying and extracting useful data from user input.

  • What are the three types of entities mentioned in the script?

    -The three types of entities mentioned are system entities, developer entities, and session entities.

  • How are system entities beneficial for Dialogflow agents?

    -System entities are beneficial as they allow agents to extract information about a wide range of concepts without any additional configuration.

  • Can you provide an example of a system entity?

    -Examples of system entities include data like addresses, emails, currency, and phone numbers.

  • What is a developer entity and how is it created?

    -A developer entity is a custom entity created by the developer to capture specific types of information, such as 'drivers license' and 'vehicle registration' in the context of a DMV appointment scheduler.

  • How does Dialogflow handle entities that are not initially listed?

    -Dialogflow can automatically identify and add new entities to the list based on other training phrases if the checkbox is checked.

  • What is the purpose of slot filling mentioned in the script?

    -Slot filling is used to ensure that all required information, such as appointment type, time, and date, is collected from the user to book an accurate appointment.

  • How can entities be managed in bulk?

    -Entities can be managed in bulk by uploading or downloading them in CSV or JSON format.

  • What is a session entity and how does it differ from other entities?

    -A session entity is defined at the session ID level and is tied to a specific user and their session, allowing for dynamic updates based on the conversation.

  • How does the chatbot respond when a user provides all the required information in one input?

    -When a user provides all required information in one input, the chatbot sends a confirmation response back to the user right away.

  • What is the next step for the appointment scheduler chatbot discussed in the script?

    -The next step is to integrate the appointment scheduler with Twilio Messaging Service, which will be covered in the next episode.

Outlines

00:00

🤖 Introduction to Entities in Dialogflow

Priyanka Vergadia hosts 'Deconstructing Chatbots', where she delves into Dialogflow's entities. Entities are a mechanism for extracting data from user input. She reminds viewers to watch previous episodes for context and explains the three types of entities: system, developer, and session. System entities automatically extract common data like addresses and phone numbers. Developer entities are customized for specific use cases, demonstrated by creating an 'Appointment Type' for a DMV scheduler, including services like driver's license and vehicle registration. The episode also covers adding entities, using slot filling to ensure all necessary information is collected, and modifying responses to include appointment details. The importance of saving changes and testing updates is emphasized.

05:00

📚 Session Entities and Upcoming Integration

The second paragraph focuses on session entities, which are unique to each user session and can be updated dynamically based on the conversation. Priyanka gives an example of how an 'Appointment Type' entity might be updated to include a state ID or motorcycle test. She encourages viewers to try these concepts and share their experiences. The episode concludes with a teaser for the next installment, which will cover integrating the appointment scheduler with Twilio Messaging Service.

Mindmap

Keywords

💡Entities

Entities in the context of Dialogflow are mechanisms used to identify and extract useful data from user inputs. They are crucial for understanding user intent and providing relevant responses. The video discusses three types of entities: system, developer, and session entities, and explains how they are used in an appointment scheduler chatbot to extract information such as date, time, and appointment type.

💡System Entities

System entities are pre-defined by Dialogflow and can automatically extract information like dates, times, addresses, emails, currency, and phone numbers without additional configuration. In the script, system entities are used to automatically recognize and extract the date and time when a user wants to schedule an appointment.

💡Developer Entities

Developer entities are custom entities created by developers to capture specific information relevant to their application. In the video, an 'Appointment Type' developer entity is created to categorize services like 'drivers license' and 'vehicle registration' for a DMV appointment scheduler chatbot.

💡Session Entities

Session entities are defined at the session level and are tied to a specific user and their session. They allow for dynamic updates based on the conversation context. The video gives an example where the 'Appointment Type' entity could be updated to include 'state ID' or 'motorcycle test' based on the user's responses during the session.

💡Intents

Intents represent user's intentions or actions. The video mentions adding more intents to accommodate the 'Appointment Type' entity, which helps the chatbot understand and respond to user requests for scheduling different types of appointments.

💡Slot Filling

Slot filling is a process where the chatbot prompts the user to provide missing information required to fulfill an intent. The video illustrates how slot filling is used to ask for the time and date if a user only provides the appointment type, or vice versa.

💡Training Phrases

Training phrases are examples of user inputs that help Dialogflow understand how users might express their intents. The script suggests adding training phrases like 'Set an Appointment for Driver's License for 3:00 PM tomorrow' to teach the chatbot to recognize and extract entities from user inputs.

💡Prompts

Prompts are the messages that the chatbot uses to ask users for information. The video discusses defining the right prompts for when a user does not provide the necessary appointment type, ensuring the chatbot can guide the user to provide complete information.

💡API

API stands for Application Programming Interface, which allows developers to create, manage, and update session entities programmatically. The video mentions that session entities are managed using the Dialogflow API, highlighting the technical aspect of chatbot development.

💡Dialogflow

Dialogflow is a Google-owned developer platform used to build conversational interfaces for websites, mobile applications, and other services. The video is a tutorial on how to use Dialogflow to deconstruct and build chatbots, specifically focusing on the use of entities.

💡Twilio Messaging Service

Twilio Messaging Service is a cloud communications platform that allows developers to send SMS, MMS, and WhatsApp messages. The video hints at an upcoming episode where the appointment scheduler chatbot will be integrated with Twilio, suggesting the expansion of the chatbot's functionality beyond just scheduling appointments.

Highlights

Introduction to the episode 'Deconstructing Chatbots' with Priyanka Vergadia

Exploration of entities as Dialogflow's mechanism for extracting data

Explanation of the three types of entities: system, developer, and session entities

Demonstration of how system entities automatically extract information like date, time, address, emails, etc.

Example of creating a developer entity 'Appointment Type' for a DMV appointment scheduler

Discussion on adding entity types like 'drivers license' and 'vehicle registration'

Option to automatically add new entities based on training phrases

Capability to upload or download entities in bulk formats like CSV or JSON

Adding intents to accommodate the 'appointment type' entity in user inputs

Slot filling as a method to ensure all required fields are provided by the user

Defining prompts for when users do not provide the appointment type

Modifying responses to include appointment type along with date and time

Testing updates with sample inputs to ensure the chatbot works correctly

Explanation of session entities and their use tied to a specific user session

Example of updating session entities based on conversation with the user

Invitation to try the methods discussed and share feedback in the comments

Summary of the episode covering the three types of entities and their setup in a chatbot

Teaser for the next episode which will integrate the appointment scheduler with Twilio Messaging Service

Transcripts

play00:00

PRIYANKA VERGADIA: Hey, everyone.

play00:01

I am Priyanka Vergadia, and you are watching

play00:03

"Deconstructing Chatbots."

play00:05

In today's episode, we will explore entities further.

play00:08

[MUSIC PLAYING]

play00:15

From the second and third episodes,

play00:18

you might remember that entities are Dialogflow's mechanism

play00:22

for identifying and extracting useful data from user's input.

play00:27

If you've not checked out the episode

play00:29

on "Getting Started with Dialogflow,"

play00:31

please do so for more context.

play00:34

Just scroll up to the second episode on the right,

play00:37

or click in the link and description below.

play00:40

There are three types of entities-- system entities,

play00:43

developer entities, and session entities.

play00:46

Now you might remember from our appointment scheduler chatbot

play00:49

when we said need an appointment for 4:00 PM tomorrow,

play00:53

the date and time were automatically

play00:55

extracted as system entities date and time.

play00:58

It was all automatic.

play01:00

As you saw, system entities allow

play01:02

agents to extract information about a wide range of concepts

play01:07

without any additional configuration.

play01:09

Data like address, emails, currency, phone numbers

play01:14

are some of the common examples of system entities.

play01:17

Now so far, we have been addressing our appointment

play01:21

scheduler in a generic manner.

play01:23

Let's say our scheduler is for DMV.

play01:26

We click on Entities and create a new entity.

play01:30

Let's call this Appointment Type.

play01:34

Let's think about the types of services DMV offers.

play01:38

Most people go to the DMV for a drivers license,

play01:41

maybe vehicle registration, also driving tests.

play01:45

So in our scenario, let's stick to the two main services--

play01:48

drivers license and vehicle registration

play01:51

are obviously the two main ones that I

play01:53

can think of that DMV offers.

play01:55

So let's create those two as entities.

play01:59

You can add more rows with more services as entity types.

play02:03

Additionally, you can check the box

play02:04

to add more entities automatically.

play02:07

When an entity is not available in the entity list,

play02:09

Dialogflow identifies that this is an entity based

play02:13

on other training phrases and adds that new entity

play02:16

automatically to the list.

play02:17

You can also upload or download entities in bulk

play02:20

in CSV or JSON format.

play02:24

Now let's add more intents to accommodate the appointment

play02:27

type entity in our inputs.

play02:29

When you add Set an Appointment for Driver's License for 3:00

play02:31

PM tomorrow, driver's license is identified as developer entity

play02:36

that we just set up, while time and date are obviously

play02:39

system entities.

play02:41

Add a few more training phrases like these.

play02:45

Now remember slot filling from episode three

play02:48

when we built our appointment scheduler?

play02:50

To book an accurate appointment, we

play02:52

needed to make appointment type a required field

play02:55

just like time and date.

play02:56

Let's define the right prompt for when a user does not

play03:00

provide us the appointment type.

play03:01

Now while we are at it, let's modify our response

play03:05

to include the appointment type along with the date and time

play03:08

to make it look more complete.

play03:11

When done, don't forget to save your changes.

play03:14

And then, let's test our updates now with some sample inputs.

play03:18

The first example, let's say, user only

play03:21

gives us the appointment type.

play03:23

Well, slot filling kicks in and asks for the time and the date

play03:28

when they want to come in.

play03:30

All looks good.

play03:31

We get the appointment scheduled.

play03:35

In the second example, let's say, a user says,

play03:38

I need an appointment for 4:00 PM tomorrow

play03:40

without providing us the appointment type.

play03:43

Again, our slot filling kicks in and prompts the user

play03:47

to provide us the service information.

play03:50

They say driver's license, and we

play03:52

provide them a response with their appointment confirmation.

play03:56

In our third and last example, let's say

play03:59

the user gave us all three things

play04:01

we needed in just one shot-- set an appointment for vehicle

play04:05

registration at 2:00 PM tomorrow.

play04:07

Our bot has everything it needs, so it

play04:09

sends a confirmation response back to the user right away.

play04:14

Now the third type of entity is session entity.

play04:18

These are defined at session ID level, which

play04:21

allows for a specific entity to be tied

play04:24

to a user and their session.

play04:27

Let's take an example to understand this better.

play04:31

Our agent had appointment type as entity,

play04:34

which includes drivers license and vehicle

play04:36

registration at this point.

play04:39

That entity could be updated to include a state

play04:42

ID or a motorcycle test depending

play04:45

on the information your agent collects from the user

play04:48

during the conversation.

play04:50

The updated session entity will have state ID or motorcycle

play04:55

test entry for rest of the conversation with your user.

play05:00

Well, try this out on your own, and let

play05:02

me know how it goes in the comments below.

play05:04

Remember, you will create, manage, and update

play05:07

session entities using the API.

play05:11

That was a lot, so let's summarize.

play05:13

Today, we looked at the three types of entities--

play05:16

system entity, developer entity, and session entities.

play05:19

Then, we went hands on and learned

play05:22

how to set up these entities in our appointment scheduler

play05:25

chatbot.

play05:26

Don't miss the next episode of "Deconstructing Chatbots"

play05:29

because we are going to integrate our appointment

play05:32

scheduler with Twilio Messaging Service.

play05:35

[MUSIC PLAYING]

Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
ChatbotsDialogflowEntitiesDevelopmentTutorialAppointment SchedulerSystem EntitiesDeveloper EntitiesSession EntitiesSlot FillingTwilio Integration
هل تحتاج إلى تلخيص باللغة الإنجليزية؟