Let us consider Question Answering systems that accept input in English and provide answers also in English. This problem is harder than the previous one as it is more difficult to specify the problem formally. Another area of difficulty concerns deciding whether the answer obtained is correct, and further what is meant by correct. For example consider the following situation.

TEXT

Mary went shopping for a new coat. She found a red one she really liked.

When she got home, she discovered that it went perfectly with her favourite dress.

QUESTIONS

1 What did Mary go shopping for?

2 What did Mary find that she liked?

3 Did Mary buy anything?

Method 1

DATA STRUCTURES

A set of templates that match common questions and produce patterns used to mathc against inputs. Templates and patterns are used so that a template that matches a given question is associated with the corresponding pattern to find the answer in the input text. For example the template

who did x y generates x y z if a match occurs and z is the answer to the question.The given text and the question are both stored as strings.

ALGORITHM

Answering a question requires the following four steps to be followed:

Compare the templates against the questions and store all successful matches to produce a set of text patterns.

Pass these text patterns through a substitution process to change the person or voice and produce an expanded set of text patterns. Apply each of these patterns to the text collect all the answers and then print the answers.

EXAMPLES

In question 1 we use the template WHAT DID X Y which generates

Mary go shopping for z and after substitution we get

Mary goes shopping for z and Mary went shopping for z giving z [[equivalence]] a new coat

In question 2 we would need a very large number of templates and also a scheme to allow the insertion of find before ' that she liked'; the insertion of reallyin the text; the substitution of she to give Mary to give the answer a red one.

Question 3 cannot be answered.

COMMENTS

This is a very primitive approach basically not matching the criteria we set for intelligence and worse than that use in the game . Surprisingly this type of technique was actually used in ELIZA which will be considered later in the course.

Method 2

DATA STRUCTURES

A structure called Englishknow consisting of a dictionary, grammar and some semantics about the vocabulary we are likely to meet. This data structure provides the knowledge to convert English text into a storable internal form and also to convert the reponse back into English.The structured representation of the text is a processed form of the input text and defines the context of the input text by making explicit all references such as pronouns. There are three types of such knowledge representation systems: production rules of the form if x then y , slot and filler systems and statements in mathematical logic. The system used here will be the slot and filler system. The sentence

