forked from anthay/ELIZA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eliza_test_conversations.py
414 lines (394 loc) · 15.6 KB
/
eliza_test_conversations.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# The same DOCTOR_1966.. script with comments stripped.
CACM_1966_01_DOCTOR_test_script = ''.join([
"(HOW DO YOU DO. PLEASE TELL ME YOUR PROBLEM)\n",
"(ALIKE 10\n",
" (=DIT))\n",
"(ALWAYS 1\n",
" ((0)\n",
" (CAN YOU THINK OF A SPECIFIC EXAMPLE)\n",
" (WHEN)\n",
" (WHAT INCIDENT ARE YOU THINKING OF)\n",
" (REALLY, ALWAYS)))\n",
"(AM = ARE\n",
" ((0 ARE YOU 0)\n",
" (DO YOU BELIEVE YOU ARE 4)\n",
" (WOULD YOU WANT TO BE 4)\n",
" (YOU WISH I WOULD TELL YOU YOU ARE 4)\n",
" (WHAT WOULD IT MEAN IF YOU WERE 4)\n",
" (=WHAT))\n",
" ((0)\n",
" (WHY DO YOU SAY 'AM')\n",
" (I DON'T UNDERSTAND THAT)))\n",
"(ARE\n",
" ((0 ARE I 0)\n",
" (WHY ARE YOU INTERESTED IN WHETHER I AM 4 OR NOT)\n",
" (WOULD YOU PREFER IF I WEREN'T 4)\n",
" (PERHAPS I AM 4 IN YOUR FANTASIES)\n",
" (DO YOU SOMETIMES THINK I AM 4)\n",
" (=WHAT))\n",
" ((0 ARE 0)\n",
" (DID YOU THINK THEY MIGHT NOT BE 3)\n",
" (WOULD YOU LIKE IT IF THEY WERE NOT 3)\n",
" (WHAT IF THEY WERE NOT 3)\n",
" (POSSIBLY THEY ARE 3)))\n",
"(BECAUSE\n",
" ((0)\n",
" (IS THAT THE REAL REASON)\n",
" (DON'T ANY OTHER REASONS COME TO MIND)\n",
" (DOES THAT REASON SEEM TO EXPLAIN ANYTHING ELSE)\n",
" (WHAT OTHER REASONS MIGHT THERE BE)))\n",
"(BELIEVE DLIST(/BELIEF))\n",
"(BROTHER DLIST(/FAMILY))\n",
"(CAN\n",
" ((0 CAN I 0)\n",
" (YOU BELIEVE I CAN 4 DON'T YOU)\n",
" (=WHAT)\n",
" (YOU WANT ME TO BE ABLE TO 4)\n",
" (PERHAPS YOU WOULD LIKE TO BE ABLE TO 4 YOURSELF))\n",
" ((0 CAN YOU 0)\n",
" (WHETHER OR NOT YOU CAN 4 DEPENDS ON YOU MORE THAN ON ME)\n",
" (DO YOU WANT TO BE ABLE TO 4)\n",
" (PERHAPS YOU DON'T WANT TO 4)\n",
" (=WHAT)))\n",
"(CANT = CAN'T)\n",
"(CERTAINLY\n",
" (=YES))\n",
"(CHILDREN DLIST(/FAMILY))\n",
"(COMPUTER 50\n",
" ((0)\n",
" (DO COMPUTERS WORRY YOU)\n",
" (WHY DO YOU MENTION COMPUTERS)\n",
" (WHAT DO YOU THINK MACHINES HAVE TO DO WITH YOUR PROBLEM)\n",
" (DON'T YOU THINK COMPUTERS CAN HELP PEOPLE)\n",
" (WHAT ABOUT MACHINES WORRIES YOU)\n",
" (WHAT DO YOU THINK ABOUT MACHINES)))\n",
"(COMPUTERS 50\n",
" (=COMPUTER))\n",
"(DAD = FATHER DLIST(/ FAMILY))\n",
"(DEUTSCH\n",
" (=XFREMD))\n",
"(DIT\n",
" ((0)\n",
" (IN WHAT WAY)\n",
" (WHAT RESEMBLANCE DO YOU SEE)\n",
" (WHAT DOES THAT SIMILARITY SUGGEST TO YOU)\n",
" (WHAT OTHER CONNECTIONS DO YOU SEE)\n",
" (WHAT DO YOU SUPPOSE THAT RESEMBLANCE MEANS)\n",
" (WHAT IS THE CONNECTION, DO YOU SUPPOSE)\n",
" (COULD THERE REALLY BE SOME CONNECTION)\n",
" (HOW)))\n",
"(DONT = DON'T)\n",
"(DREAM 3\n",
" ((0)\n",
" (WHAT DOES THAT DREAM SUGGEST TO YOU)\n",
" (DO YOU DREAM OFTEN)\n",
" (WHAT PERSONS APPEAR IN YOUR DREAMS)\n",
" (DON'T YOU BELIEVE THAT DREAM HAS SOMETHING TO DO WITH YOUR PROBLEM)\n",
" (NEWKEY)))\n",
"(DREAMED = DREAMT 4\n",
" (=DREAMT))\n",
"(DREAMS = DREAM 3\n",
" (=DREAM))\n",
"(DREAMT 4\n",
" ((0 YOU DREAMT 0)\n",
" (REALLY, 4)\n",
" (HAVE YOU EVER FANTASIED 4 WHILE YOU WERE AWAKE)\n",
" (HAVE YOU DREAMT 4 BEFORE)\n",
" (=DREAM)\n",
" (NEWKEY)))\n",
"(ESPANOL\n",
" (=XFREMD))\n",
"(EVERYBODY 2\n",
" (=EVERYONE))\n",
"(EVERYONE 2\n",
" ((0 (* EVERYONE EVERYBODY NOBODY NOONE) 0)\n",
" (REALLY, 2)\n",
" (SURELY NOT 2)\n",
" (CAN YOU THINK OF ANYONE IN PARTICULAR)\n",
" (WHO, FOR EXAMPLE)\n",
" (YOU ARE THINKING OF A VERY SPECIAL PERSON)\n",
" (WHO, MAY I ASK)\n",
" (SOMEONE SPECIAL PERHAPS)\n",
" (YOU HAVE A PARTICULAR PERSON IN MIND, DON'T YOU)\n",
" (WHO DO YOU THINK YOU'RE TALKING ABOUT)))\n",
"(FATHER DLIST(/NOUN FAMILY))\n",
"(FEEL DLIST(/BELIEF))\n",
"(FRANCAIS\n",
" (=XFREMD))\n",
"(HELLO\n",
" ((0)\n",
" (HOW DO YOU DO. PLEASE STATE YOUR PROBLEM)))\n",
"(HOW\n",
" (=WHAT))\n",
"(I = YOU\n",
" ((0 YOU (* WANT NEED) 0)\n",
" (WHAT WOULD IT MEAN TO YOU IF YOU GOT 4)\n",
" (WHY DO YOU WANT 4)\n",
" (SUPPOSE YOU GOT 4 SOON)\n",
" (WHAT IF YOU NEVER GOT 4)\n",
" (WHAT WOULD GETTING 4 MEAN TO YOU)\n",
" (WHAT DOES WANTING 4 HAVE TO DO WITH THIS DISCUSSION))\n",
" ((0 YOU ARE 0 (*SAD UNHAPPY DEPRESSED SICK) 0)\n",
" (I AM SORRY TO HEAR YOU ARE 5)\n",
" (DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE 5)\n",
" (I'M SURE ITS NOT PLEASANT TO BE 5)\n",
" (CAN YOU EXPLAIN WHAT MADE YOU 5))\n",
" ((0 YOU ARE 0 (*HAPPY ELATED GLAD BETTER) 0)\n",
" (HOW HAVE I HELPED YOU TO BE 5)\n",
" (HAS YOUR TREATMENT MADE YOU 5)\n",
" (WHAT MAKES YOU 5 JUST NOW)\n",
" (CAN YOU EXPLAIN WHY YOU ARE SUDDENLY 5))\n",
" ((0 YOU WAS 0)\n",
" (=WAS))\n",
" ((0 YOU (/BELIEF) YOU 0)\n",
" (DO YOU REALLY THINK SO)\n",
" (BUT YOU ARE NOT SURE YOU 5)\n",
" (DO YOU REALLY DOUBT YOU 5))\n",
" ((0 YOU 0 (/BELIEF) 0 I 0)\n",
" (=YOU))\n",
" ((0 YOU ARE 0)\n",
" (IS IT BECAUSE YOU ARE 4 THAT YOU CAME TO ME)\n",
" (HOW LONG HAVE YOU BEEN 4)\n",
" (DO YOU BELIEVE IT NORMAL TO BE 4)\n",
" (DO YOU ENJOY BEING 4))\n",
" ((0 YOU (* CAN'T CANNOT) 0)\n",
" (HOW DO YOU KNOW YOU CAN'T 4)\n",
" (HAVE YOU TRIED)\n",
" (PERHAPS YOU COULD 4 NOW)\n",
" (DO YOU REALLY WANT TO BE ABLE TO 4))\n",
" ((0 YOU DON'T 0)\n",
" (DON'T YOU REALLY 4)\n",
" (WHY DON'T YOU 4)\n",
" (DO YOU WISH TO BE ABLE TO 4)\n",
" (DOES THAT TROUBLE YOU))\n",
" ((0 YOU FEEL 0)\n",
" (TELL ME MORE ABOUT SUCH FEELINGS)\n",
" (DO YOU OFTEN FEEL 4)\n",
" (DO YOU ENJOY FEELING 4)\n",
" (OF WHAT DOES FEELING 4 REMIND YOU))\n",
" ((0 YOU 0 I 0)\n",
" (PERHAPS IN YOUR FANTASY WE 3 EACH OTHER)\n",
" (DO YOU WISH TO 3 ME)\n",
" (YOU SEEM TO NEED TO 3 ME)\n",
" (DO YOU 3 ANYONE ELSE))\n",
" ((0)\n",
" (YOU SAY 1)\n",
" (CAN YOU ELABORATE ON THAT)\n",
" (DO YOU SAY 1 FOR SOME SPECIAL REASON)\n",
" (THAT'S QUITE INTERESTING)))\n",
"(I'M = YOU'RE\n",
" ((0 YOU'RE 0)\n",
" ( PRE ( YOU ARE 3 ) ( = I ) )))\n",
"(IF 3\n",
" ((0 IF 0)\n",
" (DO YOU THINK ITS LIKELY THAT 3)\n",
" (DO YOU WISH THAT 3)\n",
" (WHAT DO YOU THINK ABOUT 3)\n",
" (REALLY, 2 3)))\n",
"(ITALIANO\n",
" (=XFREMD))\n",
"(LIKE 10\n",
" ((0 (*AM IS ARE WAS) 0 LIKE 0)\n",
" (=DIT))\n",
" ((0)\n",
" (NEWKEY)))\n",
"(MACHINE 50\n",
" (=COMPUTER))\n",
"(MACHINES 50\n",
" (=COMPUTER))\n",
"(MAYBE\n",
" (=PERHAPS))\n",
"(ME = YOU)\n",
"(MOM = MOTHER DLIST(/ FAMILY))\n",
"(MOTHER DLIST(/NOUN FAMILY))\n",
"(MY = YOUR 2\n",
" ((0 YOUR 0 (/FAMILY) 0)\n",
" (TELL ME MORE ABOUT YOUR FAMILY)\n",
" (WHO ELSE IN YOUR FAMILY 5)\n",
" (YOUR 4)\n",
" (WHAT ELSE COMES TO MIND WHEN YOU THINK OF YOUR 4))\n",
" ((0 YOUR 0)\n",
" (YOUR 3)\n",
" (WHY DO YOU SAY YOUR 3)\n",
" (DOES THAT SUGGEST ANYTHING ELSE WHICH BELONGS TO YOU)\n",
" (IS IT IMPORTANT TO YOU THAT 2 3)))\n",
"(MYSELF = YOURSELF)\n",
"(NAME 15\n",
" ((0)\n",
" (I AM NOT INTERESTED IN NAMES)\n",
" (I'VE TOLD YOU BEFORE, I DON'T CARE ABOUT NAMES - PLEASE CONTINUE)))\n",
"(NO\n",
" ((0)\n",
" (ARE YOU SAYING 'NO' JUST TO BE NEGATIVE)\n",
" (YOU ARE BEING A BIT NEGATIVE)\n",
" (WHY NOT)\n",
" (WHY 'NO')))\n",
"(NOBODY 2\n",
" (=EVERYONE))\n",
"(NOONE 2\n",
" (=EVERYONE))\n",
"(PERHAPS\n",
" ((0)\n",
" (YOU DON'T SEEM QUITE CERTAIN)\n",
" (WHY THE UNCERTAIN TONE)\n",
" (CAN'T YOU BE MORE POSITIVE)\n",
" (YOU AREN'T SURE)\n",
" (DON'T YOU KNOW)))\n",
"(REMEMBER 5\n",
" ((0 YOU REMEMBER 0)\n",
" (DO YOU OFTEN THINK OF 4)\n",
" (DOES THINKING OF 4 BRING ANYTHING ELSE TO MIND)\n",
" (WHAT ELSE DO YOU REMEMBER)\n",
" (WHY DO YOU REMEMBER 4 JUST NOW)\n",
" (WHAT IN THE PRESENT SITUATION REMINDS YOU OF 4)\n",
" (WHAT IS THE CONNECTION BETWEEN ME AND 4))\n",
" ((0 DO I REMEMBER 0)\n",
" (DID YOU THINK I WOULD FORGET 5)\n",
" (WHY DO YOU THINK I SHOULD RECALL 5 NOW)\n",
" (WHAT ABOUT 5)\n",
" (=WHAT)\n",
" (YOU MENTIONED 5))\n",
" ((0)\n",
" (NEWKEY)))\n",
"(SAME 10\n",
" (=DIT))\n",
"(SISTER DLIST(/FAMILY))\n",
"(SORRY\n",
" ((0)\n",
" (PLEASE DON'T APOLIGIZE)\n",
" (APOLOGIES ARE NOT NECESSARY)\n",
" (WHAT FEELINGS DO YOU HAVE WHEN YOU APOLOGIZE)\n",
" (I'VE TOLD YOU THAT APOLOGIES ARE NOT REQUIRED)))\n",
"(THINK DLIST(/BELIEF))\n",
"(WAS 2\n",
" ((0 WAS YOU 0)\n",
" (WHAT IF YOU WERE 4)\n",
" (DO YOU THINK YOU WERE 4)\n",
" (WERE YOU 4)\n",
" (WHAT WOULD IT MEAN IF YOU WERE 4)\n",
" (WHAT DOES ' 4 ' SUGGEST TO YOU)\n",
" (=WHAT))\n",
" ((0 YOU WAS 0)\n",
" (WERE YOU REALLY)\n",
" (WHY DO YOU TELL ME YOU WERE 4 NOW)\n",
" (PERHAPS I ALREADY KNEW YOU WERE 4))\n",
" ((0 WAS I 0)\n",
" (WOULD YOU LIKE TO BELIEVE I WAS 4)\n",
" (WHAT SUGGESTS THAT I WAS 4)\n",
" (WHAT DO YOU THINK)\n",
" (PERHAPS I WAS 4)\n",
" (WHAT IF I HAD BEEN 4))\n",
" ((0)\n",
" (NEWKEY)))\n",
"(WERE = WAS\n",
" (=WAS))\n",
"(WHAT\n",
" ((0)\n",
" (WHY DO YOU ASK)\n",
" (DOES THAT QUESTION INTEREST YOU)\n",
" (WHAT IS IT YOU REALLY WANT TO KNOW)\n",
" (ARE SUCH QUESTIONS MUCH ON YOUR MIND)\n",
" (WHAT ANSWER WOULD PLEASE YOU MOST)\n",
" (WHAT DO YOU THINK)\n",
" (WHAT COMES TO YOUR MIND WHEN YOU ASK THAT)\n",
" (HAVE YOU ASKED SUCH QUESTIONS BEFORE)\n",
" (HAVE YOU ASKED ANYONE ELSE)))\n",
"(WHEN\n",
" (=WHAT))\n",
"(WHY\n",
" ((0 WHY DON'T I 0)\n",
" (DO YOU BELIEVE I DON'T 5)\n",
" (PERHAPS I WILL 5 IN GOOD TIME)\n",
" (SHOULD YOU 5 YOURSELF)\n",
" (YOU WANT ME TO 5)\n",
" (=WHAT))\n",
" ((0 WHY CAN'T YOU 0)\n",
" (DO YOU THINK YOU SHOULD BE ABLE TO 5)\n",
" (DO YOU WANT TO BE ABLE TO 5)\n",
" (DO YOU BELIEVE THIS WILL HELP YOU TO 5)\n",
" (HAVE YOU ANY IDEA WHY YOU CAN'T 5)\n",
" (=WHAT))\n",
" (=WHAT))\n",
"(WIFE DLIST(/FAMILY))\n",
"(WISH DLIST(/BELIEF))\n",
"(WONT = WON'T)\n",
"(XFREMD\n",
" ((0)\n",
" (I AM SORRY, I SPEAK ONLY ENGLISH)))\n",
"(YES\n",
" ((0)\n",
" (YOU SEEM QUITE POSITIVE)\n",
" (YOU ARE SURE)\n",
" (I SEE)\n",
" (I UNDERSTAND)))\n",
"(YOU = I\n",
" ((0 I REMIND YOU OF 0)\n",
" (=DIT))\n",
" ((0 I ARE 0)\n",
" (WHAT MAKES YOU THINK I AM 4)\n",
" (DOES IT PLEASE YOU TO BELIEVE I AM 4)\n",
" (DO YOU SOMETIMES WISH YOU WERE 4)\n",
" (PERHAPS YOU WOULD LIKE TO BE 4))\n",
" ((0 I 0 YOU)\n",
" (WHY DO YOU THINK I 3 YOU)\n",
" (YOU LIKE TO THINK I 3 YOU - DON'T YOU)\n",
" (WHAT MAKES YOU THINK I 3 YOU)\n",
" (REALLY, I 3 YOU)\n",
" (DO YOU WISH TO BELIEVE I 3 YOU)\n",
" (SUPPOSE I DID 3 YOU - WHAT WOULD THAT MEAN)\n",
" (DOES SOMEONE ELSE BELIEVE I 3 YOU))\n",
" ((0 I 0)\n",
" (WE WERE DISCUSSING YOU - NOT ME)\n",
" (OH, I 3)\n",
" (YOU'RE NOT REALLY TALKING ABOUT ME - ARE YOU)\n",
" (WHAT ARE YOUR FEELINGS NOW)))\n",
"(YOU'RE = I'M\n",
" ((0 I'M 0)\n",
" ( PRE ( I ARE 3 ) ( = YOU ) )))\n",
"(YOUR = MY\n",
" ((0 MY 0)\n",
" (WHY ARE YOU CONCERNED OVER MY 3)\n",
" (WHAT ABOUT YOUR OWN 3)\n",
" (ARE YOU WORRIED ABOUT SOMEONE ELSES 3)\n",
" (REALLY, MY 3)))\n",
"(YOURSELF = MYSELF)\n",
"(NONE\n",
" ((0)\n",
" (I AM NOT SURE I UNDERSTAND YOU FULLY)\n",
" (PLEASE GO ON)\n",
" (WHAT DOES THAT SUGGEST TO YOU)\n",
" (DO YOU FEEL STRONGLY ABOUT DISCUSSING SUCH THINGS)))\n",
"(MEMORY MY\n",
" (0 YOUR 0 = LETS DISCUSS FURTHER WHY YOUR 3)\n",
" (0 YOUR 0 = EARLIER YOU SAID YOUR 3)\n",
" (0 YOUR 0 = BUT YOUR 3)\n",
" (0 YOUR 0 = DOES THAT HAVE ANYTHING TO DO WITH THE FACT THAT YOUR 3))\n"])
cacm_1966_conversation = [
# // --- exact conversation quoted in Weizenbaum's 1966 CACM article ---
("Men are all alike.", "IN WHAT WAY"),
("They're always bugging us about something or other.", "CAN YOU THINK OF A SPECIFIC EXAMPLE"),
("Well, my boyfriend made me come here.", "YOUR BOYFRIEND MADE YOU COME HERE"),
("He says I'm depressed much of the time.", "I AM SORRY TO HEAR YOU ARE DEPRESSED"),
("It's true. I am unhappy.", "DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UNHAPPY"),
("I need some help, that much seems certain.", "WHAT WOULD IT MEAN TO YOU IF YOU GOT SOME HELP"),
("Perhaps I could learn to get along with my mother.", "TELL ME MORE ABOUT YOUR FAMILY"),
("My mother takes care of me.", "WHO ELSE IN YOUR FAMILY TAKES CARE OF YOU"),
("My father.", "YOUR FATHER"),
("You are like my father in some ways.", "WHAT RESEMBLANCE DO YOU SEE"),
# // In the CACM article, the following prompt contained no comma.
# // Without the comma, this simulation responds "WHAT MAKES YOU
# // THINK I AM NOT VERY AGGRESSIVE BUT YOU THINK I DON'T WANT YOU TO
# // NOTICE THAT". I assume the comma got lost from the CACM article.
# //{ "You are not very aggressive, but I think you don't want me to notice that.",
# //
# // UPDATE: We now have a version of Weizenbaum's original MAD-SLIP
# // source code where we see that the word "BUT" is also considered
# // to be a delimiter. So I was wrong to assume a missing comma.
("You are not very aggressive but I think you don't want me to notice that.",
"WHAT MAKES YOU THINK I AM NOT VERY AGGRESSIVE"),
("You don't argue with me.", "WHY DO YOU THINK I DON'T ARGUE WITH YOU"),
("You are afraid of me.", "DOES IT PLEASE YOU TO BELIEVE I AM AFRAID OF YOU"),
("My father is afraid of everybody.", "WHAT ELSE COMES TO MIND WHEN YOU THINK OF YOUR FATHER"),
("Bullies.", "DOES THAT HAVE ANYTHING TO DO WITH THE FACT THAT YOUR BOYFRIEND MADE YOU COME HERE"),
# // --- end of 1966 CACM article conversation ---
]