File Information

File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/88/p88-1031_metho.xml

Size: 14,408 bytes

Last Modified: 2025-10-06 14:12:14

<?xml version="1.0" standalone="yes"?>
<Paper uid="P88-1031">
  <Title>Graph-structured Stack and Natural Language Parsing</Title>
  <Section position="3" start_page="0" end_page="249" type="metho">
    <SectionTitle>
2. The Graph-structured Stack
</SectionTitle>
    <Paragraph position="0"> In this section, we describe three key notions of the graph-structured stack: splitting, combining and local ambiguity packing.</Paragraph>
    <Paragraph position="1"> * 2.1. SpUttlng When a stack must be reduced (or popped) in more than one way, the top of the stack is split. Suppose that the stack is in the following state. The left-most element, A, is the bottom of the stack, and the right-most element, E, is the top of the stack. In a graph-structured stack, there can be more than one top, whereas there can be only one bottom.</Paragraph>
    <Paragraph position="2"> #,--- n --- C --- D --- Z Suppose that the stack must be reduced in the following three different ways.</Paragraph>
    <Paragraph position="4"> Then after the three reduce actions, the stack looks</Paragraph>
    <Section position="1" start_page="249" end_page="249" type="sub_section">
      <SectionTitle>
2.2. Combining
</SectionTitle>
      <Paragraph position="0"> When an element needs to be shifted (pushed) onto two or more tops of the stack, it is done only once by combining the tops of the stack. For example, if &amp;quot;1&amp;quot; is to be shifted to F, G and H in the above example, then the stack will look like:</Paragraph>
      <Paragraph position="2"/>
    </Section>
    <Section position="2" start_page="249" end_page="249" type="sub_section">
      <SectionTitle>
2.3. Local Ambiguity Packing
</SectionTitle>
      <Paragraph position="0"> If two or more branches of the stack turned out to be Identical, then they represent local ambiguity; the Identical state of stack has been obtained in two or more different ways. They are merged and treated as a single branch. Suppose we have two rules:</Paragraph>
      <Paragraph position="2"> After applying these two rules to the example above, the stack will look like: A---a .... c---o \ \ \-- x --- z The branch of the stack, &amp;quot;A-B-C-J', has been obtained in two ways, but they are merged and only one is shown in the stack.</Paragraph>
    </Section>
  </Section>
  <Section position="4" start_page="249" end_page="251" type="metho">
    <SectionTitle>
3. Graph-structured Stack and
</SectionTitle>
    <Paragraph position="0"/>
    <Section position="1" start_page="249" end_page="251" type="sub_section">
      <SectionTitle>
Shift-reduce LR Parsing
</SectionTitle>
      <Paragraph position="0"> In shift-reduce parsing, an input sentence is parsed from left to dght. The parser has a stack, and there are two basic operations (actions) on the stack: shift and reduce. The shift action pushes the next word in the input sentence onto the top of the stack. The reduce action reduces top elements of the stack according to a context-free phrase structure rule in the grammar.</Paragraph>
      <Paragraph position="1"> One of the most efficient shift-reduce parsing algorithms is LR parsing. The LR parsing algodthm pre-compiles a grammar into a parsing table; at run time, shift and reduce actions operating on the stack are deterministically guided by the parsing table. No backtracking or search is involved, and the algodthm runs in linear time. This standard LR parsing algorithm, however, can deal with only a small subset of context-free grammars called LR grammars, which are often sufficient for programming languages but cleady not for natural languages. If, for example, a grammar is ambiguous, then its LR table would have multiple entries, and hence deterministic parsing would no longer be possible.</Paragraph>
      <Paragraph position="2"> Figures 3-1 and 3-2 show an example of a non-LR grammar and its LR table. Grammar symbols starting with &amp;quot; represent pre-terminals. Entdes &amp;quot;sh n&amp;quot; in the actton table (the left part of the table) Indicate that the action is to &amp;quot;shift one word from input buffer onto the stack, and go to state n'. Entries &amp;quot;re n&amp;quot; Indicate that the action is to &amp;quot;reduce constituents on the stack using rule n'. The entry &amp;quot;acc&amp;quot; stands for the action &amp;quot;accept', and blank spaces represent &amp;quot;error'. The goto table (the dght part of the table) decides to which state the parser .should go after a reduce action. The LR parsing algorithm pushes state numbers (as well as constituents) onto the stack; the state number on the top of the stack Indicates the current state. The exact definition and operation of the LR parser can be found in Aho and UIIman \[3\].</Paragraph>
      <Paragraph position="3"> We can see that there are two multiple entries in the action table; on the rows of state 11 and 12 at the column labeled &amp;quot;prep'. Roughly speaking, this is the situation where the parser encounters a preposition of a PP right after a NP. If this PP does not modify the NP, then the parser can go ahead to reduce the NP to a higher nonterminal such as PP or VP, using rule 6 or 7, respectively (re6 and re7 in the multiple entries). If, on the other hand, the PP does modify the NP, then  (1) S --&gt; NP VP (2) S --&gt; S PP (3) NP --&gt; *n (4) NP --&gt; *det *n (5) NP --&gt; NP PP (6) PP --&gt; *prep NP (7) VP --&gt; *v NP</Paragraph>
      <Paragraph position="5"/>
      <Paragraph position="7"> Figure 3-2: LR Parsing Table with Multiple Entries (dedved from the grammar in fig 3-1) .</Paragraph>
      <Paragraph position="9"> \ ..... s .... I .... \-. I \ ~-e ......... I I \ I \-,--. .... ~re .............. 6 I Flgure 3-3: A Graph-structured Stack  the parser must wait (sh6) until the PP is completed so it can build a higher NP using rule 5. With a graph-structured stack, these non-deterministic phenomena can be handled efficiently in polynomial time. Figure 3-3 shows the graph-structured stack right after shifting the word &amp;quot;with&amp;quot; in the sentence &amp;quot;1 saw a man on the bed in the apartment with a telescope.&amp;quot; Further description of the generalized LR parsing algorithm may be found in Tomita \[7, 8\].</Paragraph>
    </Section>
  </Section>
  <Section position="5" start_page="251" end_page="251" type="metho">
    <SectionTitle>
