Step 3: Create the flight booking questions

We have our entities and our passage, it's time to create the questions that will capture the cities the user mentions  and store them in our entities.

Let's take a quick look at how entities work:

  • An entity has a set of values, which are words or phrases that should match the entity.
  • When your user asks a question, the chatbot matches it against all its training phrases.
  • If the training phrase that best matches the question uses an entity, the chatbot compares the user's question to the entity values:
    • If the words the user mentioned match a value in the entity, that value is assigned as the entity's value for the passage.
    • If the words the user mentioned don't match any of the entity's values, the training phrase is still selected, but the entity value is blank.

In this case, the chatbot compares the user's words to all the city names in the entity template. If the user asks to fly between two made-up cities, our training phrases will still match, but the entity values will be blank.

Let's create an Inbound Question to capture the two cities:

  1. In the Flight booking passage, click Inbound Questions.
  2. Add a new Global question.
  3. Type a training phrase.
    When you want to use the entity in the phrase, type @ and select the entity from the list.
    Each entity can only be used once per training phrase.
  4. Add more training phrases until you have at least five.
    Make sure all your training phrases use both entities. If you use the Generate Training Phrases option, make sure you edit each phrase to use the entities.
  5. Click Save.

Make sure all training phrases use the entities

Entities are assigned by the matching training phrase. If the training phrase that best matches doesn't use an entity, then the chatbot won't capture the information. The passage will still be selected, but there won't be any value in the entity, and the entity placeholder will be blank.

This also happens if the conversation flow reaches the passage without a question, such as being directed from another passage, or if the words the user used don't match any of the entity's values.

To capture the cities and use them in our response, we need to make sure every training phrase in the Inbound Questions for this passage uses both entities, and that there is no other way the conversation flow can reach this passage.

Now that we've captured values for our entities, let's use them in our chatbot response.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.