Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
ELIZA
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Design and implementation== Weizenbaum originally wrote ELIZA in MAD-SLIP for [[Compatible Time-Sharing System|CTSS]] on an [[IBM 7094]] as a program to make natural-language conversation possible with a computer.<ref>{{cite web |url=https://multicians.org/thvv/compatible-time-sharing-system.pdf |title=Compatible Time-Sharing System (1961-1973): Fiftieth Anniversary Commemorative Overview |editor-last1=Walden |editor-first1=David |editor-last2=Van Vleck |editor-first2=Tom |editor2-link=Tom Van Vleck |date=2011 |publisher=IEEE Computer Society |access-date=February 20, 2022 |quote=Joe Wiezenbaum's most famous CTSS project was ELIZA}}</ref> To accomplish this, Weizenbaum identified five "fundamental technical problems" for ELIZA to overcome: the identification of key words, the discovery of a minimal context, the choice of appropriate transformations, the generation of responses in the absence of key words, and the provision of an editing capability for ELIZA scripts.<ref name=":1" /> Weizenbaum solved these problems and made ELIZA such that it had no built-in contextual framework or universe of discourse.<ref name=":4" /> However, this required ELIZA to have a script of instructions on how to respond to inputs from users.<ref name="Baranovska" /> ELIZA starts its process of responding to an input by a user by first examining the text input for a "keyword".<ref name=":6" /> A "keyword" is a word designated as important by the acting ELIZA script, which assigns to each keyword a precedence number, or a RANK, designed by the programmer.<ref name=":3" /> If such words are found, they are put into a "keystack", with the keyword of the highest RANK at the top. The input sentence is then manipulated and transformed as the rule associated with the keyword of the highest RANK directs.<ref name=":1" /> For example, when the DOCTOR script encounters words such as "alike" or "same", it would output a message pertaining to similarity, in this case "In what way?",<ref name=":2" /> as these words had high precedence number. This also demonstrates how certain words, as dictated by the script, can be manipulated regardless of contextual considerations, such as switching first-person pronouns and second-person pronouns and vice versa, as these too had high precedence numbers. Such words with high precedence numbers are deemed superior to conversational patterns and are treated independently of contextual patterns.{{Citation needed|date=September 2023}} Following the first examination, the next step of the process is to apply an appropriate transformation rule, which includes two parts: the "decomposition rule" and the "reassembly rule".<ref name=":1" /> First, the input is reviewed for syntactical patterns in order to establish the minimal context necessary to respond. Using the keywords and other nearby words from the input, different disassembly rules are tested until an appropriate pattern is found. Using the script's rules, the sentence is then "dismantled" and arranged into sections of the component parts as the "decomposition rule for the highest-ranking keyword" dictates. The example that Weizenbaum gives is the input "You are very helpful", which is transformed to "I are very helpful". This is then broken into (1) empty (2) "I" (3) "are" (4) "very helpful". The decomposition rule has broken the phrase into four small segments that contain both the keywords and the information in the sentence.<ref name=":1" /> The decomposition rule then designates a particular reassembly rule, or set of reassembly rules, to follow when reconstructing the sentence.<ref name=":6" /> The reassembly rule takes the fragments of the input that the decomposition rule had created, rearranges them, and adds in programmed words to create a response. Using Weizenbaum's example previously stated, such a reassembly rule would take the fragments and apply them to the phrase "What makes you think I am (4)", which would result in "What makes you think I am very helpful?". This example is rather simple, since depending upon the disassembly rule, the output could be significantly more complex and use more of the input from the user. However, from this reassembly, ELIZA then sends the constructed sentence to the user in the form of text on the screen.<ref name=":1" /> These steps represent the bulk of the procedures that ELIZA follows in order to create a response from a typical input, though there are several specialized situations that ELIZA/DOCTOR can respond to. One Weizenbaum specifically wrote about was when there is no keyword. One solution was to have ELIZA respond with a remark that lacked content, such as "I see" or "Please go on".<ref name=":1" /> The second method was to use a "MEMORY" structure, which recorded prior recent inputs, and would use these inputs to create a response referencing a part of the earlier conversation when encountered with no keywords.<ref name=":5">{{Cite book |title=Expressive Processing: Digital Fictions, Computer Games, and Software Studies |last=Wardip-Fruin |first=Noah |publisher=The MIT Press |year=2014 |isbn=9780262013437 |location=Cambridge |page=33 |via=eBook Collection (EBSCOhost)}}</ref> This was possible due to Slip's ability to tag words for other usage, which simultaneously allowed ELIZA to examine, store, and repurpose words for usage in outputs.<ref name=":1" /> While these functions were all framed in ELIZA's programming, the exact manner by which the program dismantled, examined, and reassembled inputs is determined by the operating script. The script is not static and can be edited, or a new one created, as is necessary for the operation in the context needed. This would allow the program to be applied in multiple situations, including the well-known DOCTOR script, which simulates a Rogerian psychotherapist.<ref name=":7" /> A [[Lisp (programming language)|Lisp]] version of ELIZA, based on Weizenbaum's CACM paper, was written shortly after that paper's publication by Bernie Cosell.<ref>{{cite web |url=http://www.codersatwork.com/bernie-cosell.html |title=Coders at Work: Bernie Cosell |website=codersatwork.com}}</ref><ref name="elizagen">{{cite web|title=elizagen.org|url=http://elizagen.org/ |website=elizagen.org}}</ref> A [[BASIC]] version appeared in ''[[Creative Computing (magazine)|Creative Computing]]'' in 1977 (although it was written in 1973 by Jeff Shrager).<ref>[http://www.atariarchives.org/bigcomputergames/showpage.php?page=20 Big Computer Games: Eliza β Your own psychotherapist] at www.atariarchives.org.</ref> This version, which was ported to many of the earliest personal computers, appears to have been subsequently translated into many other versions in many other languages. Shrager claims not to have seen either Weizenbaum's or Cosell's versions. In 2021, Jeff Shrager searched MIT's Weizenbaum archives, along with [[Massachusetts Institute of Technology|MIT]] archivist Myles Crowley, and found files labeled Computer Conversations. These included the complete source code listing of ELIZA in MAD-SLIP, with the DOCTOR script attached. The Weizenbaum estate gave permission to open-source this code under a [[Creative Commons]] CC0 [[public domain]] license. The code and other information can be found on the ELIZAGEN site.<ref name="elizagen" /> The 1965 source code has been dated as part of a software archaeology project which brings together researchers from USC, University of Sussex, Oxford, and Stanford U. who have worked together to unravel the complicated history of ELIZA.<ref>{{Cite journal |last=Marino |first=Dav id M. Berry Mark C. |date=2024-11-03 |title=Reading ELIZA: Critical Code Studies in Action |url=https://electronicbookreview.com/essay/reading-eliza-critical-code-studies-in-action/ |journal=Electronic Book Review |language=en-US}}</ref> In December 2024, Rupert Lane, with the assistance of several other engineers who had been studying the original MAD-SLIP ELIZA, brought up the original ELIZA and demonstrated that the implementation of ELIZA based on the discovered code can reproduce almost exactly the published conversations with ELIZA from Weizenbaum's 1966 paper. This original ELIZA was reconstructed using the vast majority of the 1965 version of the source code: approximately 96% of the functions.<ref>{{Cite web |last=Berry |first=David M. |date=2025 |title=Digital Ruins and Critical Code Studies: Towards an Ethics of Historical Software Reconstruction |url=https://stunlaw.blogspot.com/2025/01/digital-ruins-and-critical-code-studies.html |access-date=2025-01-26 |website=Stunlaw}}</ref> This was run on a version of the original MIT [[Compatible Time Sharing System|CTSS]] running on a [[IBM_7090#IBM_7094|7094]] emulator, both of the latter due to David Pitts.<ref name="ELIZA Reanimated">{{cite web|title=ELIZA Reanimated|url=https://sites.google.com/view/elizagen-org/blog/eliza-reanimated|website=elizagen.org}}</ref><ref>{{cite web | url = https://www.livescience.com/technology/eliza-the-worlds-1st-chatbot-was-just-resurrected-from-60-year-old-computer-code | title = 'ELIZA,' the world's 1st chatbot, was just resurrected from 60-year-old computer code | first = Kristina | last = Killgrove | date = January 18, 2025 | accessdate = January 18, 2025 | work = [[Live Science]] }}</ref> Another version of Eliza popular among software engineers is the version that comes with the default release of [[GNU Emacs]], and which can be accessed by typing <code>[[Meta key|M]]-x doctor</code> from most modern [[Emacs]] implementations. === Pseudocode === From Figure 15.5, Chapter 15 of Speech and Language Processing (third edition).<ref>{{cite web|url=https://web.stanford.edu/~jurafsky/slp3/15.pdf|access-date=6 April 2023|website=stanford.edu|title=Chatbots & Dialogue Systems}}</ref> function ELIZA GENERATOR(user ''sentence'') returns ''response'' Let ''w'' be the word in ''sentence'' that has the highest keyword rank if ''w'' exists Let r be the highest ranked rule for w that matches sentence ''response'' β Apply the transform in ''r'' to ''sentence'' if w = 'my' ''future'' β Apply a transformation from the βmemoryβ rule list to ''sentence'' Push ''future'' onto the memory queue else (no keyword applies) Either ''response'' β Apply the transform for the NONE keyword to ''sentence'' Or ''response'' β Pop the oldest response from the memory queue Return ''response''
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
ELIZA
(section)
Add topic