Elamur Research

A Tree Transducer Model for Grammatical Error Correction

Paper · 2013 · Jan Buys and Brink van der Merwe

Summary

A grammar checker has to decide what to leave alone as well as what to repair. In a learner’s essay, a verb may need a different form because of its subject, an article may be missing from a noun phrase, and an unusual expression may already be acceptable. Jan Buys and Brink van der Merwe tackle these decisions for the CoNLL 2013 shared task. Their system addresses five kinds of error in learner English: articles and determiners, prepositions, noun number, verb form, and subject–verb agreement. It brings these cases into a common framework for grammatical error correction.

The central component is a weighted tree-to-string transducer, a collection of rules that turn pieces of a syntax tree into words. The authors learn the rules from the NUCLE corpus of learner essays. For each training pair, they use the Berkeley parser to analyze the corrected version and align its words with those of the original. The alignment tells the rule extractor which words correspond, where substitutions occur, and which material appears on only one side. The resulting rules can preserve words, substitute forms, and insert or remove words within a syntactic context. The transducer uses a single state and passes each variable subtree on exactly once. Rule weights come from frequency counts, with Good-Turing smoothing to give unseen rules positive weight. A lexical resource supplies additional noun and verb substitutions through WordNet.

At correction time, the authors run the transducer backward. Given the learner’s words, they search for trees that could plausibly have produced them. They split long sentences into clause-like pieces to make that search tractable, collect the most promising derivations, and group together those that yield the same proposed wording. They then rerank the proposals with a 3-gram score trained on about 1,500 million words of English Wikipedia. The vocabulary for that score contains 64,000 words, and the authors tune its contribution on a validation split. The final sentence is assembled from the best-scoring clause choices. The Wikipedia component acts as a language model.

On the official test set of 1381 sentences, the system obtained precision of 0.27, recall of 0.1333, and F1 of 0.1785. Under the revised test annotations, F1 reached 0.2505. The system placed 6th under both versions of the annotations. A diagnostic that let an oracle choose from the proposals using the reference edits reached F1 of 0.64 on development data and 0.75 on the test set. Many useful corrections were therefore available in the lists, while the practical ranking frequently selected another option. Candidate generation also had gaps. Noun number was the strongest category by development recall, while subject–verb agreement was the weakest. The authors point to a structural reason for the latter difficulty: the subject and the verb that must agree with it frequently lie in separate branches of the tree. They also observed unnecessary deletions and missed insertions, especially when a missing article should have been supplied.

Deep dive: A Tree Transducer Model for Grammatical Error Correction

Buys and van der Merwe learn grammatical corrections from aligned learner sentences and use a tree transducer to search for likely repairs. · about 37 minutes to read

The problem and its context

Correction as a choice among possible sentences

Learner writing poses two related problems. A system must identify a place where the text needs attention and choose wording that fixes it. A decision about a preposition depends on which expression it belongs to. A decision about verb agreement may depend on the subject of the clause, even when other material intervenes. A missing article raises another problem because the system must identify a place where there is no word to classify. These decisions share the additional question of whether the existing wording should be preserved.

The shared task gave these questions a concrete scope. Although the essays could include several types of errors, the system was expected to handle the specified categories of article or determiner use, prepositions, noun number, verb form, and agreement. A sentence could therefore contain background irregularities that the requested correction should leave in place. That distinction matters for the training data as well as for the output. The corrected side of a pair represents the changes targeted by the task, with some additional cleanup for training. It can still contain errors outside the target categories.

A word or phrase can provide several plausible repairs by itself. A noun can have singular and plural forms, and a verb can have a set of inflected forms. Knowing the options does little to establish which form fits the sentence. Number and agreement are especially instructive together. A lexical resource can supply a candidate plural or an alternative verb form. Choosing between those alternatives depends on evidence beyond the existence of the form. The paper’s response is to make a syntactic analysis part of the representation from which candidate sentences are generated.

A constituency tree represents a sentence as nested phrases. A noun phrase can contain a determiner and a noun, and a clause can contain a subject phrase and a predicate phrase. This arrangement gives a rule places to attach changes and places to leave subphrases open. It also affects which relationships a compact rule can express. Elements under a common phrase may be easy to include in the same fragment. Elements in distinct branches may require a larger fragment to connect them. The benefits and difficulties of the paper’s approach both follow from this choice of representation in syntax and grammar formalisms.

Approaches the authors describe

The introduction identifies dedicated statistical classifiers as the most prominent line of work at the time. A classifier can learn from nearby words and local syntactic features to predict an error or recommend a correction for a specific category. A complete system can combine several such classifiers and use an estimate of how natural a sentence sounds to filter their suggestions. The paper associates this tradition particularly with work on prepositions and determiners and places most systems from both editions of the Helping Our Own shared task in this broad family. The reports cover Helping Our Own 2011 and Helping Our Own 2012.

The authors also describe noisy-channel approaches. A channel is a process that takes an intended sentence and can produce a changed version of it. For grammatical correction, the learner’s sentence is the observed result. The intended wording is inferred by asking what plausible sentence could have produced that observation. A candidate needs to account for the observed words and be plausible as a sentence. The paper traces some of these approaches to statistical machine translation.