4. Graph-structured Stack and ATN
</SectionTitle>
    <Paragraph position="0"> An ATN parser employs a stack for saving local registers and a state number when it visits a subnetwork recursively. In general, an ATN is nondeterministic, and the graph-structured stack is viable as may be seen in the following example.</Paragraph>
    <Paragraph position="1"> Consider the simple ATN, shown in figure 4-1, for the sentence &amp;quot;1 saw a man with a telescope.&amp;quot; After parsing &amp;quot;1 saw&amp;quot;, the parser is in state $3 and about to visit the NP subnetwork, pushing the current environment (the current state symbol and all registers) onto the stack. After parsing &amp;quot;a man', the stack is as shown in figure 4-2 (the top of the stack represents the current environment).</Paragraph>
    <Paragraph position="2"> Now, we are faced with a nondeterministic choice: whether to retum from the NP network (as state NP3 is final), or to continue to stay in the NP network, expecting PP post nominals. In the case of returning from NP, the top element (the current environment) is popped from the stack and the second element of the stack is reactivated as the current environment. The DO register is assigned with the result from the NP network, and the current state becomes $4.</Paragraph>
    <Paragraph position="3"> At this moment, two processes (one in state NP3 and the other in state $4) are alive nondeterministically, and both of them are looking for a PP. When &amp;quot;with&amp;quot; is parsed, both processes visit the PP network, pushing the current environment onto the stack. Since both processes are to visit the same network PP, the current environment is pushed only once to both NP3 and $4, and the rest of the PP is parsed only once as shown in figure 4-3.</Paragraph>
    <Paragraph position="4"> Eventually, both processes get to the final state $4, and two sets of registers are produced as its final results (figure 4-4).</Paragraph>
  </Section>
  <Section position="6" start_page="251" end_page="254" type="metho">
    <SectionTitle>
5. Graph-structured Stack and categorial
</SectionTitle>
    <Paragraph position="0"> grammar Parsers based on categodal grammar can be implemented as shift-reduce parsers with a stack. Unlike phrase-structure rule based parsers, information about how to reduce constituents is encoded in the complex category symbol of each constituent with functor and argument features. Basically, the parser parses a sentence strictly from left to dght, shiffing words one-by-one onto the stack. In doing so, two elements from the top of the stack are Inspected to see whether they can be reduced. The two elements can be reduced in the following cases:  When it reduces a stack, it does so non-destnJctively; that is, the original stack is kept alive even after the reduce action. An example categodal grammar is presented in figure 5-1.</Paragraph>
    <Paragraph position="1">  The category, (S\NP), represents a verb phrase, as it becomes S if there is an NP on its left. The categories, (NP~NP) and (S\NP)\(S\NP), represent a prepositional phrase, as it becomes a noun phrase or a verb phrase if there is a noun phrase or a verb phrase on its left, respectively. Thus, a preposition such as &amp;quot;with&amp;quot; has two complex categodas as in the</Paragraph>
    <Paragraph position="3"> example above. Nondeterminism in this formalism can be similarly handled with the graph-structured stack. After parsing &amp;quot;1 saw a', there is only one way to reduce the stack; (S\NP)/NP and NP/N into (S\NP)/N with Forward Functional Composition. The graph-structured stack at this moment is shown in figure 5-1.</Paragraph>
    <Paragraph position="4"> After parsing &amp;quot;man', a sequence of reductions takes place, as shown in figure 5-2. Note that S\NP is obtained in two ways (S\NP)/N N --&gt; S\NP and (S\NP)/NP NP --&gt; S\NP), but packed into one node with Local Ambiguity Packing described in section 2.3. The preposition &amp;quot;with&amp;quot; has two complex categories; both of them are pushed onto the graph-structured stack, as in figure 5-3.</Paragraph>
    <Paragraph position="5"> This example demonstrates that Categodal Grammars can be implemented as shift-reduce parsing with a graph-structured stack, it Is interesting that this algorithm is almost equivalent to &amp;quot;lazy chart parsing&amp;quot; descdbed in Paraschi and Steedman \[6\]. The relationship between the graph-structured stack and a chart in chad parsing is discussed in section 7.</Paragraph>
  </Section>
  <Section position="7" start_page="254" end_page="256" type="metho">
    <SectionTitle>
6. Graph-structured Stack and
</SectionTitle>
    <Paragraph position="0"/>
    <Section position="1" start_page="254" end_page="256" type="sub_section">
      <SectionTitle>
Principle-based Parsing
</SectionTitle>
      <Paragraph position="0"> Pdnciple-based parsers, such as one based on the GB theory, also use a stack to temporarily store partial trees. These parsers may be seen as shift-reduce parsers, as follows. Basically, the parser parses a sentence strictly from left to dght, shifting a word onto the stack one-by-one. In doing so, two elements from the top of the stack are always inspected to see whether there are any ways to combine them with one of the pdnciplas, such as augment attachment, specifier attachment and pre- and post-head adjunct attachment (remember, there are no outside phrase structure rules in principle-based parsing).</Paragraph>
      <Paragraph position="1"> Sometimes these principles conflict and there is more than one way to combine constituents. In that case, the graph-structure stack is viable to handle nondeterminism without repetition of work. Although we do not present an example, the implementation of pdnciple-based parsing with a graph-structured stack is very similar to the Implementation of Categodal Grammars with a graph-structured stack. Only the difference is that, in categodal grammars, Information about when and how to reduce two constItuents on the top of the graph-structured stack is explicitely encoded in category symbols, while in principle-based parsing, it is defined implicitely as a set of pdnciplas. 7. Graph-structured Stack and Chart Some parsing methods, such as chart parsing, do not explicitly use a stack. It Is Interesting to investigate the relationship between such parsing methods and the graph-structured stack, and this section discusses the correlation of the chart and the graph-structured stack. We show that chad parsing may be simulated as an exhaustive version of shift-reduce parsing with the graph-structured stack, as described Informally below.</Paragraph>
      <Paragraph position="2">  1. Push the next word onto the graph-structured stack.</Paragraph>
      <Paragraph position="3"> 2. Non-destructively reduce the graph- null structured stack in all possible ways with all applicable grammar rules; repeat until no further reduce action is applicable.</Paragraph>
      <Paragraph position="4"> 3. Go to 1.</Paragraph>
      <Paragraph position="5"> A snapshot of the graph-structured stack in the exhaustive shift-reduce parsers after parsing &amp;quot;1 saw a man on the bed in the apartment with&amp;quot; is presented in figure 7-1 (slightly simplified, ignodng determiners, for example). A snapshot of a chart parser alter parsing the same fragment of the sentence is also shown in figure 7-2 (again, slightly simplified). It is clear that the graph-structured stack in figure 7-1 and the chart in figure 7-2 are essentially the same; in fact they are topologically Identical if we ignore the word boundary symbols, &amp;quot;*', in figure 7-2. It is also easy to observe that the exhaustive version of shitt-reduce parsing is essentially a version of chart parsing which parses a sentence from left to dght.</Paragraph>
      <Paragraph position="6">  / ..... s ........ \ / \ / ............. s ........... \ \ / \ \ I I ........ ~ ............... \ \ / I \ \ bott~ ..... ~ ..... v ...... ~ ...... p ...... ~ ...... p ...... ~ ...... p \ \ I\ I \ ..... s ...... \, I \ ......... ~ I \ / \ ......... ~ ......................... I</Paragraph>
    </Section>
  </Section>
class="xml-element"></Paper>
Download Original XML