...
the process of creating a character is iterative in nature. The following steps create an initial character that will probably need to be refined by repeating the steps as required to obtain the desired behavior.
Three In general, three actions are required to create the content necessary to drive the natural language component:
...
The user and system utterances files use the same Excel spreadsheet format. These files have a number of columns (these are the initial 2 rows of the system utterances file for the character used in the example below):
TTERANCE_ID | VERSION | CHARACTER | STATE | SPEECH_ACT | TEXT |
statement.not-understand | I'm sorry, I didn't understand what you said. Please try to rephrase it. | ||||
greeting.hello | Hello |
The only 2 columns of relevance are SPEECH_ACT and TEXT.
...
This list of special variable can vary with each version of the dialogue manager. The list is printed out in a file called specialVariables.xml in the dm sub-directory. The content is for example:
Code Block | |||||
---|---|---|---|---|---|
| |||||
<sv id="timeSinceLastUserAction" value="0" type="NUMBER" desc="Time in seconds since the last thing said by the user."/> <sv id="timeSinceLastSystemAction" value="0" type="NUMBER" desc="Time in seconds since the last thing said by the system."/> <sv id="consecutiveUnhandledUserActions" value="0" type="NUMBER" desc="Number of consecutive user actions for which the system had no direct response (handler)."/> <sv id="timeSinceLastAction" value="0" type="NUMBER" desc="Time in seconds since anyone said something (user or system)."/> <sv id="timeSinceLastResource" value="0" type="NUMBER" desc="Time in seconds since the last resource link/video was given."/> <sv id="event" value="null" type="TEXT" desc="Name of last speech act said by the user and processed by the system."/> <sv id="lastNonNullSubdialog" value="null" type="TEXT" desc="Name of last sub-dialog executed by the system."/> <sv id="systemEvent" value="null" type="TEXT" desc="Name of the speech act last said by the system."/> <sv id="timerInterval" value="1" type="NUMBER" desc="Time in seconds between 2 consecutive timer events."/> <sv id="preferForms" value="true" type="BOOLEAN" desc="If true and a form is available for the current system speech act, the form will be selected by the NLG."/> |
...
A typical policy.xml file will look like the following:
Code Block | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
<policy xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="initKB.xml"/> <xi:include href="goals.xml"/> <stepDiscount value="0.9"/> <include href="textFormat/policy.txt"/> </policy> |
...
The following example shows the format of the information state initialization file:
Code Block | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
<informationState> <initialize expr="assign(lastNonNullSubdialog,null)"/> <initialize expr="assign(timeSinceLastAction,0)"/> <initialize expr="assign(alreadyAsked,false)"/> <initialize expr="imply(AND(>(delta-symptom_worried,0), deployed), ++(ptsd_counter, delta-symptom_worried))"/> ... </informationState> |
...
The reward definition file:
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<goals> <goal id="simple" desc="the basic reward" value= "10"/> <goal id="quick" desc="reward for something more important" value= "30"/> ... </goals> |
...
This sub-dialogue defines a confirmation dialogue tree that says different things depending of the value of the type
and flavor
information state variables.
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Network done { #topic: done #entrance condition: system initiative #condition: and(state=='done') { if (and(type=='sponge',flavor=='chocolate')) system: statement.cake.ready.chocolate.sponge if (and(type=='cheese',flavor=='chocolate')) system: statement.cake.ready.chocolate.cheese if (flavor=='lemon') system: statement.cake.ready.lemon if (flavor=='amaretto') system: statement.cake.ready.amaretto } #action: state='exit' #goal: simple } |
...
A more complex example with user actions, ORs, DO and SWAPOUT:
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Network flavorCheese { #topic: set.flavor #entrance condition: system initiative #condition: and(state=='start',type=='cheese',known(sugar)) #reentrance option: statement.back system: question.cake.flavor { { user: statement.flavor.chocolate #action: flavor='chocolate' } OR { user: statement.flavor.lemon #action: flavor='lemon' } OR { user: statement.flavor.amaretto system: apology.flavor #action: clarifyFlavors=true #action: swapout } } DO #action: state='done' #goal: simple } |
...
To do so you can a list of listeners to the policy file using this syntax:
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<listeners> <listen event="internal.timer" update="imply(questionnaire_flag==2, ++(break_timer,timerInterval))"/> <listen event="internal.timer" update="assign(smalltalk_pause_lock_auto,isQuestion(systemEvent))"/> <listen event="answer.observable.*" update="++(symptom_said)"/> </listeners> |
...