`she found a red one she really liked would be stored'

Event2 Event2

instance: finding instance: liking

tense: past tense: past

agent: mary modifier: much

object: thing1 object: thing1

Thing1

instance: coat

colour: red

The question is stored in two forms: as input and in the above form.

ALGORITHM

Convert the question to structured form using Englishknow then use a marker such as who or what to indicate the substring to be returned as an answer. By matching this structured form against the structured text the answer appears. If a slot and filler system is used a special marker can be placed in more than one slot. The structured form is matched against the text and the requested segments of the question are returned.

EXAMPLES

Both questions 1 and 2 generate answers viz a new coat and a red coat respectively. Question 3 cannot be answered.

COMMENTS

This approach is more meaningful than the previous one and so is more effective. The extra power given must be paid for by additional search time in the knowledge bases. A warning must be given here that is to generate an unambiguous English knowledge base is a complex task and must be left until later in the course. The problems of handling pronouns is tricky for example

Mary walked up to the salesperson: she asked where the toy dept was.

Mary walked up to the salesperson: she asked her if she needed any help.

Whereas in the original text the linkage of she to Mary is easy the linkage of she in each of the above sentences to Mary and to the salesperson requires additional knowledge about the context viz the people in a shop see later.Method 3

DATA STRUCTURES

As in Method 2 but also a world model. Worldmodel contains knowledge about objects actions and situations that are described in the input text. This structure is used to create Integratedtext from input text . The diagram shows how the system's knowledge of shopping might be represented and stored. This information is known as a script and this case a shopping script.

ALGORITHM

Convert the question to structured form using both the knowledge contained in Method 2 and the World model generating even more possible structures, since even more knowledge is being used. Sometimes filters are introduced to prune the possible answers, these will be indicated later in the course. To answer a question follow the scheme.

Convert the question to a structured form as before but use worldmodel to resolve any ambiguities that may occur. The structured form is matched against the text and the requested segments of the question are returned.

EXAMPLES

Both questions 1 and 2 generate answers as in the previous program.

Question 3 can now be answered. The shopping script is instantiated and from the last sentence the path through step 14 is the one used to form the representation.

M' is bound to the red coat --got home--. Mary buys a red coat comes from step 10 and the integrated tex generates she bought a red coat.

COMMENTS

This program is more pwerful than both the previous programs because it has more knowledge. Thus like the last game program it is exploiting AI techniques. However we are not yet in a position to handle any English question. The major omission is that of a general reasoning mechanism known as inference to be used when the required answer is not explicitly given in the input text. But this approach can handle with some modifications questions of the following form with the answer ---Saturday morning Mary went shopping.

Her brother tried to call her but she did not answer.

Question

Why couldn't Mary's brother reach her?

Answer

Because she was not in.

This answer is derived because we have supplied an additional fact

that a person cannot be in 2 places at once.

This patch is not sufficently genral to work in all cases and does not provide the type of solution we are really looking for.THE LEVEL OF THE MODEL

What is our goal in trying to produce programs that do the intelligent things that people do?

Are we trying to produce programs that do the tasks the same way that people do

OR

Are we trying to produce programs that simply do the tasks the easiest way that is possible

Programs in the first class attempt to solve problems that a computer can easily solve and do not usually use AI techniques. AI techniques usually encompass a search, as no direct method is available, the use of knowledge about the objects involved in the problem area and abstraction, which allows an element of pruning to occur, to enable a solution to be found in real time otherwise the data could explode in size. Examples of these trivial problems in the first class, which are now of interest only to psychologists are EPAM which memorises nonsense syllables.

The second class of problems attempt to solve problems that are nontrivial for a computer and use AI techniques. We wish to model human performance on these

1. to test psychological theories eg PARRY --COLBY 1975 . A program to simulate the conversational behaviour of a paranoid person.

2. to enable computers to understand human reasoning eg programs that answer questions based upon newspaper articles indicating human behaviour.

3. to enable people to understand computer reasoning. Some people are reluctant to accept computer results unless they understand the mechanisms involved in arriving at the results.

4. to exploit the knowledge gained by people who are best at gathering information. This persuaded the earlier workers to simulate human behaviour in the SB part of AISB simulated behaviour. Examples of this type of approach led to GPs the general problem solver discussed in greater detail later and also to natural language understanding which will be covered in later lectures.CRITERIA FOR SUCCESS

In any engineering project we often ask when will we know if we have succeded. In 1950 Alan Turing proposed the Turing Test which determined if a machine could think.

The test is conducted by two peopleone of whom is the interrogator and the other sits with a computer C in another room. The only communication is by means of typing messages on a simple terminal circa 1950. The interrogator is given the task of determining whether a response comes from the person or the computer C.

The goal of the machine is to fool the interrogator into believing that the machine is the person and therefore the iterrogator will believe the machine can think. The machine can trick the interrogator by giving the wrong answer to 12324 times 73981

Some believe a computer will never pass the Turing Test and be able to maintain the following dialogue due to Turing, which Turing believed that a computer would need to exhibit to pass the test..

I: In the first line of your sonnet which reads " shall I compare thee to a summer's day", would not spring day do as well?

A: it would not scan.

I: how about a winter's day it does scan.

A: yes but nobody wishes to be compared to a winter's day.

I: would you say Mr Pickwick reminded you of Xmas.

A: in a way.

I: yet Christmas is a winter's day and I do not think Mr Pickwick would mind the comparison.

A: you are not serious christmas is not a typical winter's day.

Recently computers have convinced five people out of ten that the programs loaded inside them were of human intelligence. Also Chinook a computer program gave the draughts world champion a close shave only losing 2-3 in a forty game battle.