11
Learning word syntactic subcategorizations interactively Fernando Gomez Learning algorithms that acquire syntactic knowledge for a parser from sample sentences entered by users who have no knowledge of the parser or English syntax are described. It is shown how the subcategorizations of verbs, nouns and adjec- tives can be inferred from sample sentences entered by end users. Then, if the parser fails to parse a sentence, for example Peter knows how to read books, because it has limited knowl- edge or no knowledge at all about 'know', an interface which incorporates the acquisition algorithms can be activated, and 'know' can be defined by entering some sample sentences, one of which can be the one which the parser failed to parse. Keywords: natural language processing; syntactic subcategor- izations, parsing, learning One of the major problems of natural language process- ing (NLP) applications is that of extending the syntactic coverage of the parser in order to deal with the applica- tion domain. However, this extension is not obvious, mainly because of the interaction of the grammar rules, and the encoding of these rules in the programming formalism in which the parser is embedded. Formal knowledge about syntax is a form of expertise that most people do not have. Moreover, the encoding of this knowledge into the parser is not an easy matter either. The ideal situation would be one in which learning algo- rithms could infer the syntactic rules from sample sentences typed by end users. This is the approach that is explored in this paper. These learning algorithms will be referred to as the interface to the parser, or simply the interface. This interface is one of the main compo- nents of the SNOWY system 1.2. Department of Computer Science, University of Central Florida, Orlando, FL 32816, USA Paper received 15 September 1993. Revisedpaper received 30 August 1994. Accepted 22 September 1994 The philosophy underlying our parser is that the core of the syntax of a language does not rely on 'general' rules, but rather on lexical items, especially verbs and nouns, and, to a lesser degree, adverbs and adjectives. This view was presented and argued for by Gross 3 and his associates, who concluded that 'for French .... the phenomena that would be called lexical by Chomsky are the rule, while the ones he termed transformational are quite rare'. Our parser is therefore a lexically driven algorithm that incorporates mechanisms to handle 'general' syntactic phenomena such as movement, embedded clauses, passive sentences, and syntactic lexical ambiguity. However, the enormous syntactic diversity of most words in English is handled by storing the syntactic rules in the lexical entries. The parsing of a sentence is driven by these syntactic usages, which are retrieved by the parser as they are encountered in the sentence. Thus, a word like 'news' may be followed (among other things) by a clause introduced by the conjunction 'that'. Or a word like 'way' may be followed by an infinitive clause. This behavior is idio- syncratic to 'news' and 'way'. Likewise, the verb 'know' may be followed by 'how', but 'want' followed by 'how' will result in an ungrammatical sentence. Formalizing the syntax of words like 'know', 'be' etc. in a transition diagram or in a grammar is not easy for people with no knowledge of linguistics. In fact, our experience has shown that even college graduates have a lot of trouble in capturing the syntax of words in any formal mechanism. The algorithm described here will show that, if the parser fails to parse a sentence, for example Peter believed that Mary read the books, because it has limited syntactic knowledge or no knowl- edge at all about 'believe', the syntax of 'believe' can be learned from sentences typed by end users, one of which can be the one that the parser failed to parse. The appendix contains a sample session which the reader may want to read prior to delving into the paper; it indi- cates how this interaction may proceed. This paper is organized as follows: first, we give a brief overview of 0950-7051/1995 Elsevier Science B.V. 190 Knowledge-Based Systems Volume 8 Number 4 August 1995

Learning word syntactic subcategorizations interactively

Embed Size (px)

Citation preview

Page 1: Learning word syntactic subcategorizations interactively

Learning word syntactic subcategorizations interactively

Fernando Gomez

Learning algorithms that acquire syntactic knowledge for a parser from sample sentences entered by users who have no knowledge of the parser or English syntax are described. It is shown how the subcategorizations of verbs, nouns and adjec- tives can be inferred from sample sentences entered by end users. Then, if the parser fails to parse a sentence, for example Peter knows how to read books, because it has limited knowl- edge or no knowledge at all about 'know', an interface which incorporates the acquisition algorithms can be activated, and 'know' can be defined by entering some sample sentences, one of which can be the one which the parser failed to parse.

Keywords: natural language processing; syntactic subcategor- izations, parsing, learning

One of the major problems of natural language process- ing (NLP) applications is that of extending the syntactic coverage of the parser in order to deal with the applica- tion domain. However, this extension is not obvious, mainly because of the interaction of the grammar rules, and the encoding of these rules in the programming formalism in which the parser is embedded. Formal knowledge about syntax is a form of expertise that most people do not have. Moreover, the encoding of this knowledge into the parser is not an easy matter either. The ideal situation would be one in which learning algo- rithms could infer the syntactic rules from sample sentences typed by end users. This is the approach that is explored in this paper. These learning algorithms will be referred to as the interface to the parser, or simply the interface. This interface is one of the main compo- nents of the SNOWY system 1.2.

Department of Computer Science, University of Central Florida, Orlando, FL 32816, USA Paper received 15 September 1993. Revised paper received 30 August 1994. Accepted 22 September 1994

The philosophy underlying our parser is that the core of the syntax of a language does not rely on 'general' rules, but rather on lexical items, especially verbs and nouns, and, to a lesser degree, adverbs and adjectives. This view was presented and argued for by Gross 3 and his associates, who concluded that 'for French . . . . the phenomena that would be called lexical by Chomsky are the rule, while the ones he termed transformational are quite rare'. Our parser is therefore a lexically driven algorithm that incorporates mechanisms to handle 'general' syntactic phenomena such as movement, embedded clauses, passive sentences, and syntactic lexical ambiguity. However, the enormous syntactic diversity of most words in English is handled by storing the syntactic rules in the lexical entries. The parsing of a sentence is driven by these syntactic usages, which are retrieved by the parser as they are encountered in the sentence. Thus, a word like 'news' may be followed (among other things) by a clause introduced by the conjunction 'that'. Or a word like 'way' may be followed by an infinitive clause. This behavior is idio- syncratic to 'news' and 'way'. Likewise, the verb 'know' may be followed by 'how', but 'want' followed by 'how' will result in an ungrammatical sentence.

Formalizing the syntax of words like 'know', 'be' etc. in a transition diagram or in a grammar is not easy for people with no knowledge of linguistics. In fact, our experience has shown that even college graduates have a lot of trouble in capturing the syntax of words in any formal mechanism. The algorithm described here will show that, if the parser fails to parse a sentence, for example Peter believed that Mary read the books, because it has limited syntactic knowledge or no knowl- edge at all about 'believe', the syntax of 'believe' can be learned from sentences typed by end users, one of which can be the one that the parser failed to parse. The appendix contains a sample session which the reader may want to read prior to delving into the paper; it indi- cates how this interaction may proceed. This paper is organized as follows: first, we give a brief overview of

0950-7051/1995 Elsevier Science B.V. 190 Knowledge-Based Systems Volume 8 Number 4 August 1995

Page 2: Learning word syntactic subcategorizations interactively

Learning word syntactic subcategorizations interactively: F Gomez

the parser. The next four sections describe the algo- rithms for the acquisition of usages for verbs, adjectives, and nouns. These sections are followed by a discussion of ambiguity. Finally, the last two sections explain related research and give our conclusions.

OVERVIEW OF PARSER

This usage is represented as (inf (obj (inf *))), which corresponds to the structure (al a2), where al matches infand a2 the list (obj (inf *)). The meaning of this repre- sentation is that 'want' may be followed by an infinitive or object, and the object in turn may be followed by an infinitive or nothing. A transition diagram representing the usage of 'want', 'like' and 'study' is shown in Figure 1. The actions corresponding to this usage are

This section describes only those features of the parser that are necessary in understanding the interface acqui- sition algorithms. The parser 4 is a top down algorithm that uses a 'grammar' indicating the structure of the sentence up to the main verb. There are two main stacks in the parser. One stack, called nonterminals, contains the nonterminal symbols, and a stack called actions contains the actions to be executed when a nonterminal is reduced from the nonterminals stack. Another stack, called structs, keep the names, actually Lisp gensyms, of the structures being built. Throughout this paper, when we use the definite reference 'the stack', we are always referring to the nonterminals stack. The algorithm consists of two steps. In the first step, the nonterminals stack is initialized with one rule of the 'grammar', and the actions stack is initialized with the actions for those nonterminals. In the second step, the symbols in the stacks are manipulated. By way of example, consider the following productions of the initial 'grammar':

(same-subj (obj (diff-subj *)))

There is a one-to-one mapping between the symbols in the usage and the symbols in the actions. The symbols in the actions are names of functions that will be executed when their matching symbols in the usage are reduced. Note that the representation of the usage of 'want' assumes that the NP following the verb is a direct object. However, this assumption will be corrected by the action diff-subj if the NP is followed by an infinitive. This action will make the NP the subject of the embed- ded clause introduced by the infinitive. An alternative representation of the usage of 'want' is shown in Figure 1. In this case, the action same-subj is associated with the first instance of 'to', and the action diff-subj with the second occurrence of 'to'. These actions take care of the verb following 'to'.

The key idea in the algorithm is the function coalesce, which selects a nonterminal from the nonterminals stack

S ---) SUBJ VERB I INF VERB [ INF SUBJ VERB

The first rule of the 'grammar' says that an English sentence consists of a subject followed by the inflected form of a verb. (The nonterminal VERB always refers to the inflected form of the verb). What follows the verb depends on each concrete verb and, consequently, it is not part of the 'grammar'. When the nonterminal VERB is reduced, its syntactic 'usage' will be retrieved from the parser's lexicon entry and pushed on the stack. Similarly, the nouns in the subject may have special usages, in which case those usages will be pushed onto the stack during execution of the NP (noun phrase) procedure. The second production of the 'grammar' says that an English sentence is formed by an infinitive followed by a verb (To read is good), while the third production says that an English sentence is formed by an infinitive followed by a subject and a verb. In this case, the infinitive introduces a purpose clause, as in To read, Mary went to the library.

The syntactic usage of a word is represented in the lexicon by a list of the form (al a2 ... ai), meaning that the word may be followed by just one of the ai elements. If an asterisk (*) belongs to the list, it means that none or one ai may follow the word. If any ai is a list, it means that the word may be followed by the first element in ai. This first element in turn may be followed by any number of elements in ai. The usage of 'eat' is represented by (obj *), which means that 'eat' may or may not take an object. Consider the usage of 'want':

want obj want inf want subj inf

want inf ~"~obj i n f ~

like ing

study about

subj

Figure 1 Transition network representing the usages of "want', 'like' and 'study'; for 'want', two possible representations are shown

Knowledge-Based Systems Volume 8 Number 4 August 1995 191

Page 3: Learning word syntactic subcategorizations interactively

Learning word syntactic subcategorizations interactively: F Gomez

on the basis of the senses of the word being scanned. The selection of the correct arc or nonterminal is deter- mined by matching the nonterminal or nonterminals on the top of the nonterminals stack to the senses in word- senses. For instance, coalesce selects an arc labeled inf i f 'inf' belongs to wordsenses, an arc labeled verb if 'verb' belongs to wordsenses, an arc labeled that if the current word is ' that ' etc. We use the feature descr to mark all those words that can form part of a noun group. Thus, adjectives, nouns, articles, pronouns and the '-ing' form of verbs are marked with the feature descr. Hence, the function coalesce selects a nonterminal labeled subj, or pred (predicate) if descr belongs to the senses in word- senses. Coalesce selects the nonterminal obj or io (in- direct object) if descr belongs to wordsenses and the marker nominative does not belong to it. If coalesce selects a nonterminal in this way, we say that a match between the nonterminal and the senses in wordsenses takes place.

If the top of the nonterminals stack contains a single nonterminal, and a match exists between that terminal and the senses in wordsenses, coalesce returns true; otherwise, it returns false. If coalesce returns true, the top of the actions stack is executed, which is the action corresponding to the nonterminal on top of the non- terminals stack. Every action, when it is executed, will pop both stacks and, if appropriate, will push a usage and a corresponding action on the nonterminals and actions stacks, respectively.

Let us now explain the behavior of coalesce when the top of the stack is a list (see Figure 1). We call the node marked a the initial node and the arcs coming from the initial node initial arcs. The initial arcs for the usage of 'want' are inf and obj. Suppose that the top of the stack contains (al a2), where a l is a single nonterminal and a2 is a list. The function coalesce will choose between al and the first element in a2. In other words, what coalesce does is to coalesce the initial arcs for the usage of a word. If the usage of 'want' is being considered, coalesce will try to select the arc labeled obj or the arc labeled inf. If coalesce selects one arc, it will discard the remaining initial arcs. It may happen that, in some cases, coalesce will fail to coalesce the initial arcs. In that case, the saving of some arcs is needed. See Reference 4 for a detailed description of this.

For example, consider the sentence Peter wanted Mary to read a book. When the nonterminal verb is reduced, the usage and actions for 'want' will be pushed on the nonterminals and actions stacks, respectively. Then coalesce will be activated with (inf(obj(inf *))) on top of the nonterminals stack and 'Mary' as the current word. Coalesce will return true, pop the stack, and push 'obj (inf *)' onto it. Coalesce will perform a similar change in the actions stack. Namely, it will pop it and push 'obj (diff-subj *)' onto it, so that the correspon- dence between nonterminals and actions is kept.

Relative clauses and prepositional phrases are handled in the following way. When the function that parses noun groups is ready to exit, it pushes (prep np pp rel ing-rel *) onto the nonterminals stack, and (prepo- sition rel-np partc-rel relatives ing°rel-act *) onto the actions stack. The nonterminal prep stands for preposi- tion, and rel is a marker for 'that', 'which', 'who' and 'whom'. The nonterminal pp stands for past participle, and ing-rel for verbs in the present participle form, e.g. the

man reading the book. Then, it is up to coalesce to select the correct arc. Coalesce will select the nonterminal prep if the marker prep belongs to the senses in wordsenses, ing-rel if the marker ing belongs to wordsenses, rel if rel belongs to wordsenses, np if the marker descr belongs to wordsenses, and pp if the marker pp belongs to word- senses. The selection of any of these nonterminals is followed by the selection of its corresponding action.

The nonterminals stack holds two special symbols: $ and +. The dollar sign indicates that the stack is empty. The + sign is used to indicate the end of the nontermi- nals for a sentence or an embedded clause. When the parser finds the + sign, it knows that a sentence or clause has been parsed, and, therefore, that the structure which it is building for that sentence or clause is complete. The + sign is put on the stack by the initial- ization step and whenever an embedded clause is found by the action corresponding to a nonterminal.

The following detailed example will give the reader a feeling of how the parser works. (We remind the reader that 'the stack' refers always to the nonterminals stack).

Script started on Mon Jul 18 03:20:33 1994 1. (SUBJ VERB + $) ~ (THE TEACHER WANTS

TO STUDY THE NOTES MARY WROTE) 2. ( (PREP NP PP REL ING-REL *) VERB + $)

--) (WANTS TO STUDY THE NOTES MARY WROTE)

3. (VERB + $) ~ (WANTS TO STUDY THE NOTES MARY WROTE)

4. ( (TO (OBJ (TO .))) + $) ~ (TO STUDY THE NOTES MARY WROTE)

5. ((OBJ ABOUT (HOW (TO (SUBJ VERB + ))) (WHERE (TO (SUBJ VERB +))) (WHY (TO (SUBJ VERB +)))(WHEN TO (SUBJ VERB +)))*) + + $) --~ (THE NOTES MARY WROTE)

6. ( (PREP NP PP REL ING-REL *) + + $) (MARY WROTE)

7. (SUBJ VERB + + + $) ---) (MARY WROTE) 8. ( ( P R E P NP PP REL ING-REL *) VERB

+ + + $ ) ~ (WROTE) 9. (VERB + + + $) ---) (WROTE) 10. ( ( (OBJ (DOWN UP OFF OUT ,)) (DOWN

(OBJ)) (UP (OBJ)) (OFF (OBJ)) OUT (OBJ)) ,) + + + $) - , NIL

11. ( ( D O W N UP OFF OUT ,) + + + $) --~ NIL 12. ( + + + $ ) ~ N I L 13. ( + + $ ) ~ N I L 14. (+ $) -~ NIL 15. ($) ~ NIL (PARSED! WANT TO SEE

STRUCTURES? Y/N)y

In line 1, coalesce matches subj to the senses of the current word, 'The', and returns true. The action corre- sponding to subj calls the noungroup function, which returns true, and 'The teacher'. The noungroup function also inserts (prep np pp rel ing-rel *) on the non- terminals stack. The action for subj opens the slot subj in the structure on top of structs, namely g01, and fills it with 'The teacher'.

In line 2, coalesce returns nil, since none of the termi- nals in (prep np pp rel ing-rel *) matches 'wants'. The main algorithm checks to see if * is one of the arcs in the list of the arcs on top of the nonterminals stack, and,

192 Knowledge-Based Systems Volume 8 Number 4 August 1995

Page 4: Learning word syntactic subcategorizations interactively

Learning word syntactic subcategorizations interactively: F Gomez

because this is the case, it pops the nonterminals stack, and coalesce is activated again.

In line 3, this time coalesce matches 'wants' with 'verb'. The action for verb pushes the usage for 'want' onto the top of the stack.

In line 4, coalesce matches 'to' in the sentence with the 'to' on top of the stack, and the function for 'to', which is same-subj, performs the following actions:

• It creates a new gensym, say g02. • It opens an obj slot in the structure on top of

structs, g01, and fills it with the gensym g02, just created.

• It opens a slot subj in g02, and fills it with the subject of g01, namely 'the teacher'.

• It pushes g02 onto the stack structs. • It pops verb from the top of nonterminals and same-

subj from the top of actions. • Finally, it retrieves the usage and actions for 'study'

and pushes them onto the nonterminals and actions stacks, respectively.

After these actions have been performed, the content of structs, g01 and g02 are as follows:

structs = (gO2 gO 1) gO1 = (subj (the teacher) verb (wants) obj (gO2)) gO2 = (subj (the teacher) verb (study)

be used again and to indicate that a long distance dependency has been solved, and it fills the rela slot with the name of the structure on the top of structs, namely g03. Finally, the main algorithm pops the stacks. If the main algorithm does not find a rel slot in the structures in structs, it announces an error if the verb is transitive (it requires an obj). Likewise, when a structure in structs is popped (see below), the main algo- rithm announces an error if the structure contains a rel marker, meaning that a long distance dependency remains unsolved. At this point, the contents of the structures are as follows:

structs = (gO3 gO2 gO1) gO1 = (subj (the teacher) verb (wants) obj (gO2)) gO2 = (subj (the teacher) verb (study) obj (the notes)

rela (gO3)) gO3 = (subj (mary) verb (wrote) obj (the notes))

In line 11, coalesce returns nil, and the main algorithm pops the stack because the asterisk is a member of the list on top of the stack.

In lines 12 to 14, coalesce returns nil for each line, and the main algorithm pops structs for each + on the top of the stack.

In line 15, coalesce returns nil, and the main algor- ithm announces success because all stacks are empty, and it has reached the end of the sentence.

In line 5, the main algorithm gains control again, and activates coalesce. Note the usage of 'study' on the top of the stack: (OBJ ABOUT (HOW (TO (SUBJ VERB + ))) (WHERE (TO (SUBJ VERB + ))) (WHY (TO (SUBJ VERB + ))) (WHEN (TO (SUBJ VERB + )))*). Coalesce selects the nonterminal obj from the top of the stack. The action for obj opens a slot obj in g02 and fills it with 'the books', which has been obtained by the function noungroup.

In line 6, the top of the stack contains the list (prep np pp rel ing-rel *), which has been put there by the noungroup function. From this list, coalesce selects the nonterminal NP because 'Mary' is a proper noun, and all proper nouns are marked with the marker 'descr'. The action corresponding to that nonterminal, namely rel-np, is executed. This action creates the slot tel in g02 and fills it with 'the notes' for use later, it pushes 'subj verb +' onto the nonterminals stack, and it creates a new structure, say g03, and pushes it onto structs. The stack structs contains (g03 g02 g01).

In line 7, coalesce selects the arc subj that matches 'Mary'. The action for subj opens and fills a subj slot on the top of structs, namely structure g03.

In line 8, coalesce returns nil, and the main algorithm pops the stack because * is in the list on the top of the stack.

In line 9, coalesce returns true, and the action for verb fills the slot verb with 'wrote' and pushes its usage onto the stack.

In line 10, coalesce returns nil. The main algorithm checks for the nonterminal obj on the top of the stack. Since that is the case, it then searches the structures being built for a slot called rel. In this case, it finds it in the structure g02. Then, it opens a slot obj in the struc- ture on top of structs and fills it with the content of the slot tel, which is 'the notes' in this case. Then, it changes the name of the slot from tel to rela, so that it cannot

A C Q U I S I T I O N O F S Y N T A C T I C U S A G E S

One easy way to define a syntactic usage for a new word is to search the lexicon for another word that behaves in the same way as the word one is defining and to copy its definition into the new one. This method, of course, is limited by the word usages currently defined in the lexicon. Moreover, there are many words that do not fall into any category. An even more serious problem with this method is that most end users are unable to determine if a word has the same syntactic distribution as another one.

It is clear that, if one wants to help end users, it is imperative that the usage be built from sample sentences posed by the users themselves. In the case of verbs, one could think of attacking this problem by attempting to parse the user's sentences with all distinct verb usages in the lexicon, and picking that usage which succeeds for all sample sentences. Again, this method will be limited by the usages presently defined in the lexicon, but a more serious limitation with this method is that it simply does not work. This may be illustrated with a very simple example. Let us assume that a user tries to define the verb 'read', and he/she types the sample sentences Mary read and Mary read the book. The first sentence will be successfully parsed with the usages (obj *) and (*). The usage (obj *) means that the verb may take or not take an object. The second sentence, Mary read the book, can be parsed with the following usages (among others): (obj), (obj *) and (obj (inf*)). From these usages and the two sample sentences above, only one usage, namely (obj *), is the correct one. The interface could rule out some of these usages by generating sentences from the successful usages and asking the user if the sentences are gram-

Knowledge-Based Systems Volume 8 Number 4 August 1995 193

Page 5: Learning word syntactic subcategorizations interactively

Learning word syntactic subcategorizations interactively: F Gomez

matical. For instance, the interface could generate from the third usage the sentence Mary reads Peter to go to the movies, and ask the user whether the sentence is correct. This method could work for some cases. However, it may produce a tedious interaction with the user. It also has the problem that a user may reject a sentence as ungrammatical for semantic reasons rather than for syntactic reasons. Most people will consider the sentence Rocks eat ideas as ungrammatical although the sentence is syntactically correct.

The solution to this problem is to parse the user's sample sentences with pieces or segments of usages. What a segment usage is will be discussed later. For now, let us observe that the usage (inf (obj (inf *))) is composed of the following segments: 'obj', 'inff, 'obj inf'. This is to say that a verb may be followed by an object, or infinitive, or object plus infinitive. Of course, a verb may be followed by many other things, which will be discussed in the next section. The basic idea is to parse the user's sentence with these segment usages, save all segment usages which successfully parse the sentence, and finally merge those usages into the final usage for the word. The algorithm is as follows.

(o)

(1)

(2)

(3)

(4)

(5)

Repeat Steps 1 to 4 until the user stops enter- ing sample sentences.

Input the user's sample sentence.

Select segment usages by examining the senses of the word immediately following the one the user is defining.

Put these segments in the list Segment- Usages.

Repeat steps 4.1 to 4.3 until the list Segment- Usages is empty.

(4.1) Parse the user's sentence with the first usage in the list Segment-Usages.

(4.2) If the parser succeeds, save the usage in the list Successful-Segment-Usages.

(4.3) Remove the first usage from Segment- Usages.

Merge the segment usages in Successful- Segment-Usages into a single usage.

Suppose that a user is defining 'read' and he/she types the sentences Mary read and Mary read a book, and let us further assume that the segment usages in the list Segment-Usages are (obj), (inf), (*), (obj inf). In this case, the parser will succeed when it parses the first sentence with the usage (*), and the second sentence with the usage (obj). The list Successful-Segment-Usages will contain ((obj) (*)) in Step 5 of the algor-ithm. This list will be passed to the function merge, which will form a single usage for 'read' based on the two sentences provided by the user. Let us consider each one of these steps separately.

L E A R N I N G T H E S U B C A T E G O R I Z A T I O N O F VERBS

First, we discuss the acquisition of the syntactic usage for verbs. The list below contains the segment usages for verbs that are implemented in the current version of the interface, and also example sentences illustrating each usage. All these segment usages are stored in the list Segment-Usages. For each one of these segments, there is a corresponding action which is not listed here.

1. (*) 2. (adj) 3. (obj) 4. (obj adj) 5. (obj bare-inf) 6. (obj inf)

7. (obj ing)

8. (obj io) 9. (obj verb) 10. (obj adverb inf)

He read. He looks sad; He is sad. He read the book. He kept her warm. I saw him fall. I want Mary to read a book. I saw her reading a book.

(obj + present part.) I stopped him talking all night.

(obj + gerund) I gave Mary the book. I know Mary likes Peter. She showed him how to

read. He gave cigarettes up. 11. (obj particle)

12. (obj adverb subj verb) He showed Mary how Peter proved the theorem.

13. (inf) Peter wants to read. 14. (prep) She believes in you. 15. (particle) She gave up. 16. (ing) Peter likes flying planes. 17. (poss ing) I enjoyed his coming. 18. (adverb inf) He knows how to read. 19. (adverb subj verb) He knows why Mary likes

books. 20. (that-clause) He knows that Mary likes

books. 21. (particle that-clause) He found out that he liked

music 22. (which-clause) He knows which books

Peter likes.

The segment (*) is for intransitive verbs. The segment usage (obj inf), as has been explained, will succeed in sample sentences such as I want Mary to read. Note that the usage will fail in the sentence I want Mary because 'Mary' is not followed by an infinitive. The usage (obj bare-inf) is handled like the (obj inf). The NP following the verb is taken as a direct object, but, if a bare infinitive is found, the obj is made the subject of the bare infinitive. The segment usage (obj io) handles bitransitive verbs by the usual procedure of assuming that the NP following the verb is the object, but if that NP is immediately followed by another one, the action for the nonterminal io will change the object slot to io, and will make the second NP the object. That segment usage will not handle indirect objects introduced by the prepositions 'to' or 'for'. The segment (obj verb) handles verbs which take a clause as the direct object, e.g. Mary knows Peter likes her. This is done in a way similar to the usage (obj inf). The parser will take the NP follow- ing the verb to be the object, but, if a verb is found, then the object will become the subject of the verb. Note that

194 Knowledge-Based Systems Volume 8 Number 4 August 1995

Page 6: Learning word syntactic subcategorizations interactively

Learning word syntactic subcategodzations interactively: F Gomez

it is the usage (obj (verb *)), which makes this parsing possible. The usage (obj (verb *)) is the result of merging the segments (obj) and (obj verb). The usages (particle) and (obj particle) deal with particles. The interface infers that a preposition is a particle if the user's sentence ends in a preposition. For instance if the user types Bears rolled over, or Peter gave cigarettes up, the interface will infer that 'over' and 'up' are particles. Adverbs that may be used as particles are marked in the dictionary. Then, the interface recognizes these adverbs in sentences such as Peter found out that Mary likes him, or Peter found out the truth. (See the appendix for an example).

The segment usages (prep) and (ing) are for verbs which are followed by a prepositional phrase and a gerund, respectively. In the case of (ing), there is a problem with ambiguity. If a user is defining the verb 'like' and she/he types the sentence Mary likes fy ing planes, the parser will return an ambiguous parse for this sentence, and also for the sentence Mary sells flying planes. Ambiguous cases are discussed in the section involving the learning of the subcategorizations of nouns and adjectives. The two segments which start with 'adverb' handle sentences such as Mary knows how to read books and Mary understood how Peter entered the house. Segments 20 and 21 cover that clauses, e.g. I think that Peter saw Mary, and particles followed by a that clause, e.g. She found out that Mary read the book respectively. Finally, segment 22 handles which clauses, e.g. Mary indicated which books to study.

There is no need to try a user's sample sentence defin- ing a verb with all segment usages, since the word immediately following the one she/he is defining constrains the relevant usages to a small subset. When a user types a sample sentence the senses of the word following the one being defined are examined. If the following word is unknown, he/she is asked to define that word prior to proceeding with the one presently being defined.

M E R G I N G S E G M E N T USAGES I N T O FINAL USAGE

For the sample sentences Peter wants a book, Peter wants Mary to buy a book and Peter wants to buy a book, the parser will succeed with the following segment usages: (obj), (obj in0 and (inf), respectively. When the function merge is called it will merge those segment usages into the final usage for 'want', namely (inf (obj (inf *))). The role of merge is to transform a represen- tation which could be highly nondeterministic into a deterministic one, making it possible for coalesce (see the parser overview section) to select deterministically the correct arc. The algorithm for merge is as follows (Successful-segment-Usages is a list containing all the segment usages which successfully parsed the user's sample sentences).

(1) Make the list Successful-Segment-Usages a set.

(2) Move all singleton subsets of Successful- Segment-Usages to the list Singleton-Sets.

(3) Repeat Steps 3.1 to 3.4 until the set Successful-Segment-Usages is empty.

(4)

(3.1)

(3.2)

(3.3)

(3.4)

Call the first subset of Successful- Segment-Usages FIRST. Move FIRST and all subsets of Successful- Segment-Usages whose first element is the same as the first clement in FIRST to the list L. If there is more than one set in L, elim- inate the first element of all subsets of L, except for one. Form the union of all subsets of L and put the result back in L. If the first element in the first subset of L is a member of any set in Singleton-Sets, remove that set from Singleton-Sets and insert-the-asterisk in L. (The function insert-the-asterisk yields (a (b c d *)) if L is equal to (a b c d). In Lisp this is defined as (list (car 1) (append (cdr 1) '(*))).) Put L in Final-Usage. Set L to nil.

Move all sets in Singleton-Sets, if there are any left, to Final-Usage.

(5) Return Final-Usage as the final usage for the word.

Let us explain each one of these steps and illustrate them with examples. Let us assume that Successful- Segment-Usages contains ((a) (a f ) (a k) (a m) (h m) (d)). Step 1 is necessary because two or more sample sentences can be parsed using the same usage. For instance, a user may type Peter wants the red book and Peter wants books as examples of two usages of 'wants'. In that case, the list Successful-Segment-Usages will contain (obj) twice. We could tell the user that his/her second sample sentence does not show a new usage of 'wants', and teach her/him a little bit of syntax along the way. We may do that in later versions of the inter- face. Step 2 is intended only to facilitate the next two steps. After executing Step 2, the list Successful- Segment-Usages is equal to ((a f ) (a k) (a m) (h m)) and the list Singleton-Sets is equal to ((a) (d)). After execut- ing Step 3.1, the list L is equal to ((a f ) (a k) (am)) and the list Successful-Segment-Usages is equal to ((h m)). After executing Step 3.2, L is equal to (a f km). After executing Step 3.3, L is equal to (a 0 c k m *)) and Singleton-Sets is equal to ((d)). After executing Step 3.4, Final-Usage is equal to ((a 0Ok m *))) and L is equal to nil. In the second iteration (h m) is put into Final- Usage. The asterisk is not inserted because (h) does not belong to the Singleton-Sets. In Step 4, (d) is moved to the Final-Usage whose final content becomes ((a (jr k m *))(h m) d). Figure 2 shows the above example in the form of a transition diagram, and Figure 3 shows the output of merge.

Knowledge-Based Systems Volume 8 Number 4 August 1995 195

Page 7: Learning word syntactic subcategorizations interactively

Learning word syntactic subcategorizations interactively: F Gomez

a A k

d

Figure 2 Transition diagram representation of input ((a) (a fi (a k) (a m) (h m) (d)) for the function merge

k

f

h m

d

Figure 3 Transition diagram representation of merge's output for input shown in Figure 2

may be followed by a that clause is that the next time they are defining a noun, say 'news', they may type the following sample sentence: The news that Peter brought was sad. This does not cause any problem for the inter- face, because it is very easy to prevent this type of mistake by parsing the sentence with 'that' as a relative in case the other usages for nouns fail.

This problem is even worse in the case of adjectives, because some adjectives in combination with be are distributed over a large domain of different usages. The data we have gathered with the interface has indicated to us that the best way to deal with this problem is by telling the users not to be overly concerned about the definitions of adjectives or nouns until the parser fails to parse a sentence. Then, they should activate the inter- face with the same sentence that failed (the automatic activation of the interface after the parser fails has not yet been implemented). Because the user's sentence may contain several user-defined words, they must redefine the one that they suspect caused the problem. An aspect that is presently under design is to let the parser deter- mine which word caused the problem and correct it by automatically activating the interface with the failed sentence. The following three usages for nouns are implemented:

(inf) (that-clause)

(it be np subj verb)

Peter has the ability to read fast. The fact that Mary came pleased

him. It's a pity Kafka died so young.

In the third usage, the head noun of the np (pity) is the noun being defined by the user. The following usages for adjectives have been implemented.

(be adj inf)

(be adj prep inf)

(be adj that-clause) (be adj prep)

It was impossible to read at the store.

It was nice of you to help him. It was impossible for Peter to

leave. I am sad that Mary left. I am sorry about your tree.

A M B I G U I T Y A N D O T H E R P R O B L E M S

L E A R N I N G T H E S U B C A T E G O R I Z A T I O N O F N O U N S A N D A D J E C T I V E S

It is very easy for an end user to understand that in order to define a verb she/he needs to type some sample sentences using the verb. However, a completely differ- ent situation occurs in the case of nouns and adjectives. We mention that some nouns and adjectives have special 'constructions' and provide some examples. This does not work in many cases, however, because many end users do not distinguish between 'that' as a conjunc- tion and as a relative. It is common for a user to define, say, 'announcement ' or 'ability' as a noun without providing any sample sentences indicating its usage. Then, one week later he/she is surprised that the parser fails to parse the sentences The announcement that Peter was coming pleased her and Her ability to write is unique. The problem with reminding users that certain nouns

In his/her sample sentence a user may include any word which is defined in the lexicon, or he/she may define a word and then use that word in defining other words. For instance, a user may define 'duck' by saying that it is a noun and a verb. Then, in defining the verb 'see', he/she may type the sample sentence I saw her duck. The interface will try this sentence with all segment usages which begin with obj. The parser will succeed with the three segment usages (obj), (obj bare-inf) and (obj io). A user may type the sample sentence I took her f lowers for which the parser will succeed with the segments (obj) (obj io). In an earlier version of the interface, if a user's sentence was ambiguous he/she was asked to choose another sample sentence. In our present implementa- tion, the user's sample sentence is modified and he/she is asked to judge if the altered sentence is grammatical. The modifications of the sentences follow very simple rules. A lexical entry which may be a pronoun or an adjective is replaced with a proper noun. For instance,

196 Knowledge-Based Systems Volume 8 Number 4 August 1995

Page 8: Learning word syntactic subcategorizations interactively

Leaming word syntactic subcategodzations interactively: F Gomez

'her' will be replaced in I saw her duck with 'Mary', resulting in I saw Mary duck. Then, the user will be asked if this sentence is grammatical. In the sentence I like flying planes, the parser will succeed with the segment usages (obj) and (ing). In this case, the rule used is to modify the user's sentence by deleting every word following the -ing form. In this example, the altered sentence will become I like flying.

The unrestricted use of adverbs by end users caused some problems at an earlier stage of the interface. The problem was solved by marking in the dictionary those adverbs and prepositions which may act as particles, and also by encoding knowledge in the parser about a large class of adverbs that includes words such as 'yesterday', 'later', 'there', and 'home'.

Time 5 NPs may also pose some problems because they may appear almost anywhere in the sentence. For instance, a user may type a sentence such as Popeye ate spinach every day, which will result in building an indi- rect object for 'ate'. Of course, this problem can easily be solved by asking the users not to construct sample sentences having nouns referring to time, such as 'day', and 'hour'. Because the present implementation of the parser is able to handle time NPs, we are asking the user to tell us if the noun they are defining is a noun referring to time. If they do that, the parser is able to determine that 'every day' in the sentence above is a time NP.

RELATED WORK

Carter's work 6 has a similar aim to this, but it is based on elicitation techniques. Most work on database inter- faces 7-9 is also based on menu-driven dialogues and is specifically designed as a front end for querying data- base systems. These systems, whatever their merits are, do not deal with the problem of acquiring syntactic subcategorizations from end users' sentences for the general task of parsing.

A very different approach, which has the same aim as this, uses the information already contained in diction- aries to extract syntactic and/or semantic lexical infor- mation t°-14. In particular, the pape rN uses the grammar coding system of the Longman Dictionary of Contemporary English in order to build syntactic sub- categorizations of verbs. The major problem that the authors found with their program was due to the omis- sions and errors in the dictionary itself. They concluded that they were planning to use their system in a semi- automatic mode, in which an expert user would correct the errors and omissions in the dictionary while building the lexical entries. This clearly contrasts with our approach, which aims at automating the task of the lexi- cographer as far as his/her knowledge about syntactic subcategorization is concerned.

RINA is an interactive system ~5 intended for the acquisition of the phrasal lexicon, not syntactic subcat- egorizations, and it is designed on principles very differ- ent from those presented in this paper. For instance, RINA tries to learn the meaning of figurative phrases such as He threw the book at him, or of new words such as 'goggled' in Mary goggled him to come over. RINA contains a priori knowledge about the lexicon organized into a hierarchy, and it forms hypotheses based on this lexicon. Finally, it relies on a user's sentences as train-

hag instances in order to correct the program when it overspecifies or underspecifies from an input sentence, as has become standard in the methodology of learning by example t6. In future work, a relation could be estab- lished between the algorithms described here that are constructed for the acquisition of the syntax of the verb, and those intended to grasp its meaning. This is espe- cially the case for those based on syntactic bootstrap- ping 17, according to which some semantic classification of verbs can be established only on the basis of syntac- tic cases, or between proposals TM that combine some weak form of semantic bootstrapping and syntactic bootstrapping 19.

As indicated in the introduction, the view which underlies our approach to syntactic knowledge can be traced back to a paper by Gross 3. He and his associates realized, after building a transformational-generative grammar of French containing 600 rules, that the task could not be achieved without abandoning the main theoretical tenets of transformational grammar. This realization came about after applying these 600 rules to over 12 000 lexical items. Gross found that, for every syntactic transformational rule, one can find some lexical items which obey the rule and others which do not. Our syntactic knowledge acquisition algorithms are a consequence of this point of view. 'General' syntactic rules are not the target of the acquisition algorithms, but rather verb patterns, adjective patterns etc. are. This clearly contrasts with the ideas presented by Berwick 2°.

From a learning point of view, our approach is a knowledge-intensive one. Our learning algorithms learn because they already know a lot. This knowledge is in the parser, which covers a considerable portion of English syntax in the form of a few 'general' syntactic rules and a considerable number of syntactic word usages.

Finally, the way in which our algorithm acquires the syntax of new words is somewhat similar to the way in which a nounative speaker of a language acquires the syntax of new words. She/he, we hypothesize, starts by mastering a set of basic and 'general' syntactic rules (e.g. passive, relative clauses), and then she/he begins to face the enormous irregularity of English syntax by learning the syntax of individual words. Then, one day, he/she starts building sentences with the verbs 'want' and 'expect', for example

Mary expected to read a book. Mary wanted to read a book.

Then, when in future days she/he says

Mary was expected to read a book. *Mary was wanted to read a book.

he/she finds, with unpleasant surprise, that Mary was wanted to read a book is not grammatical, and that she/he needs to learn a usage for 'want' and another for 'expect', just when she/he had thought that the two verbs could be put in the 'same sack'!

C O N C L U S I O N S

We have presented an algorithm that acquires syntactic subcategorizations for verbs, nouns and adjectives from

Knowledge-Based Systems Volume 8 Number 4 August 1995 197

Page 9: Learning word syntactic subcategorizations interactively

Leaming word syntactic subcategodzations interactively: F Gomez

sample sentences entered by end users. The algorithm synthetizes the rules in a way that allows the parser to parse the sentences deterministically. The interface is implemented in Allegro Common Lisp and is running on Symbolics and SPARC workstations. The time the interface takes to acquire a subcategorization for a given word depends, naturally, on how complex the syntax of that word is. However, the average time that the interface takes in processing a user's sentence describing one syntactic usage of a word is about 4 s. In most cases, the user has barely finished typing the sentence when the interface comes back asking him/her for a new sentence describing a different syntactic usage. All these tests have been performed using interpreted code, not compiled code. The interface is now being used on a daily basis by the users of the SNOWY system, and it has performed beyond our most opti- mistic expectations. Moreover, it is helping us to gather highly interesting information about naive users' intu- itions about English syntax. In that regard, we are using the interface as the main component of an intelligent tutoring system to help seventh and eighth grade school- children to learn to analyze parts of speech. In this application, the children type English sentences, many of them taken verbatim from the exercises in their text- books, and observe the interface identifying the subject, direct object, predicate nominative, predicate adjective, embedded clauses, adverbial clauses etc. Of course, the interface finds this out from the sentences typed by the children, and not from a prestored set of sentences. In order to test this aspect of the interface, we are in the process of transporting the parser and the interface to PCs running Allegro Common Lisp.

A C K N O W L E D G E M E N T S

The research described in this paper is being in part funded by NASA-KSC Contract NAG-10-0058. I would like to thank Donna MarkeT and Richard Hull for helpful comments on this paper.

REFERENCES

1 Gomez, F and Segami, C 'Knowledge acquisition from natural language for expert systems based on classification problem- solving methods' Knowledge Acquisition Vol 2 (1990) pp 107-128

2 Gomez, F and Segami, C 'Classification-based reasoning' IEEE Transactions on Systems, Man and Cybernetics Vol 21 No 3 (1991) pp 644-659

3 Gross, M 'On the failure of generative grammar' Language Vol 55 No 4 (1979) pp 859-883

4 Gomez, F 'WUP: a parser based on word usage' UCF-CS-90-1 Department of Computer Science, University of Central Florida, USA (1990)

5 Moulin, B 'Conceptual-graph approach for the representation of temporal information in discourse' Knowledge-Based Systems Vol 5 No 3 (1993) pp 183-192

6 Carter, D 'Lexical acquisition in the core language engine' CRC- 012 Cambridge Research Center, SRI International, USA, (1989)

7 Ballard, B and Tinkham, N 'A grammatical framework for trans- portable natural language processing' Computational Linguistics Vol 10 No 2 (1984) pp 81-96

8 Bates, M, Moser, M and Stallard, D 'The IRUS transportable natural language database interface' in Evens, M (Ed.) Expert Database Systems Benjamin/Cummings (1986) pp 617-631

9 Grosz, B, Appelt, D, Martin, P and Pereira, F 'TEAM: an exper- iment in the design of transportable natural-language interfaces'

Artificial Intelligence Vol 32 No 2 (1987) pp 173-243 10 Alshawi, A 'Processing dictionary definitions with phrasal pattern

hierarchies' Computational Linguistics Vol 13 No 3-4 (1987) pp 195-202

11 Boguraev, B and Briscoe, T 'Large lexicons for natural language processing: utilizing the grammar coding system of LDOCE' Computational Linguistics Vol 13 No 3-4 (1987) pp 203-218

12 Byrd, R J, Calzolari, N, Chodorow, M S, Klavans, J L and Neff, M S 'Tools and methods for computational linguistics' Computational Linguistics Vol 13 No 3-4 (1987) pp 219-240

13 Calzolari, N 'Lexical databases and textual corpora: perspectives of integration for a lexical knowledge base' in Zernik, U (Ed.) Lexical Acquisition: Exploiting On-Line Resources to Build a Lexicon Lawrence Erlbaum, USA (1991) pp 191-208

14 Velardi, P 'Acquiring a semantic lexicon for natural language processing' in Zernik, U (Ed.) Lexical Acquisition: Exploiting On- Line Resources to Build a Lexicon Lawrence Erlbaum, USA (1991) pp 341-367

15 Zernik, U and Dyer, M 'The self-extending phrasal lexicon' Computational Linguistics Vol 13 No 3-4 (1987) pp 308-327

16 Winston, P H 'Learning structural descriptions from examples' in Winston, P H (Ed.) The Psychology of Computer Vision McGraw-Hill, USA (1975) pp 157-277

17 Naigles, L, Gleitman, H and Gleitman, L R 'Children acquire word meaning components from syntactic evidence' in Dromi, E (Ed.) Language and Cognition: A Developmental Perspective Ablex, USA (1993) pp 104-140

18 Webster, M and Marcus, M 'Automatic acquisition of the lexical semantics of verbs from sentence frames' Proceedings of the Association of Computational Linguistics (1989) pp 177-184

19 Pinker, S Language Learnability and Language Development Harvard University Press, USA (1984)

20 Berwick, R C The Acquisition of Syntactic Knowledge MIT Press, USA (1985)

A P P E N D I X

Sample session with interface

The output of the system is in capital letters. The input by the user is in lower case letters. Explanatory notes to the session are preceded by the expression **REMARKS, and follow the line they are commenting on.

Script started on Tue Jul 19 15:06:35 1994 Allegro CL 4.1 [SPARC; R1] (6/9/92 16:51) Copyright (C) 1985-1992, Franz Inc., Berkeley, CA,

USA. All Rights Reserved. USER(2): (interf) (PLEASE TELL ME IF THE WORD YOU WANT

TO ADD IS A VERB. YES/NO) yes (PLEASE ENTER IN A LIST THE PRESENT

TENSE AND THE SIMPLE PAST) (AND THE PAST PARTICIPLE FORMS OF THE

VERB. E.G. (EAT ATE EATEN)) (give gave given) (PLEASE ENTER A SENTENCE USING THE

SIMPLE PAST. END SENTENCE WITH A PERIOD.)

peter gave mary a book. (DO YOU WANT TO TYPE ANOTHER

SENTENCE USING THE SAME WORD, BUT SHOWING A DIFFERENT USE OF THE WORD? YES/NO)

yes (PLEASE ENTER A SENTENCE USING THE

SIMPLE PAST. END SENTENCE WITH A PERIOD)

198 Knowledge-Based Systems Volume 8 Number 4 August 1995

Page 10: Learning word syntactic subcategorizations interactively

teaming word syntactic subcategodzations interactively: F Gomez

peter gave up cigarretes. (I DO NOT UNDERSTAND * CIGARRETES *) • *REMARKS: A MISSPELLED WORD THAT

RESULTS INTO AN UNKNOWN WORD, WHICH DOES NOT CAUSE ANY PROBLEM.

(DO YOU WANT TO TYPE ANOTHER SENTENCE USING THE SAME WORD.)

(BUT SHOWING A DIFFERENT USE OF THE WORD? YES/NO)

yes (PLEASE ENTER A SENTENCE USING THE

SIMPLE PAST. END SENTENCE WITH PERIOD.)

peter gave books up. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter gave away his fortune. (I DO NOT UNDERSTAND * FORTUNE *) • * REMARKS: ANOTHER UNKNOWN WORD (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE USING THE

SIMPLE PAST. END SENTENCE WITH PERIOD.)

peter gave his money away. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter gave back the money. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter gave the money back. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) the fuel gave out. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter gave off a strong fragrance. (I DO NOT UNDERSTAND • FRAGRANCE ,) (ANOTHER SENTENCE? YES/NO) no (DO YOU WANT TO STORE THE NEW WORD IN

THE FILE USER-LEX? YES/NO)no (DO YOU WANT TO ADD ANOTHER WORD?

YES/NO)no USER (3): (on give)

((((CTGY VERB) (ROOT GIVE) (TENSE PS) (USAGE (((OFF OBJ) (BACK OBJ) (AWAY OBJ) (UP OSJ)

OUT (OBJ (IO UP AWAY BACK ,)))))

(ACTIONS) (((PARTICLE OBJ) (PARTICLE OBJ)

(PARTICLE OBJ) (PARTICLE OBJ) PARTICLE (OBJ (IO PARTICLE PARTICLE

PARTICLE ,)))))))) ** REMARKS: SUBCATEGORIZATION FOR

"GIVE" THAT THE ALGORITHM HAS CONSTRUCTED FROM THE SENTENCES THE USER HAS TYPED.

USER(4): (start) **REMARKS: PARSER IS ACTIVATED I N

ORDER TO CHECK THE SYNTACTIC SUBCATEGORIZATION LEARNED.

(TYPE SENTENCE/DONE) peter gave his house away. (SUBJ VERB + $) --) (PETER GAVE HIS HOUSE

AWAY) (VERB + $) -~ (GAVE HIS HOUSE AWAY) (((OFF OBJ) (BACK OBJ) (AWAY OBJ) (UP OBJ)

OUT (OBJ (IO UP AWAY BACK ,))) + $) -~ (HIS HOUSE AWAY)

((PREP NP PP REL ING-REL ,) (IO UP AWAY BACK ,) + $) ~ (AWAY)

((IO UP AWAY BACK ,) + $) ~ (AWAY) (+ $) ~ NIL ($) ~ NIL (PARSED! WANT TO SEE

STRUCTURES? Y/N)y STRUCTS USED-STRUCTS G7754 (SUBJ ((PN PETER)) VERB ((MAIN-VERB GIVE-

AWAY GAVE-AWAY) (TENSE SP)) OBJ ((ADJ HIS) (NOUN HOUSE)))

** REMARKS: PARSER OUTPUT (TYPE ANY LETTER TO CONTINUE)I (TYPE SENTENCE/DONE) done USER(5): (interf) ** REMARKS: INTERFACE ACTIVATED AGAIN (PLEASE TELL ME IF THE WORD YOU WANT

TO ADD IS A VERB. YES/NO) yes (PLEASE ENTER IN A LIST THE PRESENT

TENSE AND THE SIMPLE PAST) (AND THE PAST PARTICIPLE FORMS OF THE

VERB. E.G. (EAT ATE EATEN)) (think thought thought) (PLEASE ENTER A SENTENCE USING THE

SIMPLE PAST. END SENTENCE WITH PERIOD.)

peter thought that mary ate the apples. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter thought out the problem. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter thought mary ate the apples. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter thought about Rwanda. (I DO NOT UNDERSTAND * RWANDA *) (ANOTHER SENTENCE? YES/NO) no (BESIDES ** (ABOUT) **) (ARE THERE ANY OTHER PREPOSITIONS

WHICH MAY FOLLOW THE WORD) (IF MOST PREPS CAN FOLLOW IT - - WRITE

M O S T - IF ONLY) (THOSE WRITE ONLY - - IF OTHERS WRITE

THOSE PREPS IN A LIST)

Knowledge-Based Systems Volume 8 Number 4 August 1995 199

Page 11: Learning word syntactic subcategorizations interactively

Learning word syntactic subcategorizations interactively: F Gomez

(HELP/MOST/ONLY/LIST CONTAINING OTHER PREPS ?) (of)

USER(6): (on think) ((((CTGY VERB) (ROOT THINK) (TENSE PS)

(USAGE (((OBJ VERB) (OUT OBJ) THAT ABOUT OF)))

(ACTIONS (((OBJ DIFF-SUBJ) (PARTICLE OBJ) (THAT-CLAUSE PREP PREP))))))

**REMARKS: SUBCATEGORIZATION THAT HAS BEEN CONSTRUCTED FOR "THINK."

USER(7): (interface) **REMARKS: INTERFACE ACTIVATED AGAIN (PLEASE TELL ME IF THE WORD YOU WANT

TO ADD IS A VERB. YES/NO) yes . . .

(know knew known) (PLEASE ENTER A SENTENCE USING THE

SIMPLE PAST. END SENTENCE WITH PERIOD.) peter knew mary. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter knew that mary ate the apple. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter knew about the book. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter knew where to study. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE USING THE

SIMPLE PAST. END SENTENCE WITH A PERIOD.)

peter knew where mary ate the apples. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter knew when to open his mouth. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter knew when mary opened the box. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter knew how to eat apples. (ANOTHER SENTENCE? YES/NO) yes (PLEASE ENTER A SENTENCE) peter knew how mary ate the apples. (ANOTHER SENTENCE? YES/NO) n o

(BESIDES ** (ABOUT) **) (ARE THERE ANY OTHER PREPOSITIONS

WHICH MAY FOLLOW THE WORD) (IF MOST PREPS CAN FOLLOW IT - - WRITE

MOST - - IF ONLY)

(THOSE WRITE ONLY - - IF OTHERS WRITE THOSE PREPS IN A LIST)

(HELP/MOST/ONLY/LIST CONTAINING OTHER PREPS ?) (of)

(DO YOU WANT TO ADD ANOTHER WORD? YES/NO)no

USER(8): (on know) ((((CTGY VERB) (ROOT KNOW) (TENSE as)

(USAGE (((HOW (INF (SUBJ VERB +))) (WHEN (INF

(SUBJ VERB +))) (WHERE (INF (SUBJ VERB +))) OBJ THAT

ABOUT OF))) (ACTIONS

((ADVERB-ACT (INF-AFTER-ADV (SUBJ VERB)))

(ADVERB-ACT (INF-AFTER-ADV (SUBJ VERB)))

(ADVERB-ACT (INF-AFTER-ADV (SUBJ VERB))) OBJ THAT-CLAUSE PREP PREP))))))

**REMARKS: SUBCATEGORIZATION FOR "KNOW" BUILT BY THE ALGORITHM FROM THE USER'S SENTENCES.

USER(9): (start) **REMARKS: PARSER ACTIVATED AGAIN. (TYPE SENTENCE/DONE) peter knew when the man killed the cat. (SUBJ VERB + $) ~ (PETER KNEW WHEN THE

MAN KILLED THE CAT) (VERB + $) ~ (KNEW WHEN THE MAN KILLED

THE CAT) (((HOW (INF (SUBJ VERB +))) (WHEN (INF (SUBJ

VERB + ))) (WHERE (INF (SUBJ VERB +))) OBJ THAT

ABOUT OF) + $) ~ (WHEN THE MAN KILLED THE CAT) ((INF (SUBJ VERB +)) + $) ~ (THE MAN KILLED

THE CAT) ((PREP NP PP REL ING-REL ,) VERB + + $)

(KILLED THE CAT) (OBJ + + $) --> (THE CAT) ((PREP NP PP REL ING-REL *) + + $) -~ NIL (+ + $) --~ NIL (+ $) -~ NIL ($) --~ NIL (PARSED! WANT TO SEE

STRUCTURES? Y/N)y STRUCTS USED-STRUCTS G9269 (SUBJ

G9295 (SUBJ

((PN PETER))VERB ((MAIN-VERB KNOW KNEW) (TENSE SP)) OBJ

((WHEN G9295)

((DFART THE) (NOUN MAN)) VERB ((MAIN-VERB KILL KILLED) (TENSE SP))

OBJ (DFART THE) (NOUN CAT))) (TYPE ANY LETTER TO CONTINUE)I (TYPE SENTENCE/DONE) barros 3% script done on THe Jul 19 15:25:03 1994

200 Knowledge-Based Systems Volume 8 Number 4 August 1995