A DETERMINISTIC SYNTACTIC-SEMANTIC

2 downloads 0 Views 68KB Size Report
syntactic-semantic integration, and quasi-simulta- ... thing as "the autonomy of syntax" (Marcus); so, we ... Each new interruption makes the structure at the top of ...
A DETERMINISTIC SYNTACTIC-SEMANTIC PARSER

Gerard SABAH, Mohamed RADY

GR22, PARIS V I , 4 Place J u s s i e u , 75230 PARIS CEDEX 5 ABSTRACT We consider t h a t we have made a d e c i s i v e step towards determinism in p a r s i n g . We agree w i t h Winog r a d ' s h e s i t a t i o n t o evaluate the determinism hypot h e s i s as formulated by Marcus. However, t h i s does not make us doubt about the p o s s i b i l i t y of d e t e r m i nism; on the c o n t r a r y , we examined not o n l y how to improve over Marcus, but also the h i s t o r i c a l reasons of the non-dete r minism of most systems. Our improvements are based on two p r i n c i p l e s : s y n t a c t i c - s e m a n t i c i n t e g r a t i o n , and q u a s i - s i m u l t a ,ieousness. The f i r s t means t h a t there is no such t h i n g as " t h e autonomy of s y n t a x " (Marcus); so, we agree w i t h Schank and, f u r t h e r , we showed t h a t local semantic a m b i g u i t i e s could be solved d e t e r m i n i s t i c a l l y (Marcus (ch.10) claims t h a t these a m b i g u i t i e s need p a r a l l e l p r o c e s s i n g ) . The second p e r m i t s the processing o f s t r u c t u r e s too d i f f i c u l t f o r PARSIFAL e . g . l o c a l l y ambiguous PP attachments. D e t a i l e d examples support our p r o p o s a l s . I

POSSIBLE FACTORS OF NON-DETERMINISM

With the n o t a b l e exception of Marcus, already mentioned , most "parser makers" seem to agree on having a n o n - d e t e r m i n i s t i c s t r a t e g y ( b a c k t r a c k i n g or p a r a l l e l i s m ) . Schank ( e t a l . ) have always perceived the inadequacy of those s t r a t e g i e s , and practised the i n t e g r a t i o n of syntax and semantics, but they have conserved a top-down approach ( ' p r e d i c t i o n ' cf Wilks) We shall try to show the importance of 4 factors of nondeterminism which are not related to NL ambiguity: the architecture of systems, r u l e s and i n t e r p r e t e r , stack mecanism, word by word p r o c e s s i n g . A.

A r c h i t e c t u r e of systems Decision elements f o r a parser are of 4 k i n d s : morphosyntactic, semantic, pragmatic and c o n t e x t u a l . So, i t i s obvious t h a t c o n s i d e r i n g only one o f them b r i n g s about non-determinism, independently of NL. i t s e l f . However, even when a system uses a l l of t h i s i n f o r m a t i o n , non-determinism may appear due to an a r t i f i c i a l s e p a r a t i o n between modules (eg s y n t a c t i c & s e m a n t i c ) . Some non-determinism remains even in the most sophisticated modular systems and t h a t ' s because: -one module is dominating the others (as in SHRDLU) - t o o many i n t e r a c t i o n p o i n t s e x i s t - t h e n o n - d e t . may f i n d refuge in one of the modules (as in PARSIFAL, the semantic o n e ) . B.

Representation f o r a grammar and i n t e r p r e t o r

The i n t e r p r e t e r has u s u a l l y e i t h e r a top-down or a bottom-up s t r a t e g y , but most f r e q u e n t l y top-down.

