[Next] [Up] [Previous]
Next: Pragmatics Up: Semantics Previous: The Meaning of Phrases

Answering Questions

Let us now go back once again to the exchange at the beginning of the chapter, and see how we can use a form of the semantic theory sketched above for answering the question. Assume that our database contains facts such as the following:

[[the tate gallery] isa [gallery]]
[[the national gallery] isa [gallery]]
[[trafalgar square] isa [square]]
[[leicester square] isa [square]]
[[nelsons collumn] isa [monument]]
[[the albert memorial] isa [monument]]
[[the national gallery] in [trafalgar square]]
[[the natinal gallery] underground [charing cross]]
[[the tate gallery] underground [pimlico]]
[[trafalgar square] containing [nelsons collumn]]

and so on. According to our simplified semantic theory, the meaning of `gallery' is the set of facts that will allow the Tourist Guide to identify all the values of ?place found by matching the pattern [?place isa [gallery]], in this case, [the tate gallery] and [the national gallery]. It is the same for `square' and `monument'. Put differently, part of the meaning of, for example, Trafalgar Square is that it is a square (just as part of the meaning of `small red box' is that it is a box -- if you are uncertain about this, look again at the earlier example of `box'). By extension, we can now say that another part of the meaning of Trafalgar Square, for our Automated Tourist Guide at least, is that it contains Nelson's Column; or that a part of the meaning of the National Gallery, in this extended sense, is that it is in Trafalgar Square and close to Charing Cross underground station. To answer the question ``Can you tell me how to get to the gallery in the square containing the monument?'' then, we need to transform it into a set of patterns

[[?x underground ?destination]
[?x isa [gallery]]
[?x in ?y]
[?y isa [square]]
[?y containing ?z]
[?z isa [monument]]

which can then be matched against the database until values are found for ?destination, ?x, ?y, and ?z such that each pattern is identical to an item in the database. If a consistent match can be found, then the value of destination will be the name of a station, which can be passed to the route finder, described in the last chapter, for determining the route. For the database above, the only consistent match gives [the national gallery] as the value of ?x, [trafalgar square] as the value of ?y, [nelsons column] as the value of ?z and [charing cross] as the value of ?destination.

Matching the patterns against the database is straightforward; the difficulty lies in the first stage -- transforming an English sentence into patterns representing database items. The parse-tree for the sentence suggests a simple way of constructing this query from its constituent patterns. The idea is to turn each noun-phrase into a collection of patterns which capture the meaning of that phrase. Where there is an embedded noun-phrase, the corresponding collection of patterns is combined to form the new collection. Our program will therefore have a mechanism that translates linguistic expressions into database queries (for an example see figure 5.10).

The meaning of the entire noun-phrase is then a function of the meaning of each of its parts, as these are combined together by the syntactic rules. By adding the pattern

[?x underground ?destination]

for the `canned' phrase ``Can you tell me how to get to,'' we have built up a semantic representation that corresponds to the database query given.

  [IMAGE ]
Figure 5.10: Parse-tree and database queries for ``Can you tell me how to get to the gallery in the square containing the monument?''

In sections 5.4 and 5.5, we shall briefly discuss the pragmatics of language and the generating of natural language text. Since we shall not be concerned with pragmatics in designing the natural language interface to our Automated Tourist Guide, and since our program will generate replies using only stereotyped response patterns, we shall not go into any great detail in either section. If you are interested in finding out more about these topics, you might like to follow up the references cited in the text (McCawley, 1981; Sowa, 1984). But be warned: it is often very difficult reading!


[Next] [Up] [Previous]
Next: Pragmatics Up: Semantics Previous: The Meaning of Phrases

Cogsweb Project: luisgh@cogs.susx.ac.uk