Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

There are several resources that may be useful for you to learn more about Dialogflow. First, check out Google’s documentation, for example, about Dialogflow agents, intents, and entities. You might also find it useful to inspect the following external resource about developing a Dialogflow agent: medium.com. In this project, we will (only) use the basic Natural Language Understanding (NLU) capabilities that Dialogflow provides: transcribing (speech) utterances, classifying those utterances into intents, and extracting entities from those utterances. There are a few specific requirements for making a Dialogflow agent that we use for NLU work seamlessly with the MARBEL agent that we use for dialog management. Make sure to check out the specifics below!

Creating an intent in a Dialogflow agent

You can add a new intent to your Dialogflow agent manually, using the https://dialogflow.cloud.google.com/ console, or by uploading a JSON file. For some intents, that require many examples as Training Phrases to work well, we have provided you with such files.

Check out Google’s documentation for Dialogflow with instructions on how to https://cloud.google.com/dialogflow/es/docs/intents-manage. It is important to add good https://cloud.google.com/dialogflow/es/docs/intents-training-phrases. You should think of good phrase variants yourself. But just as important, you may also find out about which phrase variants you should add by inspecting actual conversations that your agent has with someone during testing. Ask your team members to conduct conversations and check out the Training https://cloud.google.com/dialogflow/es/docs/training tool afterward.

Be sure to press the blue 'SAVE' button when you are done. If you have provided over five phrases, Dialogflow will already start training a classification model that recognizes phrases similar to the training phrases you provided.

It is very important to also fill in the correct intent name in the Actions and parameters box! If you forget to add this, your MARBEL agent will not receive any intents from your Dialogflow agent!

Note that entity names under the Action and Parameters area should be specified in lowercase.

Uploading an intent

On the page where you can create a new intent, you can also select the three vertical dots in the upper right-hand corner next to the Create Intent button:

From the menu that then appears, you can select Upload Intent. You can choose a JSON file from your, upload it, and save the intent. By hoovering over an intent, you can also select to download that intent.

Adding and uploading entities to a Dialogflow agent

Entities can be added by selecting Entities in the left sidebar menu in the https://dialogflow.cloud.google.com/ console. You can specify an entity type such as recipe and for each type specify entity entries such as, pasta aglio e olio, for example. Check out Google’s documentation on https://cloud.google.com/dialogflow/es/docs/entities-overview.

When manually creating entities, use the synonym functionality to make sure that multiple words or phrases that are considered equivalent (synonyms) are mapped onto the same main entity entry word, also known as the reference value. Some entity entries have multiple words or phrases that are considered equivalent, such as, for example, scallion and green onion. For these entity entries, you provide one reference value and one or more synonyms. This is important for the robustness of the agent, since different users may use different words to refer to the same entity entry. We provide one more example to illustrate what this looks like:

On the right, various synonyms are listed for the entity entry reference value southern-american. We did not pick the reference value randomly here but derived it from how recipes are represented in the database of recipes (the recipe_database.pl file). The cuisine of a recipe from South America is coded as 'southern-american', which is why the reference value of the entity entry (the name on the left) is exactly that. This will ensure that any of the phrases to the right when mentioned by a user will be mapped onto the reference value. This value, in our example 'southern-american', will be forwarded to the MARBEL agent and because it matches with the way things have been coded in the database this will facilitate matching entity entries received from the Dialogflow agent with values in the database processed by the MARBEL agent.

While we will ask you to create some entities, for your convenience, we have provided you with CSV files for some of the entity types which have many entity entries (such as the ingredient type, for example). You will not have to manually add all of these entity types yourself!

A disclaimer is in place though: Although we have tried to do our utmost best to ensure the quality of the data we provided, we cannot give 100% guarantees that there are no issues with it and there may still be small mistakes in the CSV files (due to the automatic processing of the data after scraping it from a website).

The files that we have provided to you can be used in Dialogflow by going to the main page of entities and clicking on the three vertical dots next to the blue ‘CREATE ENTITY’ button. Click Upload Entity and choose the file you wish to upload.

  • No labels