ELIZA Therapist: The First Chatbot
Imagine travelling back in time to the year 1966. Computers were giant, room-sized metal cabinets that didn't have screens, speakers, or mouse pads. Yet, a computer scientist named Joseph Weizenbaum created a computer program named ELIZA that could hold a conversation! In this simulation, you get to sit down at the virtual terminal and chat with ELIZA just like people did sixty years ago.
ELIZA acts like a therapist. If you tell her "I am feeling lonely today," she might ask you, "Why do you think you are feeling lonely today?" If you mention your family, she will immediately say, "Tell me more about your family."
Cabinet Controls: When playing the game, type your messages into the terminal text box and press **Send**. Underneath the chat screen, you will find an **X-Ray Panel**. Flipping the sliders allows you to see behind the curtain. It highlights exactly which word in your sentence triggered ELIZA's response rules and reveals the template she used to transform your text!
Even though ELIZA seems like she is listening and thinking, she is actually playing a clever trick. She does not understand a single word you type! Instead, ELIZA works like a text-matching puzzle using a script written by a human programmer, similar to a game of Mad Libs. Here is the step-by-step logic she follows:
- Scanning for Keywords: When you submit a sentence, ELIZA runs it through a checklist of "keywords" (like mother, sad, computer, or want) that her creator programmed her to recognize.
- Keyword Priority: If your sentence has multiple keywords (e.g., "My mother hates my computer"), she uses a priority score to choose the most important keyword. In her script, "mother" is considered more emotionally important than "computer," so she responds to that.
- Pattern Matching & Substitution: Once a keyword is selected, ELIZA searches for a matching sentence pattern. If she matches "I want [X]," she extracts whatever you typed in place of [X] (let's say, "ice cream") and plugs it into a template: "Why do you want [X]?" to output: "Why do you want ice cream?"
- Generic Fallbacks: If you type something that does not contain any keywords (like "Okay"), she pulls a random open-ended reply like "Please go on" or "How does that make you feel?" to keep you talking.
In the history of artificial intelligence, ELIZA represents the earliest form of Rule-Based Systems. In these systems, a human must write down every single rule and response for the computer to follow. The computer cannot learn anything new or reason on its own.
ELIZA taught the scientific world a massive lesson known as the "ELIZA Effect." This is the human tendency to assume that computer programs are smart, conscious, and have feelings, even when they are just following simple, basic rules. People would share their deepest secrets with ELIZA, despite knowing she was just a program!
Today, the voice assistants on your phone (like Siri or Alexa) and advanced chatbots (like ChatGPT) are much more powerful because they use complex math to understand the actual meaning and context of your words, rather than just matching simple keywords. But ELIZA is the legendary ancestor that proved conversational text is one of the most powerful ways to connect humans and machines!