ELIZA: A Computer Program for the Study of Natural Language Communication Between Man and Machine
Weizenbaum, 1966, ELIZA (Communications of the ACM)
Subscriber deck — free during early access
16 cards in “The ELIZA program” · whole deck
The ELIZA program
- Explain ELIZA’s transformations with Weizenbaum’s analogy of the foreigner.A foreigner who catches only “I am” in “I am very unhappy these days” might reply “How long have you been very unhappy these days?”: they applied a template matching “I am” and isolating the rest, plus a reassembly kit turning “I am BLAH” into “How long have you been BLAH”, regardless of what BLAH means.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- How do decomposition and reassembly rules work? Show “It seems that you hate me”.Decomposition (0 YOU 0 ME), where 0 means any number of words, splits the input; the reassembly rule (WHAT MAKES YOU THINK I 3 YOU) inserts component 3.
Output: “What makes you think I hate you”.component 1 2 3 4 text It seems that you hate me - Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- What does a nonzero integer \(n\) mean in a decomposition rule?That the component must consist of exactly \(n\) words. (0 YOU 1 ME) matches “It seems you hate me” but not “It seems you hate and love me”.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- Why does ELIZA need keywords at all?To sharply limit which decomposition rules are tried: only rules containing the keyword found are candidates, and they can be ordered, with a rule like (0 YOU 0) that is bound to succeed tried last.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- How is an ELIZA key list structured?A keyword followed by a list of decomposition rules, each followed by its reassembly rules: (K ((D1) (R1,1) (R1,2) …) ((D2) (R2,1) …) …).
Decomposition rules (D) with their reassembly rules (R) - Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- How did ELIZA find keywords efficiently?Each keyword was hashed into one of 128 slots of a vector KEY; each input word is hashed the same way, giving the only list that could contain it, so usually only the top of a key list needs checking. Often it takes less time to find a word is not a keyword than to locate one that is.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- What are simple substitutions in an ELIZA script?Unconditional word-for-word replacements made during the scan itself, written with “=”, e.g. (MYSELF = YOURSELF), (ME = YOU). The word needn’t be a keyword; this is how first- and second-person pronouns are swapped.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- Why do keywords have ranks? Give Weizenbaum’s example.In “I know everybody laughed at me”, without ranks “I” (found first) would give “You say you know everybody laughed at you”. But the important part starts at “everybody”: people speaking of universals usually mean something specific, so ranking “everybody” higher yields “Who in particular are you thinking of”.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- What is the keystack?As the input is scanned, each keyword’s rule pointer goes on top of the stack if its rank beats all earlier keywords, otherwise at the bottom. At the end the top holds the highest-ranked keyword, and the rest are in a roughly useful order.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- How does ELIZA avoid repeating the same response for a decomposition rule?Each matched decomposition rule remembers which reassembly rule it last used and cycles through all its reassembly rules before any repeats.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- What does a rule like (=WHAT) do in a script?It redirects to another keyword’s transformation rules, so keywords that should behave alike (how, what, when) form an equivalence class without copying rules. It can appear in place of a decomposition or a reassembly rule.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- What does the NEWKEY reassembly rule do?It abandons the current keyword, pops the next keyword from the keystack and restarts decomposition and reassembly as if the scan had just ended, which in effect lets scripts test for key phrases rather than single words.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- What does ELIZA do when no keyword applies?It uses the reserved keyword NONE, whose rule (0) matches anything and is followed by content-free remarks (“Please go on”, “That’s very interesting”, “I see”), or, under some conditions, the MEMORY mechanism.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- How does ELIZA’s MEMORY mechanism work?When the designated keyword (MY) is the highest-ranked one, a randomly chosen MEMORY transformation (e.g. “Earlier you said your 3”, “Does that have anything to do with the fact that your 3”) is applied to a copy of the input and queued. Later, when an input has no keywords, a queued text can be printed as the reply.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- How can script words be tagged, and how are tags used?With DLIST, e.g. (MOTHER DLIST(/NOUN FAMILY)). A decomposition rule can contain (/FAMILY) to match any word with that tag, as in (0 YOUR 0 (/FAMILY) 0); alternatives can also be listed, e.g. (* FATHER MOTHER).
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
- Why should an ELIZA script start small?With the built-in editor, a script can begin as a modest set of keywords and rules and grow with experience, which Weizenbaum saw as the best use of an interactive system: an aid for exploring strategies rather than for debugging a fully thought-out solution.
- Weizenbaum, 1966, ELIZA (Communications of the ACM), The ELIZA program
Source
- Joseph Weizenbaum. 1966. ELIZA — A Computer Program for the Study of Natural Language Communication Between Man and Machine. In Communications of the ACM, pp. 36–45. doi:10.1145/365153.365168