File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/intro/99/e99-1022_intro.xml
Size: 11,837 bytes
Last Modified: 2025-10-06 14:06:49
<?xml version="1.0" standalone="yes"?> <Paper uid="E99-1022"> <Title>Selective Magic HPSG Parsing</Title> <Section position="2" start_page="0" end_page="167" type="intro"> <SectionTitle> 1 Introduction </SectionTitle> <Paragraph position="0"> In case of large grammars the space requirements of dynamic parsing often outweigh the benefit of not duplicating sub-computations. We propose a parser that avoids this drawback through combining the advantages of dynamic bottom-up and advanced top-down control. 1 The underlying idea is to achieve faster parsing by avoiding tabling on sub-computations which are not expensive. The so-called selective magic parser allows the user to apply magic compilation to specific constraints in a grammar which as a result can be processed dynamically in a bottom-up and goal-directed fashion. State of the art top-down processing techniques are used to deal with the remaining constraints. null Magic is a compilation technique originally developed for goal-directed bottom-up processing of logic programs. See, among others, (Ramakrishnan et al. 1992). As shown in (Minnen, 1996) *The presented research was carried out at the University of Tfibingen, Germany, as part of the Sonderforschungsbereich 340.</Paragraph> <Paragraph position="1"> 1A more detailed discussion of various aspects of the proposed parser can be found in (Minnen, 1998).</Paragraph> <Paragraph position="2"> magic is an interesting technique with respect to natural language processing as it incorporates filtering into the logic underlying the grammar and enables elegant control independent filtering improvements. In this paper we investigate the selective application of magic to typed feature grammars a type of constraint-logic grammar based on Typed Feature Logic (TgvPS:; GStz, 1995). Typed feature grammars can be used as the basis for implementations of Head-driven Phrase Structure Grammar (HPSG; Pollard and Sag, 1994) as discussed in (GStz and Meurers, 1997a) and (Meurers and Minnen, 1997). Typed feature grammar constraints that are inexpensive to resolve are dealt with using the top-down interpreter of the ConTroll grammar development system (GStz and Meurers, 1997b) which uses an advanced search function, an advanced selection function and incorporates a coroutining mechanism which supports delayed interpretation.</Paragraph> <Paragraph position="3"> The proposed parser is related to the so-called Lemma Table deduction system (Johnson and DSrre, 1995) which allows the user to specify whether top-down sub-computations are to be tabled. In contrast to Johnson and DSrre's deduction system, though, the selective magic parsing approach combines top-down and bottom-up control strategies. As such it resembles the parser of the grammar development system Attribute Language Engine (ALE) of (Carpenter and Penn, 1994). Unlike the ALE parser, though, the selective magic parser does not presuppose a phrase structure backbone and is more flexible as to which sub-computations are tabled/filtered.</Paragraph> <Section position="1" start_page="0" end_page="165" type="sub_section"> <SectionTitle> Bottom-up Interpretation of Magic-compiled Typed Feature Grammars </SectionTitle> <Paragraph position="0"> We describe typed feature grammars and discuss their use in implementing HPSG grammars. Subsequently we present magic compilation of typed feature grammars on the basis of an example and introduce a dynamic bottom-up interpreter that can be used for goM-directed interpretation of magic-compiled typed feature grammars.</Paragraph> </Section> <Section position="2" start_page="165" end_page="165" type="sub_section"> <SectionTitle> 2.1 Typed Feature Grammars </SectionTitle> <Paragraph position="0"> A typed feature grammar consists of a signature and a set of definite clauses over the constraint language of equations ofTYPS (GStz, 1995) terms (HShfeld and Smolka, 1988) which we will refer to as Torz: definite clauses. Equations over TJrPS terms can be solved using (graph) unification provided they are in normal form. (GStz, 1994) describes a normal form for ir~rPS terms, where typed feature structures are interpreted as satisfiable normal form T~rPS: terms. 2 The signature consists of a type hierarchy and a set of appropriateness conditions.</Paragraph> <Paragraph position="1"> Example 1 The signature specified in figure 1 and 2 and the T~rPS: definite clauses in figure 3 constitute an example of a typed feature grammar. We write T~rPS terms in normal form, i. e., as typed feature structures. In addition, uninformative feature specifications are ignored and typing is left implicit when immaterial to the example at hand. Equations between typed feature structures are removed by simple substitution or tags indicating structure sharing. Notice that we also use non-numerical tags such as ~ and ~. In general all boxed items indicate structure sharing.</Paragraph> <Paragraph position="2"> For expository reasons we represent the ARGn features of the append relation as separate arguments. null Typed feature grammars can be used as the basis for implementations of Head-driven Phrase Structure Grammar (Pollard and Sag, 1994). 3 (Meurers and Minnen, 1997) propose a compilation of lexical rules into T~r/: definite clauses 2This view of typed feature structures differs from the perspective on typed feature structures as modehng partial information as in (Carpenter, 1992). Typed feature structures as normal form ir~'~E terms are merely syntactic objects.</Paragraph> <Paragraph position="3"> aSee (King, 1994) for a discussion of the appropriateness of T~-PS: for HPSG and a comparison with other feature logic approaches designed for HPSG.</Paragraph> <Paragraph position="4"> which are used to restrict lexical entries. (GStz and Meurers, 1997b) describe a method for compiling implicational constraints into typed feature grammars and interleaving them with relational constraints. 4 Because of space limitations we have to refrain from an example. The ConTroll grammar development system as described in (GStz and Meurers, 1997b) implements the above mentioned techniques for compiling an HPSG theory into typed feature grammars.</Paragraph> </Section> <Section position="3" start_page="165" end_page="166" type="sub_section"> <SectionTitle> 2.2 Magic Compilation </SectionTitle> <Paragraph position="0"> Magic is a compilation technique for goal-directed bottom-up processing of logic programs. See, among others, (Ramakrishnan et al. 1992). Because magic compilation does not refer to the specific constraint language adopted, its application is not limited to logic programs/grammars: It can be applied to relational extensions of other constraint languages such as typed feature grammars without further adaptions.</Paragraph> <Paragraph position="1"> Due to space limitations we discuss magic compilation by example only. The interested reader is referred to (Nilsson and Maluszynski, 1995) for an introduction.</Paragraph> <Paragraph position="2"> Example 2 We illustrate magic compilation of typed feature grammars with respect to definite 4 (GStz, 1995) proves that this compilation method is sound in the general case and defines the large class of type constraints for which it is complete.</Paragraph> <Paragraph position="4"> mary / / relation / liY~st elist /gr ~ r /~ nelistk~ &quot;st\[ th+d-sing mary If sleep~_LIBJ sem--\] s np v Figure h Example of a typed feature grammar signature (part 1) clause 1 in figure 3. Consider the TJ:PS definite clause in figure 4. As a result of magic compi-</Paragraph> <Paragraph position="6"> ure 3 lation a magic literal is added to the right-hand side of the original definite clause. Intuitively understood, this magic literal &quot;guards&quot; the application of the definite clause. The clause is applied only when there exists a fact that unifies with this magic literal) The resulting definite clause is also referred to as the magic variant of the original definite clause.</Paragraph> <Paragraph position="7"> The definite clause in figure 5 is the so-called seed which is used to make the bindings as provided by the initial goal available for bottom-up processing. In this case the seed corresponds to the initial goal of parsing the string 'mary sleeps'. Intuitively understood, the seed makes available the bindings of the initial goal to the magic vari-SA fact can be a unit clause, i. e., a TJrPS definite clause without right-hand side literals, from the grammar or derived using the rules in the grammar. In the latter case one also speaks of a passive edge.</Paragraph> <Paragraph position="9"> parsing the string 'mary sleeps' ants of the definite clauses defining a particular initial goal; in this case the magic variant of the definite clause defining a constituent of category 's'. Only when their magic literal unifies with the seed are these clauses applied. 6 The so-cMled magic rules in figure 6 are derived in order to be able to use the bindings provided by the seed to derive new facts that provide the bindings which allow for a goal-directed application of the definite clauses in the grammar not directly defining the initial goal. Definite clause 3, for example, can be used to derive a magic_append fact which percolates the relevant bindings of the seed/initial goal to restrict the application of the magic variant of definite clauses 4 and 5 in figure 3 (which are not displayed).</Paragraph> </Section> <Section position="4" start_page="166" end_page="167" type="sub_section"> <SectionTitle> 2.3 Semi-naive Bottom-up Interpretation </SectionTitle> <Paragraph position="0"> Magic-compiled logic programs/grammars can be interpreted in a bottom-up fashion without losing any of the goal-directedness normally associated with top-down interpretation using a so-called semi-naive bottom-up interpreter: A dynamic interpreter that tables only complete intermediate results, i. e., facts or passive edges, and uses an agenda to avoid redundant sub-computations.</Paragraph> <Paragraph position="1"> The Prolog predicates in figure 7 implement a ~The creation of the seed can be postponed until run time, such that the grammar does not need to be compiled for every possible initial goal.</Paragraph> <Paragraph position="2"> magic compilation to definite clause 1 in figure 3 semi-naive bottom-up interpreter. 7 In this interpreter both the table and the agenda are represented using lists, s The agenda keeps track of the facts that have not yet been used to update the table. It is important to notice that in order to use the interpreter for typed feature grammars it has to be adapted to perform graph unification. 9 We refrain from making the necessary adaptions to the code for expository reasons.</Paragraph> <Paragraph position="3"> The table is initialized with the facts from the grammar. Facts are combined using a operation called match. The match operation unifies all but one of the right-hand side literals of a definite clause in the grammar with facts in the table. The 7Definite clauses serving as data are encoded using the predicate definite_clause/l: definite_clause((Lhs :-B/Is))., where Khs is a (possibly empty) list of literals.</Paragraph> <Paragraph position="4"> SThere are various other--more efficient--ways to implement a dynamic control strategy in Prolog. See, for example, (Shieber et el., 1995).</Paragraph> <Paragraph position="5"> 9A term encoding of typed feature structures would enable the use of term unification instead. See, for example, (Gerdemann, 1995).</Paragraph> <Paragraph position="6"> remaining right-hand side literal is unified with a newly derived fact, i. e., a fact from the agenda. By doing this, repeated derivation of facts from the same earlier derived facts is avoided.</Paragraph> </Section> </Section> class="xml-element"></Paper>