Those old timers out there will remember an old computer program called Eliza. Eliza was basically a dumb, but sometimes effective, AI type program. You could ask it questions and Eliza would parrot them back. Eliza has been around since 1966 if you can believe it. Anyway, for a long time now I've been wanting to port it to ColdFusion. However, most of the example source code programs I found were extremely hard to read. (Or maybe ColdFusion is making me spoiled. ;) Last night I finally got around to writing a simple implementation.
The logic is simple. You take a string, which is what the human is saying, and look for keywords. If a keyword match is found, you pick a random respond and add what the user said after the keyword.
So for example, if the user says: "I can't swim", Eliza may say, "How do you know you can't swim". Nothing terribly sophisticated about it, but sometimes it actually works rather well.
For my version of Eliza, the data is all XML based, making it a lot easier to update the keywords and add additional responses. You can download the code here.
Even better - if you are using the Google IM client, or any Jabber client, you can talk to Eliza right now. Simply add the contact, "elizacamden@gmail.com", and talk away. Have a cool conversation with her? Paste it into the comments.
Archived Comments
Nice one!, but the Virtual Bartender is much more hot!
And too bad Eliza don't know to talk about ColdFusion.. :P
I added ColdFusion to the XML file. :) It may not show up for you though until your session expires.
THAT'S all there was to Eliza????
I remember talking to 'Doctor' on a HP teletype machine thinking it had artificial intelligence, back in 1976.
Ah, those were the days.
I wonder what it would be like if you linked the user's input to a verity search of a Thesaurus and changed the question using similar words instead of the exact words themselves....
This is just crying out for... borkliza.. homerliza... 1337l12@, etc.
Try Alice instead, it's much more advanced. We have it also on www.collab.nl, try typing "/alice how are you doing?"
well obviously there are plenty of other people interested in an advanced version of Eliza, Ray... if you want to invest the time... maybe some of your coldfusion "students" can take the Eliza Challenge and eventually come up with a book like in Neal Stephenson's Diamond Age.
Ray, this is great! i see the point isn't what Eliza C. can do, but the endlesss possibilities that are open with just a few lines of 'well thought' code. Thanks again for sharing your knowledge with the world and please, keep on wasting your time like this...