ok
CHOOSE YOUR LANGUAGE

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. This class might come in handy in the intent tab page, because while you are creating sentences, referring to the class means referring to 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.

Type

A concept can be either of type class or phrase. Selecting "class" requires all instances to be composed of classes. Selecting "phrase" requires all instances to be made up of phrases (purple icons).

Class

The name of a class is represented by its Concept ID. This field specifies a name used to identify the class. While defining a sentence in the intent tab page, you can reference a class by selecting its ID from a list that should pop up after you enter an @ sign. We will be discussing how to use a class ID in detail later.

It should be noted that every class should be assigned a unique ID.

 

Class Synonyms

The DS1. uses the values in this field for collecting/asking missing information, a process we call clarification, which will be discussed later.

1. DS stands for dialogue system, and we will continue using this acronym in this tutorial.

Here is an example. In Fig. 1, in the Concepts tab page, we see that there are a class with ID=myFamily10a and a class synonym family member. In addition, in Fig. 2, in the intent tab page, we have a sentence referencing the myFamily10a class, where we set a belief called member. Then suppose a speaker fails to provide the information of the family member. (For example, s/he might say, "I am going to visit.") In this case, the DS will need further clarification, a process done by asking a clarifying question inquiring the missing information.

What will the DS do about it? Well, in the plan tab page, 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. However, let's assume we forgot to define any prompts for the belief. Then based on our system design, if the class synonym field is empty, the DS will try to clarify what s/he said through a series of clarifying questions, only to be able to ask something 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 some letters.), 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 a class synonym called family member, the DS can instead ask clarifying questions such as "What's your family member?”, which obviously makes much more sense.

Lang

Selecting "All languages" means the synonyms can be processed and recognized whatever Zenbo's background language is. Selecting other ones, however, indicates that the synonyms can be processed only if Zenbo's background language is set to that language.

 

Fig. 1. Class Synonyms.

 

Fig. 2. A sentence that references the myFamily10a class 

 

Instances


A class can instantiate instances that belong to it. For example, supposing there is a class called human, then we might want it to have instances such as artistengineer, and writer, which all belong to the human class. Note that a class cannot have two duplicate instances. 

To add more instances, click +New item.

Instance IDs

An instance ID is similar to a class ID. The name of an instance is called the instance ID.

Lang

Selecting "All languages" means the instances are able to be processed and recognized no matter what Zenbo's background language is. Selecting others, however, indicates that they can be processed only if Zenbo's background language is set to that language.

Instance Synonyms

By pressing the plus icon beside an instance, you will see a list of synonyms of the instance pop up.

Phrases

You can construct an instance by mixing up some plain words, concepts, and even phrases to form a bigger phrase.  For more information on what a phrase is and how to create one, please see phrases on the navigation panel.

An Example


To have a better understanding of why and how it's a good idea to create concepts, let's look at an example. Supposing you want to create an intent meaning "I like + some fruit."---which could be "I like apples." or "I like oranges.", etc.---, we suggest defining 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 Automobilemotor vehiclemotorized 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 concept defined in our system. A system concept can be either an class 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.

 

Go To Top