<<

: " :i .. :,-.:: . . . : : - . . .

, : . • .. : i i ;!,: : . • . : ...

• • i " " : • . '... • ...... • .. ---":t .7:g~~

:::: :i ¢ompu aI cma • . • . .. • " .: : " " " • " : ; . i • ~i: : 1"5." ... • . • .. . .: :. .'~ ~..

.: • . : , : • :-: ; ;: i A. G. OETTINGER, Editor ELIZA A Tile object of this paper is to cause just such a re- evaln~tion of the program about to be "explained". Few } 4 For the Study of Natural Language programs ever needed it more. 7:~.S : Communication Between Man ELIZA Prograrn } ELIZA is a program which makes naturM hmguage

And Machine conversation with a Colnputer possible. Its present imple- 5)~.;. ~~- ! mentation is oa the MAC time-sharing system at MIT. i: o ,JosEPh ~VEIZENBA UM It is written in 5lAD-SLIP [4] for the IBM 7091. Its name 7?27 E was chosen to emphasize that it nmy be incrementally Massach.usclls [nshl-ute qf Tcchnu[ogg,* Cambridge, Mass. :2:~: improved by its users, since its language abilities may be

continually improved by a "teacher". Like the Eliza 0! 7~9j ~ ELIZA is a program operating within the MAC time-sharing Pygmalion fame, it (ran be made to appear even more system at MIT which makes certain kinds of natural language civilized, t,he relation of appearance to realiW, however, conversation between man and computer possible. Input sen- remaining in ~he donmin of the playwright. tences are analyzed on the basis of decomposition rules which For ll~e present purpose it is sufficient to characterize :7;2: Y :? are triggered by key words appearing in the input text. the ~[A() system as one which permits an individual to Responses are generated by reassembly rules associated with operate a full seale computer from a remotely located type- selected decomposition rules. The fundamental technical prob- writer. The individual operator has the illusion thai, he is 75~.7c_'-5 lems with which ELIZA is concerned are: (1) the identification of the sole riser of the computer complex, while in facl~ others } :~:<:.. key words, (2) the discovery of minimal context, (3) the choice may be "time-sharing" the system with him. What is of appropriate transformations, (4) generation of responses in important here is that the computer can read messages }: the absence of key words, and (5) the provision of an editing typed on the typewriter and respond by writing oil the capability for ELIZA "scripts". A discussion of some psychologi- same instrument. %'he time between the computer's -.5~::a cal issues relevant to the ELIZA approach as well as of future receipt of a message and the appearance of its response is developments concludes the paper. a of the program controlling the dialogue and of Introduction such MAC system parmneters as the number of users currently eon'esponding with the system. These latter It is said that• to explain is to explain away. This maxim parameters generally contribute so little to the overall is nowhere so well fulfilled as in the area of computer response time that conversational interaction with the programming, especially in what is ealled heuristic pro- computer need never involve truly intolerable delays. gramming and artifieiM intelligence. For in those realms :: L 2: .: When in conversation with ELIZA, tile types in .i: machines are made to behave in wondrous ways, often some statement or set of statements in natm'al language suftieient to dazzle even the most experim~eed observer. using normal punetua.tion and sentence structures. Only i. :::! 7: But once a particular program is unmasked, once its the question mark may not be used, because it is inter- i );4pyL> inner workings are explained in language sufficiently plain preted as a line delete character by the MAC system. The to induce understanding, its magic crumbles away; iL user's sratement is terminated by a double carriage return st~mds revealed as a mere collection of procedures, each which serves to turn eontrol over to ELIZA. ELIZA Ithen >>7- quite comprehensible. The observer says to himself "I analyzes the user's statement and generates some response could have written that". With that thought he moves the whieh it types out.. Control is then again with the user. ::{ ) :2>J2 program in question from the shelf m~trked "intelligent", A ltypieal conversation is the following: to that reserved for curios, fit to be discussed only with Men are all alike. % people enlightened than he. IN WHAT WAY They're always bugging us about something or other. Work reported herein was supported (iu prot) by Project MAC, CAN Y()U THINK (H: A SPECIFIC EXAMPLE i::i ::7 an _\-lIT research program sponsored by the Advm~ced Research Well, my boyfriend made me come here. Pr,,jects Aget,cy, l)~l)ar~met~t ~,1" l)ofense, under Office of Naval YOUR BOYFRIEND MAI)E YOU COME HERE ::.73:G{ ::::,• )i : Research Contract Number Nora'-4102(01). tie says i'm depressed much of the time. i:-(-: * Department of Eleeirieal . [ AM SORRY TO HEAR YOU ARE DEPRESSED

36 Comnutnieations of the .~(',M %olume 9 / Number / / January., 1966 2.: it'~ ~=~e. !. ant tmhappy. occurring in the input message. i)() ~ 0U TitlNK COMING IIERE WILl, IiELP YOU NOT TO (2) Tile identification of some minimal context within t@; iTNiIAPPY which the chosen keyword at)pears; e.g., if the keyword is i >cod some help, tidal m,,teh seems certain. "G'I~AT WOL'I,D IT MEAN TO YOU IF YOU GOT SOME IIELP "you", is it followed by the word "are" (in which ease an l'c, ri~ ps I could learn ~o get ahmgv, ith my mother. assertion is probably being made). 2-.f::LL 2~ii:: MORE ABOUT YOUE FAMILY (3) The choice of an appropriate transformation rule ),[5" -mnher takes care of me, and, of course, the making of the transformation itself. WiI() EI,SE IN ¥0UR FAMILY TAKES CAiIE 0F YOU (4) The provision of mechanism that will permit ),iy father. YO[/R FATHER ELIZA to respond "intelligently" when the input text 5-,)u are like my father in some ways. contained no keywords. ~t such a WiIAT RESEMBLANCE DO YOU SEE (5) The provision of machinery that facilitates editing, )lained . i. You are not vet',," aggressive but 1 think you don't wa.t~.t me to particularly extension, of the script on the script writing notice that. level. WHAT MAKES YOU TttINK I AM NOT VER~ AGGRESSIVE ~'ou dolt'; argue with me. There are, of course, the usual constraints dictated by the need to be eeononfical in the use of computer time and tral langu WIlY 1)O YOU THINK I DON'T ARGUE WITH YOU "~-(}u are afraid of me, storage space. ~resent, inn: DOES iT PLEASE YOU TO BEI, IE\'E I AM AFRA[I) OF YOU The central issue is clearly one of text manipulation, teal at _1[ My far her is afraid of everybody. and at the heart of that issue is the concept of the trans- ~94. Its n~ WHAT ELSE COMES TO MIND WtIEN YOU THINK OF formation rule which has been said to be associated with inereme~t:. Y()(-II FATHER certain keywords. The meehanisins subsumed under the ilities mat" Bullies. DOES THAT HA\-E ANYTtIING TO DO WITH THE FACT sloga.n "transformation rule" are a number of SLIP func- the Eli~e. TItAT YOUR BOYFR IENI) MADE YOU COME HERE tions which serve to (1) decompose a string according tr even 1~: to certain criteria, hence to test the string as to whether it ity, howe; The capitalized lines are the machine responses. The gross procedure of the program is quite simple; the satisfies these criteria or not, and (2) to reassemble a decomposed string according to certain assembly specifica- ) cha.racte text: is read and inspected for the presence of a keyword. tions. individuai if such a word is found, the sentence is transformed While this is not the i)lace to discuss these functions in loeated t~ according to a rule associated with the keyword, if not a all their detail (or even to reveal their full power and ion that ii content-free renmrk or, under certain conditions, an earlier generality), it is important to the understanding of the in fact off: transformation is retrieved. The text so computed or operation of ELIZA to describe them in some detail. tint. Whai retrieved is then printed out. Consider the sentence "I ant very unhappy these days". ead messy;: In detail, of course, the procedure sketched above is Suppose a foreigner with only a limited knowledge of "riting 01i considerably more complex. Keywords, for example, amy English but with a veer good ear heard that sentence compute have a RAXK or precedence number. The procedure is spoken but understood only the first two words "I am". ts resp0i~ sensitive to such numbers in that it will abandon a key- Wishing to appear interested, perhaps even sympathetic, alogue and: word a.lready found in the left-to-right scan of the text in he may reply "How long have you been very unhappy ~ber of us fxvor of one having a higher rank. Also, the procedure these days?" What he nmst have done is to apply a kind These [~i~ reeo~,afizes a comma or a period as a delimiter. Whenever of template to the original sentence, one part of which o the 0vei either one is encountered and a keyword has already been matched the two words "I aln" and the remainder isolated ion with found, all snbsequent text is deleted from the input mes- the words "very unhat)py these days". He must also have .e delays. sage. If no key had yet been found the phrase or sentence a reassembly kit specifically associated with that template, user types to the left• of the delimiter (as well as the delimiter itself) one that specifies that any sentence of the form "I am ural lunge is deleted. As a result•, only single phrases or sentences are ever transformed. BLAH" can be transformed to "How long have you been aetures. 6t I£eywords and their associated transformation t rules BLAH", independently of the meaning of BLAH. A se it, is b:.: constitute the SCRIPT for a particular class of con- somewhat more complicated example is given by the ) svstera. ~ sentence "It seems that you hate me". Here the foreigner a.rriage ret~. versation. An important property of ELIZA is that a script is data; i.e., it is not part of the program itself. understands only the words "you" and "me"; i.e., he • ~LIZA i?: Hence, ELIZA is not restricted to a particular set of applies a template that decomposes the sentence into the .,ornle reset four parts: :h tho recognition patterns or responses, indeed not even to any specific language. ELIZA scripts exist (at, this writing) in (1) It seems that (2) you (3) hate (4) me Welsh attd Gernmn as well as in English. ( The fundamental technical problems with which ELIZA of which only the second and fourth parts are understood. must be preoccupied are the following: The reassembly rule might then be "What makes you (1) The identification of the "most important" keyword think I hate you"; i.e., it nfight throw away the first 7 : component, translate the two known words ("you" to RI~ : The word "transformation" is used in its generic sense rather "I" and "me" to "you") and tack on a stock phrase than that given it by tia.rris and Chomsky in linguistic contexts. (What makes you think) to the front of the reconstruction. ~o V(~lume 9 /Numher 1 / January, 1966 Communications of the ACM 37 J tl tl u arv;[ I: A formal notation in which to represent the decomposition almost none of the words in any given sentence are repre. template is: sented in the keyword dictionary. The other is that of "associating" both decomposit;ion and reassembly rules (0 YOU 0 ME) with keyword~-;. The iirst is serious in that the determina- and the reassembly rule tion that a word is not in a dictionary may well require (WHAT MAKES YOU THINK I 3 YOU). more computation (i.e., time) than the location of a word which is represented. The attack on both problems begins The "0" in the decomposition rule stands for "an in- by placing both a keyword trod its associated rules on a definite number of words" (analogous to the indefinite list. The basic format of a typical key list is the following: dollar sign of COMIT) [6] while the "3" in the reassembly rule indicates that the third component of the subject (K ((D0 (R~. t) (R~, 2) "'" (Rt .... )) decomposition is to be inserted in its place. The decom- ((D2) (R2. ~) (R2.2) "" (R2.,,,~)) : position rule ((D,~) (R,,, ~) (taw, ~) ... (R,~, .~))) (0 YOU 1 ME) where K is the keyword, D, the it,h decomposition rule would have worked just as well in this specific example. A associated with K and R¢, ~ the jth reassembly rule ass0. nonzero integer "n" appearing in a decomposition rule ciated with the ith decomposition rule. indicates that the component in question should consist A common pictorial representation of such a structure of exactly "n" words. However, of the two rules shown, is the diagram shown in Figure 1. The top level of only the first would have matched the sentence, "It seems this structure contains the keyword followed by the names you hate and love me," the second failing because there is of lists; each one of which is again a list structure beginning more than one word between "you" and "me". with a decomposition rule and followed by reassembly rules. Since list structures of this type have no predeter- mined dimensionality limitations, any number of decom- position rules may be associated with a given keyword and any number of reassembly rules witch any specific decom- position rule. SLiP i8 rich in functions that sequence over structures of this type efficiently. Hence programmin problems are minimized. ~1 RI,1 R1,2"'" Rl,ml D2 R2J RZ,Z" " "Rz,m2 De Ra,t FIn'2~'" " R%nan An ELIZA script consists mainly of a set of list struc- Fro. 1. :Keyword and rule list structure tures of the type shown. The actual keyword dictionary is constructed when such a script is first read into the in ELIZA the question of which decomposition rules to hitherto empty program. The basic structural component apply to an input text is of course a crucial one. The input of the keyword dictionary is a vector KEY of (currently) sentence might have been, for example, "It seems that 128 contiguous computer words. As a particular key list you hate," in which ease the decomposition rule (0 YOU structure is read the keyword K at its top is randomized 0 ME) would have failed in that the word "ME" would (hashed) by a procedure that produces (currently) a 7 not have been found at all, let alone in its assigned place. integer "i". The word "always", for example, yields Some other decomposition rule would then have to be the integer 14. KEY(i), i.e., the ith word of the vector tried and, failing that, still another until a match could KEY, is then examined to determine whether it contains be made or a total failure reported. ELIZA must therefm~ a list. name. If it does not, then an empty list is created, have a mechanism to sharply delimit the set of decom- its name placed in KEY(i), and the key list structure in position rules which are potentially applicable to a cur- question placed on that list. If KEY(i) already contains a rently active input sentence. This is the keyword mecha- list name, then the name of the key list structure is placed nism. on the bottom of the list named in KEY(i). The largest An input sentence is scanned from left to right. Each dictionary so far attempted contains about 50 keywords. word is looked up in a dictionary of keywords. If a word No list named in any of the words of the KEY vector is identified as a keyword, then (apart from the issue of contains more than two key list structures. precedence of keywords) only decomposition rules con- Every word encountered in the scan of an input text, taining that keyword need to be tried. The trial sequence i.e., during the actual operations of ELIZA, is randomized can even be partially ordered. For example, the decom- by the same hashing as was originally applied to position rule (0 YOU 0) associated with the keyword the incoming keywords, hence yields an integer which "YOU" (and decomposing an input sentence into (1) all points to the only possible list structure which could words in front of "YOU", (2) the word "YOU", and (3) potentially contain that word as a keyword. Even then, all words following "YOU") should be the last, one tried only the tops of any key list structures that may be found since it is bound to succeed. there need be interrogated to determine whether or not a Two problems now arise. One stems from the fact that keyword has been found. By virtue of the various list

