Skip to main content

Model Basics

What is the model?

The model, sometimes referred to as the interaction model, is the set of intents and entities that categorize what the user says to that it can then be used within the applications, specifically the dialog manager.

The primary building blocks of a model are as follows:

  • Intent A set of similar utterances, or things the user can say, that individually communicate the same intent
  • Slot A defined variable on an utterance within an intent used to capture data from the user
  • Entity Help take unstructured data and add structure, either through lists or parsing text to dates or time.

To illustrate how these components work together to build a model for a particular application, let's look at our virtual barista example. The virtual barista will leverage the built-in intents for the common utterances of "yes", "no", "cancel", which are provided by the NLUs. It also needs custom intents & entities specifically for taking coffee orders. Let's look at a typical coffee order:

May I have a large cafe au lait?


The important parts of the request are:

WordMeaning
largeSize
cafe au laitDrink

These are the start of two custom entities that will be used throughout your model. Insert slots for these entities in the example above and you have the first sample utterance of a custom Drink Order intent.

May I have a ${size} ${drink}?

important

The ${} notion is used in the above example to define the slot in the utterance where the value inside is the name of the slot. This notation will be used frequently throughout OC Studio to define slots and variables in the assistant's responses.

The example above is not the only way to express that you would like a drink, it is only one sample utterance of many that will come together to make up an utterance.

May I have a ${size} ${drink}?

I would like a ${drink}?

I would like a ${size} ${drink}?

${size} ${drink} please, ${packaging}

${size} ${drink} please, ${packaging}

Leverage existing transcripts, wizard of oz exercises and simple brain storming to come up with your initial list of sample utterances. It will the continue to grow and evolve once you start receiving live data.

In the last two samples, you noticed we added an additional slot ${packaging} as an opportunity to also capture if they want it "for here" or "to go". We now have three slots, each with a unique value set called an entity.

SlotEntityValues
sizeSizesmall, medium, large..
drinkDrinkcoffee, latte, mocha...
packagingDrink Packagingto go, for here

These entities can be used multiple times in the same intent (with different slot names) and used across different intents. They are list of values that tend to be mutually exclusive, a drink cannot be both large and small, and can have synonyms for each value. Let's take a look at the drink size entity.

ValueSynonyms
smalllittle, petite..
mediumaverage, mid-size...
largebig, sizeable...

While these synonyms are not the most popular values they still will be mapped back to the value and if the user says:

I need a sizeable coffee this morning

we will know what they mean.