Header Ads

How to create a chatbot using google dialogflow

How to create a chatbot using Google Dialogflow: Hello Everyone! Welcome to this article. If you are here you might be looking to create a chatbot using Google Dialogflow. But you don’t know working with DialogFlow.

Don’t panic. I’ll tell you how to create a chatbot using Google Dialogflow. You might be thinking about how we can do this without coding. Believe me, it’s easy to do.


How to create a chatbot using google dialogflow


What is DialogFlow?

DialogFlow is a development platform developed by Google that can help us create chatbots. It is based on NLP (Natural Language Processing) which gives our chatbots the potential to be very powerful.

What is a chatbot?

A chatBot is an intelligent program that can communicate with people like humans and serve them in the specific domain where it was created. ChatBot analyzes client intent and analyzes the response that is most favorable.

Now that you know what dialog flow and chatbot are, let's see how we can create a chatbot using dialog flow.

Note: You must have a Google Account and be logged in to the Dialog Flow platform before following these steps.

In this article, we will create a chatbot that can serve clients who would like to make a reservation for a hotel bedroom.

Step 1 Create an agent

An agent is an intelligent program within the chatbot, a program that communicates with clients or users.

To create an agent, go to the left side of your screen and click the first button below the dialog flow logo and scroll down to the new agent button.

After that, a new screen will load, and you'll be asked to specify the agent's name, what language he or she should speak, and the time zone. 

For me, I type reservation-bot for the name, and for the rest, I leave out the default values. After that, you have to click on CREATE button and DialogFlow will create an agent for your chatbot.

Step 2 Make intents

Intentions are used by chatbots to understand what clients or users want. It is in this context that we provide chatbots with examples of phrases that clients may ask and some answers that chatbots may use to respond to clients. Without wasting any time go and see how we can do this.

Note: When we create a new agent, it comes with two default intentions called default fallback intent and default welcome intent.

For creating a new intent, click the Create Intent button.

After that, you must name your intention. Then go to the training phrases section and click Add training phrases. This section deals with the way in which you should give an example of a phrase that represents the various questions that a client can ask a chatbot. We suggest giving many examples to make your chatbot very powerful.

For example, you can use sentences like mine.

We've added some phrases that clients may ask our chatbots, for your own chatbots, feel free to add any other phrases to improve the power of your chatbots.

In this picture, we can see that the two impressions are overlined. In fact, DialogFlow has identified these impressions as an entity. DialogFlow recognizes three types of entities, which are given as systems entities, developer entities, and session entities. 

This night and today are recognized as a system entity, it refers to the period of time or date, this type of entity is already set in the dialogue flow. Later we will create our own entities which DialogFlow will recognize as developer entities. For more information, check this document.

Now, let's explain some of the answers that an agent can use to answer clients. Scroll down to the answer section, click the Add Answer button, and add some answer statements.

You can see that within the examples of these answers there are some impressions that start with the $ symbol, these expressions are considered as variables which will include the values ​​which the client will mention in their questions, And the dialogue flow must have been recognized as a specific entity. 

In the picture above, we have three variables, such as $ time-period, $ date-time, and $ reservation-type. $ time-period and $ date-time are variables of system entities and $ reservation-type is a developer entity variable, which means that $ reservation-type must be created by the developer before DialogFLow Recognize it. After adding some answers that the agent should use, click the Save button, we'll come back to that later.

Step 3 Creation of entities

In fact, organizations are keywords that help the agent identify what the client wants. To make it, just follow me.

Click the Entities button.

After clicking the Create Entity button

Next, name the entity (you should swear the reservation as your entity name because you used it as a variable when you gave the agent some answers). Then, add an entity bedroom and some synonyms like downstairs.

Be sure to check the case before the synonym explanation, and then click the Save button.

The role of synonyms is that, when clients should talk about bedroom, bed, or room, they should all refer to the bedroom.

Do the same with the entity reservation action and save it.

Now, we have two companies ready to use.

Step 4. Adding our entities in the expression of training phrases.

  • Go back to the reservation intent interface and go to the training phrases section.
  • When you're there, select an expression, and select the word bedroom within that expression.
  • Then, research for the قسم reservation type.
  • And click on it, and the color of the bedroom will change.
  • Do the same thing with all bedrooms within all impressions.
  • Do the same for the words booking, reservation, and reservation, but you will research the reservation action instead of the reservation type.

Step 5 Definition of parameters and actions

It is not required, but in some cases, it will be important for the user to provide some information to the chatbot.

Scroll down to the Actions and Parameters section, always within the reservation intent interface. You should have this image below.

For our chatbot, we want the client to provide the type of reservation and the date of the reservation. Be sure to check it out.

Next, we must specify the text that the agent should show to the client when they have not specified the required parameters. You need to click Define prompts… space in the right place of this section, after specifying the prompt text, close the box dialog.


  • For the date-time parameter
  • For reservation type parameters
  • Then save the intention.
  • Now you can test your chatbot.
  • You can test your chatbot here.

Step 6 Integration on web platforms

  • Click the integration button.
  • You can integrate your chatbot into many platforms, such as Facebook Messenger, WhatsApp, Telegram, and more.
  • For this article, we are going to choose Web Demo.
  • Click the link, and test it again.

Conclusion:

So, this was all about "How to create a chatbot using google Dialogflow". We have inserted a lot of effort into bringing this in front of you. If you want to ask something, or you have any queries feel free to comment below. We will definitely respond back. Thank you very much for being here.

No comments:

Powered by Blogger.