AIML A I Markup Language
CATEGORIES Basic knowledge unit Stimulus is called the pattern Response is called the template <category> <pattern> …. </pattern> <template>…… <template> </category>
Wildcards * and _ means match a word of input Matching order is different (_ word *) <star/> accesses the matched word <star index = index /> for multiple wildcards
Context “that” “topic” <that> </that> matches the last utterance of the bot Occurs inside the category “topic” <topic> </topic> Occurs outside a set of categories Groups related sets of categories
Context Usage Pattern Side That <category> <pattern> …. </pattern> <that> … </that> <template>…… <template> </category>
Context Template Side That “that” appears in a template No content! Just an attribute with integer or list of integers (don’t forget to make a string!) <that index=../> Outputs the past utterences
Recursion Symbolic Reduction Divide and Conquer Spelling or grammar corrections Keyword detection anywhere in the input Conditionals Synonyms
Recursion <srai> </srai> Warning – infinite loops are possible Symbolic reduction: <category> <pattern>DO YOU KNOW WHO * IS</pattern> <template><srai>WHO IS <star/></srai></template> </category>
Divide and Conquer <category> <pattern>YES *</pattern> <template><srai>YES</srai> <sr/></template> </category>
Synonyms <category> <pattern>HELLO</pattern> <template>Hi there!</template> </category> <category> <pattern>HI</pattern> <template><srai>HELLO</srai></template> </category>
Keyword <category> <pattern>MOTHER</pattern> <template> Tell me more about your family. </template> </category> <category> <pattern>_ MOTHER</pattern> <template> Tell me more about your family. </template> </category> <category> <pattern>MOTHER _</pattern> <template> Tell me more about your family. </template> </category>
Conditionals – using <srai> <category> <pattern>Who is he</pattern> <template> <srai>whoishe <get name=“he”/></srai> </template> </category>
Conditionals Single: <condition name=“X“ value=“Y”> <li> </li> </condition> Multiple: <condition name=“X“> <li value=“Y”> </li> <li value=“Z”> </li> <condition> <li name = “X” value = “Y”> …. </li>
Return Random Responce <template> <random> <li> .. </li> <li> … </li> </random> </template>
Predicates Get Set There are other predicates! <get name= …/> returns value assigned to the name Empty string if no value has been assigned Set <set name = … > contents </set> There are other predicates!
Targeting A design strategy Examine the user input If one person input a sentence – odds are good some else will!