Classical NLPNLP 02
ELIZA
ELIZA, written by Joseph Weizenbaum at MIT in the mid-1960s, was one of the first programs to hold a conversation in English. Its best-known script, DOCTOR, imitated a Rogerian psychotherapist, who mostly reflects the patient’s own words back as questions. That choice let it seem attentive while understanding nothing: every reply comes from a keyword, a pattern and a template. Talk to it, and watch the steps on the right.
ELIZA is typing...
Why it matters
Weizenbaum was troubled by how readily people confided in the program, even when they knew how it worked. The tendency to read understanding into a system’s output is now called the ELIZA effect. He later argued that some decisions, including in medicine and psychotherapy, should not be handed over to computers at all. Today’s clinical chatbots are far more fluent, but they raise the same questions.
This is the original program’s behaviour running Weizenbaum’s own DOCTOR script, exactly as printed in the appendix of the 1966 paper. The engine is a JavaScript port of Anthony Hay’s careful recreation of the original program, which he wrote in C++ from Weizenbaum’s description and code. Both the recreation and the original code and script are in the public domain (CC0), the latter with the permission of Weizenbaum’s estate. Like the original, ELIZA replies in capitals, keeps only the first clause that contains a keyword, and swaps pronouns across the whole sentence before matching any pattern.
References
- Weizenbaum, J. (1966). ELIZA — a computer program for the study of natural language communication between man and machine. Communications of the ACM, 9(1), 36–45. doi.org/10.1145/365153.365168
- Weizenbaum, J. (1976). Computer Power and Human Reason: From Judgment to Calculation. San Francisco: W. H. Freeman.
- Hay, A. ELIZA: a recreation of Weizenbaum’s 1966 ELIZA and DOCTOR script (CC0). github.com/anthay/ELIZA
- ELIZAGEN: the original ELIZA code, found in Weizenbaum’s archive at MIT. elizagen.org