But a r e l a t i v e c l a u s e , f o r i n s t a n c e , should r a t h e r be parsed bottom-up, in order to be attached d e t e r m i n i s t i c a l l y . In t h e o r y , the Marcus parser seems to permit t h i s strategy ( " a t t e n t i o n s h i f t i n g r u l e s " ) . But the grammar Marcus a c t u a l l y wrote does not take advantage o f t h i s f a c i l i t y \nd r e l a t i v e clauses are a l s o parsed top-down. From h i s t h e o r e t i c a l work , we s t i l l have the c o n f i r m a t i o n o f f o l l o w i n g p o i n t : A completely top-down or completely bottom-up mecanism must parse non d e t e r m i n i s t i c a l l y some s e n tences t h a t would not g i v e the same t r o u b l e to a mixed s t r a t e g y . ( I n the f i e l d o f programming languages, such a mixed s t r a t e g y has already been a p p l i e d , Earley) Now, another i m p o r t a n t p o i n t : in a t r a d i t i o n a l d e c l a r a t i v e system (ATN or PSG), the r u l e s are i n d e pendent of the i n t e r p r e t e r . So, when a c o n f l i c t arises between two v a l i d r u l e s , i t i s not p o s s i b l e f o r the i n t e r p r e t e r to make a d e c i s i o n . Hence,one has to l i m i t the r o l e of the i n t e r p r e t e r and the r u l e s must be non ambiguous ( t h e i r c o n d i t i o n p a r t being as det a i l e d as p o s s i b l e ) . C.

The stack

One e s s e n t i a l step in NL processing is to gene r a t e from a t e x t a s o - c a l l e d meaning r e p r e s e n t a t i o n . Concretely, t h i s representation is an interconnected graph o f i n t e r n a l s t r u c t u r e s , b u i l t step b y s t e p . At a c e r t a i n s t e p , processing may be i n t e r r u p t e d in order to s t a r t working on some o t h e r s t r u c t u r e . This makes necessary to s t o r e a t r a c e of the i n t e r r u p t e d s t r u c t u r e . In g e n e r a l , t h i s is done by means of a stack. Each new i n t e r r u p t i o n makes the s t r u c t u r e at the top of the stack i n a c c e s s i b l e . This i m p l i e s two c r u c i a l problems: when to s t a r t b u i l d i n g a c e r t a i n s t r u c t u r e , and t h e n , how does one know it is f i n i s h e d . A c o m p l i c a t i o n may appear when a c e r t a i n word f u n c t i o n s as a s t a r t e r f o r s e v e r a l s t r u c t u r e s . Without e l a b o r a t i n g on t h i s problem, we can say it has to do w i t h top-down or bottom-up i n t e r p r e t a t i o n of the r u l e s . Even harder is the d e c i s i o n of ending a s t r u c t u r e : take the ambiguous sentence "I saw the man w i t h a t e l e s c o p e " . The d i f f i c u l t y comes from having t o decide e i t h e r t o end the d i r e c t o b j e c t a f t e r 'man' or to continue it by a NP m o d i f i e r . That proves a c e r t a i n inadequacy of the stack mecanism. One c o u l d t h i n k of a l i s t i n s t e a d of a s t a c k , i n order t o solve t h i s problem ( c f Schank); however, when t h e r e are s e v e r a l modifiers in succession, attachment becomes so complicated t h a t t h i s necessary improvement is by no m e a n s a u f f i c i e n t : it seems

708 G. Sabah and M. Rady

necessary to make use of a quasi-simultaneous mecanism l i k e ours ( c f § I I - C ) . D.

Word by word processing

Most parsers " r e a d " one word at a t i m e , i n t e g r a t i n g i t i n t o a r e p r e s e n t a t i o n before any process i n g of the next word. This s t r a t e g y could be termed " h i e et nunc" and opposed to the famous " w a i t and see" s t r a t e g y . The obvious advantage of the second one is t h a t the parser may delay a d i f f i c u l t d e c i s i o n u n t i l i t becomes e a s i e r . I n p a r t i c u l a r , many p o t e n t i a l a m b i g u i t i e s disappear as soon as what canes next is known. E. The design of our parser w i l l r e s u l t from the s o l u t i o n of the f o u r above problems: - I n t e g r a t i o n of syntax and semantics -Top-down and bottom-up r u l e s -Quasi simultaneous e l a b o r a t i o n of s t r u c t u r e s -Look ahead f a c i l i t y . II A.

ORIGINAL FEATURES OF THE PARSER

Formal r u l e s

