September 2022

S M T W T F S
    123
45678910
11121314151617
181920 21222324
2526 27282930 

Style Credit

Expand Cut Tags

No cut tags
Friday, October 3rd, 2003 01:14 am
For several years (summer of '98 is when it started in earnest, I believe) I have been building a toy AI, the Gargoyle. It isn't really an AI, just a fun little system that occasionally makes a half-hearted attempt at looking intelligent. People on Migdard can add phrases (or quips, in garg lingo) to its database (now up to 11,300). There are several interaction modes, but the main focus is the query, where an input string is taken and the Gargoyle looks for the 'best' quip to respond with. This can be in response to a direct question, or just because the Gargoyle saw a question in the ambient conversation on the MOO. There is also a web interface that I use to provide my talking media players (the DJ and VJ) at home with weird things to say about what they're playing.


The core of this process is simple: match words in the query string with words in the quip database. The quip with the most hits wins. That only kind of worked, so now there is a large amount of munging going on. Boring words (like conjugations of 'to be' and 'to have', articles, etc) are removed, interesting words are expanded using a custom thesaurus. The storage backend has gone from a simple list to a MOO database to a MySQL database.

One of the biggest changes was to allow pronoun and player substitution. All pronouns are removed from the query phrase, and a target person (first, second, third-male, third-female, third-plural) is determined from it. If a player is explicitly named, then their gender defines the target person. After a quip is chosen, all pronouns are replaced with those of the target person. If a player name was in the query phrase, then it is used for the first pronoun in the quip. This allows you to ask about specific people and get quips talking about them. Of course, this sometimes introduces grammatical errors, and has remained a controversial change. I think it's worth it for the increased immediacy and impact of the returned quips.

I've been on a small improvement spree for the last few days. This was triggered by listening to the Buffy musical on the DJ. When the DJ gets a quip from the Gargoyle, it passes along the group name for the song, which is then used in the player sub routines. Except that the Gargoyle didn't know in later steps if a name had been explicitly chosen, or if the name had just been in the original search string. So if a player had an alias the same as the name of a group, their name would get subbed in instead. This was funny on occasion, but since [livejournal.com profile] shandryl has the alias 'buffy', it would get to be a bit much when going through the OMWF playlist to have her mentioned between most songs.

Continuing with the long-put-off-improvements, I just finished adding a new step to the garg's pre-processing. It now tries to remove all morphemes, reducing words to their root component. Pluralizations, conjugations, adjectival endings, etc. The upside to this is that it can now connect 'hacks', 'hacker', 'hacked', 'hacking' and 'hackable' as all referring to a common root: hack. The process isn't perfect, but with the addition of an associative list of 77 irregular pluralizations, it's pretty decent. This happens for both query strings and in the word index for quips in the database, so even when mistakes are made, the worst that can happen is that it acts the same way it used to.

In conclusion, the Gargoyle marches proudly into the 21st century! Or something.

Reply

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting