Books
in black and white
Main menu
Home About us Share a book
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Communicating with Databases in Natural Language - Wallace M.

Wallace M. Communicating with Databases in Natural Language - Ellis Horwood Limited, 1985. - 170 p.
Download (direct link): comumunicatingwthisdatabase1985.djvu
Previous << 1 .. 24 25 26 27 28 29 < 30 > 31 32 33 34 35 36 .. 59 >> Next

(d) The verb modifiers may include a subject and one or two objects (all of which are noun phrases). A verb modifier may also be a prepositional phrase, a relative clause or a specific adverb such as “today” E.g.
subject or object: “Pencils cost 5p”
prepositional phrase: “Who is served by Collinsl”
relative clause: “Tell me when ICL order desks”
(e) A noun phrase may be just a noun such as “Smith” or “?10” However, a compound noun phrase may start with an article (“the”), or a possessive (“ICL’s”), followed by a count(“1000”), adjectives, classifiers and head-noun (“1974 ICL orders”, “creditworthy Berkshire customers”)
A noun phrase may be followed by any number of prepositional phrases and relative clauses (“customers in credit who are served by Collins"). The grammar does not cover ordinals (“the first order”), complicated counts (“more than .3 and less than 10 orders”) or comparative or superlative adjectives (“a bigger order than ICL’s”, “the biggest order this year”).
2. THE SENTENCE, OR CLAUSE
2.1 Verbs and verb modifiers
A sentence has a verb and a number of verb modifiers. The verb modifiers are noun phrases or adverbial phrases that modify the verb. The verb modifiers can be distinguished by their grammar. If one appears before the verb, for example, it is the subject', after the verb it is an object,
QPROC’s dictionary associates with each verb a database relation and with each proper noun a data value. Thus we can illustrate a simple example of mapping a natural language query onto a database (Fig, 5 1).
Sentence Smith contested which election?
Grammar subject verb object
Meanings ‘Smith’ contest X (variable)
Database contest person election
‘Smith’ ‘electl’
‘Bolton’ ‘electl’
Fig 5 1 - Mapping a simple natural language query onto a database relation.
In PROLOG grammar rule notation this analysis can be expressed as:
sentence(Meaning) - -> subj(Value),
verb(Relation, Attributes), objects(List),
{match([Value | List], Attributes, Args), Meaning = . [Relation | Args]}..
This grammar states that a ‘sentence’ comprises:
‘sub}’ and ‘verb’ and ‘objects'
Each of these must also have a grammatical definition, The goals in curly brackets are ordinary PROLOG goals, which derive the meaning
For the query “Smith contested which election?”, the ‘Meaning’ would be the PROLOG structure:
‘contest(‘Smith’, X)’
and when this is executed against the database it yields the answer X = ‘electl’. In the sentence
“John bought a car in 1974 in Oxford”
the two verb modifiers “in 1974” and “in Oxford” are grammatically indistinguishable, Their order of occurrence within the sentence might equally well be reversed, so even this cannot be used to make the distinction between them.
However, verb modifiers can be distinguished not only grammatically but semantically. When a verb modifier is interpreted onto the database, it is associated with a database domain. In our example database “Oxford” is attached to the data value ‘Oxford’ which belongs to the ‘location’ domain, “1974” is a ‘date’. Thus
“John bought a car in 1974 in Oxford” can be interpreted onto the database as shown in Fig, 5 „2.
Sentence John bought
Grammar subject verb
Dictionary values ‘John’ buyl
Domains person
a car 1974
object in-object
car 1974
item date
in Oxford in-object ‘Oxford’ location
Database buyl Subject Object Location Date
‘John’ car ‘Oxfoid’ 1974
Fig, 5 2- “John bought a car in 1974 in Oxford”
Sometimes the grammatical association conflicts with the domain requirements of a relation. Consider the example the passive sentence;
“A car was bought by John”
In the previous example the ‘subject’ attribute ranged over ‘person’. In this sentence, however, the grammatical subject is “a car” which is associated with the wrong database domain. Without complicating the grammai, this might be dealt with by recognising a separate verb “be bought”, with its own interpretation, ‘buy2’:
Sentence Grammar Dictionary values Domains
A car Subject car item
was bought verb buy2
by John by-object ‘John’ person
Database buy2 Subject By-object
car ‘John’
Fig, 5 3 - “A cai was bought by John”
The relation, ‘buy2’, would be a derived relation. The derivation would simply involve renaming the attributes of ‘buyl’.
Instead QPROC actually uses a moie sophisticated giammar to lecognise the “logical-subject” and the “logical-object” of a sentence. Thus both active and passive foims of the sentence can be mapped onto the same lelation, ‘buy3’:
buy3 logical-subject logical-object
‘John’ car
86 SEMANTICS
[Ch
This new grammar still misses some useful generalisations Consider the two sentences:
“John bought a car for Mary”
“John bought Mary a car”
If the first sentence is interpreted as:
buy3 logical-subject logical-object for-object
‘John’ car ‘Mary’
then the second sentence will requite another derived relation, ‘buy4’, with attributes “lst-logical object”, “2nd-logical-object”,
The necessity for two relations, ‘buy.3’ and ‘buy4’, can be averted by introducing two even more sophisticated categories of verb modifier:
Previous << 1 .. 24 25 26 27 28 29 < 30 > 31 32 33 34 35 36 .. 59 >> Next