Опубликован: 08.09.2012 | Доступ: свободный | Студентов: 10542 / 2755 | Длительность: 48:33:00
Специальности: Программист
Лекция 30:

Robots, Androids, Al

< Лекция 29 || Лекция 30: 12345 || Лекция 31 >

3.1. Read the text

3.1. Pre-reading task:

Here is an example of a conversation with a computer (or to be more precise with the combination of a computer and a program). Read the first part and answer the question: which contributions belong to the machine – in upper or lower case? What helped you understand?


I haven't much of a problem really


I think I am unique in some ways


That's true as well, I'm sure


Yes, I am certain


No, I have felt certain of things before now


The program that generated this conversation is loosely based on a well-known one, developed by Joseph Weizenbaum in the mid-1960s, called ELIZA. ELIZA altered people's view of computers, since it appeared that computer science had breached the defenses of human language. In one version, ELIZA took the role of a nondirective therapist – that is to say, a psychiatrist whose main aim is to help patients determine the direction of the therapy themselves, and to find their own solutions.

After the program has printed its opening phrase "GOOD DAY WHAT IS YOUR PROBLEM?" it operates in a cycle, repeatedly carrying out the following actions:

  1. Get input from the user.
  2. Generate a response.
  3. Print the response.

When the program gets input from the user, it converts all the characters typed by the user into lowercase, and then in printing its response it converts lowercase characters into uppercase ones. So, in showing the internal workings of the Eliza program, we shall use all lowercase characters. Generally, the program just responds to its most recent input, but occasionally, not on every cycle, it stores the input so that it can reproduce it later prefaced by "EARLIER YOU SAID".

It is the middle part of the cycle – generating an appropriate response – that is interesting. This has the following sequence of actions:

  1. Transform the input to change the 'point of view'.
  2. If there is a pattern that matches the transformed input, then choose one of the responses associated with the pattern. Otherwise choose a general-purpose response.

As the program will often use all or part of the input in constructing a response, it first changes the 'point of view' to that of Eliza. The method is just to change 'you' to 'i', 'me' to 'you', 'are' to 'am', 'myself' to 'yourself', and so on. So the sentence "you understand me" would be changed to "I understand you". One problem with this very simple approach is that 'you' can be the subject or the object of a sentence (i.e., it may come before or after the verb). Just changing 'you' to 'I' would result in "I understand you" being changed to "you understand I".

The program, therefore, uses another simple trick to deal with this: if the transformed sentence ends in 'I', then the 'I' is changed to 'me'. This is far from foolproof, for example:

If I could explain to you I could explain anything to anyone


Further tricks like this would not solve the central problem, which is that Eliza is not founded on any principled representation of the form and content of English.

With the input in its new form, the program then searches for a keyword on a particular topic, or a suitable pattern to match the transformed input, by means of pattern matching. Pattern matching underlies most of Eliza's apparent cleverness, and computer languages that have access to a pattern matching mechanism can easily be programmed to emulate Eliza.

Patterns. A pattern for Eliza is a list containing a mixture of words and wild cards. Wild cards are elements that can match any series of words, so a pattern is like a partly specified sentence in which some of the words are present and some are still to be filled in. We shall adopt the convention that lists of words and wild cards are enclosed in square brackets, and we will use = or == to denote a wild card in the list. The = (single equals) wild card stands for a single word, and the == (double equals) wild card stands for any number of words (including none at all). The pattern is matched against the list of words inputted by the user (after each occurrence of 'you' has been changed to 'I', etc.), for example:

[you think you are unique in some way] is changed to [I think I am unique in some way] which matches the pattern [== i am ==]

[anyone who wasn't a computer] matches the pattern [== computer ==]

In order to match keywords or phrases in the input Eliza has a series of such patterns associated with standard responses:


[== want ==] [beware of addictions]

[== need ==] [can you do without]

[== mother ==] [tell me more about your family]

[== sister ==] [family life is full of tensions]

[do you like your relatives?]

The program compares the input to each pattern in turn until a match is found. It then produces one of the standard responses. If there is more than one response available, then it picks one at random.

All in all, it is not difficult to program a computer to give it the appearance of understanding English and producing intelligent responses. One simple method is to match a series of words against a pattern and, if the words match, to give a predefined response. This was used in ELIZA, which was celebrated as an early computer program that could hold an extended dialogue with a human being. But its facade crumbles when you ask it a question with a complicated grammatical structure, or one that demands a reasoned or calculated response. What ELIZA lacks is firstly a means of recognizing the grammatical structure of language and secondly a means of converting the user's query into a representation of the underlying knowledge, from which inferences can be drawn. Despite its limitations the ELIZA approach of word pattern matching has some use as a simple means of communicating with a computer through natural language, in circumstances where 'user-friendliness' is more important than precision.

Adapted from Sharples, Mike et al. (1991) Computers and Thought: A Practical Introduction to Artificial Intelligence, MIT Press

< Лекция 29 || Лекция 30: 12345 || Лекция 31 >
Сауле Бельгинова
Сауле Бельгинова
Альмира Мукашева
Альмира Мукашева

Здравствуйте, мне не совсем понятно сколько нужно оплатить за курс, квитанцию получила, а какую сумму нужно указать и оплатить