The analogy with translation concerns the representation of paired examples and the inference problem. A learner’s original sentence and an edited version can be linked word by word or phrase by phrase even though they are both in English. This makes it possible to learn transformations from examples and to apply those transformations in a search over possible outputs. The authors cite earlier correction work based on phrase-level statistical translation, including Correcting ESL Errors Using Phrasal SMT Techniques.

The introduction also describes grammar checking with handwritten rules, an approach used in commercial writing tools. An error-tolerant grammar can analyze expressions that violate some of its constraints and identify the point of failure. In the approach developed in this paper, the relevant patterns are extracted from pairs of learner and corrected sentences. The parser supplies a structural analysis, and the paired examples supply evidence for which rewrites to learn and how much weight to give them.

These strands of earlier work help explain the division of labor in the proposed system. The transducer constructs alternatives and assigns scores grounded in the training pairs. The Wikipedia component supplies additional evidence about the resulting word sequences. Both contribute to the decision, and only the first determines which alternatives the second can see. This distinction becomes important when the authors ask whether a correction was unavailable or merely ranked too low.

The method, step by step

Learn the error direction and search it backward

The method starts with a training pair whose intended changes are already marked. The corrected wording is parsed, and the learner’s version is kept as a sequence of words. A rule describes how a fragment on the corrected side can turn into a piece of the learner string. For instance, the paper illustrates a corrected tree containing sprang that produces the learner form sprung. A rule learned in that direction can propose sprang when the decoder encounters sprung. Other rules can account for the same observed form, including a rule that leaves it as it is.

The direction matters for insertions and deletions. An article present in the learner string and absent from the correction is an insertion when the rule is read from tree to string. The same rule is a deletion when used to recover the corrected tree. Conversely, a word present in the corrected tree can be omitted in the learner string. Running such a rule backward makes it possible to propose a word that the learner left out. The terms insertion and deletion therefore depend on which side is taken as the starting point.

At training time, the tree, the learner string, and the links between the two are available together. At correction time, the unknown object is the corrected tree. The authors do obtain a parse of the learner sentence, but they use it to find clause boundaries. The correction search then considers trees whose forward rewrites would account for the words in a clause. This gives the learner-side parse a different job from the corrected-side parses used to extract rules.

From annotated essays to a ranked sentence correction

The steps in order.

From annotated essays to a ranked sentence correctionStep 1: Build learner and corrected sentence pairs1. Build learner and corrected sentence pairsStep 2: Parse corrections and align corresponding words2. Parse corrections and align corresponding wordsStep 3: Extract, supplement, and weight rewrite rules3. Extract, supplement, and weight rewrite rulesStep 4: Split each new sentence into clauses4. Split each new sentence into clausesStep 5: Search backward for candidate corrected trees5. Search backward for candidate corrected treesStep 6: Combine weights for identical candidate wordings6. Combine weights for identical candidate wordingsStep 7: Rerank candidates with Wikipedia word-sequence scores7. Rerank candidates with Wikipedia word-sequence scoresStep 8: Reassemble clauses and restore original case8. Reassemble clauses and restore original case

Prepare sentence pairs from annotated essays

The training resource is the shared-task release of the NUS Corpus of Learner English, or NUCLE. Its essays are divided into paragraphs. In the release used by the authors, NLTK’s Punkt component supplies sentence boundaries, and NLTK’s word tokenizer supplies the word units. The authors retain those boundaries even where they see errors, such as the handling of quotation marks in some contexts. An annotated change is identified by token offsets and replacement text. Consistent segmentation keeps the edit positions meaningful throughout the training procedure. The corpus is described in The NUS Corpus of Learner English.

The authors split the essays at random, assigning 80% to training and 10% each to validation and development. The allocation takes place at the essay level, so sentences belonging to an essay travel together. The training split supplies rule counts. The validation split supplies the evidence used to choose the weight of the Wikipedia score. The separate development split is used for evaluation and diagnosis. This division matters when reading the reported results because the validation score is measured on the material used to choose a setting.

To produce the corrected version of a training sentence, the authors apply the annotated edits in the task’s target categories. They considered applying the other annotated corrections to both sides of every pair. They chose to retain those other errors so that the pairs would resemble the input available at test time. They do make some mechanical corrections on both sides, particularly to spelling. Such a change reduces noise in the pair without asking the transducer to learn the mechanical correction as a target edit.

Training words are lower-cased. The corrected side of each pair is analyzed with the Berkeley parser. It is an unlexicalized parser, meaning that its representation of phrase structure does not assign a particular head word to each constituent in the way a lexicalized parser does. The authors doubt that the remaining errors in the corrected sentences would favor a lexicalized analysis. They configure the parser to select left-binarized trees through Viterbi decoding, which chooses the best-scoring parse under its scoring procedure. This step supplies a single training tree for a corrected string and arranges its branches so a node has at most 2 children. The parser is described in Improved Inference for Unlexicalized Parsing.

Binarization changes the shape of a tree while retaining its terminal words. When a verb phrase has several immediate children, an intermediate node can group some of them. The paper’s example places an intermediate @VP in a verb phrase involving a past-tense verb, a particle, and a prepositional phrase. Rule extraction then has intermediate positions where a transformation can be divided into smaller parts. That is useful because large rules make backward search slower. The distinction between the words of a sentence and the structure imposed on them is central to this use of parsing.

Turn annotated changes into word alignments

