Showing posts with label pandorabots. Show all posts
Showing posts with label pandorabots. Show all posts

I'm through with Pandorabots

After a brief fling with Pandorabots and AIML I have decided that the affair is over.

My reasons are that the AIML language is a little primitive and I can do better by coding a chat bot myself. Coding the engine and the chat bot itself seems much more exciting as a project to me.

Secondly, I can host as many chat bots as I want on my own domain (www.superdecadegames.com) for free.

One aspect of AIML that I can do better with is the <vrai> substitutions which require an awful lot of copying and pasting of pre-existing code and can cause problems when the thing you are substituting changes or does not exist.  The <that> construction makes code look a little messy overall and, as I am not afraid to get my hands dirty with some regular expressions, I should be able to produce something a little more impressive.

Well, work begins tonight.

Some of these should help.

Goodbye, Mac.  We hardly knew you!

I am slowly getting somewhere with my chatbot

So today I reworked most of my chatbot code so that he would accept multiple greetings ("Hi", "Hullo", "Hello" etc).  Also, I wanted Mac to respond with a friendly "what is your name?" and have the chatbot remember what to call you in the future.


This is achieved through the use of AIML <srai> recursion and setting context with <that>.

  • This code deals with matching multiple ways of saying 'Hi'.  What did I miss out?


<category><pattern>HI</pattern><template>Hullo. What is your name?</template></category>
<category><pattern>HI ^</pattern><template><srai>HI</srai></template></category>
<category><pattern>HELLO ^</pattern><template><srai>HI</srai></template></category>
<category><pattern>HULLO ^</pattern><template><srai>HI</srai></template></category>
<category><pattern>HEY ^</pattern><template><srai>HI</srai></template></category>
<category><pattern>HOWDY ^</pattern><template><srai>HI</srai></template></category>
<category><pattern>SUP ^</pattern><template><srai>HI</srai></template></category>

  • This code deals with the user replying to Mac's question "What is your name?"  Whatever is typed is stored in a variable called 'name' for later.

<category><pattern>*</pattern><that>^ WHAT IS YOUR NAME</that>
<template>It is nice to meet you <set name="name"><star/></set>.</template></category>
<category><pattern>MY NAME IS *</pattern><that>^ WHAT IS YOUR NAME</that>
<template>It is nice to meet you <set name="name"><star/></set>.</template></category>

  • This code deals with the user checking whether Mac has indeed remembered their name.
<category><pattern>WHAT IS MY NAME</pattern><template>You are <get name="name"/>.</template></category>
<category><pattern>WHO AM I</pattern><template><srai>WHAT IS MY NAME</srai></template></category>

I'm building a chat bot

Following my work on Susan, the ASCII personal assistant, I have become interested in chatbots. Today I set up an account with pandorabots and began to create my first bot - Mac, a ten year old cat from England.

It is early days yet.

It is still early days for Mac. Pandorabots use AIML (Artificial Intelligence Markup Language) for defining the responses to the human's input. I am still reading through the tutorial. There are libraries of responses you can import, however I want Mac to be unique, so I am coding him from scratch. As such, he can only respond to a few questions, but hopefully I will stay interested in the project and keep building him.

If you want to talk to Mac, then you will need a pandorabots account. There is an API through which I will eventually publish Mac, but for now I'll keep you posted on developments in this blog.

Mac, helping me code

Label

World Karma Game