ok
CHOOSE YOUR LANGUAGE

Intent

  • An Overview
  • Intent IDs
  • Sentences
  • Using References When Defining an Intent
  • Some More Details on the Options when Typing the @ sign

 

An Overview

Intent is the thing one plans to do. In our DS system, one's intent is expressed by a sentence conveying one's intention. The purpose of defining intents is to make the DS capable of recognizing what a speaker is trying to do. Because people can express an idea through different sentences, it is the developer's responsibility to enumerate all the possible sentences that a speaker might say for a particular intent in order for the DS to correctly identify what intent the speaker is trying to express.

Here is an example:

  • I like you.
  • I don't hate you.

Although constructed by different words, the above two sentences essentially mean the same thing. Therefore, you need to build as many sentences conveying the same intent as possible lest the DS fail to recognize the speaker's intent.

Please see the further discussions below so that you can familiarize yourself with intents.

 

Intent IDs

Firstly, you need to give an ID to each intent so that it can be referenced later while defining plans under the plan tab.

In Fig. 1, we give the intent an ID called where_to_travel.

Fig. 1. Give a name, or ID to an intent.

 


Sentences

It is imperative that you create at least one sentence for every intent.

A sentence represents one of the various ways of expressing an intent. Usually there is more than one way to express an intent; therefore, it the your responsibility to enumerate all the possible paraphrases that the speaker might use to convey the intent.

To give an example, considering the following three sentences, although composed of different words, they mean the exact same thing. Thus, they are considered equivalent.

Hardly had I arrived home when my phone rang.
I had scarcely arrived home when my phone rang.
No sooner had I arrived home than my phone rang.
...

Of course you can easily come up with more sentences expressing the same idea.

Hence, you should include at least, but not limited to, all the above sentences. Sounds tedious? It is worthwhile to note that a simple way to circumvent this cumbersome enumeration is to use references, which will be discussed later in this page.

Furthermore, when creating intents, it is preferable to avoid using segmental words, for the DS sentence recognition reason. Thus, regarding the following two sentences,

  • sentence 1: "I want to go to Las Vegas this weekend."
  • sentence 2: "I" | "want" | "to go" | "to Las Vegas" | "this weekend" | "."

It is recommended that you build the sentence as the first one instead of the second.

 

Fig. 2. All these sentences mean the exact same thing.

 


Using References When Defining an Intent

It's a good idea to use references when defining intents. As mentioned earlier, you can reference a class by simply typing an '@' and click add @ that pops up below.

 

Reference Classes

When trying to create an intent, you must create all the conceivable sentences that can express it. Enumerating all the possible variations, however, might cause considerable redundancy. For example, "I want to see a movie.", "I want to go to see a movie.", "I plan to go to see a movie." You got the idea. And it is in fact impractical to do so. A better solution is using class references.

In Figure 3, supposing, under the concepts tab, we have defined a class named myCity instantiated by some city names such as New York and London, under the intent tab, we can see the forth sentence contains the class reference myCity. How to create this orange rectangle is shown in the same figure.

 

Fig. 3. Using the city class reference.

 

System Concepts

Furthermore, our system predefines a set of built-in system entities/phrases you can refer to (they are just some reference classes), thus making the development much more convenient. For those who are interested in our system defined entities/phrases, please see system concepts on the navigation panel. Fig. 4 below shows you how to use the built-in entitybase.geo.city in the fourth sentence definition.


Fig. 4. Using the system.geo.city system.entity.

At this point, we are able to eliminate the redundant sentence definitions that exist in Fig. 4. The results are shown in Fig. 5. Obviously this new version is a lot more efficient and elegant, compared to the previous one.

Note that there are two more new sentences created in this figure because they have the same meaning so they can also be included.


Fig. 5. Reduced sentence definition.

 

Reference Phrases

Additionally, you can reference a phrase in the same way you reference a class. Please see Fig. 6 below to get an idea of how to do it.

 

Fig 6. Phrase references.

 


Some More Details on the Options when Typing the @ sign

Set Beliefs

Set belief is used to save information of a user utterance in one or more parameters, of which the values you might want to use in the future. You can retrieve the values of parameters under the plan tab.

  1. Set Phrase Beliefs 
    To set a phrase belief, follow the left screenshot in Fig. 7 below. In this figure, buy_a_vehicle is a phrase from which we extract a belief called buy_a_vehicle_belief. Owing to the fact that the phrase buy_a_vehicle is composed of "buy a" + {the vehicle class}, we can set the phrase belief concept to vehicle so that if someone says “I want to buy a truck”, the word truck will be extracted and assigned to the belief buy_a_vehicle_belief (of which the value can be manipulated afterwards under the plan tab).
  2. Set Class Beliefs 
    To set a (class) belief, follow the right screenshot in Fig. 7 below. The second sentence is made up of "recommend" + {the vehicle class}. We can extract a belief from this vehicle class. Thus, supposing someone says, "recommend a truck", the word truck will be extracted and assigned to the belief vehicle_belief (Again, this belief can be used later under the plan tab.).


Fig. 7. How to Set a Phrase/Class Belief

 

Order

If the order box of a belief is checked, it means that the order of the class/phrase references in the sentence where the belief is extracted matters.

In Fig. 8, we see that both order boxes of adverbs_of_time and anEvent_nounClause are not checked, which means their orders are interchangeable. Therefore, let's say this intent can cover the sentence

"He said on Wednesday he wanted to see you."

And since the two reference classes are not ordered, this intent can of course also cover the sentence

"He said he wanted to see you on Wednesday."

Were these selection boxes checked, only the first sentence would be covered.

 

Optional

When you are writing a sentence, if the optional box is checked, it means that the class/phrase references in the sentence is optional; thus, the sentence will be chosen by the DS irrespective of whether or not the speaker says an instance of the class/phrase references in his or her utterance.

Again in Fig. 8, the reference class adverbs_of_time is optional, for its optional box is checked, meaning the presence of an adverb of time is optional. Hence, let's say this intent can cover the sentence "He said on Wednesday he wanted to see you." And since the first reference class is optional, this intent can also cover the sentence "He said he wanted to see you." If the first reference class were not optional, the second sentence would not be covered.


Fig. 8. An example of check boxes and their capabilities.

 

Set Phrase Belief

Set phrase belief is used to extract information of a phrase from the speaker's utterance.

 

Exception Set

While you are defining a sentence of an intent, there is an option for you to specify an exception set, which is a set of instances of a class. The instances included in the exception set won't be given any consideration when they are part of a sentence. For example, suppose the DS is searching for the sentence defined as "I lived in {...} for three years.", where {...} is a class of country names and the exception set={Germany}. Then the sentence---"I lived in Germany for three years." won't be matched even though Germany is a country, for the word Germany is in the exception set.

 

Go To Top