Thursday 24 March 2016

ChatBot 4 - Sioni on the Web

Leat House
After a long break from ChatScript I now have enough to make Sioni vaguely interesting - to me at least.

Here he is: sioni.online

Status Update

I started out trying to find a way to build a conversational agent that would capture the life and times of someone like my grandmother. That way people could sit down and have a chat with a distant relative and find out about their lives in a much more engaging way than reading some facts about where they were born and seeing some photographs about where they lived.

How are things going so far? Here's a sanity check:

  • Is it engaging enough?
    Yes, it's not bad. It could be much more engaging if I put more time into the script. However, ChatScript is a great tool for bots, there's no doubt.
  • Is it possible to simply feed a bunch of stories and facts into a repository and have the bot use that for its memory of events for conversions?
    No, that's not what ChatScript does in it's current form. Although the recent extension of ChatScript to call out to other sources of truth using REST APIs is worth pursuing. Commercial bots obviously do this to some extent based on knowledge bases.
    Next blog post maybe. 
  • Is the experience rich enough?
    It's ok but it would be useful if the bot was able to use URL's in the script to display additional content or play audio files.  Another blog post.

What did I learn?

Events not Facts

I started with a mind-map of Sioni's world. Being as ChatScript is driven by topics, structuring the mind-map by topics is a good idea. I started with topics for friends, family and places etc. My initial approach was to have a whole bunch of facts as rules. This probably reflects my Prolog programming thought process. However, this approach doesn't result in particularly entertaining conversations! It is much better (as the ChatScript docs suggest) to have your bot drive the conversation. So I ended up with topics for specific life events driven by the bot. If you're building a bot based on your life events (as Sioni is) this is a much more natural way to remember your past and structure your bot. When we catch up with family and friends and talk about the past, we almost always talk about particular events - the memorable ones are often the most emotional too: funny or sad or significant in other ways. Once I figured out that was my best approach, the flood gates opened and the memories of particular events came in thick and fast: The day the onion seller came to the village, that time when I rode my bike into Annie May, the times we went to the big swing past the sand-banks and threw coins into the wishing pond, my first day at school, picking pees in the garden for dinner etc. etc.
If you have a chat to Sioni, you'll see these events come through along with some of my fact-based style weaved in. I haven't gone back and cleaned up the scripts - this is an experiment in bot creation and not a fully complete and consistent bot.

AWS Server

sioni.online is hosted in Amazon (AWS). If you're a bit technical, setting up the Linux server in AWS is straight forward. In fact, it's a lot easier than setting it up on the Mac. Look at "ChatScript Amazon Server.pdf" in the documentation directory.
I used the BETTER PHP files and modified them to call Sioni.

Topics and Behaviour

Because ChatScript remembers where you left off, its behaviour can be confusing when you're trying to develop more script. You need to rebuild and reset to get a clear idea of what it's doing. Initially, I was confused about why a certain topic was being executed and why. In simple terms, ChatScript stays in its current topic as long as there are things left to say and what you've typed matches a rule. If you type something that can't be matched, it will find a typic which will match and then find a rule within that topic. It's pretty obvious really but the behaviour when you're developing can be confusing.

Sublime Text Editor

There are now themes for ChatScript. Syntax highlighting makes writing ChatScript much easier!

ChatScript files

While ChatScript ships with example bots, creating a new bot by copying an existing one can lead to some confusion. I ended up copying quibble.topintroductions.topchildhood.top, keywordless.top, simplecontrol.top and the entire quibble Eliza file set. Update introductions for your bot, add a bunch of things to keywordless.top that makes sense for your bot, and update the simplecontrol.top to make sure it has the right topics are called in the control loop. Most of the text for Sioni is obviously in childhood.top.






No comments:

Post a Comment