The selection of a parsing strategy for an on-line machine translation system in a sublanguage domain. A new practical comparison
Paper · 1989 · Patrick Shann
Summary
An interactive translation system has to make decisions while its user is still writing. Patrick Shann’s paper compares ways of doing that for a machine translation system designed to turn German avalanche bulletins into French. Its users compose a bulletin from a controlled vocabulary and grammar. Each time they choose a word, the system must check the sentence so far and work out which words can come next. The choice of parsing strategy therefore affects how quickly the user can keep writing. A parser that handles complete sentences efficiently may spend its effort at the wrong points for an interface that needs an answer after each word.
The comparison puts Tomita’s extended LR parser alongside chart parsers that differ in when they put grammar rules to work. A chart records partial and complete analyses so the parser can build on work it has already done. Among the chart parsers, the left-corner strategy with top-down filtering generally performed best. It uses evidence from the words already read to start a rule, then checks whether the proposed phrase fits the sentence context. Filtering paid off particularly when it prevented expensive grammatical checks. On some inputs with few possible readings, the check itself cost more time than it saved.
Tomita’s parser had its clearest timing advantage on artificial sentences with many interpretations. Much of that advantage disappeared when the parser ran without its parse forest, a representation that lets alternative analyses share common parts. On the avalanche test, which used a grammar of 750 rules and sentences with relatively few readings, total parsing time relative to Tomita was 1.38 for the filtered left-corner parser and 2.15 for the Earley-like top-down parser. The smaller gap with the filtered left-corner implementation made it a credible candidate for the application.
The project chose Tomita’s parser with a grammar whose categories were atomic labels. In a difficult coordination example, the paper reports average times per word of 70 ms with such a grammar, 160 ms with simple features, and 1267 ms with unification. The choice also took into account the additional work that unification would entail when finding words to offer the user. The experiments time sentence analysis, and their main lesson for the interface is an engineering one. The cost of the grammar’s checks and the way a parser stores ambiguity can matter as much as the order in which it applies rules.
Deep dive: The selection of a parsing strategy for an on-line machine translation system in a sublanguage domain. A new practical comparison
Patrick Shann compares parsing strategies for an interactive German-to-French translation system and traces Tomita’s speed advantage to its parse forest. · about 35 minutes to read
The problem and its context
Analysis while the sentence is being written
The avalanche bulletin project made the source text part of the translation system’s design. The user would compose a bulletin in [German] from words known to the system, within constructions its grammar could handle, and the system would produce a French translation intended for use without post-editing. Control at the input stage was the project’s way of placing a boundary around what the translator had to handle. That boundary had to be available to the person writing the bulletin. If a sequence led outside it, the input system needed to detect the problem at the point where it arose.
The interface offered a practical way to enforce the boundary. It displayed choices in windows and let the writer select a word with the mouse. The available choices depended on what the writer had already entered. Once a word was selected, the system processed it and refreshed the choices. Each update therefore depended on the state of a sentence that might be incomplete, and on the grammatical continuations still available from that state. Shann mentions an earlier system reported by Tennant as another example of a similar input facility.
Consider the difference between admitting a word to a dictionary and admitting it at the current position. The dictionary determines whether the system knows the word. The parser determines whether it fits any of the analyses that remain possible at that point. A word can belong to a category that is useful somewhere in a bulletin while being unsuitable at the position the writer has reached. The list in the window draws on both kinds of information. Grammatical analysis has to advance far enough after each selection to make that list available before the next selection.
A prefix can also support several interpretations, each with a different set of possible continuations. A parser has to preserve the alternatives that could matter to the next step. It may have enough information to recognize a phrase without knowing where that phrase will ultimately attach. A parser that shares work between interpretations can maintain those options at lower cost. A parser that generates many hypotheses, or constructs phrases that cannot fit the current sentence context, can increase the delay the user experiences even when the sentence eventually has a straightforward analysis.
These requirements give the comparison a narrower purpose than ranking parsing algorithms in general. The project needed strict left-to-right progress and useful grammatical state at word boundaries. It also needed a grammar precise enough to license appropriate inputs for translation. The speed of finding a structural match was only one part of that choice. The grammar could impose extra tests on a match, and the cost of those tests could change which search strategy was preferable.
Why earlier comparisons left the choice open
Shann presents the study as a continuation of empirical work by Slocum and Tomita. The comparisons he reviews examined different parts of the design space. Slocum compared bottom-up chart strategies and looked at the cost of grammatical procedures in a translation setting. Tomita compared his generalized LR parser with versions of Earley’s algorithm. Wiren tested ways of directing the search in chart parsers. Together, they supplied reasons to test several alternatives under shared conditions. Each comparison used its own combination of grammar, parser configuration, and timing conventions.
Slocum’s work supplied the closest precedent for treating a parser as part of a larger language-processing system. His translation-oriented experiment used a German analysis grammar with 500 rules and 262 sentences. The sentences ranged from 1 to 39 words, with a reported mean of 15,6 words per sentence. The analysis did work that mattered to subsequent translation, including feature operations, transformations, and case-frame processing. Finding that the categories of a rule fit was an intermediate step toward constructing what the translator would use.
Slocum compared left-corner parsing with a variant of Cocke-Kasami-Younger parsing. Both use constituents already recognized in the input to bring grammar rules into play. His experiment included top-down filtering, which checks whether a proposed constituent fits what the sentence could require at its position. It also considered early constituent tests, which run the part of a rule’s grammatical procedure concerned with its first constituent as soon as that constituent becomes available. The comparison raised a practical question about where to pay for a check. Screening a candidate costs time at the point of proposal, yet allowing it through can commit the parser to more expensive work later.
The distinction mattered because Slocum argued that theoretical worst-case behavior could be a poor guide to operating costs. Storage management, the construction of interpretations, and the execution of grammatical procedures could account for a substantial part of the work. The constant costs of the operations an implementation performs were therefore relevant to a decision about which parser to use. For the bulletin project, this argument applied directly to the choice between a grammar that performs largely category matching and one that carries out complex feature operations.
Tomita’s earlier comparison addressed a different question. He compared the extended LR parser with two versions of an Earley parser, corresponding in Shann’s terms to a top-down strategy and a top-down strategy with lookahead. Lookahead consults the next word to see whether a grammatical expectation is worth pursuing. The experiment used context-free grammars of different sizes. In a context-free rule, the category on the left expands into a specified sequence of symbols, regardless of where that category occurs. One of Tomita’s sentence sets came from texts. The other was constructed to increase ambiguity by adding prepositional phrases.
Tomita viewed compiling the grammar into an LR table as an important explanation for his parser’s speed. His parser also produced a compact forest of analyses, while the Earley implementations operated as recognizers, reporting whether the input was accepted without producing a parse. Shann’s comparison asks what happens when the competitors include bottom-up chart parsers equipped with their own ways of compiling grammar rules. It also asks what changes when the LR parser’s representation of the result is varied while keeping the parser in the same family. These are separate questions about the search mechanism and the work of representing its output.
Wiren’s comparison provided a reason to take enhanced chart parsers seriously. It set top-down and left-corner approaches alongside configurations with lookahead and, for left-corner parsing, top-down filtering. Shann draws a distinction between the two checks. A top-down filter asks whether the proposed phrase can connect to the context available on its left. Lookahead asks whether the parser’s new expectation agrees with the next word on its right. A strategy may be economical in the number of hypotheses it produces while incurring considerable cost deciding which hypotheses to preserve.
The timing conventions of the earlier comparisons also shaped the new experiment. Shann describes the timings in the Tomita and Wiren studies as CPU parsing times with garbage collection deducted. Their phrase-structure grammars required little work in the procedures attached to rules. Shann wanted timing that reflected the work of applying those procedures, since their cost could be substantial in the application under development. The proposed comparison consequently changed the grammar representations as well as the parsers. It also put the chart strategies on a common implementation base so that their differences in rule invocation could be examined within a shared design.
The method, step by step
What the parser records
A chart parser keeps a record of what has been recognized and what remains possible at different places in a sentence. Vertices mark the positions between words as well as the start and end of the input. An edge connects two vertices and carries grammatical information about the span. It can record a constituent that has been found, or a rule that has been partly satisfied. If the parser later needs the same constituent or partial analysis, it can refer to the chart.
The grammar supplies the rules for interpreting those spans. Its start symbol names the category for a complete sentence. Terminals are the symbols at the input end of the grammar, and nonterminals are categories that the grammar expands. The paper uses upper-case letters for nonterminals, lower-case letters for terminals, and Greek letters for sequences of symbols. It marks the progress of a rule by inserting a dot into the sequence on its right-hand side.
⟨A → B • C D | i, j⟩
The angle brackets enclose an edge. A is the category the rule would yield on completion, and → introduces its expansion into B, C, and D. The dot • shows that B has been recognized and that C is required next. D follows C in the same rule. The bar | separates the grammatical information from the endpoints. i and j are the left and right vertices of the portion recognized so far, and the comma separates them.
The paper calls an unfinished edge active. For the ordinary left-to-right dotted notation, its required category is the symbol immediately after the dot. An edge is complete when the rule has recognized all its constituents. That complete result can then supply a category required by another rule. An edge can also cover an empty span when the parser has just proposed a rule at a vertex and has yet to recognize any of its constituents.
Two operations organize the chart implementations. Propose selects grammar rules that are worth starting, based on a grammatical expectation or on material already found. Combine uses existing edges to form new ones. The choice of what triggers a proposal is central to the experiment. Two parsers can use the same grammar and build up the same finished constituent through different sequences of partial work. That difference affects the number of edges they handle and the point at which they encounter grammatical checks.
How a parser advances during bulletin composition
The steps in order.
The flow describes the application that motivates the tests. The underlying operations differ by parser. The chart versions use rules and edges, while Tomita’s version uses states and a stack structure. In each case, the grammar and dictionary provide the information for restricting continuation. The experimental comparison focuses on the cost of analyzing the input under the different parsing and grammar configurations.
Starting from an expectation
The top-down chart parser, abbreviated TD, starts by expanding the sentence category. At the beginning of the input, it proposes rules whose left-hand side is the start symbol S. Their edges initially cover the empty span at vertex 0. If one of these rules expects a nonterminal, the parser proposes rules for that category at the current vertex. It continues making the hypotheses implied by the grammar and advances them when it finds matching constituents in the input.
⟨A → α • B β | i, j⟩, B → γ ⇒ ⟨B → • γ | j, j⟩
A is the category of the active rule and B its required nonterminal. α is the part already recognized, β is the sequence after B, and γ is the expansion of B in the rule being proposed. The arrow → separates a rule’s category from its expansion, the dot • divides recognized from prospective material, and | introduces the endpoints inside the angle brackets. The active edge begins at i and ends at j. The new edge begins and ends at j because the newly proposed expansion is still empty at that point. The commas separate endpoints or premises, and ⇒ indicates the edge the operation produces.
A separate operation carries recognition forward. Suppose an active edge requires a category at its right boundary and a complete constituent with that category starts there. The parser can move the dot past the required category, with the right boundary of the active edge advancing to the end of the constituent it has just used.
⟨A → α • | j, k⟩, ⟨B → β • C γ | i, j⟩ ⇒ ⟨B → β C • γ | i, k⟩
A is the category of the complete edge and α its recognized expansion. B is the category of the active rule, β is its recognized portion, C is its required category, and γ is the remaining sequence. The operation applies when A matches C. The complete edge spans j to k, and the active edge spans i to j. Their shared boundary j makes the combination possible, and the new edge spans i to k. The arrows show expansions and the inferred result, the dots show progress, and the bars, brackets, and commas delimit the parts of each edge.
TD is Earley-like in the paper’s terminology. The version tested completes the proposals and combinations available at the current position before moving to the next word. Its schedule suits an input procedure that needs an updated analysis after every selection. Its cost depends partly on how many expansions the grammar offers for each category it expects. An expectation with many possible realizations can generate a large stock of partial hypotheses before the input provides evidence for any of them.
Starting from a constituent
Left-corner parsing, abbreviated LC, starts a rule when it finds a constituent that can occupy the rule’s first position. That position is the rule’s left corner. If the parser has found a phrase of category A, a rule that begins with A can already be treated as partly recognized. The new edge covers the existing phrase and expects whatever follows it in the rule. Further recognition proceeds by the same kind of left-to-right combination used in TD.
⟨A → α • | i, j⟩, B → A β ⇒ ⟨B → A • β | i, j⟩
A is the category already recognized over the span from i to j, and α is the expansion recognized in that span. B is a category whose rule starts with A, and β is the rest of that rule. The new edge retains the same endpoints because its recognized part is the A it uses as evidence. The dot • moves from the end of the existing expansion to a position immediately after A in the new rule. Here again → marks expansion, ⇒ gives the result, and the brackets, bar, and commas organize the edge and its endpoints.
Starting from a recognized constituent makes the proposal depend on something the parser has found in the sentence. It can still propose a rule that turns out to be irrelevant. A phrase may be internally well formed but unusable at the position where it was found. This distinction between evidence within the phrase and evidence from the sentence around it motivates the addition of a top-down filter.
The CKY strategy, named for Cocke, Kasami, and Younger, also starts from recognized constituents. Shann’s variant takes the rule’s rightmost category as the trigger. When a complete constituent appears, the parser looks for rules that can end with that constituent and searches leftward for the adjacent constituents that would complete them. The chart records complete edges in this variant. The rules can have longer right-hand sides than those in the normal form associated with the standard algorithm.
B → β A
B is the category to be built, A is the rightmost category that invokes the rule, and β is the sequence the parser must match to the left of A. The arrow separates the resulting category from the ordered constituents of its expansion. If the edge for A goes from i to j, the first edge chosen to its left must end at i. The same adjacency condition applies at every earlier boundary. If the matching sequence starts at k, the resulting B spans from k to j, where i, j, and k are chart vertices.
The leftward construction matters when rules share endings. The paper gives the example of rules that expand A into B C D and into C D. The ending C D can support both on input that also contains the preceding B. Producing each applicable result can be appropriate locally. The wider context determines which ones can participate in a sentence analysis. A grammar with many shared endings can therefore drive substantial bottom-up work, especially when completed phrases trigger further rules.
Giving individual rules their own triggers
The bidirectional parser, abbreviated BI, gives the grammar writer more control over invocation. A rule can be annotated for top-down use, or designated as bottom-up with a specified trigger somewhere in its expansion. Shann motivates this with De Roeck’s observations about linguistic evidence. An analysis involving a trace may be easier to initiate from a grammatical expectation. In coordination, a conjunction observed in the sentence can be a strong reason to propose the rule that joins the phrases on either side.
Np → Np Conj Np {up Conj}
Np is the noun-phrase category, and Conj is the conjunction category. The arrow → introduces the coordination rule’s expansion. The braces contain the rule’s invocation annotation. up selects bottom-up invocation, and Conj within the braces identifies the category that triggers it. A completed conjunction can start this proposal even though the conjunction is in the middle of the rule. The parser then looks for noun phrases on its left and right.
To describe partial recognition around an interior trigger, BI uses a colon as well as a dot. The colon marks where the recognized sequence begins, and the dot marks where it ends. An edge can thus state that it has found material in the middle of the rule and still needs material on both sides.
⟨B → α : A • β | i, j⟩
B is the category of the rule being pursued. A is the trigger already recognized between vertices i and j. α is the sequence sought to its left and β the sequence sought to its right. The colon : and dot • delimit the recognized material. The arrow → introduces the rule’s expansion, and the angle brackets, bar, and comma mark the edge and separate its boundary information.
When such an edge still needs material to its left, the parser searches for a sequence of adjacent complete edges that satisfies that part of the rule. It then proceeds to combinations on the right. The implementation uses this order to avoid duplicating work through different interleavings of left and right combinations. Top-down proposals are made to the right from a required category and invoke the rules annotated for that use. BI keeps both active and complete edges in the chart. The test asks whether the grammar writer’s choice of trigger can shrink the search enough to improve timing.
Screening candidates and sharing rule paths
Top-down filtering, abbreviated tdf in the paper, checks whether a bottom-up proposal can fit the sentence context. A completed constituent can suggest a parent rule, but the parent’s category may be impossible at the position where the phrase begins. The filter uses the categories that the sentence analysis could require there. In effect, the bottom-up component provides evidence for a candidate and the top-down information determines whether that kind of candidate has a place to attach.
A R B
A and B are grammar categories. R is the reachability relation used for filtering. The expression holds when expanding A can produce a sequence whose leftmost symbol is B. The grammar’s reachability information can be compiled ahead of parsing, so checking the relation during a proposal is a constant-time lookup in the paper’s description. The preparation matters because the filter can be consulted many times in a single sentence.
The paper gives the LC implementation in detail. Before parsing, it computes the reachable categories for each nonterminal, following the relation through successive expansions. At the initial vertex, it installs the set reachable from the root category. When a new active edge expects a category at its ending vertex, the filter adds the categories reachable from that expectation to the information stored at that boundary. In this way the list at a vertex reflects the constituent starts that the current analysis can accommodate there.
When LC considers proposing a rule, it tests the category on the rule’s left-hand side against the reachability information at the relevant vertex. A passing proposal creates a new active edge. This use of top-down information retains the evidence-driven trigger of left-corner parsing. The deciding question is whether a candidate that has local evidence also has a possible connection to the sentence’s structure. The bookkeeping and lookups add work, which the parser can recover by avoiding edge construction, later combinations, and grammatical tests.
Lookahead uses reachability for a different check. Once a parser proposes an active edge, it can ask whether the category that edge now requires can begin with the category associated with the next input word.
Cₙ R aᵢ₊₁
Cₙ is the newly required category, with n identifying that expectation. R is the same leftmost reachability relation. aᵢ₊₁ denotes the preterminal category for the next input word, where i indexes the current input position and +1 advances to the following word. A preterminal is the grammar category immediately above a word. The relation asks whether an expansion of the new expectation could start with that category. Shann describes this check to distinguish it from filtering against the left context. The experiments use an LR(0) table, which does not use a lookahead symbol, and the chart configurations were also run without lookahead.
Rule compilation addresses repeated work inside the grammar itself. A parser may have several rules with a shared sequence of constituents. Shann’s chart implementations group compatible rules into decision trees so they can traverse the shared part together. The example for LC uses two expansions of A that start with B.
A → B (C, D E)
A is the resulting category and B the common first constituent. The arrow → introduces the factored expansion. The parentheses group the possible continuations, with the comma separating the alternative C from the sequence D E. One active edge can represent progress through B for both rules. The analysis branches when the remaining constituents require it.
TD and LC factor from the left because that is the direction in which they advance their active rules. CKY factors from the right because it starts with the rightmost constituent and searches left. BI can use both directions according to how individual rules are annotated. Shann relates this grouping to the construction of LR tables. In each case, preparation can group rule positions that expect the same category next. The representations differ, but both let the parser reuse work encoded before it sees a test sentence.
Parsing with an LR table and a shared forest
Tomita’s parser generalizes LR shift-reduce parsing to handle ambiguous grammars. A shift takes an input symbol into the parser’s current analysis. A reduction recognizes a sequence as the expansion of a grammar category and makes the category available for further parsing. The LR table provides information for choosing actions from the state the parser has reached. Ambiguity can make several actions or paths possible. Tomita’s graph-structured stack represents those alternatives while allowing them to share stack structure.
The parse forest shares a different kind of work. The graph-structured stack concerns progress through the analysis, whereas the forest represents the resulting interpretations. Several interpretations may contain the same analysis of a phrase. A forest can store that piece once and let several larger analyses refer to it. The paper explains the motivation in terms of growth. The number of full parse trees can rise exponentially, while their shared forest has polynomial growth. The distinction has practical consequences when the grammar leaves several attachments or groupings open.
Shann compares a version of Tomita’s parser with the forest and a version without it. Both belong to the same extended LR approach. This comparison makes it possible to vary the representation that stores the result while preserving the general parsing strategy. It also gives the chart comparison a more informative baseline. If much of the timing advantage follows the forest, the gap between a compiled LR parser and a compiled chart parser reflects more than the way each decides which rule to apply.
Adding grammatical checks and preparing inputs
Each parser can use a context-free skeleton with a procedure attached to the rule body. The skeleton specifies the categories a rule combines. When the parser has found all the required constituents, it runs the procedure before constructing the new result. The procedure can inspect or assign grammatical information carried by particular parts of the rule. If a test fails, the parser discards the candidate. A rule may consequently match at the level of categories and still fail once its grammatical conditions are evaluated.
In the monadic configuration, each category is an atomic label and rules carry no feature annotations. A distinction needed by the grammar is expressed through the categories and rules themselves. The simple-feature configuration adds sets of attribute-value pairs whose values are atomic. Its rule procedures can test and assign those values at nodes in a rule. The unification configuration, in the style of PATR-II, uses complex features. Unification attempts to bring compatible feature information together and fails when the required information cannot be made consistent.
The grammar configurations vary how much work follows a candidate structural match. This gives filtering a different economic role in each case. With cheap rule procedures, it may save little beyond chart operations. With costly procedures, avoiding a candidate can also avoid an expensive grammatical check. Conversely, a representation that spends more time on checks may express distinctions in a form that requires fewer context-free rules. Shann therefore treats rule count and rule procedure cost as separate properties.
The first input collection was constructed to control sentence length, ambiguity, and the constructions under investigation. It included prepositional-phrase attachment, relative clauses, and coordination. The same artificial sentences were used for the small-grammar tests. The second collection came from the German avalanche corpus and was paired with a larger monadic grammar based on that corpus. The procedure consists of preparing grammars and running parser configurations over the selected inputs. Rule compilation and the preparation of filter information are grammar operations performed in advance.
Experiments and results
The inputs and the timing comparison
The small-grammar experiment used 50 artificial sentences ranging from 3 to 24 words. Shann describes the inputs in terms of how ambiguity develops. For prepositional-phrase attachment and some coordination examples, longer sentences can give rise to rapidly increasing numbers of parses. In another group, length was varied while the number of readings stayed within a small range, described as 1 to 3 readings. This design gave the experiment a way to examine longer inputs where taking another word increases the number of structures the parser may have to preserve, alongside inputs where length and ambiguity behave differently.
The paper introduces the small grammars as having 22 and 80 rules and also describes their sizes approximately across grammar types. The figures identify some individual settings more precisely for their own comparisons, including a 75-rule monadic grammar for the second prepositional-phrase attachment plot and a 30-rule setting for the coordination plot across grammar types. The small monadic tests used all 9 parser configurations. These included both versions of Tomita, the top-down chart parser, and the bottom-up-capable chart variants with filtering as applicable. The simple-feature and unification tests used Tomita without the forest alongside the chart parsers.
The avalanche experiment used a monadic grammar with 750 rules and 300 lexical items. Its 50 sentences were drawn from the avalanche corpus. They ranged from 6 to 42 words, averaging 19 words per sentence. The compared systems were Tomita, TD, and the LC and CKY strategies with and without top-down filtering. The test brought the comparison closer to the intended domain and included longer sentences than the artificial set. Its sentences had relatively little ambiguity, which makes the set useful for asking how much of Tomita’s advantage persists when the need to represent many alternative readings is less acute.
The programs ran in Allegro Common Lisp on a Macintosh II with an MC68020 and 5 MB RAM. The experiment considers overall time, the production of edges, and the execution of procedures attached to rule bodies. The timing includes the work of those procedures. Garbage collection was forced before each sentence to keep it apart from the timed analysis. In the appendix, Shann reports time in milliseconds and gives totals over sentences as well as average time per word. The relative timing columns use Tomita as the reference for the corresponding comparison.
The appendix also reports timing for a subset of 26 sentences with low ambiguity. The subset includes relative clauses and coordination. The paper describes these inputs as ranging from 5 to 23 words, with a mean of 13 words, and having 1 to 5 readings. These are the reported bounds for the timed subset. The earlier description of how the artificial sentences were constructed gives a separate characterization of the group intended to vary length without increasing ambiguity. The distinction matters when interpreting a timing statement for the subset or a plot for only one construction.
Edge totals need to be read with the representation in mind. In Shann’s implementations, TD and LC keep active chart edges, CKY keeps complete ones, and BI keeps both. For Tomita the corresponding count is the number of shifts. Thus the counters describe how much activity the individual implementations record in their own terms. A shift, a complete constituent, and a partial rule are different units of work. The paper finds that ordering the implementations by these totals gives a different ranking from ordering them by time.
What changes when the input is highly ambiguous
The artificial attachment sentences give Tomita with its forest a favorable setting. In the prepositional-phrase series, a 20 word sentence has 132 parses. The parser is then doing more than progressing through successive words. It must retain many possible structures over material it has already read. The paper’s plots show the forest-equipped version pulling ahead in these cases. Smaller differences are visible when the comparison is with an enhanced chart strategy whose search is already directed by input evidence and the top-down filter.
The overall timings in the small monadic tests report TD at 4.75 to 6.53 times the Tomita reference. The corresponding values for LC with top-down filtering range from 1.67 to 1.9. These are ratios over the tables’ sentence sets. The prepositional-phrase plots show how the timings develop within a construction as the input becomes more ambiguous. The full-set ratios and the plots answer related questions at different scales. An aggregate establishes the overall ordering for a collection, while the plots show where ambiguity makes that ordering particularly consequential.
Total relative parsing time on the artificial sentences with the small monadic grammar of 22 rules
Tomita with a forest takes the least time, and filtered left-corner parsing is the closer chart competitor.
The numbers
| System or setting | total time relative to Tomita |
|---|---|
| Earley-like top-down | 4.75 |
| Left-corner with top-down filtering | 1.67 |
| Tomita with parse forest (this paper) | 1.00 |
The figures for attachment also show Tomita without the forest running roughly alongside filtered LC. That comparison changes how the faster result should be interpreted. The gap between TD and forest-equipped Tomita combines differences in rule invocation with differences in how the implementations handle their analysis work. The narrower comparison with LC, and then the removal of the forest within Tomita, give Shann a way to trace a substantial part of the observed gain to the shared representation of results.
Across the chart implementations, LC with top-down filtering is generally the fastest. The trend holds across the tested grammar types and sizes, with exceptions in the larger of the small monadic and simple-feature settings for low-ambiguity sentences. TD generates many active edges in the small-grammar tests without lookahead. In the attachment plots, the larger grammar makes that proliferation especially costly. BI gives the grammar writer finer control over what starts a rule, but the tests did not find a grammar or sentence set on which that flexibility gave it a winning position.
Timings in the avalanche domain
On the avalanche sentences, the filtered LC parser came closer to Tomita than it did on the smaller monadic sentence sets. Shann reports relative total times of 1.38 for filtered LC and 2.15 for TD, with Tomita as the reference. The longer sentences in this corpus are therefore compatible with a smaller overall gap between the leading approaches. Sentence length and the number of analyses to be represented have different effects, and the avalanche corpus varies the former without reproducing the rapid growth in ambiguity of the artificial attachment examples.
Total relative parsing time on the avalanche corpus sentences with the 750-rule monadic grammar
Tomita leads the comparison, with filtered left-corner parsing closer to it than the top-down parser.
The numbers
| System or setting | total time relative to Tomita |
|---|---|
| Earley-like top-down | 2.15 |
| Left-corner with top-down filtering | 1.38 |
| Tomita with parse forest (this paper) | 1.00 |
The plot for the avalanche set gives additional context for those totals. Shann describes a fairly constant time difference between Tomita and filtered LC in the plot of time per word. TD starts with the cost of creating many active hypotheses and moves closer to LC as the sentences grow longer. Unfiltered LC moves away from the better-performing configurations as length increases. The paper relates that behavior to shared right-hand portions of rules in the avalanche grammar. A parser driven by the constituents it finds can perform substantial work on phrases that eventually prove unnecessary for the context.
For the deployment decision, the avalanche test mattered because it put the leading strategies in contact with text from the intended domain. The edge count alone would have given an incomplete basis for that choice. Each strategy records different events, and the time attached to an event can change when a constituent invokes a rule procedure. In the measurements that include that work, the filtered left-corner strategy remains close enough to make compilation into decision trees a credible alternative to compilation into an LR table for this grammar and sentence set.
The cost of the grammar at a difficult input
The high-ambiguity coordination series supplies a comparison among grammar representations. In discussing the most ambiguous example in that series, a 20 word sentence, Shann reports an average of 70 ms per word for the monadic grammar, 160 ms for the simple-feature grammar, and 1267 ms for the unification grammar. The coordination plot itself follows LC with and without top-down filtering across the grammar types. The timing figures in the discussion capture the scale of the cost difference relevant to the project’s decision.
Average parsing time per word by grammar type in the hardest artificial coordination example
The monadic grammar takes the least time, and the unification grammar requires the most.
The numbers
| System or setting | ms per word |
|---|---|
| Simple features | 160 |
| Unification | 1267 |
| Monadic grammar (this paper) | 70 |
The grammar choice also had implications for the part of the application that proposes continuations. Shann explains that unification would have to account for variables already instantiated by recognized constituents when searching for words that might come next. The timing of the coordination example measures analysis. The additional search burden is a reason for expecting the grammar choice to have a further effect on the interface. The distinction is important because the paper uses the measurements to guide system design without presenting the word-selection window itself as a timed experimental condition.
The project needed fairly fine grammatical distinctions, which Shann describes in terms of about 100 grammatical and semantic features. The design decision was to express the necessary distinctions with a monadic grammar and choose Tomita for the parser. Among the candidates compatible with strict left-to-right operation, TD was set aside on timing grounds. The two leading choices were then Tomita and filtered LC. Tomita ran faster on the large avalanche grammar, and Shann also preferred the design in which the grammar could be compiled into an LR table. Computational simplicity favored atomic categories over the two feature-based alternatives.
What the ablations show
Removing the forest changes the interpretation of the LR result
The comparison between Tomita’s two versions is the clearest component test. With the parse forest, the generalized LR parser can retain ambiguous results in a shared structure. Without it, the overall approach still uses LR actions and a graph-structured stack, but the result representation is different. In the high-ambiguity attachment plots, the forest-free version is roughly comparable to LC with filtering. That supports the paper’s attribution of a substantial part of Tomita’s timing advantage to the forest.
This is evidence about the implemented versions under the tested conditions. The comparison gives the forest a plausible mechanism for the observed effect. When multiple complete parses reuse substantial parts of the same analysis, representation of the shared parts can dominate the cost of keeping the alternatives. Under low ambiguity, the opportunity for such sharing is smaller. The aggregate for the avalanche sentences is consistent with that explanation, although it comes from a different grammar and input set and does not isolate ambiguity on its own.
The finding also revises the explanation Shann takes from Tomita’s earlier experiment. LR precompilation remains a useful implementation strategy, and the selected system uses it. The enhanced chart alternative also precompiles rules, however, and the small difference between filtered LC and Tomita without the forest gives less reason to attribute the full advantage to LR tables. Shann observes that a chart parser could also use a parse forest. This is a distinction between the general usefulness of an output representation and the performance of the particular parser in which it was tested.
Filtering can save expensive work or add avoidable work
Comparing the same bottom-up strategy with and without top-down filtering asks whether the left-context check pays for itself. On the 750-rule avalanche grammar, it improved both LC and CKY. The common right-hand portions of rules in that grammar help explain this result. A recognizable ending can enable several proposals. When some of the resulting categories cannot connect to what is needed at that point, the top-down check can cut off work that would otherwise proceed through combinations and rule procedures.
The relation between work avoided and work added reverses in another setting. The paper reports that on low-ambiguity inputs with the larger small monadic and feature grammars, the added checks can make chart parsing slower. In that comparison, unfiltered parsers are faster for sentences up to 19 words. The relative-clause plot for the 75-rule monadic grammar illustrates this type of condition. A simple analysis offers fewer unproductive possibilities for a filter to eliminate. The parser still has to maintain and consult the information used to screen candidates.
Size alone gives an incomplete prediction. The discussion also reports a positive filter effect with small grammars of 22 or 30 rules. Rule count can affect the number of hypotheses available, but rules of the same count can branch in different ways or repeat different endings. The useful quantity is the amount and cost of work excluded by a successful filter decision. Grammar size matters through its influence on that work, alongside the shape of the right-hand sides and the distribution of readings in the input.
Changing the rule procedures gives a second view of the same tradeoff. In the coordination comparison, filtering is more valuable as the procedures become expensive. According to Shann, roughly two-thirds of the time goes to unification and one-third to parsing alone. Under those conditions, a check that prevents even some rule procedure calls can improve total analysis time. A filter may also reduce chart work. The difference in the cost of procedure calls explains why the effectiveness of the same kind of check can change when the grammar representation changes.
Shann explicitly frames the result in terms of the balance between parsing work and rule procedure work. The specific feature systems in the experiment create the measured costs. A prospective parser comparison using other grammatical procedures would have to establish how frequently those procedures run and how much they cost. Even a modest reduction in the number of candidates can matter when a candidate is costly to evaluate. In a grammar with cheap checks, the check performed by the filter can take up a larger part of the total.
Rule triggers and sentence length explain different parts of the result
The bidirectional tests address a more local intuition about search. A conjunction offers a sensible trigger for a coordination rule, and rule-specific annotations allow the grammar writer to exploit that observation. The timing comparison asks whether such choices improve the parser as a whole. BI produced no winning condition in the tested collections. The evidence supports using the observed chart rankings for this experiment, while the general question of whether an annotation strategy can be effective remains tied to the rules, implementation, and inputs used to test it.
The explanation is clearer if the two kinds of direction are kept distinct. An interior trigger tells the bidirectional parser where it has found evidence to start a rule. A top-down filter tells a bottom-up parser whether the category produced by a proposed rule has a place in the analysis. The two mechanisms address different sources of work. Finding a good anchor inside a proposed phrase can help locate the rule, and the phrase can still be unusable in the sentence context. The experiment gives stronger timing evidence for the context check than for the particular trigger annotations it tests.
Sentence length is another tempting predictor. Shann revisits Slocum’s break-even estimate of about 7 words for top-down filtering, an average over the strategies in that earlier experiment. The artificial constructions in Shann’s experiment illustrate why a single threshold has limited reach. Adding material to an attachment sentence can multiply the number of interpretations. Adding material to an input designed for low ambiguity can leave the number of readings within a narrow range. The filter operates on the hypotheses actually proposed and on the contexts that could accept them, so equally long inputs can offer very different opportunities to save work.
The grammar can amplify those differences. TD has more possible expansions to pursue when a required category branches widely. Bottom-up strategies can follow several paths when prospective rules share the ending already found in the input. Rule procedures add another source of variation after the structural search. The comparisons therefore support a conditional account of performance. The meaning of an extra word depends on the new hypotheses it creates, the ability of the implementation to share them, and the processing cost of those that reach a grammatical test.
Limitations
Limits identified by Shann
The paper cautions that the timings depend on the machine, the Lisp environment, and the way the algorithms were implemented. An implementation’s management of edges, storage, and rule procedures contributes to its measured running time. The shared design for the chart implementations helps make their rule-selection strategies comparable, but the chart and LR families still use different structures. Shann presents the timings as evidence about relative behavior in this experiment and as a basis for choosing components for the bulletin system.
The use of an LR(0) table set the scope of the lookahead comparison. All the tested chart parsers also ran without lookahead. In particular, the results for the Earley-like TD implementation describe a parser that proposes categories from its current grammatical expectations without screening them against the next input word. Shann identifies a comparison between Tomita with an LALR table and filtered LC with lookahead as work still to be done. An LALR table is the lookahead-based LR table variant named in that proposed comparison. The paper reports the empirical comparison for its chosen table and chart configurations.
The study also leaves the combination of parse forests and unification open. Its monadic tests include Tomita with and without the forest, while the feature and unification tests use the version without it. The positive result for the forest therefore has direct evidence in the monadic settings. How the shared representation interacts with richer feature information, and what it saves when unification consumes much of the time, are questions Shann expressly leaves for further investigation.
The paper also cautions against generalizing from the unification timing to all unification grammars or from the filter results to a universal sentence-length threshold. The grammar decides how much work a rule procedure has to perform. The test inputs and rule structure influence the number of times the parser performs it. These properties can move independently. The experiment establishes the timing of the chosen combinations and shows several ways their ranking changes. Its strongest explanation concerns the relation between the cost of screening a proposal and the subsequent work the screening can prevent.
Limits visible in the study design
The measured outcome is sentence analysis time. The project’s application goal includes the time to find possible next words and refresh the selection windows after each choice. Overall sentence time and average time per word summarize a useful part of that workload. They leave the timing of individual interface updates unresolved. An analysis can be economical on average while concentrating its work at a few particularly demanding positions. The paper’s discussion of extra continuation-search work under unification is a design argument based on the grammar’s requirements.
The translations themselves are also outside the empirical comparison. The project gave controlled input an explicit purpose, namely keeping the writer within what the translator could process. The experiments compare the cost of analyzing selected sentences under different configurations. They offer evidence for choosing a parser and grammar representation, while the coverage of all intended bulletin formulations and the quality of the resulting French text remain separate outcomes. The no-post-editing requirement belongs to the design of the translation system.
The artificial tests isolate some useful patterns of ambiguity by construction. The appendix follows prepositional-phrase attachment, coordination, and relative clauses in selected plots. The corpus test supplies a larger domain grammar and real bulletin sentences, with a different distribution of readings and lengths. Comparing those settings can reveal where rankings change, but each transition between them changes several conditions. The avalanche test combines its domain, grammar structure, rule count, and relatively low ambiguity. Its smaller gap between Tomita and filtered LC cannot by itself assign a share of the change to each condition.
The two experiment types also differ in what they test across grammar representations. The artificial tests exercise monadic rules, simple features, and unification. The larger avalanche test uses the monadic grammar. The evidence for a large grammar drawn from the application domain is consequently specific to that representation and the reduced parser comparison. The measured expense of unification on the artificial coordination series informed the decision, while the larger corpus timings quantify the performance of the atomic-category design.
Finally, the comparison of compilation strategies packages several implementation decisions together. LC with filtering uses decision trees, active edges, and a proposal mechanism driven by recognized left corners. Tomita’s parser uses an LR table, a graph-structured stack, and, in the principal comparison, a parse forest. The forest test varies one of those choices inside the LR implementation. The close timing between the enhanced chart parser and forest-free Tomita is evidence about those packages. Establishing the separate contribution of rule compilation would require a comparison that varies compilation while holding the relevant search and result representations fixed.
What came after
The paper closes with two proposed comparisons whose outcomes remain open in this account. One would revisit the relative performance of LR and left-corner parsing when both can use information about the next input word. The other would test the benefit of a shared parse forest when the grammar uses unification. Each proposal follows from an interaction the experiments identified. Lookahead can change the number of active hypotheses a parser pursues, and a forest can change the cost of storing the analyses that survive. No later citing study is documented here that establishes how either comparison turned out.
Cite
Cite as Patrick Shann. 1989. The selection of a parsing strategy for an on-line machine translation system in a sublanguage domain. A new practical comparison. Proceedings of the First International Workshop on Parsing Technologies.
@inproceedings{patrick1989selection,
title = {{The selection of a parsing strategy for an on-line machine translation system in a sublanguage domain. A new practical comparison}},
author = {Patrick Shann},
booktitle = {Proceedings of the First International Workshop on Parsing Technologies},
year = {1989},
url = {https://aclanthology.org/W89-0228/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/shann-1989-selection-parsing-strategy-line-machine/