An annotation tells the system that a stretch of learner text should be replaced. To learn a general rewrite, the authors need a finer account of which words on the corrected side correspond to which learner words. They obtain this account from the annotations themselves. Words outside the edited stretches are linked to their unchanged counterparts. Inside each edited stretch, the procedure first looks for words that appear on both sides and links matching occurrences while preventing overlaps.

The paper’s illustrated phrase containing America shows why matching inside an edit matters. The learner side contains the America, and the correction contains America. The annotated replacement covers the phrase, but America has a clear counterpart. The procedure links that word and leaves the unaligned. The extractor can then learn that the name was preserved and that its surrounding phrase accounts for the extra determiner. Treating the entire annotated replacement as an opaque substitution would lose that distinction.

Matching shared words may divide an edited phrase into smaller unmatched regions. If material remains on just one side of such a region, it stays unaligned. If both sides have material, the authors connect every remaining learner word in the region to every remaining corrected word in that region. For a single-word replacement, that procedure gives a simple pair of links between forms, as with the learner’s sprung and the correction sprang. For a larger replacement, the complete set of links says that the corresponding phrases belong together without making a finer claim about which individual word realizes which part of the meaning.

In the annotations used here, the learner stretch for an edit is always nonempty, while its correction may be empty. An annotation can still represent an insertion into learner text by replacing a stretch with a version that includes a new word. The matching procedure recovers the words that were already there and leaves the inserted word unaligned on the corrected side. The extraction procedure therefore receives cases of both kinds: words added in the learner output of the transducer and corrected words that disappear from that output.

These links determine how local a learned rule can be. With a direct link between sprang and sprung, the verb substitution can be assigned to the verb node. The authors explain that without that link, the learner verb in their example would be attached to a higher clause rule. The learned fragment would then carry a wider piece of structure even though the annotated change can be explained at the verb. The alignment is consequently part of the design of the rule inventory, not simply an annotation carried along with it.

Define the objects the rules connect

The paper formalizes the transducer using trees over a ranked alphabet. The rank of a node is the number of children it takes. A node labeled with a syntactic category can have child subtrees. A terminal word occupies a leaf. The basic tree notation is as follows.

t = σ(t₁, …, tₖ)

Here t is the whole tree, σ is its root label, and t₁ through tₖ are its ordered child trees. The index k is the rank of σ in this use, and the ellipsis stands for any intervening children. With rank zero, there are no child trees. The paper uses Σ for the tree alphabet, Σₖ for its symbols of rank k, and TΣ for the trees over that alphabet. In TΣ(S), S is an additional set of symbols allowed only at leaves. Variables can occupy those leaves.

M = (Q, Σ, Δ, R, Q_d)

M is the transducer. Q is its state alphabet, whose states take a single tree argument. Σ is the ranked input alphabet on the tree side, and Δ is the output alphabet on the string side. R is the finite collection of rewrite rules. Q_d is the set of permitted initial states. Each rule has a weight assigned by the function π, which maps rules in R to values in a weight set W. In the correction system, there is a single state, named q.

r : q.t → g

r names a rule. On its left, q is the state in which the rule applies and t is the tree fragment to match. The dot associates the state with that fragment. The arrow separates the matching pattern from g, an ordered sequence of output symbols and state-marked variables. A state-marked variable in g instructs the transducer to continue rewriting the subtree matched by that variable. Every variable used on the right must occur on the left.

The left-hand pattern is linear, so a variable appears there at most once. The system also restricts the right-hand side to be linear and nondeleting with respect to the variables in the pattern. Together, those conditions pass each matched variable subtree on exactly once. A rule can still omit a word that it matches explicitly, or emit a fixed word that has no counterpart in its tree fragment. The restrictions apply to the open subtrees represented by variables. Those subtrees are the portions of the tree whose internal rewriting is handed to another rule.

The single state means that the system has no separate transducer state for a noun, verb, clause, or error category. It can still impose syntactic restrictions. Look-ahead conditions require a variable to match a subtree of a specified constituent type. A clause rule can, for instance, require a noun phrase at one variable position and a verb phrase at another. Such a rule preserves the distinction between those positions while leaving the details of each phrase to lower rules.

Rule application begins at the top of the tree. The paper describes each derivation step by looking for the leftmost state-marked subtree in the current sequence. A rule whose tree pattern matches that subtree replaces it with the rule’s right-hand sequence. Wherever that sequence contains a variable, the corresponding matched subtree is substituted into its new position, still marked with the state that will process it. Successive applications eventually leave a sequence containing only output symbols.

t ⇒[r₁] t₁ ⇒[r₂] … ⇒[rₘ] s

t is the starting tree, with the initial state understood, and s is the final string. Each ⇒[rⱼ] denotes one rewrite using rule rⱼ. The tⱼ between steps are intermediate sequences that can contain both output words and state-marked subtrees. j indexes a step, m is the total number of steps, and the ellipsis represents the intervening rewrites. The starting tree and final string form the pair described by the derivation.

wt(d) = π(r₁) · … · π(rₘ)

d is the ordered derivation consisting of rules r₁ through rₘ. wt(d) is its weight. Here π(rⱼ) denotes the assigned weight of the rule at step j. The centered dots denote multiplication, and the ellipsis covers all the intermediate factors. The product gives a score for one complete route through the rules, including both the transformations that introduce changes and the ones that carry material through.