The f i n a l aim of our parser is to generate a semantic r e p r e s e n t a t i o n . But, it also generate a p r o v i s i o n a l s y n t a c t i c r e p r e s e n t a t i o n based on s y s temic grammars ( H a l l i d a y ) , in order to have r e f e r e n ce e i t h e r to semantic or s y n t a c t i c i n f o r m a t i o n when i t s own f u n c t i o n i n g makes it necessary. The " c o n d i t i o n p a r t " of a r u l e considers s y n t a c t i c and semantic f e a t u r e s of the c u r r e n t structure but also of whatever comes n e x t , words or s t r u c t u r e s . The " a c t i o n p a r t " can do several t h i n g s : -generate and develop a s y n t a c t i c s t r u c t u r e -develop a semantic d e s c r i p t i o n of a syntactic s t r u c t u r e - a t t a c h a s t r u c t u r e to another - d e t a c h or resume a s t r u c t u r e - a c t i v a t e o r d e a c t i v a t e other r u l e s ( " m e t a - a c t i o n s " ) Both the a c t i o n s and the c o n d i t i o n s a l l o w a f u s i o n of syntax and semantics,and may c a l l domain s p e c i f i c procedures (eg f o r i n f e r e n c e s , . . . ) . The r u l e s are arranged in o v e r l a p p i n g packets. Each packet corresponds to a w e l l defined kind of situation (top-down d e f i n i t i o n ) . I n t e r r u p t i o n r u l e s ( § I I - B 2 ) a l l o w a bottom-up mecanlsm. Take a r u l e a c t i v a t e d by ' t o c u r e ' , f o r example IF .the verb is f o l l o w e d by a NP & . t h e semantic description (SD.) of t h i s NP is compatible w i t h the desc r i p t i o n o f the ' o b j e c t i v e ' case o f the verb THEN . a t t a c h NP to verb as d i r e c t o b j e c t & . a t t a c h SD of NP to SD of verb w i t h l a b e l ' o b j e c t i v e ' . This r u l e is OK f o r " t h e doctor cures the f l u " , but does not apply f o r " t h e doctor cures my daughter". Such cases are to be t r e a t e d by a r u l e s i m i l a r to the preceding one, r e p l a c i n g ' o b j e c t i v e ' by ' d a t i v e ' . In an ambiguous case l i k e " t h e doctor cures i t " the two r u l e s by themselves do not r e s o l v e the semant i c problem a t t h i s l e v e l , b u t , having t r i e d them, we may f i n d t h a t the search f o r the antecedent of ' it' i s made e a s i e r : i t i s p o s s i b l e t o s t a r t i n f e rences from the c o n d i t i o n s of these non a p p l i e d rules.

B.

Look ahead

This n o t i o n is w e l l known to people who w r i t e compilers ( c f Ako & Ullman quoted by Marcus). Marcus was the f i r s t to apply it to the syntax of NL and we t r i e d to go over to semantics. M a t e r i a l l y , look ahead means t h a t the parser has a c e r t a i n f i e l d o f v i s i o n , i n c l u d i n g the c u r r e n t s t r u c t u r e and the three next ones, which may be non t e r m i n a l (3 is an experimental c h o i c e , cf Marcus f o r the n e c e s s i t y of a l i m i t a t i o n ) . 1.

Look ahead and semantic ambiguity

To show the connection between look ahead and choice of a meaning r e p r e s e n t a t i o n , l e t us consider the two sentences: "John makes a program in Simula" and "John makes a program c o n s c i o u s " . Each sentence corresponds to a d i f f e r e n t mean i n g of ' t o make1 and it is necessary to know what comes a f t e r the f i r s t s y n t a c t i c o b j e c t t o r e s o l v e the ambiguity. So, t h i s p a r t of the sentence should be processed before choosing a meaning f o r the v e r b . The look ahead f a c i l i t y permits to examine s i m u l t a neously the 1st and 2nd complements. Looking at t h i s l a t t e r , one can decide between 'makel' and 'make2' and c o r r e c t l y a t t a c h the semantic s t r u c t u r e s . In case of t r u l y ambiguous sentences, what remains arc s y n t a c t i c and semantic preference h e u r i s t i c s . 2.

Interruption rules

