Concepts
Classes
If a set or category of vocabularies has a common trait or attribute, it is recommended that you define a class (just think of it as a category) representing these vocabularies. As a result, while you are creating sentences under the intent tab, referring the class means referring one of the vocabularies in the class. But for this feature of defining a class to represent a bunch of vocabularies of a meaning, intent design could be a rather tedious effort.
Class IDs
The name of a class is represented by its class ID. This field specifies a name used to identify the class. It should be noted that every class should be given a unique class ID.
Class Synonyms
The DS uses the values in this field for collecting/asking missing information, a process we call clarification, which will be discussed later. In Fig. 1, under the Concepts tab, we see that there are a class with ID=myFamily10a and a class synonym family member. In addition, in Fig. 2, under the intent tab, we have a sentence referencing the myFamily10a class, where we set a belief called member. Then suppose a speaker doesn't provide the information of the family member. (For example, s/he just says, "I am going to visit.") In this case, the DS will need further clarification, a process done by asking a question inquiring the missing information. What will the DS do? Normally, under the plan tab, if we have defined one or more prompts for the belief, the DS will ask the speaker a question according to whatever the message(s) stored inside the prompt field. But, let's assume we forgot to define it. If we don’t define any class synonym, the DS will only be able to ask questions such as "What's your myFamily10a?", which might be, as you can see, rather confusing to an app developer, not to mention to the speaker, depending on the class ID. (Often a class ID is just a meaningless combination of digits, along with numbers.) On the other hand, supposing we have defined the class synonym family member, the DS can instead ask questions such as "What's your family member?” which obviously makes much more sense.
Note that by clicking the blue plus icon under class synonyms, one can see a list pop up showing class synonyms recommended by the system.
Fig 1. Class Synonym (the class synonym should be “family member”)
Fig 2.
Phrases
A sentence can be either a word or a phrase. For more information on what a phrase is and how to create one, please see phrases on the navigation panel.
Instances
A class can instantiate instances that belong to it. For example, supposing there is a class called human, then we can create instances such as artist, engineer, and writer, which all belong to the human class.
Instance IDs
An instance ID is similar to a class ID. The name of an instance is called the instance ID.
Instance Synonyms
By pressing the plus icon beside an instance, you will see a list of synonyms of the instance pop up.
An Example
To have a better understanding of why and how we should use concepts, let's look at an example. Supposing a developer wants to create an intent meaning "I like + some fruit."---which could be "I like apples." or "I like oranges.", etc.---, we suggest that s/he define a sentence of the intent as "I like {the fruit class}." (which is more generic) rather than define other sentences such as "I like apples." or "I like oranges." (which is, in contrast, too specific and not general enough). It is obvious that if s/he chose not to define the fruit class, s/he would have to enumerate all kinds of fruit lest the DS be unable to recognize what s/he says. Undoubtedly, this choice would be extremely impractical and definitely not worth considering.
In addition, a word might have different meanings once its context is changed. For example, the phrase big apple could simply mean a very big apple, but on the other hand, it is also a nickname of New York City. Hence, having defined the fruit class, the DS knows "I like big apples." doesn't mean "I like New York City." since New York City does not belong to the fruit class.
More Examples
Let's look at another example. In Figure 1-a, were I a seller of cars, I would want to define a vehicle class and then instantiate it by creating all the types of vehicles I sell, such as trucks and cars. Thus, in Figure 1-a, we create a class named vehicle, which is synonymous with Automobile, motor vehicle, motorized vehicle, and instantiate two instances with different IDs, one of which is truck_id, the other lorry_id. The first instance is called truck, and the second, lorry. Note that there are only instances of words (which are the opposite of phrases) created in the vehicle class. A word is the opposite of a phrase and can be distinguished from a phrase by its color---a word icon is in blue, and a phrase icon, by contrast, in purple.
In Figure 1-b, we create a class named buy_a_vehicle, and as its name suggested, this class ought to mean something like buying a vehicle, of which the sentence structure should be a verb following by an object, thus forming a phrase. The first instance the class instantiates is called buy a vehicle, a phrase composed of two words (“buy” and “a”) and a class (vehicle). After combining them together, the instance becomes a phrase (buy a vehicle). Similarly, the second instance is made up of two words (“purchase” and “a”) and the vehicle class, thereby forming a phrase (purchase a vehicle).
Figure 1-c shows the sentence "Are you looking for {the vehicle class} for sale?", which can represent either
Are you looking for + truck + for sale?
or
Are you looking for + lorry + for sale?
Figure 1-d shows the sentence "I want to {the buy_a_vehicle phrase}.", which can represent
I want to buy a truck.
I want to buy a lorry.
I want to purchase a truck.
I want to purchase a lorry.
Do Not Instantiate a Class with Words, Mixed with Phrases!
One more thing that needs to be clarified is that it is crucial that you not instantiate a class with words, mixed with some phrases. You should instantiate a class with words only, or phrases only. Why? This is because it is just illogical to instantiate a class which is supposed to be a category of words, such as the vehicle class, with a few phrases, such as buy a vehicle.
The Right Arrow Icon
Moreover, in Fig. 1-a and 1-b, the right arrow icons beside the plus icons next to the instances are buttons for setting up properties, which will be discussed in detail later in this page.
Fig 1-a. define a class with instances of words
Fig 1-b. define a class with instances of phrases
Fig 1-c. sentence definition containing classes
Fig 1-d. sentence definition containing phrases
System Concepts
System Concepts are built-in reference classes defined in our system. A system concept can be either an entity or a phrase.
For more information, please see the System Concepts section on the navigation panel.
Define a Property
We can define one or more properties that an instance has. To give an example, in Figure 3 below, we specify that the instance of the movie---The Avengers---has a property=(key:hasDirector, value: Joss Whedon), meaning The Avengers is directed by the film director Joss Whedon. Later on the DS can use this information for user queries, such as "Who is the director of The Avengers?”
Fig 3. Define property
Parents
You can also define a hierarchy between concepts by specifying which is whose parent, thus making classes more organized.
In figure 4, we can see a hierarchy of the concepts arts and movie. The movie class has the parent arts. Thus, all the instances belonging to the movie class are the instances of the arts class.
In Figure 5, you can see the movie class is under the arts class.
Fig 4. Define the parents of the movie class
Fig 5. Hierarchy trees