Amalia A Unied Platform for Parsing and Generation z y Evgeniy Gabrilovich and Nissim Francez Shuly Wintner Lab oratory for Computational Linguistics Seminar f ur Sprachwissenschaft Computer Science Department Universitat T ubingen Technion Israel Institute of Technology Kl Wilhelmstr Haifa Israel T ubingen Germany fgabrfrancezgcstechnionac il shulysfsnphilunituebin gen de Abstract mar and a string and parses the string according to the grammar For generation the input is a Contemporary linguistic theories in particular HPSG are declarative in nature they sp ecify semantic formula from which a phrase is gener constraints on p ermissible structures not how ated The earliest HPSG parsers eg Prudian such structures are to b e computed Gram mars designed under such theories are there Pollard Franz were designed in this fore suitable for b oth parsing and generation way A slightly more elab orate technique is the However practical implementations of such the use of some highlevel unicationbased logic pro ories dont usually supp ort bidirectional pro cessing of grammars We present a grammar gramming language eg Prolog or LIFE At development system that includes a compiler of Kaci Podelski for sp ecifying the grammar grammars for parsing and generation to ab Further along this line lies compilation of gram stract machine instructions and an interpreter for the abstract machine language The genera mars directly into Prolog using Prologs internal tion compiler inverts input grammars designed mechanisms for p erforming unication This is for parsing to a form more suitable for genera the implementation technique of eg Prot Er tion The compiled grammars are then executed by the interpreter using one control strategy re bach Systems such as ale Carp enter a gardless of whether the grammar is the original Carp enter Penn also compile grammars into or the inverted version We thus obtain a uni ed ecient platform for developing reversible Prolog However ale compiles grammar descrip grammars tions directly into Prolog co de rather than into a Prolog representation of feature structures At run time ale executes the co de that was com Introduction piled for the rules Parts of the unications re The p opularity of contemporary linguistic for sulting from typeunication are p erformed at malisms such as Lexical Functional Grammar compiletime to increase the eciency of the gen Kaplan Bresnan Categorial Grammar erated co de Haddo ck et al or HeadDriven Phrase In this pap er we advocate a further step along Structure Grammar HPSG Pollard Sag the same sp ectrum We prop ose Amalia an ab and esp ecially their mathematical and formal ma stract machine sp ecically designed for executing turity have led to the development of various ale grammars without relational extensions frameworks applying dierent metho ds for their cmp-lg/9709014 24 Sep 1997 Amalia includes a compiler of input grammars implementation into the abstract machine language and an inter This pap er fo cuses on a computational frame preter for the abstract instructions This imple work in which HPSG grammars can b e devel mentation technique was proved useful for many op ed A wide sp ectrum of implementation tech programming languages most notably Prolog it niques for HPSG exist one extreme is direct in 1 self and as we show b elow it improves the ef terpretation of grammars For parsing this in ciency of parsing with ale grammars consider volves a program that accepts as input a gram ably We emphasize in this pap er the more prac In R Mitkov N Nicolov and N Nikolov eds Pro tical asp ects of the system fo cusing on the in ceedings of Recent Advances in Natural Language Process tegration of parsing and generation as its the ing RANLP pp Tzigov Chark Bulgaria September oretical infrastructure has b een presented else y Supp orted by the Minerva Stip endien Komitee where Wintner Francez Wintner z Supp orted by a grant from the Israeli Ministry of Sci From the p oint of view of grammar engineer ence Programming Languages Induced Computational Linguistics and the Fund for the Promotion of Research 1 Recently such techniques were used for implementing in the Technion We thank an anonymous reviewer for the new programming language Java useful comments ing the abstract machine approach has an ad the WAM that gave the language not only a go o d ditional advantage Amalias compiler incorp o ecient compiler but p erhaps more imp ortantly rates an algorithm based on Samuelsson for an elegant op erational semantics inverting grammars designed for parsing into a The WAM immediately b ecame the starting form more suitable for generation The compiler p oint for many compiler designs for Prolog The then pro duces co de for the inverted grammar us techniques it delineates serve not only for Pro ing exactly the same machine language Thus log prop er but also for constructing compilers the same grammar can b e compiled to two dier for related languages parallel Prolog compilers ent ob ject programs for the two dierent tasks variants of Prolog that use dierent resolution The interpreter executes b oth kinds of programs metho ds extend Prolog with types or with record in the same way only the initialization of the structures etc An additional advantage of ab machines state and the format of the nal re stract machines is that they are a useful to ol in sults dier We thus obtain a uniform platform formally verifying the correctness of compilers for developing grammars serving b oth for parsing Inverting grammars for generation and for generation We discuss the use of abstract machine tech One of the attractions of declarative linguistic niques for compilation in the next section and theories such as HPSG is that a single grammar sketch the algorithm that inverts a grammar for formulated in the theory can b e used b oth for generation in Section Section explains the parsing and for generation While this is true in dual op eration of the abstract machine and Sec theory not many practical implementations of lin tion lists some implementation details guistic formalisms supp ort bidirectional grammar pro cessing Many advantages of bidirectional nat Why abstract machines ural language systems are listed in Strzalkowski where three options for reversibility are con Highlevel programming languages with dynamic sidered pp xiiixxi A grammar is compiled structures have always b een hard to develop com into two separate programs parser and generator pilers for A common technique for overcoming requiring a dierent evaluation strategy The the problems involves the notion of an abstract parser and the generator are separate programs machine It is a machine that on one hand executed using the same evaluation strategy captures the essentials of the highlevel language The parser and the generator are one program in its architecture and instruction set such that and the evaluation strategy can handle it b eing compiling from the source language to the ab run in either direction Our solution falls into the stract machine language b ecomes relatively sim second category there is only one input grammar ple On the other hand the architecture must which is compiled into two dierent abstract ma b e simple enough for the abstract machine lan chine ob ject programs these two programs are guage to b e easily interpretable on common ma executed using exactly the same mechanism the chines This technique also facilitates p ortable interpreter and hence employ the same strategy front ends for compilers as the machine language This guarantees b oth ease of grammar develop is abstract it can b e easily interpreted on dier ment and maintenance and no loss of eciency ent concrete machinesplatforms Grammars are usually oriented towards the Abstract machines were used for various pro analysis of a string and not towards generation cedural and functional languages but they b e from a usually nested semantic form In other came prominent for logical programming lan words rules reect the phrase structure and not guages since the introduction of the Warren Ab the predicateargument structure It is therefore stract Machine WAM Warren AtKaci desirable to transform the grammar in order to for Prolog While Prolog has gained a recogni enable systematic reection of any given logical tion as a practical implementation of the idea of form in the pro ductions To this end we apply programming in logic a metho d for interpreting 2 an inversion pro cedure based up on Samuelsson the declarative logical statements was needed for such an implementation to b e wellfounded Even 2 Samuelssons inversion algorithm was developed for though there were prior attempts to construct denite clause grammars Pereira Warren We p orted it to a typed featurestructure framework b oth interpreters and compilers for Prolog it was grammar is inherently suitable for generation to render the rules with the nested predicate argument structure corresp onding to that of in Grammar inversion is p erformed as part of the put logical forms Once the grammar is inverted compilation The given grammar is enhanced in the generation pro cess can b e directed by the in a way that will ultimately enable to reconstruct put semantic form elements of the input are con the words spanned by the semantic forms To sumed during generation just like words are con achieve this aim each rule constituent is extended sumed during parsing by an additional sp ecialpurp ose feature str in the example grammar The value of this feature Figure depicts a simple example grammar in
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-