-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoctor.html
More file actions
133 lines (120 loc) · 9.58 KB
/
Copy pathdoctor.html
File metadata and controls
133 lines (120 loc) · 9.58 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The DOCTOR script · ELIZA (1966)</title>
<meta name="description" content="Weizenbaum’s Rogerian therapist script for ELIZA: how its keyword rules work, a searchable dictionary of every keyword, and the full 1966 script.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="ELIZA Archaeology Project">
<meta property="og:title" content="The DOCTOR script · ELIZA (1966)">
<meta property="og:description" content="Weizenbaum’s Rogerian therapist script for ELIZA: how its keyword rules work, a searchable dictionary of every keyword, and the full 1966 script.">
<meta property="og:image" content="https://findingeliza.org/assets/images/share-card.png?v=202607172046">
<meta property="og:url" content="https://findingeliza.org/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="The DOCTOR script · ELIZA (1966)">
<meta name="twitter:description" content="Weizenbaum’s Rogerian therapist script for ELIZA: how its keyword rules work, a searchable dictionary of every keyword, and the full 1966 script.">
<meta name="twitter:image" content="https://findingeliza.org/assets/images/share-card.png?v=202607172046">
<link rel="icon" type="image/svg+xml" href="assets/favicon.svg?v=202607172046">
<link rel="stylesheet" href="assets/css/site.css?v=202607172046">
<script src="assets/nav.js?v=202607172046" defer></script>
<script src="assets/term.js?v=202607172046" defer></script>
<script src="assets/eliza-hay.js?v=202607172046" defer></script>
<script src="assets/dict.js?v=202607172046" defer></script>
</head>
<body>
<header class="site-header">
<div class="wrap">
<a class="brand" href="index.html" aria-label="ELIZA home">
<svg viewBox="0 0 32 32" aria-hidden="true"><path d="M4 6 H22 L28 12 V26 H4 Z" fill="#d9cfbc"/><g fill="#14161b"><rect x="8" y="13" width="3" height="5" rx="0.8"/><rect x="14" y="13" width="3" height="5" rx="0.8"/></g><rect x="20" y="13" width="3" height="5" rx="0.8" fill="#ef6f44"/><text x="16" y="24" text-anchor="middle" font-family="ui-monospace, Menlo, monospace" font-size="4.4" letter-spacing="0.3" fill="#14161b" opacity="0.5">000010</text></svg>
<span class="brand-block"><span class="brand-text"><svg class="brand-wordmark" viewBox="0 -735 2500 735" aria-hidden="true" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><g transform="scale(1,-1)"><path transform="translate(0 0)" d="M66 0V735H442V630H190V435H385V330H190V105H442V0Z"/><path transform="translate(500 0)" d="M86 0V735H210V105H448V0Z"/><path transform="translate(1000 0)" d="M75 0V105H188V630H75V735H425V630H312V105H425V0Z"/><path transform="translate(1500 0)" d="M58 0V105L300 630H58V735H442V630L200 105H442V0Z"/><path transform="translate(2000 0)" d="M35 0 179 735H321L465 0H339L314 155H186L161 0ZM297 260 260 490Q257 505 254.5 519.5Q252 534 250 549Q248 534 245.5 519.5Q243 505 240 490L203 260Z"/></g></svg></span></span>
</a>
<button class="nav-toggle" aria-label="Open menu" aria-expanded="false"><span class="bars" aria-hidden="true">☰</span> Menu</button>
<nav class="site-nav" id="site-nav">
<div class="nav-group">
<button class="nav-top" aria-expanded="false">ELIZA <span class="caret" aria-hidden="true">▾</span></button>
<div class="nav-menu">
<a href="overview.html">Overview</a><a href="doctor.html">The DOCTOR script</a><a href="versions.html">The versions</a><a href="try.html">Try ELIZA</a><a href="book.html">The book</a>
</div>
</div>
<div class="nav-group">
<button class="nav-top" aria-expanded="false">The code <span class="caret" aria-hidden="true">▾</span></button>
<div class="nav-menu">
<a href="code.html">The program</a><a href="slip.html">SLIP</a><a href="how.html">How it works</a>
</div>
</div>
<div class="nav-group">
<button class="nav-top" aria-expanded="false">Project <span class="caret" aria-hidden="true">▾</span></button>
<div class="nav-menu">
<a href="talks.html">Talks</a><a href="blog.html">Blog</a>
</div>
</div>
<div class="nav-group">
<button class="nav-top" aria-expanded="false">About <span class="caret" aria-hidden="true">▾</span></button>
<div class="nav-menu">
<a href="about.html">About</a><a href="people.html">TEAM-ELIZA</a><a href="bibliography.html">Bibliography</a><a href="links.html">Resources</a>
</div>
</div>
</nav>
</div>
</header>
<main class="wrap content" style="padding-top:3rem;">
<article class="block">
<span class="kicker">The code</span>
<h1 class="page">The DOCTOR script</h1>
<div class="lede"><p>DOCTOR is the script that made ELIZA famous. It is a list of keywords, each with patterns for taking apart what you say and templates for putting a reply back together. Feed ELIZA this script and it answers like a Rogerian therapist.</p></div>
<div class="rule" id="dictionary">THE DICTIONARY</div>
<p>Every word DOCTOR knows, and the rules behind it. Type to filter the keyword list, then click a keyword to read its transformation rules: the <em>decomposition</em> patterns that take your sentence apart, and the <em>reassembly</em> templates that build a reply.</p>
<div id="dict-app"></div>
<h2>How a rule works</h2>
<p>Each keyword carries a rank and a set of rules. A <em>decomposition</em> pattern splits your sentence into numbered parts; a <em>reassembly</em> template builds a reply from those parts. Take the keyword <code>ALIKE</code>, ranked high so it wins over ordinary words:</p>
<pre class="listing">(ALIKE 10 (=DIT))
(DIT
((0)
(IN WHAT WAY)
(WHAT RESEMBLANCE DO YOU SEE)
(WHAT DOES THAT SIMILARITY SUGGEST TO YOU)))</pre>
<p>Say “Men are all alike” and <code>ALIKE</code> fires, hands off to <code>DIT</code>, and ELIZA replies “IN WHAT WAY”. The next time, it cycles to the following template. The famous opening of Weizenbaum’s paper is nothing more than this.</p>
<h2>The canonical conversation</h2>
<p>This is the exchange Weizenbaum printed in the 1966 CACM paper. Every ELIZA line is produced by the rules in the DOCTOR script. <a href="try.html">Try it yourself ›</a></p>
<div class="fanfold">
<div class="fanfold-cmd"><div class="cmd-line">DOCTOR</div><div class="cmd-line">W 0809.3</div></div>
<pre class="fanfold-listing">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
You are like my father in some ways.
WHAT RESEMBLANCE DO YOU SEE</pre>
<div class="fanfold-cmd fanfold-foot"><div class="cmd-line">R 0809.3+.80</div></div>
</div>
<h2>Three scripts, one in progress</h2>
<p>There are three known contemporaneous DOCTOR scripts: the one published as an appendix to the 1966 paper, and two more (<code>.TAPE. 102</code> and <code>.TAPE. 100</code>) on a printout in Weizenbaum’s archive. They are clearly successive drafts: keywords gained extra replies, a misplaced line was fixed, redirects were simplified. The script was built incrementally, almost without a plan, each change improving ELIZA’s ability to conceal its lack of understanding. <a href="blog/post.html?p=8-the-doctor-script-a-work-in-progress">The DOCTOR script, a work in progress ›</a></p>
<div class="callout"><span class="kicker">Memory</span><p>One special rule, <code>MEMORY</code>, watches for when you mention something that is “yours”, stores a transformed version of it, and brings it back later (“EARLIER YOU SAID YOUR…”). It is the closest DOCTOR comes to keeping track of a conversation.</p></div>
<div class="rule">THE FULL SCRIPT</div>
<p>The whole DOCTOR script as published in the appendix to Weizenbaum’s 1966 <cite>Communications of the ACM</cite> paper, transcribed by Anthony C. Hay (<code>DOCTOR.txt</code> in the <a href="https://github.com/critical-code-studies/ELIZA">repository</a>). This is the exact text the engine on this site reads, listed here as a line-printer printout.</p>
<div class="fanfold">
<div class="fanfold-cmd"><div class="cmd-line">PRINT DOCTOR</div><div class="cmd-line">W 1009.4</div></div>
<pre id="dict-script" class="fanfold-listing"></pre>
<div class="fanfold-cmd fanfold-foot"><div class="cmd-line">R 1009.4+.28</div></div>
</div>
</article>
</main>
<footer class="site-footer">
<div class="wrap">
<p class="micro">The ELIZA Archaeology Project, a Critical Code Studies reading of ELIZA (Joseph Weizenbaum, MIT, 1966). Source: <a href="https://github.com/critical-code-studies/ELIZA">github.com/critical-code-studies/ELIZA</a>. All project documents © 2024–2026 the authors, except where indicated.</p>
</div>
</footer>
</body>
</html>