Extract rules at the boundaries licensed by alignment

The authors use the GHKM rule extraction algorithm, which they take from work on syntactically informed translation. Its input for this paper is a corrected tree, a learner string, and the alignment. These can be viewed as a directed graph. Tree edges run from a parent to its children, and alignment edges link leaves on the corrected side to positions on the learner side. The extraction step looks for places where the graph lets a subtree be handled independently of material outside it.

For each node, the algorithm finds the first and last learner positions reachable beneath that node through the word alignments. The interval bounded by those positions is the node’s span. At a leaf, the alignment directly supplies the reachable positions. For a larger phrase, the spans of its children give its boundaries. The algorithm computes these intervals from the bottom of the tree upward.

The algorithm also computes a complement span for each node. This collects spans belonging to nodes outside the node’s own subtree and outside the chain of its ancestors. It can be passed down the tree. A child receives the material already outside its parent’s domain, together with the spans of its siblings. The complement span gives the extractor a way to check whether material in another branch intrudes into the learner interval claimed by the current node.

If a node’s span and complement span are disjoint, it qualifies as a frontier node. A frontier marks a place where an independent rule can begin. To obtain a tree pattern, the extractor starts at a frontier node, follows its descendants, and replaces each further frontier encountered along a branch with a variable. On the learner side, it takes the words within the root node’s span and replaces the stretch covered by each variable subtree with the corresponding variable. Any remaining fixed output words belong to the rule itself.

This procedure produces rules of different kinds from the same graph. A part of the tree with no edits can yield a structural rule that expands a clause into a noun phrase and a verb phrase through variables, or a lexical rule that emits an unchanged word. The linked sprang and sprung yield a local substitution. A larger edit can yield a phrase substitution in which fixed words and tree structure are matched together. The paper illustrates a corrected noun phrase containing the right with rights as the learner-side output.

Unaligned material demonstrates how the spans connect words to context. In the America example, the learner’s extra the sits between aligned words. It goes into the rule for the lowest node whose learner span reaches across it. In the illustrated tree that node is a prepositional phrase. The rule can therefore express the extra article as part of a particular phrase transformation. The same rule, applied backward, can remove the article during correction.

The rule inventory also includes phrase rewrites with a mixture of fixed words and variables. One example relates a verb phrase built with to work and a following prepositional phrase to a learner sequence built with working and the same variable phrase. Another type can place a fixed preposition between the outputs of variable subtrees. Such rules carry some structural context while allowing the subtrees themselves to vary. The authors distinguish fully lexical phrase substitutions from those with variables and describe their word insertion and deletion rules as context-sensitive.

The extractor builds a derivation that is minimally consistent with the alignment for each training example. Each frontier boundary allows it to delegate part of the rewrite to a smaller rule. The counts used for estimation come from these extracted derivations. The learner corpus thus supplies both the structure of the observed rules and the evidence about how often they are used.

Add lexical coverage and estimate rule probabilities

The transducer’s vocabulary combines the words on the corrected side of NUCLE training pairs with the vocabulary chosen for the Wikipedia component. The authors want the transducer to be able to accept words from this union even if the extractor never found an identity rule for them. For each vocabulary word, they use the NLTK part-of-speech tagger to obtain one or two possible tags and add rules that can pass the word through unchanged under those tags. An unchanged option is important when a word participates in a possible rewrite but is already suitable in its context.

URLs in the training essays are replaced with <url>, reducing the influence of varied citation strings on the vocabulary. In validation, development, and test material, a word outside the vocabulary is represented by <unk>. The system tracks the original words so it can put them back after decoding and supplies an identity rule for the unknown symbol. This procedure gives the decoder a way through a sequence containing an unfamiliar word. The authors use the low occurrence of unfamiliar words as their reason for omitting an automatic spelling-correction step on test input.

The additional substitution rules address the sparsity of nouns and verbs in the paired data. Through NLTK’s WordNet interface, the authors group singular and plural forms of non-proper nouns in the Wikipedia vocabulary, along with verb forms that share a base form. They add noun-number substitutions in both directions and substitutions among the forms of a verb. An alternative verb form can serve either a verb-form correction or an agreement correction. The lexical rule provides the form change, while the ranking still has to decide whether the subject or surrounding context calls for it.

For articles, determiners, and prepositions, the authors judge that the set of likely substitutions is small enough for the training corpus to supply the necessary rules. This assumption gives those categories a different source of coverage. A useful noun or verb substitution can be available through the supplementary vocabulary even when no matching edit was extracted. A determiner or preposition substitution depends on what the extraction procedure learned from the corpus.

The observed count of a rule is preserved when an added rule already exists. Rules that come only from supplementation start with a count of 0. Before smoothing, the estimated probability of a rule is its frequency divided by the total frequency of rules with the same root category.

p(r ∣ root(r)) = f(r) / ∑[r′ : root(r′) = root(r)] f(r′)

p(r ∣ root(r)) is the estimated probability of choosing rule r given its root category. The vertical bar means “given.” root(r) is the syntactic label at the root of the rule’s left-hand tree fragment. f(r) is the count of that rule across the training derivations. In the denominator, r′ ranges over the rules whose root label equals root(r), and ∑ adds their counts. The slash denotes division.

