Thursday, October 20, 2011

Two Pandorabots Ranked Top AI by Junior Judges

For the first time in its history the Loebner Prize included a separate prize known as the Junior Loebner Prize in which the judging panel consisted of students between 12 and 14 years old. Our team's two entries, Zoe by Adeena Mignogna and Tutor by Ron C. Lee, tied for first place in the Junior contest. Zoe also came in second place in the main contest. Also this was the first time two finalists used the same platform, Pandorabots. Adeena, Ron, Steve Worswick, and Pandorabots engineering staff all worked together to make it a team effort.

The main contest was as usual judged by scientists, technology experts and journalists.  Typically the judges try to give the bots an IQ test with questions like, "How many syllables in the word banana?" or "Which is bigger a small mountain or a large tooth?" (not very good icebreakers in ordinary human conversation--can these judges carry on a conversation with a person?) and predictably once again the bots are pronounced "disappointing".   The junior judges have more fun with the bots, suspend their disbelief more easily, and engage in casual chat using internet slang, saying "LOL", "Wassup?" and "What did you have for breakfast?" instead of giving an IQ test.   It is as if the scientists are testing to see how much a human is like a computer, and the kids are testing to see how much the computer is like a human.

Bruce Wilcox, the winner of last year's Loebner Prize bronze medal once again took the award in the main contest this year.   No bot has yet been awarded the silver medal for passing the Turing Test.

Siri and Pannous Voice Actions

Several people have independently written us asking if the AI Foundation was involved in the development of the Apple iPhone Siri app.  The simple answer is no, unless Apple is perhaps using some version of the free open source ALICE AIML software.

There is a comparable Android app developed by Pannous, called Voice Actions (not to be confused with Google Voice Actions) .  Besides making it possible to control your phone through speech commands, the Pannous Voice Actions app also allows you to have a conversation with an AIML bot based on ALICE.

What the users of Pannous Voice Actions appreciate most

The Pannous Voice Actions app has:

- Better conversations because it relies on the Lisp-based Pandorabots service, in contrast,  the Siri conversational replies are far more limited.  Pandorabots is the home to high-quality award-win
-ning chatbot characters, representing many person-years of development invested in original content.

- Greater richness of features: much broader integration with the device (camera, video, sound) other services (images, youtube, twitter, facebook, poems, quotes, etc. ), other apps and settings. For example, Siri is unable to open GPS map navigation for directions

- Better question answering by accessing a broader set of knowledge bases such as Wikianswers and Trueknowledge (an excellent substitute for Wolfram Alpha).

There is even an iPhone app version of Pannous Voice Actions,  but its features are limited due to the constraints on the API imposed by Apple. In general third-party apps on the iPhone are unable to  (a) open any other app, (b) query and modify system settings and (c) hook into other applications (available through Android’s ‘intents’ capabilities).

Currently Pannous Voice Actions market site receives around 50 positive reviews daily, and here are some quotes.

“Wow this thing is wicked!”

“Beats Siri hands down!”

“I just carried on a conversation with my telephone. This application is amazing!”

“Siri crusher.”

If you want to have a more intelligent conversation with your phone than you can have with Siri, give Pannous Voice Actions a try and see the power of AIML in action!

Friday, October 07, 2011

Processing common suffixes with AIML

One of the longstanding problems with AIML pattern matching is related to processing certain common suffixes in English.  These are words or phrases added to the end of a sentence that may contribute little in the way of meaning, such as “really”, “eh”, and “you know.”  By far the most common example of this is the use of a personal name at the end of a sentence: “Nice to meet you, Alice”, “How is the weather over there, Alice?”  and “You are silly, Alice.” 

When creating a bot in AIML we’d like to reduce these kinds of sentences to the same thing without the suffix.  “How is the weather over there Alice?” is the same as “How is  the weather over there?”  It’s quite tempting to write one AIML category that covers all these cases:

<pattern>_ ALICE</pattern>

This category reduces any sentence ending with ALICE to the same sentence without the suffix, and uses the <srai> recursion to find a response.  Moreover, because it uses the _ wildcard, the category will reduce every input ending with ALICE.  This reduction category saves us from having to write separate patterns for every case like “How are you” and “How are you Alice?” (which would effectively double the number of categories needed for a bot). 

This is all well and good except that in other cases the suffix ALICE does add meaning to the sentence.  “Who is Alice”, “Why are you named Alice?” and “My name is Alice” would all be reduced to meaningless sentence fragments: “Who is”, “Why are you named”, and “My name is”. 

AIML  uses the wildcard _ to indicate that the pattern has higher priority than a word or the wildcard *.  Simply changing the above category to use <pattern>* ALICE</pattern> doesn’t solve the problem.  An input like “Why are you named Alice” might match a default category with a 
<pattern>WHY ARE YOU *</pattern>  
before it matches 
<pattern>* ALICE</pattern>.

The solution outlined here uses two tricks.  First, we replace suffix ALICE with the word BOTNAME.  Then we use the AIML <topic> feature to collect all the categories ending with ALICE where the word ALICE plays a meaningful role.   If one of those matches the modified input, then the AIML returns that result.  Otherwise, we look for a match for the sentence with the suffix removed.  

<category><pattern>_ ALICE</pattern>
<set name="savedtopic"><get name="topic"/></set>
<set name="topic">ENDS WITH ALICE</set>
<set name="matched">false</set>
<set name="response"><srai><star/> BOTNAME</srai></set>
<condition name="matched">
<li value="true"><get name="response"/></li>
<set name="topic"><get name="savedtopic"/></set>

The AIML above uses the “savedtopic” predicate to remember the current conversation topic.  Then we set “topic” to ENDS WITH ALICE.    Another predicate, “matched”, is initialized to false.  If the program finds a match where the suffix is meaningful, the value of "matched" is set to true and the conditional branch returns that match.  Otherwise, the conditional returns a match for the sentence without the suffix.  The following AIML topic group collects together the categories where we want to match the sentence including the suffix ALICE.   Each of these includes the statement <set name="matched">true</set> indicating a successful match.

<topic name="ENDS WITH ALICE">

<category><pattern>TEST BOTNAME</pattern>
<bot name="name"/> is functioning normally.
<think><set name="matched">true</set></think>

<category><pattern>CALL ME BOTNAME</pattern>
My name is 
<set name="name"><bot name="name"/></set> too!
<think><set name="matched">true</set></think>

<category><pattern>WHAT IS BOTNAME</pattern>
<template><srai>WHAT ARE YOU</srai>
<think><set name="matched">true</set></think>

<category><pattern>WHO IS BOTNAME</pattern>
<template>I am <bot name="name"/>.
<think><set name="matched">true</set></think>


One slightly pathological case can however make the above code “forget” the original conversation topic.  This is the case where the suffix is repeated, and the first category is called recursively more than once.  For example the input “Alice Alice Alice Alice Alice” will result in four levels of recursion, and when the procedure unwinds, the topic will still be set to ENDS WITH ALICE.  There does appear to be a solution covering this situation, however, and it is left as an exercise to the attentive reader.

The code in this example is built into the latest development snapshot of the ALICE AIML set available in our repository at


blogger templates | Make Money Online