I'm iterating on my chatbots. My current favorite is called "reggie" because he just learns regular expressions. (Not sure when to use 'he' vs 'it' - when I'm talking about chatting 'he' seems natural, but when I'm talking about algorithm 'it' seems best.) Like
my name is (.) -> hi \1
is the regular expression that will respond "hi bob" if you say "my name is bob".
For positive and negative feedback I'm using emoticons. A smiley face means "that was good" (+1), a negative face means "that was bad" (-1). Also there is a built in desire to mimic; anything the human does gets a +1. Technically I'm using beta distributions not +1/-1 but it works out mostly the same.
So far I don't have any bias towards simpler rules, so there's a lot of ties. And if there's an uninstantiated group in the optimal rule, reggie just says "blah". I figured I could train him not to say blah, which I can, but reggie can't generalize to realize "saying blah is always bad". Basically, it's picking the best regular expression that applies to the user statement. Instead it could look at all of them and combine with some Bayes-ish method. Then you could have negative rules like "don't say x".
Anyway it is still very charming. Here is a session from the start - if you think about it, you can figure out how everything happened, i.e. the regex rules that applied for each reggie statement. I am trying to explain that one should not say "blah" in polite company.
reggie: ...
me: hi
reggie: hi
me: do you like math
reggie: blah
me: :-(
reggie: blah
me: :-(
reggie: :-(
And reggie finally learns just to frown when I frown instead of "blah"ing back to me.
;-)
I have gotten a couple requests to expose these chat bots to the public. I want to! - I just need to figure out how to serialize them to the database and do some low-level web-app gluing. Probably just store a pickled blob, upgrade path be damned.
One exciting thing during development - at some point I wrote about 200 lines of regular expression parsing code, got tired and set it aside, came back the next evening to write some unit tests, and... it all just worked. I was fired up.