38 Communications of tile ACM Volume 9 / Number 1 / January, 1966 i : e repre- that of ....~,-.~,~,~ciT~o.~., ...... ~, operations_ that SLIP makes available, the new word is higher than that of any previously encoun- y rule~ a,:ttta] identification of a keyword leaves as its i)rim:ipal tered word, the pointer to tile transformation rules arn~inw product a pointer to the list of decomposition (and hence associated with the new word is placed on top of a list require rc:t~se~bly) rules associated with the identified keyword. called the keystack, otherwise it is placed on the bottom word ()~e resui~ of this strategy is that often less time is required of the keystaek. Wizen the text scan terminates, the key- ; begim to discover that a given word is >_of in the keyword dic- stack has at its top a pointer associated with the highest ~io~ary than to locate it if it. is there. However, tile location es Oil ranked keyword encountered in the scan. The remaining lowing: of a keyword yields pointers to all inforntation associated pointers in the stack may not be monotonically ordered with that word. with respect to the ranks of the words from which they Some conversational protocols require that certain were derived, but they are nearly so--in any event they transformations be made on certain words of .the input text are in a useful attd interesting order. Figure 2 is a simpli- iiidependel~tly of any contextual considerations. The first , conversation displayed in this paper, for example, requires ~ ke'/steck ~ J on rule that firsb person pronouns be exchanged for second person le asso; pronouns and vice versa throughout tile input text. There ' ' ' * ! : YES may be further transformations but these minimal sub- -~ ...... ~.._i k..!i_IH~[_/~-- _ t rueLure stitutions are unconditional. Simple substitution rules [evel Of ought not to be elevated to the level of transformations, nor should the words involved be forced to carry with them ginning all the structure required for the fully complex case. ],'urthermore, unconditional substitutions of single words .seInbly YgS for single words can be accomplished during the text scan "edeter:: itself, not as a Lransformat.ion of the entire text subsequent decon> to scanning. To facilitate the realization of these )rd &nd desiderata, any word in the key dictionary, i.e., at the deoom: top of a key fist, structure., may be followed by an equM t ~' ~c___F-]:;,:~:o~ 1 oe. over sign followed by whatever word is to be its substitute. 1TI YV~ irt : Tranformation rules may, but need not, follow. If none FIG. 2. Basic flow diagram of keyword detect.ion do follow such a subst, itution rule, then the substitution is :: st:t?ue-: fled flow diagram of keyword detection. The rank of a made on the fly, i.e:, during text scanning, but the word ,nary is keyword must, of course, a!so be associated with the in question is not identified as a keyword for subsequent ~to the keyword. Therefore it must appear on the keyword list purposes. Of course, a word may be both subtituted for portent : structure. It may be found, if at all, just in front of the rently) and be a keyword as well. An example of a simple sub- list of transformation rules associated with the keyword. stitution is ~ey list As an example consider the word "MY" in a particular script. Its keyword list may be as follows: onfized (YOUIISELF = MYSELF). Y) a 7 (MY -- YOUR. 5 (transformation rules)). 5~ields Neither "yourself" nor "myself" are keywords in the Such a list would mean that whenever the word "MY" is veer.tot particular script from which this example was chosen. encountered in any text, it would be replaced by the word )ntains The fact that keywords can have ranks or precedences "YOUR". Its rank would be 5. reated,}i has already been mentioned. The need of a ranking mecha- nism may be established by an example. Suppose an input Upon completion of a given text scan, the keystack is either empty or contains pointers derived from the key- t ains a: sentence is "I know everybody laughed at me." A script words found in the text. Each of such pointers is actually a ola~eed: may tag the word "I" as well as the word "cvetTbody" sequence reader--a SLip mechanism which facilitates l~trg-est i as a keyword. Without differential ranking, "I" occurring scanning of lists--pointing into its particular key list in xx-ol-ds.i first would determine the transformation to be applied. A typical response might be "You say you know everybody such a way that one sequencing operation to the right \-"e e tog laughed at. you." But. the important message in the input (SEQLR) will sequence it to the first set of transformation rules associated with its keyword, i.e., to the list t text, sentence begins with the word "everybody". It is very 1hi zed often true that when a person speaks in terms of universals ((Dr) (Rt,,) (R,,e) ... (R~,R,.~)). such as "everybody", "always" and "nobody" he is really )liecI to The top of that list, of course, is a list which serves a ~vhieln referring to some quite specific event or person. By giving "'everybody" a higher rank than "I", the response "Who decomposition rule for the subject text. The top of the eoutld : keystack contains the first, pointer to be activated. in particular are you thinking of" may be generated. l then ::: The decomposition rule D~ associated with the keyword fol_t ha{ The specific mechanism employed in ranking is that the rank of every keyword encountered (absence of rank K, i.e., {(D0, K}, is now tried. It may fail however. For not a example, suppose the input text was: us list implies rank equals 0) is compared with the rank of the highest, ranked keyword already seen. If the rank of the You are very helpful. Y, 1966: Volume 9 / Number 1 / .]anuary, 1966 Conarnunications of the ACM 39 :i} Tile lwywor

