File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/91/p91-1016_metho.xml
Size: 18,228 bytes
Last Modified: 2025-10-06 14:12:49
<?xml version="1.0" standalone="yes"?> <Paper uid="P91-1016"> <Title>The Acquisition and Application of Context Sensitive Grammar for English</Title> <Section position="3" start_page="122" end_page="124" type="metho"> <SectionTitle> 2 Context-Sensitive Parsing </SectionTitle> <Paragraph position="0"> The simplest form of parser applies two operations shift or reduce to an input string and a stack. A sequence of elements on the stack may be reduced -- rewritten as a single symbol, or a new element may be shifted from the input to the stack. Whenever a reduce occurs, a subtree of the parse is constructed, dominated by the new symbol and placed on the stack. The input and the stack may both be arbitrarily long, but the parser need only consult the top elements of the stack and of the input. The parse is complete when the input string is empty and the stack contains only the root symbol of the parse tree. Such a simple approach to parsing has been used frequently to introduce methods of CFG parsing in texts on computer analysis of natural language \[J. Allen 1987\], but it works equally well with CSG. In our application to phrase structure analysis, we further constrain the reduce operation to refer to only the top two elements of the stack</Paragraph> <Section position="1" start_page="122" end_page="123" type="sub_section"> <SectionTitle> 2.1 Phrase Structure Analysis with CFG </SectionTitle> <Paragraph position="0"> For shift/reduce parsing, a phrase structure anMysis takes the form of a sequence of states, each comprising a condition of the stack and the input string. The final state in the parse is an empty input string and a stack containing only the root symbol, SNT. In an unambiguous analysis, each state is followed by exactly one other; thus each state can be viewed as the left-half of a CSG production whose right-half is the succeeding state.</Paragraph> <Paragraph position="1"> stacksinpu~ ~ ::C/, s~ack,+ l inpu~,+ l News story sentences, however, may be very long, sometimes exceeding fifty words and the resulting parse states would make cumbersome rules of varying lengths.</Paragraph> <Paragraph position="2"> To obtain manageable rules we limit the stack and input parts of the state to five symbols each, forming a ten symbol pattern for each state of the parse. In the example of Figure 1 we separate the stack and input parts with the symbol &quot;*&quot;, as we illustrate the basic idea on the sentence &quot;The late launch from Alaska delayed interception.&quot; The symbol b stands for blank, ax-1; for article, adj for adjective, p for preposition, n for noun, and v for verb. The syntactic classes are assigned by dictionary lookup.</Paragraph> <Paragraph position="3"> The analysis terminates successfully with an empty input string and the single symbol &quot;snt&quot; on the stack. Note that the first four operations can be described as shifts followed by the two reductions, adj n --* np and art np --, up. Subsequently the p and n were shifted onto the stack and then reduced to a pp; then the np and pp on the stack were reduced to an np, followed by the shifting of v and n, their reduction to vp, and a final reduction of np vp ~ snt.</Paragraph> <Paragraph position="4"> The grammar could now be recorded as pairs of successive states as below: b b b np p* nvn bb--*b bnpp n* vn b bb b b np p n* v nb b b--~ b b b np pp* v n bbb but some economy can be achieved by summarizing the right-half of a rule as the operations, shift or reduce, that produce it from the left-half. So for the example immediately above, we record: hbbnpp*nvnbb--~(S) bbnp p n* vn b b b--* (Rpp) where S shifts and (R pp) replaces the top two elements of the stack with pp to form the next state of the parse, Thus we create a windowed confexf of 10 symbols as the left half of a rule and an operation as the right half. Note that if the stack were limited to the top two elements, and the input to a single element, the rule system would reduce to a CFG; thus this CSG embeds a CFG.</Paragraph> <Paragraph position="5"> The late launch from Alaska art ads n p n delayed interception.</Paragraph> </Section> <Section position="2" start_page="123" end_page="124" type="sub_section"> <SectionTitle> 2.2 Algorithm for Shift/Reduce Parser </SectionTitle> <Paragraph position="0"> The algorithm used by the Shift/Reduce parser is described in Figure 2. Essentially, the algorithm shifts elements from the input onto the stack under the control of the CSG productions. It can be observed that unlike most grammars which include only rules for reductions, this one has rules for recognizing shifts as well. The reductions always apply to the top two elements of the stack and it is often the case that in one context a pair of stack elements lead to a shift, but in another context the same pair can be reduced.</Paragraph> <Paragraph position="1"> An essential aspect of this algorithm is to consult the CFG to find the left-half of a rule that matches the sentence context. The most important part of the rule is the top two stack elements, but for any such pair there may be multiple contexts leading to shifts or various reductions, so it is the other eight context elements that decide which rule is most applicable to the current state of the parse. Since many thousands of contexts can exist, an exact match cannot always be expected and therefore a scoring function must be used to discover the best matching rule.</Paragraph> <Paragraph position="2"> One of the exciting aspects of neural network research is the ability of a trained NN system to discover closest matches from a set of patterns to a given one. We studied Sejnowski and Rosenberg's \[1988\] analyses of the weight matrices resulting from training NETtalk. They reported that the weight matrix had maximum weights relating the character in the central window to the output phoneme, with weights for the surrounding context characters falling off with distance from the central window. We designed a similar function with maximum weights being assigned to the top two stack elements and weights decreasing in both directions with distance from those positions. The scoring function is developed as follows.</Paragraph> <Paragraph position="3"> Let &quot;R be the set of vectors {R1, R2,..., Rn} where R~ is the vector \[rl, r2,..., rl0\] Let C be the vector \[Cl, c2,..., c10\] Let p(ci, rl) be a matching function whose value is 1 if ci = n, and 0 otherwise.</Paragraph> <Paragraph position="4"> is the entire set of rules, P~ is (the left-half of) a particular rule, and C is the parse context.</Paragraph> <Paragraph position="5"> Then 7~' is the subset of 7~, where if R~ 6 7~' then #(n4, c4). P(ns, c5) = 1.</Paragraph> <Paragraph position="6"> The statement above is achieved by accessing the hash table with the top two elements of the stack, c4, c5 to produce the set 7~'.</Paragraph> <Paragraph position="7"> We can now define the scoring function for each R~ 6</Paragraph> <Paragraph position="9"> The first summation scores the matches between the stack elements of the rule and the current context while the second summation scores the matches between the elements in the input string. If two items of the rule and context match, the total score is increased by the weight assigned to that position. The maximum score for a perfect match is 21 according to the above formula.</Paragraph> <Paragraph position="10"> From several experiments, varying the length of vector and the weights, particularly those assigned to blanks, it has been determined that this formula gave the best performance among those tested. More importantly, it has worked well in the current phrase structure and case analysis experiments.</Paragraph> </Section> </Section> <Section position="4" start_page="124" end_page="3430" type="metho"> <SectionTitle> 3 Experiments with CSG </SectionTitle> <Paragraph position="0"> To support the claim that CSG systems are an improve- null ment over Augmented CFG, a number of questions need be answered.</Paragraph> <Paragraph position="1"> * Can they be acquired easily? * Do they reduce ambiguity in phrase structure analysis? null * How well do CSG rules generalize to new texts? * How large is the CSG that encompasses most of the syntactic structures in news stories?</Paragraph> <Section position="1" start_page="124" end_page="124" type="sub_section"> <SectionTitle> 3.1 Acquisition of CSG </SectionTitle> <Paragraph position="0"> It has been shown that our CSG productions are essentially a recording of the states from parsing sentences.</Paragraph> <Paragraph position="1"> Thus it was easy to construct a grammar acquisition system to present the successive states of a sentence to a linguist user, accepting and recording the linguist's judgements of shift or reduce. This system has evolved to a sophisticated grammar acquisition/editing program that prompts the user on the basis of the rules best fitting the current sentence context. It's lexicon also suggests the choice of syntactic class for words in context. Generally it reduces the linguistic task of constructing a grammar to the much simpler task of deciding for a given context whether to shift input or to rewrite the top elements of the stack as a new constituent. It reduces a vastly complex task of grammar writing to relatively simple, concrete judgements that can be made easily and reliably.</Paragraph> <Paragraph position="2"> Using the acquisition system, it has been possible for linguist users to provide example parses at the rate of two or three sentences per hour. The system collects the resulting states in the form of CSG productions, allows the user to edit them, and to use them for examining the resulting phrase structure tree for a sentence. To obtain the 4000+ rules examined below required only about four man-weeks of effort (much of which was initial training time.)</Paragraph> </Section> <Section position="2" start_page="124" end_page="125" type="sub_section"> <SectionTitle> 3.2 Reduced Ambiguity in Parsing * </SectionTitle> <Paragraph position="0"> Over the course of this study six texts were accumulated.</Paragraph> <Paragraph position="1"> The first two were brief disease descriptions from a youth encyclopedia; the remaining four were newspaper texts.</Paragraph> <Paragraph position="2"> Figure 1 characterizes each article by the number of CSG rules or states, number of sentences, the range of sentence lengths, and the average number of words per sentence.</Paragraph> <Paragraph position="3"> It can be seen that the news stories were fairly complex texts with average sentence lengths ranging from 22 to 29 words per sentence. A total of 92 sentences in over 2000 words of text resulted in 4062 CSG productions.</Paragraph> <Paragraph position="4"> It was noted earlier that in each CFG production there is an embedded context-free rule and that the primary function of the other eight symbols for parsing is to select the rule that best applies to the current sentence state. When the linguist makes the judgement of shift or reduce, he or she is considering the entire meaning of the sentence to do so, and is therefore specifying a semantically preferred parse. The parsing system has access only to limited syntactic information, five syntactic symbols on the stack, and five input word classes and the parsing algorithm follows only a single path. How well does it work? The CSG was used to parse the entire 92 sentences with the algorithm described in Figure 2 augmented with instrumentation to compare the constituents the parser found with those the linguist prescribed. 88 of the 92 sentences exactly matched the linguist's parse. The other four cases resulted in perfectly reasonable complete parse trees that differed in minor ways from the linguist's pre- null scription. As to whether any of the 92 parses are truly &quot;correct&quot;, that is a question that linguists could only decide after considerable study and discussion. Our claim is only that the grammars we write provide our own preferred interpretations -- useful and meaningful segmentation of sentences into trees of syntactic constituents. Figure 3 displays the tree of a sentence as analyzed by the parser using CSG. It is a very pleasant surprise to discover that using context sensitive productions, an elementary, deterministic, parsing algorithm is adequate to provide (almost) perfectly correct, unambiguous analyses for the entire text studied.</Paragraph> <Paragraph position="5"> Another mission soon scheduled that also would have priority over the shuttle is the first firing of a trident two intercontinental range missile from a submerged submarine. null</Paragraph> <Paragraph position="7"/> </Section> <Section position="3" start_page="125" end_page="3430" type="sub_section"> <SectionTitle> 3.3 Generalization of CSG </SectionTitle> <Paragraph position="0"> One of the first questions considered was what percent of new constituents would be recognized by various accumulations of CSG. We used a system called union-grammar that would only add a rule to the grammar if the grammar did not already predict its operation. The black line of Figure 4 shows successive accumulations of 400-rule segments of the grammar after randomizing the ordering of the rules. Of the first 400 CS rules 50% were new; and for an accumulation of 800, only 35% were new. When 2000 rules had been experienced the curve is flattening to an average of 20% new rules. This curve tells us that if the acquisition system uses the current grammar to suggest operations to the linguist, it will be correct about 4 out of 5 times and so reduce the linguist's efforts accordingly. The curve also suggests that our collection of rule examples has about 80% redundancy in that earlier rules can predict newcomers at that level of accuracy. On the down-side, though, it shows that only 80% of the constituents of a new sentence will be recognized, and thus the probability of a correct parse for a sentence never seen before is very small. We experimented with a grammar of 3000 rules to attempt to parse the new shuttle text, but found that only 2 of 14 new sentences were parsed correctly.</Paragraph> <Paragraph position="1"> If two parsing grammars equally well account for the same sentences, the one with fewer rules is less redundant, more general, and the one to be preferred. We used union-grammar to construct the &quot;minimal grammar&quot; with successive passes through 3430 rules, as shown in Figure2.</Paragraph> <Paragraph position="2"> The first pass found 856 rules would account for the rest.</Paragraph> <Paragraph position="3"> A second pass of the 3430 rules against the 856 extracted by the first pass resulted in the addition of 26 more rules, adding rules that although recognized by earlier rules found interference as a result of later ones. The remaining 8 rules discovered in the next pass are apparently identical patterns resulting in differing operations -- contradictories that need to be studied and resolved. The resulting minimal grammar totaling 895 rules succeeds in parsing the texts with only occasional minor differences from the linguist's prescriptions. We must emphasize that the un, retained rules are not identical but only similar to those in the minimal grammar.</Paragraph> </Section> <Section position="4" start_page="3430" end_page="3430" type="sub_section"> <SectionTitle> 3.4 Estimated Size of Completed CSG </SectionTitle> <Paragraph position="0"> A question, central to the whole argument for the utility of CSG, is how many rules will be required to account for the range of structures found in news story text? Refer again to Figure 4 to try to estimate when the black line, CS, will intersect the abscissa. It is apparent that more data is needed to make a reliable prediction.</Paragraph> <Paragraph position="1"> Let us consider the gray line, labeled CF that shows how many new context-free rules are accumulated for 400 CSG rule increments. This line rapidly decreases to about 5% new CFG rules at the accumulation of 4000 CSG productions. We must recall that it is the embedded context-free binary rule that is carrying the most weight in determining a constituent, so let us notice some of the CFG properties.</Paragraph> <Paragraph position="2"> We allow 64 symbols in our phrase structure analysis. That means, there are 642 possible combinations for the top two elements of the stack. For each combination, there are 65 possible operations3: a shift or a reduction to another symbol. Among 4000 CSG rules, we studied how many different CFG rules can be derived by eliminating the context. We found 551 different CFG rules that used 421 different left-side pairs of symbols. This shows that a given context free pair of symbols averages 1.3 different operations.</Paragraph> <Paragraph position="3"> Then, as we did with CSG rules, we measured how many new CFG rules were added in an accumulative fashion. The shaded line of Figure 4 shows the result. Notice that the line has descended to about 5% errors at 4000 rules. To make an extrapolation easier, a log-log graph shows the same data in Figure 5. From this graph, it can be predicted that, after about 25000 CSG rules are accumulated, the grammar will encompass an Mmost complete CFG component. Beyond this point, additional CSG rules will add no new CFG rules, but only fine-tune the grammar so that it can resolve ambiguities more effectively. null Also, it is our belief that, after the CSG reaches that point, a multi-path, beam-search parser would be 3 Actually, there are many fewer than 65 possible operations since the stack elements can be reduced only to non-terminal symbols. able to parse most newswire stories very reliably. This belief is based on our observation that most failures in parsing new sentences with a single-path parser result from a dead-end sequence; i.e., by making a wrong choice in the middle, the parsing ends up with a state where no rule is applicable. The beam-search parser should be able to recover from this failure and produce a reasonable parse.</Paragraph> </Section> </Section> class="xml-element"></Paper>