We want to make it. p o s s i b l e f o r a s t r u c t u r e to w a i t completion of another one and resume t h e n . If SO, S I , S2, S3 are the viewed s t r u c t u r e s (the c u r r e n t one plus the 3 in the f i e l d of v i s i o n ) and Rl the r u l e : IF SI is a NP & S2 an a d j e c t i v e & S3 a PP, THEN . . . ; and, i f t h i s r u l e being a c t i v e the f i e l d of vision i s : S0=(VP(...(Verb:MAKE))) , S I - ( A r t i c l e : A ) S2=,( Noun: PROGRAM) , S3=(Adjective:CONSCIOUS) t h e n , i t i s v i s i b l e t h a t R l does not a p p l y , f o r S I is not a NP. So, the NP and PP have to be generated f i r s t . This w i l l be done by means o f : R2: IF s e r t it R3: IF s e r t it

SI begins a NP THEN generate a new PP & i n before SI & a c t i v a t e NP r u l e s . S3* begins a PP THEN generate a new PP & i n before S3 & a c t i v a t e PP r u l e s .

R2 and R3 must be a c t i v e at the time as R l . There is no need to order them since the c o n d i t i o n s in Rl w i l l be s a t i s f i e d only a f t e r R2 and R3 are a p p l i e d . When they apply, they i n t e r r u p t the development of the a c t i v e s t r u c t u r e by c r e a t i n g the NP and PP, and a c t i v a t i n g corresponding r u l e s . Once the NP and PP are detached, the i n t e r p r e t e r goes back to SI and applies Rl C. Quasi simultaneous execution This i s another o r i g i n a l f e a t u r e o f our p a r s e r . As we have shown, the stack mecanism does not permit the c o r r e c t r e c o g n i t i o n of the end of a c o n s t i t u e n t * These r u l e s have a v a r i a b l e ($) in t h i s place: then it a p p l i e s e i t h e r if SI or S2 or S3 matches the cond i t i o n p a r t ( c f ). This seems an improvement on the "attention s h i f t i n g r u l e s " developped by Marcus. ** I n s p i r e d by SIMULA

G. Sabah and M. Rady

"Quasi simultaneous" generation brings a new s o l u t i o n to t h i s problem: a developping s t r u c t u r e can be detached as soon as p o s s i b l e and elaborated l a t t e r i f i t i s needed. This makes p o s s i b l e more i n t e l l i g e n t choices i n the s i t u a t i o n o f complex a t t a c h ment mentioned above: when a t t a c h i n g a new s t r u c t u r e , the parser may consider a l l the p r e v i o u s l y detached ones. Two operations are i n v o l v e d : detach and resume. They are to be performed in f o l l o w i n g cases: 1) Creating a new s t r u c t u r e ; means detaching the c u r r e n t one before a c t i v a t i n g the new one. 2) End the c u r r e n t s t r u c t u r e , which is then detached; the previous one being resumed. 3) E x p l i c i t detach i n s t r u c t i o n in a r u l e , implying t h a t the l a s t detached s t r u c t u r e is resumed. A) S i m i l a r l y , e x p l i c i t resume i n s t r u c t i o n in a r u l e .

709

A LISP v e r s i o n is being considered. The present conceptual r e p r e s e n t a t i o n permits to consider synonymy, homonymy and s e l e c t i o n r e s t r i c t i o n s . Moreover, in a p e r s p e c t i v e of i n t e g r a t i o n of the domain knowledge to l i n g u i s t i c competence, t h i s r e p r e s e n t a t i o n (or a more f r a m e - l i k e one) w i l l make p o s s i b l e not only these tasks but also more s o p h i s t i c a t e d and u s e f u l i n f e r e n c e s . The program is already able to process the French forms of every example mentioned in the t e x t , and we hope to make it usable to other r e search teams in the next f u t u r e .