((D~)I(Re,~)(R2,~) ... (Re ..... )). would elicit either Next time ~(De), K} matches an input text, the reassembly ])o you believe you are siek rule (R2..2) will be applied and the integer 2 will replace or the 1. After (R2. ,~,) has been exercised, (Re. ,) will again Why do yotl ask i be invoked. Thus, after the system has been in use for a time, ex'ery decomposition rule which has matched some depending on how many tinles the general form had input text has associated with it an integer which corre- already occurred. sponds to the last l~assembly rule used in connection with Under still other conditions it may be desirable to

40 Connnunications of tile AkC~I Volume 9 / Number 1 / January, 1966 <~--~ mt tb :i<<[o:~'iY~ ,::~ preliminary transformciiiou On tile htput ~L m,v y[eid the ou[t)ut .:ext. ~¢or example, the Consider tile following structure: ~-,v,:{or / "vouh-e" should bad to the transformation rules (MEMORY MY which ~t..... ,.iat,-d with "you" t,)ttt S}tOltld {;;'At })e replaced by a (0 YOUR 0 = LETS DISCUSS FURTHER WHY YOUR 3) ,,. ~)r,:[ Imir. The dieticmarv e:ttry £~u" "3-ou'rC' is therefore: (0 YOUR 0 - EARLIER YOU SAID YOUR 3) ~ texi make yo~re = i:m ((0 I'm O) (P1~I; (I _k).[ 3) (:=YOU.)}) The word "MY" (which must be an ordinary keyword :t with ,.~ hic.h has the foiiowit~e~ effect: as well) has been selected to serve a special function. tlerate l'). -Wherever :'3:ou']'e" is _out~u~'~ in the input text.., i~ is Whenever it is the highest ranking keyword of a text one % for r~q,h eed bv I m . of the transformations on the MEMORY list is randomly pecific t-/ ..ou.re is actually selected as ihe ream%hi, selected, and a copy of the text is transformed accordingly. rming i.ce of "I'm", the word "I'm" itself, and all text then carried out. When a text without keywords is en- vould followi~lg tile first occurrc:we of "I'm". countered later and a certain counting mechanism is in a tes b~: (3) The reassembly rule beginning with ih(' eode particular and the stack in question is not empty, :l but 'g?RI5" is eneountered at!d the decomposed texk: re- then the transformed text is printed out as the reply• It t als0 assembled such that the words ' I A-Xl" appear in front is, of course, also deleted from the stack of such trans- "ef0re of the third constituent, determined by the earlier de- formations. char. compositiou. The eurrent version of ELIZA requires that one keyword f the; (4) Contxol is transferred, so to speak, to the trans- be associated with MEMORY and that exactly four ~hieh formmion rules associated with the keyword "you", transformations aceoinpany that word in that context. (An r eli where, further decompositions etc. are attempted. application of a transformation rule of the form t.h it, It, is to be noted that the set : (LEFT HAND SIDE = tlIGIIT HAND SIDE) ,'P {Ill (I AM 3) (=YOU)) is equivalent to the successive application of the two forms • .,) i~ logically in the place of a reassembly rule attd may therefore be one of really reassembly rules associated with (LEFT HAND SIDE), (RIGIIT HAND SIDE).) OW" the given decomposition. Three more details will complete the formal description may: Another form of reassembly rule is of the ELIZA program. (NEWKI::Y) The transformation rule mechanism of SLIP is such that. it permits tagging of words in a text and their subsequent v..,deh serves the eas{~ in which attempts to nmtch on the recovery on the basis of one of their tags. The keyword s be (:urcently regnant keyword are to be given up and the "MOTHER?' in ELIZA, for example, may be identified the end.ire decomposition a~d reassembly is to start as a noun and as a member of the class "family" as follows: a~aht on the basis of the keyword to be found in the the keystack. Whenever this rule is invoked, the top of ttle (MOTHER DLIST (/NOUN FAMILY)). no k('ysta('k is "popped Ul)" once, i.e., the new regnant key- Such tagging in no way interferes with other information ear, : word recovered and removed from the keystack, att(.l the (e.g., rank or transformation rules) which may be asso- ple, entire process reinitiated as if the initial text scan had jusla dated with the given tag word. A decomposition rule nmy ing : termirmted. This mechanism makes it possible to, in effect, contain a matching constituent of the form (/TAGI test on key phrases as opposed to single key words. TAG2 .--)which will match and isolate a word in the A serious problem whieh remains to be discussed is the • .) subject text having any one of the mentioned tags. If, for reaction of the system in ease no keywords renmin to example, "MOTHER" is tagged as indicated and the for serve as transformation triggers. This can arise either in input text cas:, the ke3"stack is emI)ty when NEWKEY is invoked or "CONSIDER 5IY AGED MOTtIER AS WELL AS ME" wheu the input text. contained no keywords initially• The simplest meelmnism supplied is in the form of the subjected to the decomposition rule special reserved keyword "NONE" which must be part of (0 YOUR, 0 (/FAMILY) 0) nny script. The script writer must assoeiate the universally matching deeomposition rule (0) with it and follow this by (remembering that "MY" has been replaced by "YOUR"), as many content-h'ee remarks in the form of transforma- then the decomposition would be tied rules as he pleases. (Exmnples are: "Please go on", (1) CONSIDER (2) YOUR (3) AGED (4) MOTHER rhars very interesting" and "I see".) (5) AS WELL AS ME. There is, however, another mechanism which causes the Another flexibility inherent in the SLiP text manipula- system to respond more spectacularly in the absence of a tion mechanism underlying ELIZA is tha or-ing of key. The word "MEMORY" is another reserved pseudo- matching criteria is permitted in decomposition rules• to :; keyword. The key list structure associated with it differs The above input text would have been decomposed

• "Volume 9 / Number 1 / January, 1966 Communications of the ACM 41 :i :t precisely as stated above by the decomposition rule: i>

42 Communications of the ACM Vohunc 9 / Number 1 / January, 1966 J { tg de.-erving of eredibilRy. A certain d:u~ge1 lurks there. is make the tentative inference that he is either a widower ~.~: idea ihat the presettt ELIZA s{:rk)t contains no or divorced. Of course, he could simply be confused. In ,y infocmation about tl~e real world i:s ,tot. e~tirely true. For /:he long run, ELIZA should be able to build up a belief C- e>:ample, the tran>formation rules which cause ihc input structure (to use Abelson's phrase) of the subject and on [I: that basis detect the subject's rationalizations, contra- Everybody hates me dictions, etc. Conversations with such an ELIZA would to be transformed to often turn into arguments, hnportant steps in the realiza- tion of these goals have ah'cady been taken. Most notable w Can you think of anyone in particular among these is Abelson's and Carroll's work on i- and other such are based on quite specific hypotheses about of belief structures [1]. ~e the world. The whole script constitutes, in a loose way, a The script that has formed the basis for most of this model of certain aspects of the world. The act of writing a discussion happens to be one with an overwhehningly [e script is a kind of programming act and has all the advan- psychological orientation. The reason for this has already )f tages of programming, most particularly that it clearly been discussed. There is a danger, however, that the is : shows where the progranuner's understanding and con> example will run away with what it is supposed to illus- mand of his subject leaves off. t.rate. It is useful to remember that the ELIZA program A large part of whatever elegance may be credited to itself is merely a translating processor in the technical it = ELIZA lies in the fact that ELIZA maintains the illusion programming sense. Gem [2] in a paper on language of understanding with so little machinery. But. there are systems says: )f bounds on the extendability of ELIZA's "understanding" 1. Given a language which already possesses semantic content, then power, which arc a function of the ELIZA program itself a translating processor, even if it operates only syntactically, .11 and not a function of any script it may be given. The generates correspondittg expressions of another language to which we can attritmte as "meanings" (possibly multiple--the crucial test of understanding, as every teacher should l- may not be one to one) the "semantic intents" of the generating know, is not the subject's ability to continue a conversa- source expressions; whether we find the result consistent or useful. tion, but to draw valid conclusions h'om what. he is being or both is, of course, another problem. It is quite possible that by told. In order for a to be able to do this method the same syntactic object language can be usefully [e that, it must at least have the capacity to store 8elected assigned multiple meanings for each expression... 7t parts of its inputs. ELIZA throws away each of its inpuls, It is striking to note how well his words/fit ELIZA. The except for those few transformed by means of the "given language" is English as is the "other language", :\IIiL\:IOI{Y machinery. Of course, the problem is more expressions of which arc generated. In principle, the given than one of storage. A great part of it is, in fact, subsumed hmguage could as well be the kind of English in which under the word "selected" used just, above. ELIZA in its "word problems" in algebr~L am given to high school use so far has had as one of its principal objectives the Lt students and the other language, a allowing cot~cetdment of its lack of understanding. But to encourage a particular computer to "solve" the stated problems. its conversational partner to offer inputs from which it ;r (See Bobrow's program STUDENT [3].) can select remedial information, it, must ret,eal its mis- n The intent of the above remarks is to further rob ELIZA tmderstanding. A switch of objectives from the conceal- of the aura of magic to which its application to psycho- meat to the revelation of misunderstanding is seen as a y logical subject matter has to some extent contributed. precondition to making an ELIZA-like program the basis Seen in the coldest possible light, ELIZA is a translating for an effective natural language man machine com- processor in Gorn's sense; however, it is one which has munication system. been especially constructed to work well with natural One goal for an augmented ELIZA program is thus a language text. system which already has access to a store of information 7 about some aspects of the real world and which, by means REFERENCES h of conversational interaction with people, can reveal both 1. ABEl.SON, Pt. P., AND CARROLL, J. D. Computer simulation what it knows, i.e., behave as an infh)rmation retrieval gt of individual belief systems. Amer. Behav. Set. 9 (May 1965), system, and where its knowledge ends and needs to be 24-30. t~t augmented. Hopefully the augmentation of its knowledge 2. Goax, S. Semiotic relationships in ambiguously stratified will also be a direct consequence of its conversational bmguage systems. Paper presented at Int. Colloq. Algebraic ,f Linguistics and Automatic Theory, Hebrew U. of Jerusalem, experience. It is precisely the prospect that. such a program Aug. 1964. will converse with many people and learn something from 3. Bom¢ow, D.G. Natural language input for a computer prob- each of them, which leads to the hope that R will prove an lem solving system. Doctoral thesis, Math. Dept., MIT. interesting and even useful conversational partner. Cambridge, Mass., 1964. One w~v to state a slightly different intermediate goal is 4. WEIZENB_~UM, J. Symmetric list processor. Comm. ACM 6, (Sept. 1963), 524-544. to say that ELIZA should be given the power to slowly f 5. ROGEaS, C. Centered Therapy: Current Practice, Impli- build a model of the subject conversing with it. If the cations and Theory. Houghton Mifflin, Boston, 1951. ~3 subject mentions that. he is not. married, for example, and 6. YNGVE, J. COMIT Programndng Manual. M[T Press, Cam- t < later speaks of his wife, then ELIZA should be able to bridge, Mass., 1961.

G Communications of the ACM 43 :: ? Volume 9 / Number 1 / January, 1966 APPENIOIX. A~a. ELIZA Script (WOU!D YOU WANT TO BE ~) {YOU WISH I WCUL0 TELL YOU YOU ArE 4) (WHAT WOULD IT MEAN IF YOU WERE ~) (=WHAT)) ((0) (WHY O0 YOU SAY 'AM') (I DON~T UNDERSTgNO THAT))) (ARE ((0 ARE I 0 ) (WHY ARE YOU iNTERESTED IN WHETHFR I AM ~ OR NOT) (HOW DO YOU 00. PLEASE TELL ME YOUR PROBLEM) START (WOULD YOU PREFER IF ~ WEREN'T ~) (PERHAPS i A~ ~ IN YOU~ FANTASIES) (DO YOU SOMETIMES THINK I AM ~) (=W~AT)) (SORRY ((0) (PLEASE DON'T APOLIGIZE) (APOLOGIES ARE NOT NECESSARY) (WHAT FEELINGS ((O ARE 0) (DiD YOU THINK THEY MIGHT NOT BE 3) (WOULD YOU LIKE IT IF THEY WERE NOT 3) (WHAT !F THEY WPRE NOT 3> DO YOU HAVE WHEN YOU APOLOGIZE) (lIVE TOLD YOU THAT APOLOGIES ARE NOT REQUIRED))) (POSSIBLY THEY ARE 3)) ) (DONT = DON'T) (YOUR = MY ((0 MY O) (WHY ARE YOU CONCERNED OVER MY 3) (CANT = CAN'T) (WHAT ABOUT YOUR OWN 3) (ARE YOU WORRIED ABOUT SO~.!EONE ELSES 3) (WONT = WON'T) (REALLY, MY 3))) (REMEMBER S (WAS 2 ((0 WAS YOU 0 ) (WHAT IF YOU WERE ~) (DO YOU THINK YOU WERE h) ((0 YOU REMEMBER O) (DO YOU OFTEN THINK OF 4) (WERE YOU k) (WHAT WOULD IT MEAN IF YOU WERE ~) (DOES THINKING OF ~ BRING ANYTHING ELSE TO MINO) (WHAT DOES ' 4 ' SUGGEST TO YOU) (=WHAT)) (WHAT ELSE OO YOU REMEMBER) ((O YOU WAS O) (WHY DO YOU REMEMBER 4 JUST NOW) (WERE YOU REALLY) (WHy DO YOU TELL ME YOU WERE ~ NOW) (WHAT IN THE PRESENT SITUATION REMINDS YOU OF ~) (WERE YOU REALLY) (WHY DO YOU TELL ME YOU WERE ~ NOW) (WHAT IS THE CONNECTION BETWEEN ME AND ~)) (PERHAPS I ALREADY KNEW YOU WERE h) ) ((0 DO I REMEMBER 0) (DID YOU THINK I WOULD FORGET 5) ((O WAS I O) (WOULD YOU LIKE TO BELIEVE { WAS h) (WHY DO YOU THINK I SHOULD RECALL S NOW) (WHAT SUGGESTS THAT I WAS ~) (WHAT ABOUT 5) (=WHAT) (YOU MENTIONED S)) (WHAT DO YOU THINK) (PERHAPS I WAS q) ((0) (NEWKEY))) (WHAT IF I HAD BEEN ~)) (IF 3 ((0 IF 0) (DO YOU THINK ITS LIKELY THAT 3) (DO YOU WISH THAT 3) ((0) (NEWKEY))) (WHAT DO YOU THINK ABOUT 3) (REALLY, 2 3))) (WERE = WAS (=WAS)) (WHAT DO YOU THINK ABOUT ~) (REALLY, 2 3))) (ME = YOU) (DREAMT ~ ((0 YOU DREAMT O) (YOU'RE = I'M ((0 I'M 0) (PRE (I ARE S) (=YOU)))) (REALLY, ~) (HAVE YOU EVER FANTASIED ~ WWILE YOU WERE AWAKE) (I'M = YOU'RE ((0 YOU'RE O) (PRE (YOU ARE 3) (=I)))) (HAVE YOU DREAMT ~ BEFORE) (=DREAM) (NEWKFY))) (MYSELF = YOURSELF) (DREAMED = DREAMT ~ (=DREAMT)) (YOURSELF = MYSELF) (DREAM 3 ((0) (WHAT DOES THAT DREAM SUODEST TO YOU) (MOTHER OLIST(/NOUN FAMILY)) (OO YOU DREAM OFTEN) (WHAT PERSONS APPEAR IN YOUR DREAMS) (NON = MOTHER DLIST(/ FAMILY)) (DON'T YOU BELIEVE THAT DREAM HAS SOMETHINC TO ~0 WITH (DAD = FATHER DLIST(/ FAMILY)) YOUR PROBLEM) (NEWKEY))) (FATHER DLIST(/NOUN FAMILY)) (DREAMS = DREAM 3 (=DREAM)) (SISTER BLIST(/FAMILY)) (HOW (=WHAT)) (WHEN (=WHAT)) (BROTHER DLIST(/FAMILY)) (WIFE DLIST(/FAMILY)) (ALIKE 10 (=DIT)) (SAME 10 (=DIT)) (CHILDREN OLIST(/FAMILY)) (CERTAINLY (=YES)) (I = YOU ((0 YOU (* WANT NEED) O) (WHAT WOULD IT MEAN TO YOU IF YOU GOT ~) (FEEL DLIST(/BELIEF)) (WHY DO YOU WANT 4) (SUPPOSE YOU GOT ~ SOON) (WHAT (THINK DLIST(/BELIEF)) IF YOU NEVER GOT ~) (WHAT WOULD GETTING ~ MEAN TO (BELIEVE DLIST(/BELIEF)) (WISH DLIST(/BELIEF)) YOU) (WHAT DOES WANTING ~ HAVE TO DO WITH THIS DISCUSSION)) ((0 YOU ARE O (-SAD UNHAPPY DEPRESSED SICK ) 0) (MEMORY MY (0 YOUR 0 = LETS DISCUSS FURTHER WHY YOUR 3) (I AM SORRY TO HEAR YOU ARE 5) (DO YOU THINK COMING HERE (0 YOUR 0 = EARLIER YOU SAID YOUR 3) WILL HELP YOU NOT TO BE 5) (I'M SURE ITS NOT PLEASANT TO (O YOUR 0 = BUT YOUR 3) BE 5) (CAN YOU EXPLAIN WHAT MADE YOU 5)) (0 YOUR 0 = DOES THAT HAVE ANYTHING TO DO WITH THE FACT THAT YOUR 3)) ((O YOU ARE O (-HAPPY ELATED GLAD BETTER ) 0) (NONE ((0) (I AM NOT SURE I UNDERSTAND YOU FULLY) (PLEASE GO ON) (HOW HAVE I HELPED YOU TO BE 5) (HAS YOUR TREATMENT MADE YOU 5) (WHAT MAKES YOU S JUST (WHAT DOES THAT SUGGEST TO YOU) NOW) (CAN YOU EXPLAIN WHY YOU ARE SUDDENLY 5)) (DO YOU FEEL STRONGLY ABOUT DISCUSSING SUCH THINGS))) ((0 YOU WAS O) (=WAS)) (PERHAPS ((0) (YOU DON'T SEEM QUITE CERTAIN) (WHY THE UNCERTAIN TONE) ((0 YOU WAS O) (:WAS)) (CAN'T YOU BE MORE POSITIVE) ((O YOU (/BELIEF) YOU 0) (DO YOU REALLY THINK SO) (BUT YOU ARE (YOU AREN'T SURE) (DON~T YOU KNOW))) NOT SURE YOU 5) (DO YOU REALLY DOUBT YOU 5)) (MAYBE (=PERHAPS)) ((0 YOU 0 (/BELIEF) O I 0) (=YOU)) (NAME 15 ((0) (I AM NOT {NTERESTED IN NAMES) ((0 YOU ARE O) (I'VE TOLD YOU BEFORE, I DON'T CARE ABOUT NAMES - (IS IT BECAUSE YOU ARE ~ THAT YOU CAME TO ME) PLEASE CONTINUE)) ) (HOW LONG HAVE YOU BEEN 4) PLEASE CONTINUE)) ) (DO YOU BELIEVE IT NORMAL TO BE ~) (DEUTSCH (=XFREMD)) (DO YOU ENJOY BEING 4)) (PRANCAIS (=XFREMD)) ((0 YOU (* CANIT CANNOT) G) (HOW DO YOU KNOW YOU CAN'T ~) (ITALIAN0 (=XFREMD)) (HAVE YOU TRIED) (ESPANOL (=XFREMD)) (PERHAPS YOU COULD ~ NOW) (XFREMD ((0) (I AM SORRY, I SPEAK ONLY ENGLISH))) (DO YOU REALLY WANT TO BE ABLE TO ~)) (HELLO ((0) (HOW DO YOU DO, PLEASE STATE YOUR PRORLFM))) ((0 YOU DONIT 0)(DONIT YOU REALLY 4)(WHY DON'T YOU ~) (COMPUTER 50 ((O) (DO WORRY YOU) (DO YOU WISH TO BE ABLE TO ~) (DOES THAT TROUBLE YOU)) (WHY DO YOU MENTION COMPUTERS) (WHAT DO YOU THINK MACHINES ((0 YOU FEEL 0) (TELL ME MORE ABOUT SUCH PEELINGS) HAVE TO DO WITH YOUR PROBLEM) (DON'T YOU THINK COMPUTERS CAN (DO YOU OFTEN FEEL ~) HELP PEOPLE) (WHAT ABOUT MACHINES WORRIES YOU) (WHAT (DO YOU ENJOY FEELING ~) DO YOU THINK ABOUT MACHINES))) (OF WHAT DOES FEELING 4 REMIND YOU)) (MACHINE SO (=COMPUTER)) ((0 YOU G I 0) (PERHAPS IN YOUR FANTASY WE 3 EACH OTHER) (MACHINES 50 (=COMPUTER)) (DO YOU WISH TO 3 ME) (COMPUTERS 50 (=COMPUTER)) (YOU SEEN TO NEED TO 3 ME) (AM = ARE ((O ARE YOU O) (DO YOU BELIEVE YOU ARE ~) (DO YOU 3 ANYONE ELSE))

44 Communications of the ACM Volume9 / Number l / January, 19h6 i/ i:(

((o) (YOU SAY 1)

(CAN YOU ELABORATE ON THAT) (~0 Y~U SAY Z FOR SDME S~ECiAL REASON) LETTERS--continued from p. 35 (TNATtS QUITE INTERESTING))) (YOU = I ((0 I REWIND YOU OF O) (-DIT)) The ,echnique consists of translating the code for the letter ((O I ARE O) (WHAT MAKES YOU THINK i A~ h) "O" to tim co" a rescan of lhe characters in the name ES 3) (WHAT MAKES YOU THINK I 3 YOU) field. (REALLY, I 3 YOU) (DO YOU WISH TO RFLIEVF I 3 YOU) (REALLY, I 3 YOU) (00 YOU WISH TO RELIEVE I 3 YOU) If no sorting is required, the retranslation can be avoided, pro- (SUPPOSE I DID 3 YOU - WHAT WOULD THAT NEAt]) vided that delimiters such as FORMAT or GO TO are spelled (DOES SOMEONE ELSE BELIEVE I 3 YOU)) with zero within the recognizer seglnent of a translator. It, is also ((O i O) (WE WERE DISCUSSING YOU - FiOT ME) necessary to redefine identifier as (OH, I 3) (YOU'RE NOT REALLY TALKI~;G ABOUT ME - ARE YOU) (WHAT ARE YOUR FEELINGS NOW))) identifier) ::= (letter::- (identifier) (fetter3 i (identifier> (digit'., [ (YES ((0) (YOU SEEM QUITE POSITIVE) (YOU AqE SURE) (0) (ident.ifier) (! SEE) (I UNDERSTAND))) (NO ((0) (ARE YOU SAYING 'NO' JUST TO BE NEGATIVE) where it is understood that the letter "O" is removed from the (YOU ARE BEING A BIT NEGATIVE) (WHY NOT) (WHY 'NO'))) standard definition of letter as in ALGOL 60. The redefinition per- (MY = YOUR 2 ((D YOUR 0 (/FAMILY) 0) mits the inclusion of identifiers such as 017)11) or COPS but prevents (TELL ME MORE ABOUT YOUR FAMILY) ( WHO ELSE IN YOUR FAMILY the use of an identitier consisting only of the repeated inark O. 5) (YOUR ~) (WHAT ELSE COMES TO MIND WHEN YOU THINK OF This technique requires consistency of use and might result in YOUR ~)) chaos in a wat'ehousing operation in which tile letter "0" is used ((0 YOUR O) (YOUR 3) (WHY DO YOU SAY YOUR )) (DOES THAT ili parts labels with check digits. SUGGEST ANYTHING ELSE WHICH BELONGS TO YOU) (IS IT L. RICH:~.RD TUaNER IMPORTANT TO YOU THAT 2 3))) / ATASA Lewis Rcsvarch Cente:" (CAN ((0 CAN I O) (YOU BELIEVE I CAN ~ DON'T YOU) (:WHAT) //: (YOU WANT ME TO BE ABLE TO ~) (PERHAPS YOU WOULD LIKE TO BE / CIeceland, Ohio ABLE TO 4 YOURSELF)) ((0 CAN YOU 0) (WHETHER OR NOT YOU CAN / DEPENDS ON YOU MORE THAN ON ME) (DO YOU WANT TO BE ABLE TO ~) / (PERHAPS YOU DON'T WANT TO ~) (=WHAT))) / (WHAT ((O) (WHY DO YOU ASK) (DOES THAT QUESTION INTFRrST YOU) (WHAT IS IT YOU REALLY WANT TO KNOW) / (ARE SUCH QUESTIONS MUCH ON YOUR MIND) / ~ J (WHAT ANSWER WOULD PLEASE YOU MOST) (WHAT DO YOU THINK) (WHAT COMES TO YOUR MIND WHFN YOU ASK THAT) ~-~mments on a Problem in Concurrent (HAVE YOu ASKED SUCH QUESTION BEFORE) Programming Control (HAVE YOU ASKED ANYONE ELSE))) (BECAUSE ((0) (IS THAT THE REAL REASON) (nON'T A~!Y OTHER RPASONS Dear Editor : COME TO HIND) (DOES THAT REASON SEEM TO EXPLAIN ANYTHING ELSE) I would like to cornment on Mr. Dijkstra's solution [Solution (WHAT OTHER REASONS MIGHT THERE BE))) of a problem in concurrent programming control. Comm ACM 8 (WHY ((O WHY DON'T I 0) (DO YOU BELIEVE I DONIT 5) (PERHAPS I (Sept. 1965), 569] to a messy pr(~hlem that is hardly academic. We WILL 5 IN GOOD TIME) (SHOULD YOU 5 YOURSELF) (YOU WANT ME TO 5) are using it now on a multiple computer complex. (:WHAT)) When there are only two computers, the algorithm may be (=WHAT)) simplified to the following: ((0 WHY CAN'T YOU O) (DO YOU THINK YOU SHOULD BE ABLE TO S) (DO YOU WANT TO BE ABLE TO 5) (DO YOU BFLIFVE THIS WILL HELP YOU Boolean array bE0; 1) integer k, i, j, TO 5) (HAVE YOU ANY IDEA WHY YOU CANfT 5) (=WHAT)) comment This is the program for computer i, which may he (= WHAT)) tither 0 or 1, computer j ~ i is the other one, 1 or 0; (EVERYONE 2 ((O (* EVERYONE EVERYBODY NOBODY NOONF) O ) (REALLY, 2) (SURELY NOT 2) (CAN YOU THINK OF CO: b (i) := false; ANYONE IN PARTICULAR) (WHO, FOR EXAMPLE) (YOU ARE THINKINO OF CI: if k ~- i then begin A VERY SPECIAL PERSON) C2: if not b(j) then go to C2; s (WHO, MAY I ASK) (SOMEONE SPECIAL PERHAPS) elsek := i; go to C1 end; (YOU HAVE A PARTICULAR PERSON IN MINn, DON'T YOU) (WHO DO YOU else critical section; THINK YOU'RE TALKING ABOUT))) b(i) := true; (EVERYBODY 2 (= EVERYONE)) remainder of program; (NOBODY 2 (=EVERYONE)) go to C0; (NOONE 2 (:EVERYONE)) end (ALWAYS I ((0) (CAN YOU THINK OF A SPECIFIC EXAMPLE) (WHEN) (WHAT INCIDENT ARE YOU THINKING OF) (REALLY, ALWAYS))) Mr. Dijkstra has come up with a clever solution to a really (LIKE 10 ((O (*AM IS ARE WAS) 0 LIKE O) (=DIT)) practical problem. ((0) (NEWKEY)) ) HARRIS H Y$.[AN (DIT ((O) (IN WHAT WAY) (WHAT RESEMBLANCE DO YOU SEE) (WHAT DOES THAT SIMILARITY SUGGEST TO YOU) Munitype (WHAT OTHER CONNECTIONS DO YOU SEE) New York, New York (WHAT DO YOU SUPPOSE THAT RESEMBLANCE MEANS) (WHAT IS THE CONNECTION, DO YOU SUPPOSE) (COULD THERE REALLY BE SOME CONNECTION) (HOW))) ;7 ()

I=~ECEIVi.3D SEPTEMBER, 1965 966 :: Vohune 9 / Number 1 / January, 1966 Communications of tile ACM 45