*3.3. Utterance Selection in Each State*

Every state (except for the answer state) has a set of objects for the robot utterances and an algorithm for selecting an object from the set.

The question state has a set of objects shown in the Listing 1. When the system transitions to the question state for the first time, it selects an object among the set randomly. After the second time, it selects an object with the same topic as the previous question among the set, except for objects that have already been selected. The reason for maintaining the same topic is that it would be unnatural to change topics with every question. However, to prevent the user from getting bored, the topic is changed every four times.


```
1 [
2 {
3 Question: "Have you ever been abroad?",
4 Topic: "travel"
5 } ,
6 {
7 Question: "Where do you want to travel to?",
8 Topic: "travel"
9 } ,
10 {
11 Question: "What was your favorite food in childhood?",
12 Topic: "childhood"
13 } ,
14 ...
15 ]
```
The answer state has no set. The system selects no objects because it waits for the user to answer. The backchannel state has a set of objects shown in the Listing 2. The question key is used to associate a backchannel with a question. The keyword, 'key', is a list of answers expected of the user in the answer state. The backchannel key is a sentence with a backchannel. The algorithm for selecting a backchannel is as follows: First, the system selects objects having the same question key as the previous question and it searches whether any of keywords of each object is in the speech recognition results. If a keyword is in the speech recognition results, the object having that keyword is selected. In contrast, if there is no keyword in the speech recognition results, the system selected the object without keywords (i.e., default backchannel). For example, as shown in Figure 1, when the user answered "I don't remember." to the question; "Have you ever been abroad?", the second object of the

Listing 2: Objects in the backchannel state.

```
1 [
2 {
3 Question: "Have you ever been abroad?",
4 Keyword: ["yes", "yeah"]
5 Backchannel: "Cool!"
6 } ,
7 {
8 Question: "Have you ever been abroad?",
9 Backchannel: "I see."
10 } ,
11 {
12 Question: "Where do you want to visit?",
13 Keyword: ["kyoto", "tokyo", "osaka"]
14 Backchannel: "Yeah."
15 } ,
16 ...
17 ]
```
The comment state has the same set of objects as in the backchannel state (Listing 3). The selection algorithm is also the same as that of the backchannel state.

Listing 3: Objects in the comment state.

```
1 [
2 {
3 Question: "Have you ever been abroad?",
4 Keyword: ["yes", "yeah"]
5 Comment: "You are a global person. I also want to go someday."
6 } ,
7 {
8 Question: "Have you ever been abroad?",
9 Comment: "I would like to go abroad someday."
10 } ,
11 {
12 Question: "Where do you want to visit?",
13 Keyword: ["kyoto", "tokyo", "osaka"]
14 Comment: "That's an exciting city. I want to go there too."
15 } ,
16 ...
17 ]
```