The conditioning choice follows from the authors’ use of a joint probability over trees and strings. At a given syntactic root, different left-hand fragments compete with one another as well as with different outputs. If the entire left-hand fragment were fixed in the conditioning context, the estimate would instead describe the distribution of outputs for a supplied fragment. Root-based conditioning allows the choice of tree fragment itself to contribute to the weight assigned during the search for a corrected tree.

The authors use Good-Turing smoothing to make the supplemental rules available with non-zero weights. Within each root nonterminal, they re-estimate counts whose frequencies lie between 0 and 5. The adjustment gives weight to rules with no observed use and reduces reliance on low counts that may be unreliable. Consequently, the vocabulary can provide a correction the extracted derivations never exhibited, while its score still comes from an estimation procedure shared with the observed rules.

Define the search objective and keep it tractable

The aim is to recover a corrected sentence from the learner sentence. The observed input is held fixed while the decoder compares the joint probability of that input and each possible correction.

ĉ = arg max[c ∈ C] P(c, i)

ĉ is the chosen correction, and c ranges over the set C of possible corrected sentences. i is the observed learner sentence, which may already be acceptable. P(c, i) is the joint probability of candidate c and observation i. The expression arg max returns the candidate that maximizes this probability.

A candidate sentence can have more than one parse. The final words are what the system returns, so the intended sentence-level objective sums probability over trees with those words as their yield. The yield of a tree is its terminal word sequence read in order.

ĉ = arg max[c ∈ C] ∑[π ∈ τ(c)] P(π, i)

ĉ, c, C, and i have the same meanings as in the previous equation. τ(c) is the set of parses whose yield is c. Within this equation, π means a particular parse tree. The notation here differs from the earlier use of π for a rule weight function. P(π, i) is the joint probability of that tree and the learner string, and ∑ accumulates this probability over the parses of c. The paper also notes that a given tree and learner string may be connected by several derivations, though it reports that this first kind of ambiguity occurs infrequently in application.

Exact search over whole sentences is impractical for many of the examples in the study. In the training material, 46% of sentences exceed 20 words and 13% exceed 30 words. The authors observed a steep rise in decoding time above 20 words and found lengths above 30 impractical on their resources. They ran their decoder on a desktop equipped with 8 GB of RAM and aimed for an average processing time of one minute or less per sentence. They therefore use clause splitting to reduce the amount of text handled at once. Clauses still over 30 words are skipped by the decoder.

The splitting rules inspect constituency parses of the original learner sentences. The authors group S, SINV, and SQ under the label S-clauses, and SBAR and SBARQ under SBAR-clauses. An SBAR-clause commonly introduces an embedded clause along with a subordinating conjunction or a wh-word. When the embedded S-clause falls under such a constituent, the procedure keeps the introductory material outside the extracted clause. It also splits at a coordinating conjunction tagged CC when the conjunction is a direct child of an S-clause. The conjunction is kept out of the individual spans given to the decoder.

The goal is to supply relatively sentence-like units that still contain enough structure for useful rules to apply. The resulting units can be shorter than the sentences from which they were taken. They also delimit the evidence available during correction. Once a split is made, any relation between words in separate pieces is unavailable to the search within either piece. The preserved material between clauses allows the chosen replacements to be put back into the sentence after decoding.

The authors implement backward application with Tiburon, a toolkit for weighted tree automata and transducers. Its decoder uses a weighted form of Earley parsing and supports search for the top k derivations. The implementation takes the 1000-best derivations for a learner input under the search settings. Whenever retained derivations produce trees with the same corrected yield, their weights are added to give that sentence a combined score. The result approximates the sum over all parses in the objective, using only the surviving derivations the decoder returns.

Binarized trees help keep the extracted patterns small. The authors also remove any remaining rule with more than four variables. Additional pruning takes place as the search runs. The cell limit γ is 30, so a search cell can retain at most that many hypotheses. The beam width β is 10⁻⁴. At a point in the search, a hypothesis is dropped if its score falls below the best partial score there multiplied by β. The settings were chosen for feasibility on the available hardware. Even a candidate that would score well as a complete correction can be lost if it depends on a partial analysis eliminated by these limits.

Use Wikipedia to rank the surviving strings

The other score estimates how plausible a candidate’s word sequence is in English Wikipedia. The authors use the April 2013 XML dump, extract sentences of at least 6 words, tokenize them with NLTK, and lower-case them. The resulting corpus contains about 1,500 million words. They keep the 64,000 most frequent words as the vocabulary and train a 3-gram language model with SRILM, using Kneser-Ney smoothing. A 3-gram score uses short sequences to estimate how well words fit their immediate predecessors. It is an instance of an n-gram.

This source gives the ranking evidence distinct from the corrections observed in NUCLE. The transducer scores how a proposed tree and wording can give rise to the particular learner input. The Wikipedia score concerns the candidate string itself. A plausible local word sequence can receive support from Wikipedia even if the corresponding edit was infrequent in the annotated corpus. The advantage applies only after the transducer has generated a candidate. A sequence absent from the candidate list receives no opportunity to compete.

The two scores are log probabilities normalized by the length of the learner input. The transducer score keeps a fixed coefficient, and the Wikipedia score receives a tunable weight. The practical selection rule is as follows.

ĉ = arg max[c ∈ H(i)] [TT(c, i) + α · LM(c)]

