Eliza / Doctor

From XPUB & Lens-Based wiki
Revision as of 10:10, 11 October 2020 by Michael Murtaugh (talk | contribs)

Famous "mother of all chatbot" programs by wikipedia:Joseph Weizenbaum. Eliza was in fact a generic engine for producing / conducting interactive dialogues. The "DOCTOR" script became the legendary example of a "Rogerian" psychologist employing mirroring technique to converse with its user as patient.

The original source code seems to be lost (?). A faithful implmentation was made by Charles Hayden in the Java language and included in the CD-ROM of the MIT Press publication: New Media Reader.

RUles

(from Charles Hayden's Java implmentation)

How Eliza Works

All the behavior of Eliza is controlled by a script file.
The standard script is attached to the end of this explanation.

Eliza starts by reading the script file.  Because of Java security, it
must be on the same server as the class files.  Eliza then reads a line at
a time from the user, processes it, and formulates a reply.

Processing consists of the following steps.
First the sentence broken down into words, separated by spaces.  All further
processing takes place on these words as a whole, not on the individual
characters in them.
Second, a set of pre-substitutions takes place.
Third, Eliza takes all the words in the sentence and makes a list of all
keywords it finds.  It sorts this keyword list in descending weight.  It
process these keywords until it produces an output.
Fourth, for the given keyword, a list of decomposition patterns is searched.
The first one that matches is selected.  If no match is found, the next keyword
is selected instead.
Fifth, for the matching decomposition pattern, a reassembly pattern is
selected.  There may be several reassembly patterns, but only one is used
for a given sentence.  If a subsequent sentence selects the same decomposition
pattern, the next reassembly pattern in sequence is used, until they have all
been used, at which point Eliza starts over with the first reassembly pattern.
Sixth, a set of post-substitutions takes place.
Finally, the resulting sentence is displayed as output.


Other similar (but not complete) eliza implementations: