11-823 Conlanging Building your own chatbot with AIML AIML Chatbots - - PowerPoint PPT Presentation

11 823 conlanging
SMART_READER_LITE
LIVE PREVIEW

11-823 Conlanging Building your own chatbot with AIML AIML Chatbots - - PowerPoint PPT Presentation

11-823 Conlanging Building your own chatbot with AIML AIML Chatbots AIML Chatbots A.L.I.C.E A.L.I.C.E An Eliza (very advanced) system An Eliza (very advanced) system Lots of example AIML XML templates Lots of example AIML XML


slide-1
SLIDE 1

11-823 Conlanging

Building your own chatbot with AIML

slide-2
SLIDE 2

AIML Chatbots AIML Chatbots

◆ A.L.I.C.E

A.L.I.C.E – An Eliza (very advanced) system An Eliza (very advanced) system – Lots of example AIML XML templates Lots of example AIML XML templates – Text based (not speech) Text based (not speech)

slide-3
SLIDE 3

AIML Interpreters AIML Interpreters

◆ C++/Pyhton/etc interpreters

C++/Pyhton/etc interpreters – Maybe on-line web interface(?) Maybe on-line web interface(?)

◆ Python toolkits

Python toolkits – PyAIML (download and install) PyAIML (download and install) – standard-aiml.tar.bz2 (dl and unpack) standard-aiml.tar.bz2 (dl and unpack) – Gives std-startup.xml and standard/ Gives std-startup.xml and standard/ – Create do_aiml.py Create do_aiml.py

slide-4
SLIDE 4

PyAIML PyAIML

◆ Install PyAIML and standard-aiml.tar.bz2

Install PyAIML and standard-aiml.tar.bz2

◆ Create do_aiml.py

Create do_aiml.py #!/usr/bin/python #!/usr/bin/python import aiml import aiml k = aiml.Kernel() k = aiml.Kernel() k.learn("std-startup.xml") k.learn("std-startup.xml") k.respond("load aiml b") k.respond("load aiml b") while True: print k.respond(raw_input("> ")) while True: print k.respond(raw_input("> "))

slide-5
SLIDE 5

Chat in English Chat in English

◆ python do_aiml.py

python do_aiml.py

◆ Hello

Hello

◆ What can I call you?

What can I call you?

◆ Alan

Alan

◆ Nice to meet you Alan.

Nice to meet you Alan.

◆ Can you pass the Turing Test?

Can you pass the Turing Test?

◆ You be the judge of that, Alan.

You be the judge of that, Alan.

slide-6
SLIDE 6

Chat in Something Else Chat in Something Else

◆ cp do_aiml.py do_eth.py

cp do_aiml.py do_eth.py #!/usr/bin/python #!/usr/bin/python import aiml import aiml k = aiml.Kernel() k = aiml.Kernel() k.learn("eth-startup.xml") k.learn("eth-startup.xml") <----- <----- k.respond("load aiml b") k.respond("load aiml b") while True: print k.respond(raw_input("> ")) while True: print k.respond(raw_input("> "))

slide-7
SLIDE 7

eth-startup.xml eth-startup.xml

<aiml version="1.0"> <aiml version="1.0"> <category> <category> <pattern>LOAD AIML B</pattern> <pattern>LOAD AIML B</pattern> <template> <template> <learn>eth-greetings.aiml</learn> <learn>eth-greetings.aiml</learn> </template> </template> </category> </category> </aiml> </aiml>

slide-8
SLIDE 8

eth-greeting.xml eth-greeting.xml

<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?> <aiml version="1.0"> <aiml version="1.0"> <category> <category> <pattern>KONNICHI WA</pattern> <pattern>KONNICHI WA</pattern> <template> <template> konnichi wa konnichi wa </template> </template> </category> </category>

slide-9
SLIDE 9

eth-greeting.xml eth-greeting.xml

<category> <category> <pattern>* MATA</pattern> <pattern>* MATA</pattern> <template> <template> <random> <random> <li>ja mata</li> <li>ja mata</li> <li>ato de</li> <li>ato de</li> <li>mata</li> <li>mata</li> </random> </random> </template> </template> </category> </category> </aiml> </aiml>

slide-10
SLIDE 10

Chat in Eth Chat in Eth

◆ python do_eth.py

python do_eth.py konnichi wa konnichi wa konnichi wa konnichi wa ja mata ja mata ato de ato de mata mata ja mata ja mata sayonara sayonara WARNING: No match found for input: mata WARNING: No match found for input: mata

slide-11
SLIDE 11

Questions Questions