ĉ is the selected correction, and c ranges over H(i), the hypothesis set generated for learner input i. TT(c, i) is the normalized transducer score of the candidate paired with that input. LM(c) is the normalized Wikipedia score of the candidate’s words. α is the weight on that score. The centered dot denotes multiplication, the plus sign adds the contributions, and arg max selects the candidate giving the greatest combined score.

The authors choose α on the validation set by evaluating the edits produced by the corresponding selections. The objective pools edit counts across the split before calculating F1.

α̂ = arg max[α] F1[∑[i ∈ I] edits(ĉ, i, g(i))]

α̂ is the selected weight, and α ranges over the weights under consideration. I is the collection of learner inputs in the validation set, and i is one such input. ĉ is the candidate selected for that input at the weight being evaluated. g(i) gives its gold-standard edits, and edits(ĉ, i, g(i)) returns the counts of matching system edits, all system edits, and gold edits. The sum pools those counts across I. F1 is the evaluation function applied to the pooled counts, and arg max returns the weight that gives its best value.

After ranking, the system takes the top candidate for each decoded clause. It rejoins the pieces and preserves the introductory or coordinating material excluded from the clause search. The original case is restored, and tracked unknown words are recovered from their placeholders. The resulting text can be compared with the learner sentence to identify the system’s proposed edits.

Experiments and results

Data and the unit of evaluation

The paper reports performance on the NUCLE validation and development splits and the official shared-task test set. The test set contains 1381 sentences. The splitting procedure turns them into 2247 clauses. The authors describe the test and training sentence-length distributions as similar. They report 0.03% out-of-vocabulary words in the test set, which contains no URLs and appeared cleaner to them than the training material. The share of clauses with annotated corrections differs between splits. It is 21% in development and 46% in the test set.

The official metrics are measured over edits. Precision asks what share of proposed edits match the reference. Recall asks what share of reference edits the system recovers. F1 combines the two, so a system needs both reliable proposals and reasonable coverage to score well. The calculation pools edits over the set being evaluated. A sentence that needs no changes contributes to precision if the system alters it, and a sentence with several errors can contribute several successful or missed edits. Sentence-level exact match is a different question from the one asked by the official F1 score.

There can be more than one way to break the difference between a learner sentence and a system output into edits. The shared task uses the M2 scorer to resolve that issue. It represents alternative sequences of system edits in a lattice, a structure that lets different edit sequences connect the same original and output. The scorer selects the sequence with the best match to the gold edits. The resulting counts are used for the system’s precision, recall, and F1. The gold annotations and the procedure for matching them are both part of the evaluation benchmark.

The paper’s main results table reports the submitted approach across evaluation splits and annotation versions. It gives the shared-task rank, but supplies no named competitor’s score in that table. The principal numerical comparison for the system on the same test material is between the original and revised annotations. The oracle provides a different comparison within the approach, since it measures how well the generated suggestions could do if selected with access to the reference.

Validation, development, and the official test

The strongest validation F1 was obtained with α set to 1.6949. At that weight, validation precision is 0.065, recall is 0.153, and F1 is 0.092. Development precision is 0.079, recall is 0.149, and F1 is 0.103. The best validation setting determines what is evaluated on development. These results show a system which recovers some gold edits but makes many proposals that the references do not credit.

On the test set under the original annotations, the results table gives precision of 0.2700, recall of 0.1333, and F1 of 0.1785. Under the revised annotations, precision is 0.3712, recall is 0.1891, and F1 is 0.2505. The authors submitted plausible alternative corrections produced by their own system for consideration in the revision. They attribute part of the improvement to that process. The rank is 6th with either annotation set.

Submitted corrections on the CoNLL 2013 test set by annotation version, F1

The revised annotations give the submitted corrections more credit.

Submitted corrections on the CoNLL 2013 test set by annotation version, F1Original annotations: 0.1785Original annotations0.1785Revised annotations (this paper): 0.2505Revised annotations (this paper)0.2505
The numbers
System or settingF1
Original annotations0.1785
Revised annotations (this paper)0.2505

The chart compares evaluation conditions for the submitted system. A reference revision can turn a proposal that previously lacked a match into a credited edit. It can also change which edits count towards recall. The higher score therefore reflects what the revised gold standard recognizes. The paper reports no intervening decoder or reranker change to account for this increase.

Precision under the original test annotations is higher than on development, while recall is lower. The authors connect the precision result to the greater prevalence of clauses with annotated errors. When fewer clauses need a change, edits to text that should be preserved weigh particularly heavily. They also judge the test set less noisy overall. These are observed differences between the splits and possible explanations for the scores. The experiment does not vary the prevalence of errors while holding the rest of the test material fixed.

Results by error category

The paper gives recall for each target category on development and the original test set. Noun number has recall of 0.2231 on development and 0.1818 on the original test. Verb form has recall of 0.1839 and 0.1475, respectively. These are the categories for which the authors supplement the extracted inventory with lexical substitutions, though the reported results concern the whole system with those rules in place.

Article or determiner recall is 0.1564 on development and 0.1261 on the original test. Preposition recall is 0.1655 on development and 0.0932 on the original test. The authors single out prepositions because their test recall falls substantially relative to development. They take this as possible evidence that the preposition rules generalize poorly. The recall breakdown does not identify which particular rules, contexts, or ranking decisions account for the change.

