File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/89/p89-1013_metho.xml
Size: 23,091 bytes
Last Modified: 2025-10-06 14:12:24
<?xml version="1.0" standalone="yes"?> <Paper uid="P89-1013"> <Title>SOME CHART-BASED TECHNIQUES FOR PARSING ILL-FORMED INPUT</Title> <Section position="3" start_page="0" end_page="0" type="metho"> <SectionTitle> THE PROBLEM </SectionTitle> <Paragraph position="0"> Although the ultimate solution to the problem of processing ill-formed input must take into account semantic and pragmatic factors, nevertheless it is important to understand the limits of recovery strategies that age based entirely on syntax and which are independent of any particular grammar. The aim of Otis work is therefore to explore purely syntactic and granmmr-independent techniques to enable a to recover from simple kinds of iil-formedness in rex.</Paragraph> <Paragraph position="1"> tual inputs. Accordingly, we present a generalised parsing strategy based on an active chart which is capable of diagnosing simple C/nvrs (unknown/mi.uq~elled words, omitted words, extra noise words) in sentences (from languages described by context free phrase slructurC/ grammars without eproductions). This strategy has the advantage that the recovery process can run after a standard (active chart) parser has terminated unsuccessfully, without causing existing work to be reputed or the original parser to be slowed down in any way, and that, unlike previous systems, it allows the full syntactic context to be exploited in the determination of a &quot;best&quot; parse for an ill-formed sentence.</Paragraph> </Section> <Section position="4" start_page="0" end_page="102" type="metho"> <SectionTitle> EXPLOITING SYNTACTIC CONTEXT </SectionTitle> <Paragraph position="0"> Weischedel and Sondheimer (1983) present an approach to processing ill-formed input based on a modified ATN parser. The basic idea is, when an initial p~s@ fails, to select the incomplete parsing path that consumes the longest initial portion of the input, apply a special rule to allow the blocked parse to continue, and then to iterate this process until a successful parse is generated. The result is a &quot;hillo climbing&quot; search for the &quot;best&quot; parse, relying at each point on the &quot;longest path&quot; heuristic. Unfortunately, sometimes this heuristic will yield several possible parses, for instance with the sentence: The snow blocks I&quot; te road (no partial parse getting past the point shown) where the parser can fail expecting either a verb or a determiner. Moreover, sometimes the heuristic will cause the most &quot;obvious&quot; error to be missed: He said that the snow the road T The paper will T the best news is the Times where we might suspect that there is a missing verb and a misspelled &quot;with&quot; respectively. In all these cases, the &quot;longest path&quot; heuristic fails to indicate unambiguously the minimal change that would be necessary to make the whole input acceptable as a sentence. This is not surprising, as the left-fight bias of an ATN parser allows the system to take no account of the right context of a possible problem element.</Paragraph> <Paragraph position="1"> Weischedel and Sondheimer's use of the &quot;longest path&quot; heuristic is similar to the use of locally least-cost error recovery in Anderson and Backhouse's (1981) scheme for compilers. It seems to be generally accepted that any form of globally &quot;minimum-distance&quot; error correction will be too costly to implement (Aho and Ullman, 1977). Such work has, however, not considered heuristic approaches, such as the one we are developing.</Paragraph> <Paragraph position="2"> Another feature of Weischedel and Sondheimer's system is the use of grammar-slx~ific recovery rules (&quot;meta-rules&quot; in their terminology). The same is true of many other systems for dealing with ill-formed input (e.g. Carhonell and Hayes (1983), Jensen et al. (1983)). Although grammar-specific recovery rules are likely in the end always to be more powerful than grammar-independent rules, it does seem to be worth investigating how far one can get with rules that only depend on the grammar forma//sm used.</Paragraph> <Paragraph position="3"> In _~.~_pting an ATN parser to compare partial parses, Weischedel and Sondheimer have already introduced machinery to represent several alternative partial parses simultaneously. From this, it is a relatively small step to introduce a well-formed substring table, or even an active chart, which allows for a glohal assessment of the state of the parser. If the grammar form~fi~m is also changed to a declarative formalism (e.g. CF-PSGs, DCGs (Pereira and Warren 1980), patr-ll (Shieber 1984)), then there is a possibility of constructing other partial parses that do not start at the beginning of the input. In this way, right context can play a role in the determination of the ~est&quot; parse.</Paragraph> </Section> <Section position="5" start_page="102" end_page="102" type="metho"> <SectionTitle> WHAT A CHART PARSER LEAVES BEHIND </SectionTitle> <Paragraph position="0"> The information that an active chart parser leaves behind for consideration by a &quot;post mortem&quot; obviously depends on the parsing sWategy used (Kay 1980, Gazdar and Mellish 1989). Act/re edges are particularly important fx~n the point of view of diagnosing errors, as an unsatisfied active edge suggests a place where an input error may have occurred. So we might expect to combine violated expectations with found constituents to hypothesise complete parses. For simplicity, we assume here that the grammar is a simple CF-PSG, although there are obvious generalisations.</Paragraph> <Paragraph position="1"> (Left-right) top-down pars/ng is guaranteed to create active edges for each kind of phrase that could continue a partial parse starling at the beginning of the input. On the other hand, bottom-up parsing (by which we mean left corner parsing without top-down filtering) is guaranteed to find all complete constimerits of every possible parse. In addition, whenever a non-empty initial segment of a rule RHS has been found, the parser will create active edges for the kind of phrase predicted to occur after this segment. Top-down parsing will always create an edge for a phrase that is needed for a parse, and so it will always indicate by the presence of an unsatisfied active edge the first ester point, if there is one. If a subsequent error is present, top-down parsing will not always create an active edge corresponding to it, because the second may occur within a constituent that will not be predicted until the first error is corrected. Similarly, fight-to-left top-down parsing will always indicate the last error point, and a combination of the two will find the first and last, but not necessarily any error points in between. On the other hand, bottom-up parsing will only create an active edge for each error point that comes immediately after a sequence of phrases corresponding to an initial segment of the RI-IS of a grammar rule. Moreover, it will not necessarily refine its predictions to the most detailed level (e.g. having found an NP, it may predict the existence of a following VP, but not the existence of types of phrases that can start a VP). Weisobedel and Sondheimer's approach can be seen as an incremental top-down parsing, where at each stage the right-most tin.riffled active edge is artificially allowed to be safistied in some way. As we have seen, there is no guarantee that this sort of hill-climbing will find the &quot;best&quot; solution for multiple errors, or even for single errors. How can we combine bottom-up and top-down parsing for a more effective solution?</Paragraph> </Section> <Section position="6" start_page="102" end_page="103" type="metho"> <SectionTitle> FOCUSING ON AN ERROR </SectionTitle> <Paragraph position="0"> Our basic stramgy is to run a bottom-up parser over the input and then, if this fails to find a complete parse, to run a modified top-down parser over the resulting chart to hypothesise possible complete parses. The modified top-down parser attempts to find the minimal errors that, when taken account of, enable a complete parse to be constructed. Imagine that a bottom-up parser has already run over the input &quot;the gardener collects manure if the autumn&quot;. Then Figure 1 shows (informally) how a top-down parser might focus on a possible error. To implement this kind of reasoning, we need a top-down parsing rule that knows how to refine a set of global needs and a fundamental rule that is able m incorporate found constituents from either directim. When we may encounter multiple rotors, however, we need to express multiple needs (e.g. <Need N from 3 to 4 and PP from 8 to I0>). We also need to have a fimdamental rule that can absorb found phrases firom anywhere in a relevant portion of the chart (e.g. given a rule &quot;NP --+ Det Adj N&quot; and a sequence &quot;as marvellous sihgt&quot;, we need to be able to hypothesi~ that &quot;as&quot; should be a Det and &quot;sihgt&quot; a N). To save repealing work, we need a version of the top-down rule that stops when it reaches an appropriate category that has already been found bottom-up.</Paragraph> <Paragraph position="1"> Finally, we need to handle both &quot;anchored&quot; and &quot;unanchored&quot; needs. In an anchored need (e.g.</Paragraph> <Paragraph position="2"> <Need NP from 0 to 4>) we know the beginning and end of the portion of the chart within which the search is to take place. In looking for a NP VP sequence in &quot;the happy blageon su'mpled the bait&quot;, however, we can't initially find a complete (initial) NP or (final) VP and hence don't know where in the chart these phrases meeL We express this by <Need NP from 0 to *, VP f~om * to 6>, the symbol &quot;*&quot; denoting a position in the chart that remains to be determined.</Paragraph> </Section> <Section position="7" start_page="103" end_page="103" type="metho"> <SectionTitle> GENERALISED TOP-DOWN PARSING </SectionTitle> <Paragraph position="0"> If we adopt a chart parsing suategy with only edges that carry informafim about global needs, thee will be considerable dupficated effort. For instance, the further refinement of the two edges: <Need NP hem 0 to 3 and V from 9 to 10> <Need NP from 0 to 3 and Adj from 10 to 11> can lead to any analysis of possible NPs between 0 and 3 being done twice. Restricting the possible format of edges in this way would be similar to allowing the &quot;functional composition rule&quot; (Steedman 1987) in standard chart parsing, and in general this is not done for efficiency reasons. Instead, we need to produce a single edge that is &quot;in charge&quot; of the computation looking for NPs between 0 and 3. When possPSole NPs are then found, these then need to be combined with the original edges by an appropriate form of the fundamental rule. We are thus led to the following form for a generalised edge in our chart parser:.</Paragraph> <Paragraph position="1"> <C from S to E needs C$1 fi'om $1 toel, cs2 from s2 to e2.</Paragraph> <Paragraph position="2"> .o.</Paragraph> <Paragraph position="3"> C$, from $. to e,> where C is a category, the c$~ are lists of categories (which we will show inside square brackets),. S, E, the si and the e~ ate positions in the chart (or the special symbol &quot;*~). The presence of an edge of this kind in the chart indicates that the parser is attempting to find a phrase of category C covering the portion of the chart from S to E, but that in order to succeed it must still satisfy all the needs listed. Each need specifies a sequence of categories csl that must be found contiguously to occupy the portion of the chart extending from st to ei.</Paragraph> <Paragraph position="4"> Now that the format of the edges is defined, we can be precise about the parsing rules used. Our modified chart parsing rules are shown in Figure 2.</Paragraph> <Paragraph position="5"> The modified top-down ru/e allows us to refine a need into a more precise one, using a rule of the grammar (the extra conditions on the rule prevent further refinement where a phrase of a given category has already been found within the precise part of the chart being considezed). The modified fundamental ru/e allows a need to be satisfied by an edge that is completely ~ti~fied (i.e. an inactive edge, in the standard terminology). A new rule, the simplification ru/~, is now required to do the relevant housekeeping when one of an edge's needs has been completely satisfied. One way that these rules could run would be as follows. The chart starts off with the inactive edges left by bottom-up parsing, together with a single &quot;seed&quot; edge for the top-down phase <GOAL from 0 to n needs \[S\] from 0 to n>, where n is the final position in the chart. At any point the fundamental rule is run as much as possible. When we can proceed no further, the first need is refined by the top-down rule (hopefully search now being anchored). The fundamental rule may well again apply, taking account of smaller phrases that have already been found. When this has run, the top-down rule may then further refine the system's expectations about the parts of the phrase that cannot be found.</Paragraph> <Paragraph position="6"> And so on. This is just the kind of &quot;focusing&quot; that we discussed in the last section.. If an edge expresses needs in several separate places, the first will eventually get resolved, the simplification rule will then apply and the rest of the needs will then be worked on.</Paragraph> <Paragraph position="7"> For this all to make sense, we must assume that all hypothesised needs can eventually be resolved (otherwise the rules do not suffice for more than one error to be narrowed down). We can ensure this by introducing special rules for recoguising the most primitive kinds of errors. The results of these rules must obviously be scored in some way, so that errors are not wildly hypothesised in all sorts of places.</Paragraph> </Section> <Section position="8" start_page="103" end_page="105" type="metho"> <SectionTitle> SEARCH CONTROL AND EVALUATION FUNCTIONS </SectionTitle> <Paragraph position="0"> Even without the extra rules for recognising primitive errors, we have now introduced a large parsing search space. For instance, the new fundamental rule means that top-down processing can take place in many different parts of the chart. Chart parsers already use the notion of an agenda, in which possible additions to the chart are given priority, and so we have sought to make use of this in organising a heuristic search for the &quot;best&quot; poss~le parse. We have considered a number of parameters for deciding which edges should have priority: MDE (mode of formation)We prefer edges that arise from the fundamental rule to those that arise from the rap-down rule; we disprefer edges that arise from unanchored applications of the top-down nile.</Paragraph> <Paragraph position="1"> PSF (penalty so far) Edges resulting from the garbage, empty category and unknown word rules are given penalty scores. PSF counts the penalties that have been accumulated so far in an edge.</Paragraph> <Paragraph position="2"> PB (best penalty) This is an estimate of the best possible penalty that this edge, when complete. could have. This score can use the PSF, together with information about the parts of the chart covered - for instance, the number of words in these parts which do not have lexical entries.</Paragraph> <Paragraph position="3"> GU$ (the ma~um number of words that have been used so far in a partial parse using this edge) We prefer edges that lead to parses accounting for more words of the input.</Paragraph> <Paragraph position="4"> PBG (the best possible penalty for any complete hypothesis involving this edge). This is a shortfall score in the sense of Woeds (1982).</Paragraph> <Paragraph position="5"> UBG (the best possible number of words that could be used in any complete hypothesis containing this edge).</Paragraph> <Paragraph position="6"> In our implementation, each rule calculates each of these scores for the new edge from those of the contributing edges. We have experimented with a number of ways of using these scores in comparing two possible edges to be added to the chart. At present, the most promising approach seems to be to compare in mm the scores for PBG, MDE, UBG, GUS, PSF and PB. As soon as a difference in scores is encountered, the edge that wins on this account is chosen as the preferred one. Putting PBG first in this sequence ensures that the first solution found will be a solution with a minimal penalty score.</Paragraph> <Paragraph position="7"> The rules for computing scores need to make estimates about the possible penalty scores that might arise from attempting to find given types of phrases in given parts of the chart. We use a number of heuristics to compute these. For instance, the pres. ence of a word not appearing in the lexicon means that every parse covering that word must have a non-zero penalty score. In general, an attempt to find an instance of a given category in a given portion of the chart must produce a penalty score if the boltomup parsing phase has not yielded an inactive edge of the correct kind within that portion. Finally, the fact that the grammar is assumed to have no e-productions means that an attempt to find a long sequence of categories in a short piece of chart is doomed to produce a penalty score; similarly a sequence of lexical categories cannot be found without penalty in a pordon of chart that is too long. Some of the above scoring parameters score an edge according what sorts of parses it could contribute to, not just according to bow internally plausible it seems. This is desirable, as we wish the construction of globally most plausible solutions to drive the parsing. On the other hand, it introduces a number of problems for chart organisation. As the same edge (apart from its score) may be generated in different ways, we may end up with multiple possible scores for it. It would make sense at each point to consider the best of the possible scores associated with an edge to be the current score. In this way we would not have to repeat work for every differently scored version of an edge. But consider the following scenario: Edge A is added to the chart. Later edge B is spawned using A and is placed in the agenda. Subsequently A's scc~e increases because it is derived in a new and better way. This should affect B's score (and hence B's position on the agenda).</Paragraph> <Paragraph position="8"> If the score of an edge increases then the scores of edges on the agenda which were spawned from it should also increase. To cope with this sort of problem, we need some sort of dependency analysis, a mechanism for the propagation of changes and an easily resorted agenda. We have not addressed these problems so far - our cterent implementation treats the score as an integral part of an edge and suffers fiom the resulting duplication problem.</Paragraph> </Section> <Section position="9" start_page="105" end_page="106" type="metho"> <SectionTitle> PRELIMINARY EXPERIMENTS </SectionTitle> <Paragraph position="0"> To see whether the ideas of this paper make sense in practice, we have performed some very preliminaw experiments, with an inefficient implementation of the chart parser and a small CF-PSG (84 rules and 34 word lexicon, 18 of whose entries indicate category ambiguity) for a fragment of English. We generated random sentences (30 of each length considered) from the grammar and then introduced random ocxunences of specific types of errors into these sentences. The errors considered were none (i.e. leaving the correct sentence as it was), deleting a word, adding a word (either a completely unknown word or a word with an entry in the lexicon) and substituting a completely unknown word for one word of the sentence. For each length of original sentence, the re,~ts were averaged over the 30 sentences randomly generated. We collected the following statistics (see Table 1 for the results): BU cyc/e$ - the number of cycles taken (see below) to exhaust the chart in the initial (standard) bottom-up parsing phase.</Paragraph> <Paragraph position="1"> #$olns - the number of different &quot;solutions&quot; found. A &quot;solution&quot; was deemed to be a description of a possible set of errors which has a minimal penalty score and if corrected would enable a complete parse to be constructed. Possible errors were adding an extra word, deleting a word and substituting a word for an instance of a given lexical category. The penalty associated with a given set of errors was the number of em3~ in the set.</Paragraph> <Paragraph position="2"> First - the number of cycles of generalised top-down parsing required to find the first solution.</Paragraph> <Paragraph position="3"> Last - the number of cycles of generalised top-down parsing required to find the last solution.</Paragraph> <Paragraph position="4"> TD cyc/es - the number of cycles of generalised top-down parsing required to exhaust all possibilities of sets of errors with the same penalty as the first solution found.</Paragraph> <Paragraph position="5"> It was important to have an implementationindependent measure of the amount of work done by the parser, and for this we used the concept of a &quot;cycle&quot; of the chart parser. A &quot;cycle&quot; in this context represents the activity of the parser in removing one item from the agenda, adding the relevant edge to the chart and adding to the agenda any new edges that are suggested by the rules as a result of the new addition. For instance, in conventional top-down chart parsing a cycle might consist of removing the edge <S from 0 to 6 needs \[NP VI'\] from 0 to 6> from the front of the agenda, adding this to the chart and then adding new edges to the agenda, as follows. Ftrst of all, for each edge of the form <NP from 0 to a needs 0> in the chart the fundamental rule determines that <S from 0 to 6 needs \[VP\] from ct to 6> should be added. Secondly, for each rule NP -.., 7 in the grammar the top-down rule determines that <NP from 0 to * needs y from 0 to *> should be added. With generalised top-down parsing, there are more rules to be considered, but the idea is the same. Actually, for the top-down rule our implementation schedules a whole collection of single additions (&quot;apply the top down rule to edge a&quot;) as a single item on the agenda. When such a request reaches the front of the queue, the actual new edges are then computed and themselves added to the agenda. The result of this strategy is to make the agenda smaller but more structured, at the cost of some extra cycles.</Paragraph> </Section> class="xml-element"></Paper>