<category> <category> <pattern>* KA</pattern> <pattern>* KA</pattern> <template> <template> <random> <random> <li>hai, <star/> yo</li> <li>hai, <star/> yo</li> <li>iie, chigau</li> <li>iie, chigau</li> </random> </random> </template> </template> </category> </category>

slide-12
SLIDE 12

Catch all Catch all

<category> <category> <pattern>*</pattern> <pattern>*</pattern> <template> <template> <random> <random> <li>do shimashou ka</li> <li>do shimashou ka</li> <li>daisuku na eiga wa nan desu ka</li> <li>daisuku na eiga wa nan desu ka</li> </random> </random> </template> </template> </category> </category>

slide-13
SLIDE 13

Chat in Eth Chat in Eth

◆ python do_eth.py

python do_eth.py konnichi wa konnichi wa konnichi wa konnichi wa gakusei desu ka gakusei desu ka hai, gakusei desu yo hai, gakusei desu yo samuii desu ne samuii desu ne daisuke na eiga wa nan desu ka daisuke na eiga wa nan desu ka ja mata ja mata mata mata

slide-14
SLIDE 14

Chat Homework Chat Homework

◆ Greetings (partings)

Greetings (partings)

◆ Simple directed conservations

Simple directed conservations

◆ Questions/answers

Questions/answers

◆ Plus 2 other syntactic phenomena e.g.

Plus 2 other syntactic phenomena e.g. – Pronoun switch: Pronoun switch: do do you you like sushi ↔ like sushi ↔ I I like sushi like sushi – Negation: do you X ↔ I do not X Negation: do you X ↔ I do not X

◆ Submission:

Submission: – aiml files + 3 example dialogs aiml files + 3 example dialogs – Description of what could not be done Description of what could not be done

◆ Noon Friday 2

Noon Friday 2nd

nd May 2014 to awb and lsl

May 2014 to awb and lsl

slide-15
SLIDE 15

But AIML is limited But AIML is limited

◆ Would nice if …

Would nice if …

◆ Full grammatical parses

Full grammatical parses – Would allow more elaborate generation Would allow more elaborate generation

◆ Noun phrase reduction

Noun phrase reduction – Did you see the little girl in the park Did you see the little girl in the park – Yes I saw the girl Yes I saw the girl

◆ Relative clause generation

Relative clause generation – Do you see a girl riding a bike? Do you see a girl riding a bike? – A girl who was riding a bike went to the park A girl who was riding a bike went to the park

slide-16
SLIDE 16

Pragmatics Pragmatics

◆ Politeness levels

Politeness levels – Echo politeness, relationships Echo politeness, relationships

◆ Lexical entrainment

Lexical entrainment – Where will you depart from? Where will you depart from? – I will depart from downtown I will depart from downtown – Where will you leave from Where will you leave from – I will leave from downtown I will leave from downtown

◆ Sentiment mirroring (or not)

Sentiment mirroring (or not) – Did you see the Klingon usurper Did you see the Klingon usurper – *Yes I saw the Klingon liberator *Yes I saw the Klingon liberator

slide-17
SLIDE 17

Like humans do ... Like humans do ...

◆ Mine twitter posts to find answers

Mine twitter posts to find answers – Given posting “X” Given posting “X” – Find closest posting to “X” Find closest posting to “X” – Select one of the replies and post it Select one of the replies and post it – Works surprisingly well. Works surprisingly well.

◆ At unnamed large computer company

At unnamed large computer company – A congratulations bot A congratulations bot – Looks for success announcements and sens Looks for success announcements and sens congratulations automatically. congratulations automatically. – Congrats on new baby, promotion, bug fix, Congrats on new baby, promotion, bug fix, product shipping, and on leaving the product shipping, and on leaving the company (maybe not last one) company (maybe not last one)

slide-18
SLIDE 18

Alternatives Alternatives

◆ There might be AIML alternatives

There might be AIML alternatives – There might be an online version There might be an online version – There might be things with more control There might be things with more control

  • e.g. Python regex matching

e.g. Python regex matching

◆ You can use other solutions, if

You can use other solutions, if – You tell me before hand (and I agree) You tell me before hand (and I agree)

slide-19
SLIDE 19

Conversational Tricks Conversational Tricks

◆ Adding adversity:

Adding adversity: – So you think X? So you think X? – I'm not going to talk to you until we're I'm not going to talk to you until we're introduced introduced – Klingons do not tell jokes Klingons do not tell jokes – By the way, let's change the subject By the way, let's change the subject

slide-20
SLIDE 20