Subject–verb agreement recall is 0.0957 on development and 0.1048 on the original test. Agreement is the lowest-recall category on development, while preposition recall is lower on the original test. Noun number leads the recall comparison on both splits. These are comparisons of the share of annotated edits recovered within each category. The paper gives no matching category-level precision figures in that breakdown, so a higher recall category can still contain uncredited proposals.

What the candidate lists contain

The oracle evaluates the set of hypotheses generated by the transducer. For each input it can use the gold edits to select the available candidate that contributes to the best attainable F1. This supplies a measurement for the existing lists under favorable selection. The paper also reports hypothesis coverage, which asks whether the corrected wording itself was present. A partial repair may help oracle F1 even when it is insufficient for exact coverage.

On development, exact hypothesis coverage is 99% for clauses without annotated corrections and 49% for those with annotations. The oracle F1 is 0.64. On the test set, the paper reports 100% coverage for unchanged inputs and 50% for inputs that should change. The oracle F1 reaches 0.75. The test discussion also reports oracle precision increasing from 0.65 to 0.95. Those precision figures concern oracle selection, whereas the submission’s precision is obtained by ranking candidates without access to gold edits.

The coverage analysis gives a more specific reading of the oracle result. On unchanged input, the transducer nearly always offers a wording that preserves the original. A system that changes such an input has usually had the option of leaving it alone. For an input that requires edits, finding the reference wording is substantially harder. Better ranking can improve choices among available proposals, while better rule coverage or search is needed to make unavailable proposals eligible for selection.

What the ablations show

The paper gives no component-by-component ablation table. Its main analyses compare oracle and practical selection, measure coverage for changed and unchanged inputs, vary the weight of the Wikipedia score, and break recall down by error category. Each comparison answers a different question about the submitted pipeline.

Candidate availability and ranking errors

The cleanest comparison keeps the generated alternatives fixed and changes how they are selected. The ordinary reranker has the transducer and Wikipedia scores. The oracle has the reference edits as well. Its substantially higher F1 indicates that the generated alternatives include many corrections that meet the evaluation criterion and that the ordinary ranking passes over. The comparison says something concrete about the potential of the candidate lists as generated with the study’s splitting and pruning.

Coverage adds a second distinction by asking whether the reference wording is present at all. The strong coverage for unchanged input shows that proposing a change where none is required typically reflects a choice among alternatives. Where the unchanged candidate survives, a ranking rule gives another candidate a greater score. On edited input, missing reference wordings reveal a different problem. The ranking rule can choose a useful partial repair, but it has no means of returning a complete reference wording outside its list.

The F1 and coverage diagnostics also have different notions of success. Coverage requires the wording to be present. F1 can reward recovery of some reference edits in a clause that calls for several changes. It can also penalize collateral edits to text outside the repaired spot. The oracle compares candidates by their contribution to the aggregate edit score. For an individual clause, its best choice can be to make a partial repair or to preserve the original when a more heavily edited candidate would add too many unmatched changes.

How the Wikipedia score affects selection

The validation experiment changes α while keeping the transducer contribution fixed. The authors report that a relatively strong Wikipedia weight increases recall. This is evidence about ranking: the additional word-sequence score can favor alternative wording containing an edit that the transducer by itself would give less support. The choice of α comes from validation F1, so a setting that simply proposes more edits still has to earn enough matching edits to offset false positives.

The authors also say that varying α gives them better control over the precision–recall tradeoff on the test set than on validation. They take that behavior, together with the split results, as a sign that the method fits the characteristics of the test material better. The paper describes the gains from incorporating the Wikipedia component, while leaving the numerical score for a full transducer-only run unstated. The weight analysis identifies a change in the behavior of the combined ranking and gives the value used for submission. It leaves open how large the independent contribution would be under a separate, otherwise matched comparison.

A local language score can favor a common phrase, and the transducer can favor a transformation seen frequently in training. These sources of evidence can support different candidates. A high α gives common word sequences more influence among the existing alternatives. Since the score is defined for the string, it supplies no additional reason to prefer one tree over another once both produce the same words. The probability added across derivations enters through the transducer score.

How structural choices show up in the errors

The authors interpret low agreement recall on development in light of constituency structure. A subject noun phrase and the verb phrase it agrees with are in different subtrees. A verb substitution rule can supply all the forms needed for a repair, yet a local fragment within the predicate may have little information about which form agrees with the subject. A larger fragment encompassing relevant parts of both branches could express more of the dependency, and large patterns are also the ones that tend to cost more during inference. This is a structural explanation offered by the authors, instead of a result from replacing the tree representation and measuring the effect.

Noun number offers a useful comparison. The higher recall shows that the full pipeline retrieves more of those annotated edits. The inventory includes direct singular–plural substitutions and is able to use them in syntactic context. Several factors could contribute, including how frequently the relevant forms occur and how the reference edits are distributed. The study does not remove the supplemental substitutions and rerun the experiment. The per-category outcomes therefore describe where the submitted system is strongest and weakest, with the causal contribution of individual rule sources still open.

Qualitative inspection gives a further clue about insertion and deletion. The authors observed extra deletions of content words and non-article determiners. They also observed failures to add articles where needed. These are distinct failure patterns. An unnecessary deletion means a damaging transformation was available and selected. A missed insertion can arise because the appropriate insertion never survived search or because another candidate outranked it. The examples establish that both kinds of errors matter in practice, while the reported diagnostic does not assign every missed insertion to a particular stage.

