Friday, February 10, 2017

So this is where we are .. Doctor

CL-USER 1 > (eliza +eliza-rules-extended+)
Hello, I am your doctor. Please type bye to finish.

Please type your first name then return>  Clare

SPEAK> Hi there.

(HI CLARE - PLEASE STATE YOUR PROBLEM.)
SPEAK> I think a lot about the cat.

(DO YOU FEEL  STRONGLY ABOUT DISCUSSING SUCH THINGS?)
SPEAK> Yes, I dream about Shadow.

(HOW DO YOU FEEL ABOUT SHADOW IN REALITY?)
SPEAK> I dreamed he was playing in the garden.

(HAVE YOU DREAMED HE WAS PLAYING IN THE GARDEN BEFORE?)
SPEAK> I seem to see him there a lot.

(DO YOU FEEL  STRONGLY ABOUT DISCUSSING SUCH THINGS?)
SPEAK> I am not sure you are that interested.

(IN WHAT WAY ARE YOU NOT SURE I AM THAT INTERESTED)
SPEAK> You are not helpful.

(WHAT MAKES YOU THINK I AM NOT HELPFUL ?)
SPEAK> I'm going to report you. What's your name?

(I PREFER TO BE AN ANONYMOUS DOCTOR CLARE)
SPEAK> I am not surprised.

(IN WHAT WAY ARE YOU NOT SURPRISED)
SPEAK> Bye

---

Vanilla Eliza in action using the extended rule-set (about 50 rules). The conversation would flow a lot more smoothly if I kept adding rules to capture the many, many diverse possibilities for input. But in the end, it's all reflecting back what the user said.

If you look at the rules, you will see that Eliza (the generic program - it's specific rules which create an actor like Doctor) is snatching at a couple of key words in the user's input, and is basically praying that the rest will make sense when bounced back. It's like when you speak a foreign language really badly.

To do any better will take knowledge and inference (to come).

---

A 'Doctor' rule-set. A basic set of rules for test purposes, and an extended set.

The Eliza code in Common Lisp.

I don't promise bug-free, but it mostly works OK.

No comments:

Post a Comment

Comments are moderated. Keep it polite and no gratuitous links to your business website - we're not a billboard here.