Skip to content
Growth Tech News

How Eliza Chatbot works?

Eliza was one of the first chatbot implementations. Joseph Weizenbaum created it at MIT in the mid-1960s. The original version was in MAD-Slip, a list processing extension to the MAD programming language, but it has been ported to many languages. It's best known in combination with the DOCTOR script, which simulates a psychotherapist. Weizenbaum's original article on Eliza is available but requires a purchase.

The originals source code seems lost to the Internet, but a Java port by Charles Hayden claims to be "a complete and faithful implementation." It uses the original script file, slightly reformatted.

Eliza's processing loop

The main loop accepts user input and generates a response. It breaks up the input into sentences and scans each sentence for key words or phrases. It applies a synonym list to match equivalent words.

For each key, it looks for a "decomposition pattern," a meaningful way of parsing the sentence. It doesn't do a full, grammatical parsing operation. Rather, it does a simple pattern matching operation. In some cases, all it can do is use the key by itself to generate a default response. If there's more than one key, Eliza chooses the match with the greatest weight that it can decompose.

Next, Eliza applies a "reassembly pattern." This is a response to the parsed input, very often just a transformation. For instance, it the user types "I had a strange dream," the code picks up the key "dream," recognizes that the user claims to have had a dream, and may respond, "What does that dream suggest to you?"

Earlier input is saved, and if Eliza can't find a pattern to respond to, it may mention a previous statement and ask the user to elaborate on it. If there's no saved input and no matched key, Eliza generates the "xnone" key to work from. Normally it selects from a set of default responses, such as "Can you elaborate on that?"

Eliza's reassembly just inserts part of the user's input into a predefined response. The result may not make sense and may even be ungrammatical.

A simple approach, effective interaction

This brief discussion shows that Eliza applies very little intelligence and doesn't "learn." It doesn't understand English grammar, much less psychotherapy. Its responses may be widely off the mark, yet users have seen personal meaning in them.

With other scripts, Eliza can have a completely different "personality" and serve other uses. Weizenbaum may have written other scripts, but if so they've been lost to history.

Recent Posts

  • Getting Started with React
  • Encryption, hashing and cryptography
  • Understanding Open Source and Free Software Licenses
  • Designing a Smart Conversational Interface
  • Deep Learning: Recent Research

Recent Comments

    Archives

    • November 2018

    Categories

    • Case studies
    • Case studies>Case: web page
    • Chat Experience
    • Chat Experience|Insights
    • Chatbots in industries
    • Chatbots in industries|Conversational Marketing|Insights
    • Chatbots in industries|Insights
    • Chatbots in industries|Links: Chatbot usage|Links: Chatbots in industries
    • Chatbots in industries|Tech
    • Digitalization
    • Digitalization>Chatbots
    • Digitalization>Chatbots|Digitalization>Digital Communications
    • Digitalization>Digital Communications
    • Digitalization>Technology Legalities
    • Digitalization|General
    • General
    • Insights
    • Insights|Tech
    • Tech
    • Technology
    • Technology>Artificial Intelligence
    • Technology>Coding
    • Technology>DevOps & System Administrations|Tekniset videot
    • Technology>Security
    • Technology>Security|Tekniset videot
    • Technology>Web

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Our other sites

    • Kwork Innovations
    • Chatbot Pack
    • Upote