Saturday, July 16, 2011

New interaction, plus two new modes, minus some responses

http://www.dlastlee.com

The interaction has been updated as previously mentioned. Took some time to modify the AJAX interface to play the way I want to. There is a two second delay to allow users to send multiple messages before the AI responds.

To test this, I have created a mode to copy the user. By sending a message to "copy me", the AI will switch to a mode to copy the user. The user messages are queued, then the AI will respond in the same order. The mode will last a random number of times with a maximum of 15 before it gets "tired" of playing.

To further additional modes, a simple game was also implemented. This can be triggered by entering "play guess number". It is not complete, but the portion to generate a random number and allow the user to guess is published. Depending on the number of guesses, a different response is given. The breaks are if you finish within 20% of the possible numbers, 50%, and just completing.

Responses have also been modified to allow multiple responses, although a delay has not been implemented. They will appear almost instantly. I may or may not modify this in the future as it's more a UI modification.

I have also separated the library of messages to its own static class. A useful functionality I found was also searching arrays with ignoring cases:
array.Contains("str", StringComparer.InvariantCultureIgnoreCase);
array.Contains("str", StringComparer.OrdinalIgnoreCase);
array.Contains("str", StringComparer.CurrentCultureIgnoreCase);
[[source: http://stackoverflow.com/questions/952679/how-can-i-make-array-contains-case-insensitive-on-a-string-array]]

There is a lot of places for improvements in the response. One of the tricky parts of redundancies in similar terms with almost the same definitions. A simple example is different ways to agree to a question (e.g. y, yes, Y, Yes, of course, definitely, sure, why not, etc.). Besides case sensitivity, there is also misspelling. If a user mistypes yes as yse (sic), it is still highly possible it was meant to be yes. This is especially more useful for larger words. Another case is for words that are commonly misspelled or have multiple ways of spelling. To understand that a person may be speaking of Johnathon but may spell the name as Jon or John, Jonny, etc. Or "their" vs "there".

Next step will primarily be concentrating on how a figuring out the topic of the conversation, learning more of the user, and maybe start on some database stuff.

No comments:

Post a Comment