4.4 Step 2.4: Scripting the Conversational Agent Dialogue
4.4.1 Organisation of CA Scripts
Before starting to develop the CA scripts, it was important to decide on a strategy for organising and navigating script contexts to manage the tutoring dialogue. As described in Chapter 2, Sammut (2001) described a way of managing conversations by grouping rules into sets, called contexts. Each context contains rules pertaining to a particular topic or goal of the conversation, thus adding contextual information to the current user utterance. There is always a current context representing the current state of the conversation. PatternScript allows control to be passed between contexts, which is useful in a structured conversation, such as a tutoring dialogue.
In Step 2.2 of the methodology (Section 2.2), the tutoring conversation was mapped to the three-level model. The organisation of contexts for this model adopts the filter and backupcontext approach proposed by Sammut (2001). Figure 7.1 shows the application of these special scripts to the tutoring conversation, which will be described below:
1. The sociallevel of the conversation is managed using a filter context. All learner utterances will first be „filtered through‟ this context to pick up any bad or abusive language, or any signs of boredom, and give an appropriate response (such as ending the session if swearing is detected,
or giving a motivating message to bored learners). The assumption is that most utterances will pass through the filter context and down to the current context which manages the current tutoring question (the tutoring level).
2. Within a tutoring question context, a mechanism is required to cope with unmatched utterances, as it is not possible to anticipate all of the possible utterances a learner may make. Each tutoring question context must contain a „catch-all‟ rule whose purpose is to push all unmatched utterances down to a backup context (the discussion level).
3. The backup context contains rules scripted to discuss FAQs. Where an utterance does not match any rule in the backup context, control will be returned to the tutoring question context where the CA should give a response which asks for more information and reminds the learner of the tutoring question, in the hope of getting the conversation back on track.
Question Contexts
Backup Contexts
Filter Context Social Level
Tutoring Level Discussion Level LEARNER RESPONSE END SESSION Oscar CITS
Figure 7.1. Management of Conversation Levels Using Different Types of Contexts
When organising the tutoring level CA scripts, it was initially planned to map a single context to each tutorial question. However during development it became apparent that this would not be sufficient for every question as some of the contexts contained too many rules which became too complex to manage. For questions applying a generic question template (see section 4.3) more than one context was required, as described below.
The Hints question template (Chapter 6, Figure 6.2) has two main paths: 1. The learner is asked the question, gives the answer and moves on.
2. The learner does not know the answer, or gives the wrong answer. The learner is then presented with different hints until they give the correct answer or the answer is explained.
Therefore, two contexts are required as follows:
1. A context to ask the question and determine if the learner knows the answer. If the learner knows the answer, control will be passed to the next question. If not, control will be passed to the related „hints‟ context. 2. A context to give hints and help the learner remember the answer. Once
the answer is given, control will be passed to the next question.
The Choice of Approach question template (Chapter 6, Figure 6.3) has a number of paths:
1. The learner is asked the question, and whether they wish to answer in one go or step by step.
2. Path 1: the learner answers in one go. They are given three attempts to get the right answer. If the learner gives the right answer, they move on to the next question. Otherwise, they are given help with the steps of the process where errors are apparent.
3. Path 2: the learner is given guidance on each step of the process, until they give the correct answer and move on to the next step. Finally, they move on to the next question.
Therefore, at least four contexts are required depending on the number of steps in the process, as follows:
1. A context to ask the question and determine how the learner wishes to answer – in one go or step by step.
2. A context to ask the question and determine if the learner knows the answer. If the learner knows the answer, control will be passed to the next question. If not, after three attempts, control will be passed to the context related to the step in the process containing the error.
3. A context to ask the question relating to the first step in the process, and determine if the learner knows the answer. If the learner knows the answer, control will be passed to the next step in the process. If not, help the learner remember the answer. Once the answer is given, control will be passed to the next step in the process.
4. A context to ask the question relating to the second step in the process, and determine if the learner knows the answer. If the learner knows the answer, control will be passed to the next step in the process (or next question). If not, help the learner remember the answer. Once the answer is given, control will be passed to the next step in the process (or next question).
5. Further contexts similar to 3 and 4 above, one for each step in the process.
Q1_start Q2_start Q1_extra Q3_start Q2_extra Q4a_start Q3_extra Q4a_extra Q4b_start Q4b_extra Q5_start Q5_steps Q5_onego STOP WRONG/DK WRONG/DK WRONG/DK WRONG/DK WRONG/DK ANSWER IN STEPS/ DK ANSWER ALL AT ONCE
WRONG (3 ATTEMPTS)/DK CORRECT CORRECT CORRECT CORRECT CORRECT
CORRECT CORRECT/ ANSWER GIVEN CORRECT/ ANSWER GIVEN CORRECT/ ANSWER GIVEN CORRECT/ ANSWER GIVEN CORRECT/ ANSWER GIVEN CORRECT/ ANSWER GIVEN KEY: DK = Don’t Know
Figure 7.2 shows the flow of control through contexts for the first five tutoring questions. In the diagram, for question 5 three of the four „steps‟ contexts have been omitted for clarity. Navigation is managed by rules within the scripts, with control being pushed to new contexts specified within the rule response.