1 / 21

Designing a Chatbot

Designing a Chatbot. Using ALICE, AIML, and Pandorbots.com Kamal Aboul-Hosn Cornell University. How Does ALICE Work?. Implements AIML Artificial Intelligence Modeling Language Engine controls interface with person Languages: Java, PHP, Lisp... Allows for webpage, instant messenger, etc.

mckile
Download Presentation

Designing a Chatbot

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Designing a Chatbot • Using ALICE, AIML, and Pandorbots.com • Kamal Aboul-Hosn • Cornell University

  2. How Does ALICE Work? • Implements AIML • Artificial Intelligence Modeling Language • Engine controls interface with person • Languages: Java, PHP, Lisp... • Allows for webpage, instant messenger, etc.

  3. How Does ALICE Work? • “Pattern Matches” against user input • Removes punctuation and capitalization • Compares what user types to library of expected statements • Replies based on matching pattern • Replies can be dynamic based on input

  4. Example AIML Code <category> <pattern>HELLO</pattern> <template> <random> <li>Well hello there!</li> <li>Hi there!</li> <li>Oh, hello again!</li> </random> </template> </category>

  5. The Basics of AIML • Category - basic unit of knowledge • Input - <pattern>...</pattern> • Output - <template>...</template> • Possibly a context - <that>...</that>

  6. Different Inputs,The Same Output • The bot likely responds to “Hello” and “Hi” the same way. • Do we have to write the same code each time? • No, we don’t! • Tell the bot to look recursively at the responses to give for another input

  7. Recursion to the Rescue <category> <pattern>HI</pattern> <template><srai>HELLO</srai> </template> </category> <category> <pattern>HEY THERE</pattern> <template><srai>HELLO</srai> </template> </category>

  8. Combining Recurive Calls <category> <pattern>HI HOW ARE YOU</pattern> <template><srai>HELLO</srai> <srai>HOW ARE YOU</srai> </template> </category>

  9. Limitations • ALICE has no concept of “language” • Would understanding grammar help? • English is an ambiguous language • “Time flies like an arrow.” • “Fruit flies like a banana.”

  10. Maintaining Context • Consider two pieces of conversation: • Bot: Is it raining outside?User: Yes. • Bot: Is it sunny outside?User: Yes. • What is wrong with<category> <pattern>YES</pattern>...?

  11. Maintaining Context • Need a context to which the “yes” refers • Can use the bot’s last statement <category> <pattern>YES</pattern> <that>IS IT RAINING OUTSIDE</that> <template>As long as it doesn’t storm.</template> </category> <category> <pattern>YES</pattern> <that>IS IT SUNNY OUTSIDE</that> <template>We should go to the beach!</template> </category>

  12. Matching Generic Phrases • How do we accept any user input? • Do not want a pattern for every possible phrase • Use the * and <star/> commands <category> <pattern>YOU ARE *</pattern> <template>Why do you say I am <star/>? </template> </category>

  13. Using PandoraBots • Go to http://www.pandorabots.com • Click to create a new account • Fill in information • Log into the system • Click on “Create a new bot”

  14. Creating a New Bot

  15. Creating a New Bot • Give the bot a name • Select a Startup AIML set • Either of the two sets is fine • For a challenge, start with no knowledge

  16. Editing Bot Properties

  17. Editing Bot Properties • Fill in any information you want for your bot • Click on “Set Bot Properties” • To train, click “Build and run this bot”

  18. Training the Bot

  19. Training the Bot • Carry on a conversation with the bot • The current topic is listed • If the response is bad, can alter the reply in two ways • Type in new response next to “Say This Instead” and click button • Click on “Advanced Alter Response”

  20. Teaching the Bot

  21. Teaching the Bot • Type in a new response under “template” • Can contain AIML code as listed • Use the buttons to select code templates • Can make response based on “that” or “topic” • Click on “Submit” to make changes • Click on “Publish this bot” to make bot available for everyone online

More Related