Let us have some examples: " l e cahier de l ' e t u d i a n t c que Jean a examine." ("The note book of the g i r l t h a t John e x a m i n e d - ' i t ' . " ) ( I n French, the verb has a mark p e r m i t t i n g to d i s t i n g u i s h between "examined i t " , the note book and "examined h e r " , t h e g i r l ) We see t h a t : .a d e t e r m i n i s t i c processing of the r e l a t i v e clause needs to wait f o r i t s attachment u n t i l one has t r e a t e d the verb, which has a gender mark capable of i n d i c a t i n g the c o r r e c t attachment. ."To examine" has several meanings depending on what is examined. The choice of a c e r t a i n meaning needs a r e c o g n i t i o n o f the a c t u a l o b j e c t o f examine, t h a t i s equivalent, to the attachment of the r e l a t i v e c l a u s e . Here we have a couple of c o n t r a d i c t o r y requirements. Let. us d e t a i l how a quasi simultaneous t r e a t ment can get. us out of t h i s predicament. When the verb of the r e l a t i v e clause is s e e n , c e r t a i n s y n t a c t i c and semantic i'eatures of i t s o b j e c t can be recognised; the parser then detaches the r e l a t i v e clause and resume the l a s t seen NP, here, " t h e g i r l " . There is no match w i t h the ' i t ' mark, so the r e l a t i v e clause cannot, modify ' g i r l ' . This NP is then t e r m i nated, and, the NP corresponding to 'note book' is resumed. This t i m e , the r e l a t i v e clause is accepted as a m o d i f i e r and can i t s e l f be resumed in order to solve the ambiguity in 'examine'. We can also give examples of PP attachment: "John puts the wine on the t a b l e . " "John d r i n k s the wine on the t a b l e . " As soon as the noun 'the wine' has appeared, the NP can be detached, p e r m i t t i n g the PP 'on the t a b l e ' to be s t a r t e d . When c o n s i d e r i n g p o s s i b l e a t tachments f o r t h i s PP, the r u l e s allow to take i n t o account the features of the v e r b . The d i f f e r e n c e s between ' p u t ' and ' d r i n k ' exp l a i n s t h a t it is p o s s i b l e to a t t a c h the PP to the verb in one case and to the NP in the second case. CONCLUSION A f t e r examining the main f a c t o r s of n o n - d e t e r minism in p a r s e r s , we t r i e d to solve the corresponding problems. A c t u a l experimentation confirms the i n t e r e s t of such an approach. We made a SIMULA p r o gram of about 3000 i n s t r u c t i o n s which parses sentences of about 10 words in 2 seconds on a PDP10 (using an approximate t o t a l of 100 K c o r e ) .

REFERENCES (1)

Ako, A. & Ullmann,"The theory of p a r s i n g , trans l a t i o n and c o m p i l i n g " Vol.] P r e n t i c e - h a l l 1972 .

(2)

F i l l m o r e , C.J. "The case f o r case" in Bach and Harms, Universals i n l i n g u i s t i c t h e o r y . H o l t , Rinehart & Winston, 1968.

(3)

H a l l i d a y , M. "System and f u n c t i o n in language" G.Kress, Oxford Un.press, 1976.

(4)

Marcus, M.P. "A theory of s y n t a c t i c r e c o g n i t i o n f o r n a t u r a l language", MIT press, 1980.

(5)

Riesbeck,C. & R. Schank "comprehension by comp u t e r : expectation-based a n a l y s i s of sentences in c o n t e x t " , Yale U n i v e r s i t y , 1976.

(6)

R u s t i n , R. " N a t u r a l languge processing" A l g o r i t h m i c press, 1973.

(7)

Sager, N. "Natural language i n f o r m a t i o n process i n g , a computer grammar of English and i t s app l i c a t i o n " , Addison-Wesley, 1981.

(8)

Winograd, T. "Understanding n a t u r a l language" Academic press, New York, 1972.

(9)

Winograd, T. "Language as a c o g n i t i v e process" V o l . 1 , Addison-Wesley, 1982.

(10) W i l k s , Y. "computational semantics: an i n t r o d u c t i o n to a r t i f i c i a l i n t e l l i g e n c e and NL comp r e h e n s i o n " , North H o l l a n d , 1976. (11) Woods, W.A. "An experimental p a r s i n g system f o r TN grammars" in ( 6 ) , 1973. (12) E a r l e y , J. "An e f f i c i e n t c o n t e x t - f r e e p a r s i n g a l g o r i t h m " , CACM 6 : 8 , 1970. (13)

Rady, M. "L' ambiguite" du LN e s t - e l l e la source du non determinisme des procedures de t r a i t e ment" These d ' e t a t , PARIS V I , 1983.