Concepts
- Classes
- Instances
- An Example
- More Examples
- System Concepts
- Parents of A Class
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 all 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. Additionally, while defining a sentence under the intent tab, you can reference a class by selecting its ID from a list that should pop up whenever you enter an @ sign. We will be discussing how to use a class ID in more details later. Also, 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, depending on the class ID (Often a class ID is just a meaningless combination of digits, along with numbers), might be, as you can see, rather confusing to an app developer, not to mention to the speaker. 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.
Fig. 2. A sentence that references the myFamily10a class
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. Were I a seller of cars, in Fig. 3-a, 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 Fig. 3-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 Fig. 3-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).
Fig. 3-c shows the sentence "Are you looking for {the vehicle class} for sale?", which can represent either:
Are you looking for a + truck + for sale?
or
Are you looking for a + lorry + for sale?
Note that you might have noticed in Fig. 3-c, there is no article in front of the word vehicle, and that it seems obviously ungrammatical. The reason is that stop words (such as a, an, the) can be omitted while defining sentences. Our system won't take stop words into consideration.
Fig. 3-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. 3-a and 3-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. 3-a. Define a class with instances of words.
Fig. 3-b. Define a class with instances of phrases.
Fig. 3-c. Sentence definition containing classes.
Fig. 3-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.
The Parents of a Class
You can also define a hierarchy between concepts by specifying which is whose parent, thus making classes more organized.
In Fig. 5, 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 Fig. 6, you can see the movie class is under the arts class.
Fig 5. Define the parents of the movie class.
Fig. 6. Hierarchy trees.