Limitations

Limits the authors identify

The authors identify the treatment of insertions and deletions as a weakness. A transducer can represent both operations, but the submitted system deletes words that should remain and misses edits that would supply absent words. The reported cases include removals of content words or non-article determiners and missed article insertions. Preserving variable subtrees guarantees that an open part of a rule will be carried forward. It gives no guarantee about the appropriateness of deleting a word explicitly covered by a rule or about the presence of a suitable rule for an omitted article.

The paper also identifies difficulty in representing dependencies with the chosen trees. In an agreement case, the required evidence can lie in separate parts of the tree. The transducer can sometimes generate candidates that reflect nonlocal dependencies, as the authors observe, but the grammar of possible rewrites and the heuristics used for search both limit that ability. A compact rule can capture local evidence efficiently. Dependence on larger fragments raises the cost of extracting and applying rules and can make the relevant pattern rarer in the training derivations.

Runtime imposes a related constraint. The authors skip clauses still longer than 30 words and use the cell limit and beam to control the partial analyses they retain. They explicitly acknowledge that pruning may erode some of the benefit of reasoning over a whole sentence. The search still offers useful structure, while the experiments leave the size of the accuracy loss from pruning unmeasured. The chosen limits express an engineering compromise on the desktop used for decoding.

The authors also consider the evidence for generalization uneven. Preposition recall drops on the original test set relative to development. They suggest that the rules for prepositions may fail to transfer well enough across the kinds of examples present in the splits. Since determiner and preposition coverage was left to the extracted rules, the authors’ assessment of that rule source matters. They propose improving the rule set and its probability estimates, reducing the accuracy cost of faster decoding, and exploring reranking with additional features.

Limits visible in the experimental design

The study concerns a specified set of edits in English learner essays. The training corrections preserve some errors outside the target types, and the system is scored according to the shared task’s annotation scope. The results establish performance under that scope. They leave open how the pipeline would behave as a general copy editor, on other writing domains, or under a requirement to repair every grammatical problem it encounters. The same distinction applies to spelling. Some training spelling is cleaned up, and the test procedure carries unknown words through, so the reported system is evaluated as a grammar corrector with those preprocessing choices.

The “correct” tree in a training example depends on the parser’s analysis of text which can still contain errors. A poor attachment may place an edit under the wrong constituent, and an alignment choice may determine whether it is represented by a local or a broader rule. The experiment uses the resulting trees and alignments as the basis for learning. It does not measure extraction with manually verified trees or compare the correction results under alternative parse and alignment choices. The observed accuracy therefore covers the whole pipeline, including these upstream decisions.

Clause splitting creates a structural boundary of its own. A grammar repair that depends on words across that boundary cannot use them together during clause decoding. Reassembly restores the order of clauses and excluded connecting words, but the top choices were made separately. The paper’s results support the performance of this tractable clause-wise system. The behavior of a full-sentence search, and the share of missed edits attributable to clause boundaries, remain open.

The list of retained hypotheses is also shaped by more than the available linguistic rules. A candidate may be absent because no rule combination can build it, because a clause was skipped, because a partial route was pruned, or because its derivation fell outside the returned list. Exact coverage shows the combined effects of these mechanisms. It cannot identify which mechanism excluded a particular reference correction without an additional experiment. The oracle is correspondingly a ceiling for selection from the reported lists under the scorer, not an assessment of every derivation the full transducer could in principle produce.

The reference annotations affect both measured coverage and measured edits. A plausible correction can fail to match the intended wording, as the shared-task revision illustrates. The original and revised test scores are important in their own right because they show what each annotation set credits. The increase under revised annotations does not establish an improvement in the ranking procedure. Similarly, the oracle’s use of gold edits makes its scores evidence about the lists, not a performance estimate for a deployable correction system.

Finally, the comparisons across development and test involve different source material and error characteristics as well as different measured outcomes. The authors’ explanation of test precision in terms of error prevalence is plausible within their analysis. The study does not isolate that factor by constructing matched inputs at different error frequencies. The stronger test precision and the different behavior of the reranking weight describe the splits used here. A broader claim about when the system will generalize would require evidence across additional settings.

What came after

There is no documented follow-up to trace for this paper. The authors close by identifying three directions for further investigation within the approach. A richer rule inventory could expose more of the dependencies that determine whether an edit is grammatical. More efficient inference could retain useful analyses that the beam and length limits discard. A reranker with additional features could make better decisions among the candidates already available. These are questions posed by the study, and its oracle and coverage results explain why progress on selection and progress on candidate generation would address different parts of the observed error.

Cite

Cite as Jan Buys and Brink van der Merwe. 2013. A Tree Transducer Model for Grammatical Error Correction. Proceedings of the Seventeenth Conference on Computational Natural Language Learning: Shared Task.

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{buys2013tree,
  title = {{A Tree Transducer Model for Grammatical Error Correction}},
  author = {Jan Buys and Brink {van der Merwe}},
  booktitle = {Proceedings of the Seventeenth Conference on Computational Natural Language Learning: Shared Task},
  year = {2013},
  url = {https://aclanthology.org/W13-3606/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/buys-2013-tree-transducer-model-grammatical-error/