Four types of context for automatic spelling correction
Paper · 2012 · Michael Flor
Summary
A spellchecker can tell that a word is unfamiliar and still have several plausible guesses about what the writer meant. A misspelling like forst could point to first, forest or frost. The surrounding words can make the choice straightforward for a reader. Michael Flor’s study asks how a spellchecker can use the same evidence to correct unfamiliar spellings in student essays. It focuses on errors written as a single token, a unit of text recognized by the system, whose spelling is absent from its dictionaries. Choosing a correction matters for feedback to writers and for automated analysis, where an unfamiliar spelling can interfere with subsequent judgments about the language or content of an essay.
The paper’s system, ConSpel, first generates possible replacements and gives them scores based on spelling, sound and general frequency. It then tests four ways to change their order using context. The first asks whether a candidate occurs in familiar sequences with the words immediately around the error. The second asks whether nearby words are associated with the candidate, even if they do not form a phrase with it. The third looks across the essay for another use of the same word or one of its inflected forms. It can also use a strong candidate from another misspelling. The fourth gives preference to words found in the materials for the writing assignment.
The evaluation uses 3,000 annotated essays from GRE and TOEFL examinations. Across the full corpus, the system that ranks candidates in isolation scores 74.39 on Top1 F1, which evaluates the first suggestion. The strongest contextual evidence comes from ordered word sequences. Scoring them by observed frequency and by the strength of their association works better in combination than either approach on its own. The two sequence scores together reach 85.72. Adding the score for related nearby words yields the highest observed Top1 F1, 85.87, although that last addition is statistically inconclusive. The best combination scores 95.27 on InTop5 F1, which gives credit when the intended correction appears anywhere among the five leading suggestions.
Nearby word associations and repetitions elsewhere in an essay both help when added individually to the baseline. Prompt vocabulary shows a narrower benefit. It makes little difference across the whole corpus, but on the TOEFL Integrated task, whose reading and listening materials supply a substantial shared vocabulary, it takes Top1 F1 from 73.93 to 79.26. The experiments show that the usefulness of context depends on what the system can observe. A frequent local phrase, a related word elsewhere in the sentence and a term used in the assignment each offer a different basis for choosing a correction, and their benefits do not necessarily carry over when the system combines them.
Deep dive: Four types of context for automatic spelling correction
A study of how nearby phrases, related words, repetition and writing prompts help a spellchecker choose corrections for student essays. · about 35 minutes to read
The problem and its context
Finding a suspicious token and deciding what it means
An unfamiliar spelling poses two questions. Is this actually an error, and if so, which replacement preserves what the writer intended? A dictionary helps with the first question. For the second, a dictionary provides a collection of possible answers that still have to be put in order. In an essay, for example, forst might come near a mention of wildfires, an account of who arrived earliest, or a description of ice crystals. Each setting gives a different answer to the spelling question even though the letters of the suspicious token stay the same.
The paper calls a spelling a non-word when the string is absent from the spelling dictionaries used by the system. That definition is operational. A valid surname can be a non-word for a particular system if its dictionary omits it. An unintended spelling can pass a dictionary check if it happens to match an entry. The paper calls the latter kind a real-word misspelling. A replacement such as then for they therefore presents a different detection problem from a replacement such as business for businees. Context enters the study chiefly after ConSpel has decided that the written token deserves a correction attempt.
The distinction between the number of tokens in the error and the number in the answer also matters. A writer can run adjacent words together, producing a single unfamiliar token. A spellchecker can then restore the separation by proposing a replacement with spaces. A split error presents the reverse challenge because the system has to recognize that separate pieces belong together. By focusing on the location of a single suspicious token, the paper gives the rankers a well-defined place to look for evidence while allowing a replacement that can be longer than the original in tokens.
Why essays make the choice consequential
Spelling errors are a persistent feature of student writing. In the study of United States college composition that Flor cites, they accounted for about 6.5% of the errors recorded even though writers could use spellcheckers. The paper also describes research finding that writers learning English can make different kinds of spelling errors from native speakers. The difference matters for candidate generation. A system designed around slight slips can miss the intended spelling when the written form has diverged substantially from it.
The effect of a misspelling can extend beyond the line where it occurs. A writing assessment system may count or flag spelling errors directly. It may also estimate how varied a writer’s vocabulary is, look for errors of grammar or usage, or assess the content of an answer. An unintended string can obscure an ordinary word that another component expects to recognize. Conversely, treating an unfamiliar name as a spelling fault can create feedback where none is warranted. The paper discusses both kinds of problems because ConSpel is intended for use in essay analysis as well as research on spelling errors.
The cited work on prepositions and determiners gives a concrete example. When a spelling error occurs close to a preposition, a procedure trying to judge the preposition can lose evidence from the surrounding words. Work on collocations faces a similar problem when a spelling error hides one of the words in a conventional expression. Spelling correction thus affects what other procedures get to observe in grammatical error correction and learner language. The earlier study discussed in this connection is A Classifier-Based Approach to Preposition and Determiner Error Correction.
What a spelling system could already use
The conventional starting point was to check tokens against a dictionary and rank possible replacements by how closely they resemble the error. Edit distance expresses resemblance as the number of character changes needed to get from one string to the other. A phonetic comparison adds another way to recognize a connection when the writer used letters that can suggest a similar sound. General word frequencies give the system a reason to prefer a commonly used candidate over an obscure one when other evidence is comparable. These sources can all be consulted for an isolated misspelling.
Another line of work estimated how a particular word might have turned into the string the writer produced. The noisy-channel account treats the observed spelling as the outcome of possible changes to an intended form. Evidence about those changes can come from pairs of incorrect and correct spellings. Earlier work described by Flor estimated confusions involving characters or strings of characters. Such a procedure can distinguish two candidate corrections at the same edit distance when the changes required by one candidate are better attested. The paper traces the spelling application to A Spelling Correction Program Based on a Noisy Channel Model and discusses a later treatment in An Improved Error Model for Noisy Channel Spelling Correction.
Word sequence statistics were also already used in spelling correction. An n-gram is a sequence of consecutive tokens. Its frequency in a large text collection offers evidence about whether a possible replacement makes a familiar sequence with the words on either side. Flor describes earlier applications to non-word and real-word errors, including work using the Google Web1T collection and work bringing information from the web to spelling correction. The question for ConSpel is how to pool evidence from different spans and how that evidence compares with context drawn from elsewhere in the text.
Other precedents address broader kinds of context. Earlier work used WordNet to judge whether a candidate for a real-word error was semantically related to words in the text. Flor describes applying that idea to non-word correction as a new use to the best of his knowledge, and builds the evidence from recorded co-occurrences. Research on lexical cohesion had already connected repetition and relations among words to the organization of a text. The paper’s recurrence procedure puts that observation to work by using a repeated word as evidence about a particular misspelling. The earlier discussion of cohesion includes Lexical Cohesion Computed by Thesaural Relations.
Finally, earlier work on correcting the output of optical character recognition had given extra priority to words associated with a known topic. Those approaches illustrate that useful vocabulary can come from outside the text being corrected. Flor’s setting offers an external source that is available before an essay is written, namely the assignment. It also gives that idea a difficult test. A short opinion prompt can send different writers in very different directions, while an assignment that asks them to relate material they have just read and heard supplies more specific words that they may reuse.
The method, step by step
From essay text to a ranked list
ConSpel separates detection, candidate generation and ranking. It first decides which bits of the essay to treat as tokens and checks them against its dictionaries. For a suspicious token, it retrieves possible replacements. Each enabled ranker then scores the candidates using its own evidence. ConSpel places those scores on comparable scales and combines them. The result is an ordering that can be used to select a single answer or present a shortlist. Because the initial flag comes from a separate component, the same detection decisions can support all the correction comparisons.
How ConSpel finds and ranks spelling corrections
The steps in order.
Detecting the error and generating replacements
The system makes decisions about tokenization before the dictionary check. It can separate words at punctuation even when a writer has omitted an expected space. A period with no following space therefore need not cause the text on either side to be flagged as one long error. ConSpel also treats hyphenated material as separate tokens and recognizes abbreviations such as e.g. as single units. Its default exclusions cover numbers, dates, web and email addresses, and strings that mix letters and digits. The aim is to keep ordinary non-dictionary material from being mistaken for misspellings.
ConSpel’s spelling dictionaries contain about 360,000 entries. The core vocabulary contributes 240,000, including inflected forms and internationally accepted spelling variants. Dictionaries for personal names and places contribute about 120,000 entries. The names address a practical concern in international examinations, where authors can refer to people and locations from around the world. The same decision can hide an error when it coincides with a name. Flor uses hince as an example because it can be intended as hence while also matching a surname.
Once a token is flagged, ConSpel searches the same dictionaries for spellings within an edit-distance limit. The limit can vary with the length of the error and has a default value of 5. A ternary search trie, a data structure for finding strings through their constituent characters, supports this search. The system also produces candidates with more than one token to handle joined words. For example, the string cando can generate can do as a possible correction.
The search is deliberately broad. ConSpel commonly generates more than a hundred candidates for a misspelling and sometimes more than a thousand. The system prunes the list during ranking so that relatively few options reach the final choice. Casting a wide net matters when the writer’s spelling and the intended form are several edits apart. Once an intended answer is absent from the list, however, stronger contextual evidence cannot bring it into contention. The candidate generator sets the space within which every later score operates.
Scoring the error in isolation
The baseline combines three ways of ranking replacements. The spelling score uses unweighted edit distance. The sound score uses Double Metaphone to represent the written error and the candidate phonetically, then measures edit distance between those representations. The frequency score looks up how frequently the candidate occurs in the Google Web1T data. Single-token candidates use unigram frequencies, which count individual tokens. A replacement composed of several tokens uses the frequency of that sequence.
These scores give different reasons to prefer an answer. An option may closely resemble the spelling without being especially close phonetically. Another option may be common enough to deserve attention even if several dictionary entries have comparable spelling distances. The system does not estimate the probability that a given writer would make a particular spelling change. Flor attributes that choice to the focus on contextual ranking and the lack of suitable resources for estimating such error probabilities with confidence.
ConSpel normalizes scores separately for each ranker and for each misspelling. The spelling score for a candidate is thus scaled against the spelling scores of the other candidates for the same error. In turn, the contextual score is scaled against the contextual scores for that list. The general scoring rule is a weighted sum.
T(c) = ∑ₐ wₐ · Sₐ(c)
Here c is a candidate for the current misspelling and T(c) is its combined score. The summation sign ∑ adds the contributions for the enabled rankers, indexed by a. For each ranker, wₐ is its constant weight and Sₐ(c) is the candidate’s normalized score from that ranker. The dot · multiplies the weight by the normalized score. The paper gives the normalized range as 0–1. The author selected the weights experimentally and mentions automatic optimization as a possibility for future work.
Testing a candidate in the surrounding sequence
The first kind of context preserves word order. ConSpel tentatively places each candidate where the misspelling occurred and examines the contiguous sequences spanning that site. A neighboring word on the left gives one bigram and a neighboring word on the right gives another. A trigram can use context from both sides or take its extra words from just one side. Moving the window allows the system to collect evidence regardless of whether the most informative expression begins before the error or continues after it.
Suppose M is the error, C is a proposed replacement, y and z are words before the error, and e and f follow it. For the portion of the score using bigrams and trigrams, the paper’s calculation is as follows.
L(C) = log(count(zC)) + log(count(Ce)) + log(count(yzC)) + log(count(zCe)) + log(count(Cef))
Here L(C) is the illustrated log-count support for candidate C, with C occupying the position originally held by M. The letters written together indicate an ordered sequence of words. Thus zC places the immediate left neighbor z before the candidate, and Cef places the candidate before the right neighbors e and f. The function count returns a sequence’s corpus frequency, and log takes its logarithm. The plus signs add the contributions of the different windows. The same procedure includes longer sequences when those orders are enabled.
The logarithm makes the frequency contribution grow more slowly than the raw count. ConSpel sums these contributions without assigning a separate weight to each sequence length inside this ranker. A sequence missing from the database provides no support, and the procedure can still use whichever overlapping sequences it finds. It does not have to estimate a count for every missing phrase before comparing candidates. This is especially helpful when a candidate forms a familiar short phrase and the full span of nearby words has never been recorded in the frequency resource.
The retrieval database comes from a filtered version of Google Web1T. The paper reports 1,881,244,352 distinct n-grams of sizes 1–5, with punctuation included, and an 11GB file produced using TrendStream. The database is consulted at correction time. The essay itself provides the words that go into each query, while the stored frequencies indicate which candidate substitutions form attested sequences.
Measuring association within the same windows
A sequence can occur relatively frequently because its component words occur often. An alternative is to ask how strongly the words favor occurring together, given their individual frequencies. ConSpel applies this second scoring approach to the same candidate substitutions and overlapping windows. Its building block is normalized pointwise mutual information. The paper presents the formula for an ordered pair and states that the calculation extends to longer sequences.
nPMI(a, b) = log₂(p(a, b) / (p(a) · p(b))) / (−log₂(p(a, b)))
Here a and b are the words in the pair. The function p gives a corpus probability, with p(a, b) denoting the joint probability of the sequence and p(a) and p(b) denoting the probabilities of the individual words. The dot · multiplies the individual probabilities to give the reference value for independent occurrence. The slash / denotes division, log₂ is the base 2 logarithm, and the minus sign makes the logarithm of the joint probability negative in sign before it serves as the divisor. The numerator compares joint occurrence with the independence reference. The denominator normalizes that comparison, and the whole expression gives the pair’s nPMI.
The sequence database derives the probabilities from stored counts when queried. For the actual ranker, ConSpel retains positive association values and gives zero support to values that are zero or negative. The paper calls the retained measure positive normalized PMI, or PNPMI. The score is the sum of these values over the candidate’s contextual n-grams. This design allows a few strongly associated phrases to help a candidate even if other windows offer little evidence. The use of positive association values follows a line of work that the paper traces back to Word Association Norms, Mutual Information, and Lexicography.
Both sequence rankers therefore use the same basic questions about placement. They differ in what counts as a favorable answer. Frequency gives more support to sequences with greater observed use. PNPMI responds to how distinctive the association is given the components’ individual probabilities. A candidate can benefit under both criteria. Since the system keeps the scores separate until the weighted sum, it can also test whether the balance between candidates changes when both are available.
Looking for words associated with a candidate
The second kind of context comes from the vocabulary near an error. A possible replacement such as card could receive evidence from payment or casino even if the two terms never touch in the essay. Likewise, the relationship between a vehicle and its engine can help make a candidate plausible without a phrase containing both. Flor uses such examples to distinguish broad relatedness from close similarity in meaning. The procedure belongs to distributional semantics because its evidence comes from how words are distributed in texts.
To build the resource, the author counted words occurring within the same paragraph in about 2.5 billion words of text. The Gigaword news corpus contributes approximately 2 billion words, while an internal ETS collection of fiction and popular science contributes 500 million words. The resource records individual frequencies and pair frequencies in a sparse matrix reported as 2.1x2.1 million word types. Many word pairs therefore have no stored co-occurrence. TrendStream compresses the resource to a 4.7GB database and computes word association scores from the stored frequencies at lookup time. The approach follows the use of first-order co-occurrence described in work such as From Frequency to Meaning.
During correction, ConSpel takes a window around the error and sets aside stoplisted words such as common prepositions and determiners. For each remaining context word, it asks how strongly that word and the candidate are associated in the paragraph data. It adds the positive values. Here the joint event for the association calculation is co-occurrence within a paragraph, rather than occurrence as an exact sequence in the web data. The location of the context word helps decide whether it is included, but its order relative to the candidate is immaterial to this pairwise score.
This aggregation fits the idea that even a well-chosen word will have little to do with much of its immediate surroundings. If payment supports card, a nearby word with an unrelated function in the sentence need not cancel that evidence. It also gives the method a different kind of coverage from contiguous phrases. The association resource can connect words that appear apart in the essay. The resulting score says how much favorable pairwise evidence the surrounding vocabulary supplies, without identifying which particular meaning or relationship is responsible.
Using repetition across the essay
The Dejavu ranker searches the entire essay for occurrences of a candidate or its inflected forms. Inflection changes a word’s grammatical form, as when star becomes stars. A correctly spelled stars elsewhere in the essay can therefore lend support to star as a correction of stard. That finding increases the candidate’s score, leaving other evidence to determine whether a competing replacement is better at the error site. The ranker gives a nearby occurrence more influence than a distant one. Its treatment of variant forms draws on morphology.
r(d) = 1 / √(1 + d)
Here r(d) is the distance-based support for an occurrence and d is the distance between it and the misspelled token, measured from their positions in the text. The numerator 1 is the unit contribution before discounting. The 1 inside the parentheses is an offset added to the distance, and √ takes the square root of the quantity inside the parentheses. The slash divides the unit contribution by that square root, so the support declines as distance grows. The pseudocode applies this factor to configurable scores for exact and inflectional matches. Contributions from different matching occurrences accumulate for the candidate.
The author also addresses the case in which the essay supplies no correctly spelled instance of the intended word. The corpus includes an essay whose writer used several different spellings of knowledge. The ranker can look at possible corrections for these other misspellings and check whether the same word, or an inflection of it, is supported elsewhere in the essay. Agreement among candidate lists can then provide evidence even when the text offers no clean instance to match against.
rₐ(d, S꜀꜀) = S꜀꜀ / √(1 + d)
Here rₐ(d, S꜀꜀) is the support given by a matching candidate for a different misspelling. The subscript a labels the advanced recurrence procedure. S꜀꜀ denotes the corresponding candidate’s normalized overall strength from the preceding ranking, and d now measures the distance between the two misspelling positions. The offset 1, the square root √ and division / apply the same distance discount as before. The pseudocode also multiplies by the configured value for an exact or inflectional match. A strongly ranked candidate elsewhere consequently offers more support than a weak candidate at the same distance.
ConSpel computes this advanced score after the other rankers. The recurrence procedure can thus consult evidence from elsewhere in the document without having to feed its own updates back into the other lists. The program also skips the current error site when looking for a repetition or another candidate list. That restriction keeps the candidate from accumulating evidence simply because it is already a proposed answer at the site being corrected.
Adding vocabulary from the assignment
Prompt-based scoring uses words from the assignment as an external vocabulary for the essay. The system collects content words from the prompt and checks candidates for either exact matches or inflected variants. If the assignment uses power or powers, for instance, that can help power as a proposed correction for pawer. The pseudocode gives a default value of 1.0 to an exact match and 0.8 to a match through inflection. It sums the values supported by the prompt vocabulary.
The same procedure can operate with very different source material. For the TOEFL Integrated task, the list comes from a reading passage and an associated lecture presenting a different argument. Examinees have to relate the arguments in their essays, giving them a reason to reuse the language of those materials. For other assignments, the list comes from briefer prompts that leave more room for writers to choose their own examples and lines of argument. ConSpel uses the terms that are present in the available materials. The vocabulary construction does not require an estimate of the essay’s own topic.
Making the contextual scores comparable
The pseudocode for log counts, semantic relatedness, Dejavu and prompt vocabulary shows the same normalization pattern. After the ranker has computed raw support for the whole list, it divides each candidate’s score by the highest support in that list. The contextual scores are then ready to contribute to the weighted ranking alongside the baseline scores.
Sₐ(c) = Rₐ(c) / maxᵤ Rₐ(u)
Here a identifies the ranker, c is the candidate being scored, and Rₐ(c) is its raw support according to that ranker. The expression maxᵤ Rₐ(u) selects the greatest raw support over candidates u for the same misspelling. The slash divides the candidate’s support by that maximum and gives Sₐ(c), the normalized score. This expression describes the division shown in the pseudocode when there is positive support in the list. The paper leaves the case of an entirely unsupported list unspecified in those sketches.
The reference point for normalization is local to each decision. A run of strong web evidence for one misspelling does not set the scale for a different misspelling. Each ranker is asked to express the relative strength of the options currently in contention, and the constant weight determines the influence of that ranker in the final sum. This architecture also makes it possible to keep the candidate search and the baseline fixed while examining what changes when the program receives an additional kind of evidence.
Experiments and results
The essays and their reference corrections
The ETS Spelling Corpus contains 3,000 essays and 963,216 words. It draws equally from TOEFL and GRE, using 4 tasks, 10 prompts per task and 75 essays per prompt. TOEFL contributes an opinion task and a task that asks examinees to relate material from reading and listening. GRE contributes an issue essay and an evaluation of a supplied argument. The responses were written under time limits on a standard English QWERTY keyboard, without access to a spellchecker in the exam software. The selections cover the range of scores within each task.
Of the 1,500 essays in the TOEFL portion, 1,481 were written by people for whom English is not a native language, or 98.73% of that portion. For GRE, 867 of the 1,500 essays were written by non-native speakers. The paper reports the proportion as 57.86%. That composition gives the experiments substantial exposure to learner spelling. Because the material comes from specific examination tasks, its distribution of topics and errors is tied to how the essays were elicited.
Experienced annotators reviewed each essay independently. The annotation software highlighted non-words for inspection, and annotators also read the text for issues the software might have missed. They marked the span and supplied the intended correction. A strict match required agreement on both. Among cases initially marked by annotators, strict agreement was 82.6%. The paper reports 99.3% agreement over all words, with Cohen’s Kappa of 0.85 and p<.001. These figures have different denominators. The corpus-wide measure includes ordinary words as well as disputed cases, while strict agreement over marked cases requires both people to identify the same answer for the same span. A further annotator adjudicated disagreements. This process gave the correction experiments a common reference for linguistic annotation.
The corpus contains 24,257 annotated spelling errors, including 21,113 single-token non-word misspellings in the main category. That category accounts for 87.04% of annotated errors and includes fusions. There are also separate categories for non-words without a plausible correction, errors spanning more than one token and real-word errors. Annotators were encouraged to mark real-word cases, but coverage of those cases was not exhaustive. Different regional spelling conventions were accepted. Problems such as repeated words and improper capitalization were outside this annotation effort.
The paper groups essays using their examination scores as a proxy for proficiency. The higher-quality group, with scores of 4 or higher, contains 1,342 essays. The lesser-quality group, with scores of 1–3, contains 1,658. For single-token non-word errors, the reported token error rate is 1.22% in the higher-quality group and 3.53% in the lesser-quality group. Edit distance gives a separate view of severity. A distance of 1 accounts for 80.68% of the relevant errors across the corpus, with 85.11% in higher-quality essays and 78.56% in lesser-quality essays. The groups therefore differ both in how frequently these errors occur and in how close the written strings tend to be to their intended forms.
What the evaluation counts
For detection, recall asks how much of the reference set was flagged. Precision asks how much of the flagged set consists of reference errors. F1 combines these measures into a harmonic mean so that a setting with weaker performance on one measure cannot fully compensate with strength on the other. The paper uses the following definitions for the detection comparison.
Recall = H / G
Here H is the count of annotated misspellings the system flagged and G is the total count of relevant annotated misspellings. The slash / divides the matching flags by the reference count. Recall thus describes coverage of the errors the evaluation seeks to find.
Precision = H / F
Here H again counts annotated misspellings flagged by the system. F is the total number of tokens it flagged, including false alarms. The slash / divides the matching flags by all flags and gives the share supported by the annotation.
F1 = 2 · P · R / (P + R)
Here P denotes precision and R denotes recall. The dot · indicates multiplication, 2 is the constant in the harmonic mean of the two measures, the plus sign adds precision and recall, and the slash / divides their scaled product by their sum. The reported result tables put these measures on a percentage scale.
ConSpel achieves detection recall of 99.84, precision of 98.79 and F1 of 99.31 on the whole corpus for the targeted error class. The higher-quality group has recall of 99.94 and precision of 98.03, while the lesser-quality group has recall of 99.79 and precision of 99.16. Among the misses were some tokenization problems and cases covered by the default exclusion for strings with digits. False alarms included names missing from the dictionaries, improvised acronyms and unconventional word formations. These detection results are shared by the correction configurations because they use the same flagging procedure.
Correction is evaluated separately through Top1 and InTop5. In Top1, a case counts as a successful correction when the intended answer is the leading suggestion. In InTop5, any of the five leading suggestions can satisfy the criterion. The paper reports correction recall, precision and F1 for both. A high InTop5 score indicates that many intended answers survive near the top of the ranking, a different outcome from reliably selecting them for automatic replacement.
How much the ranking changes
The isolated ranking improves as the baseline adds evidence. With orthographic similarity alone, whole-corpus Top1 F1 is 54.20 and InTop5 F1 is 84.60. Adding phonetic similarity brings the scores to 63.99 and 86.90. With general word frequency included, the baseline reaches 74.39 and 90.30. For that full baseline, whole-corpus Top1 recall is 74.72 and precision is 74.06. The comparison of contextual rankers starts from this full baseline.
The baseline also performs differently across the essay groups. Top1 F1 is 72.36 in lesser-quality essays and 78.58 in higher-quality essays. InTop5 F1 is 89.13 and 92.74, respectively. The paper reports p<.01 for the baseline differences between groups on both evaluations. These separate starting points matter when interpreting the subsequent gains. A group can benefit more from a contextual addition while still ending at a lower correction score.
Baseline, contextual rankers and best combination on ETS Spelling Corpus Top1 F1
Ordered word sequences give the strongest individual gains, and their combination with semantic relatedness attains the highest score.
The numbers
| System or setting | F1 |
|---|---|
| Spelling, sound and frequency baseline | 74.39 |
| Baseline plus prompt vocabulary | 74.88 |
| Baseline plus semantic relatedness | 78.20 |
| Baseline plus Dejavu | 78.23 |
| Baseline plus sequence log counts | 84.32 |
| Baseline plus sequence PNPMI | 84.77 |
| Baseline plus both sequence scores | 85.72 |
| Baseline plus both sequence scores and semantic relatedness (this paper) | 85.87 |
Among the settings with one contextual addition, the best Top1 F1 comes from the association score over sequences up to four-grams. The log-count setting reaches its highest observed Top1 F1 using sequences up to five-grams. For InTop5, those rows give 94.72 for the association setting and 95.19 for the log-count setting. Semantic relatedness and Dejavu have much closer results. Each improves the Top1 score substantially over the isolated baseline, while their InTop5 F1 values, 91.33 and 91.30, show smaller gains on a shortlist that already performs well.
The best whole-corpus combination gives Top1 recall of 86.25, precision of 85.50 and F1 of 85.87. InTop5 recall is 95.69, precision is 94.85 and F1 is 95.27 for the same configuration. The author reports an 11.48 improvement on the Top1 F1 scale over the baseline. The combination of the two sequence scores already accounts for most of the observed gain, and the addition of semantic relatedness to that pair is not statistically significant. The highest observed result describes the configuration that placed first in this experiment. The comparisons give firmer evidence for the pair of sequence scores than for the extra contribution from word associations.
When the writing materials help
Adding prompt vocabulary to the baseline across the full corpus yields 74.88 on Top1 F1 and 90.52 on InTop5 F1. The corresponding baseline scores are 74.39 and 90.30. The paper finds no statistically significant improvement in this whole-corpus comparison or in either whole-corpus essay quality group. Flor notes that many of the 40 prompts were brief and open-ended. A word list copied from such a prompt has limited opportunity to anticipate the vocabulary an examinee chooses.
The TOEFL Integrated comparison uses 750 essays written to 10 prompts. Its vocabulary lists draw on the reading and lecture and contain about 240 unique content words per prompt. The other prompts contribute fewer than 70 unique content words per list. The form of the Integrated task also encourages writers to discuss specific material. For this subset, Top1 F1 increases from 73.93 to 79.26 and InTop5 F1 rises from 90.16 to 92.57 when prompt vocabulary is added. The comparisons with the respective baselines are significant at p<.01.
Prompt vocabulary and baseline ranking on TOEFL Integrated Top1 F1
Vocabulary drawn from the reading and lecture improves the first suggestion across the task subset and within both essay quality groups.
The numbers
| System or setting | F1 |
|---|---|
| All Integrated essays, baseline | 73.93 |
| All Integrated essays, with prompt vocabulary (this paper) | 79.26 |
| Lesser-quality Integrated essays, baseline | 73.17 |
| Lesser-quality Integrated essays, with prompt vocabulary | 77.64 |
| Higher-quality Integrated essays, baseline | 75.43 |
| Higher-quality Integrated essays, with prompt vocabulary | 82.59 |
The paper also describes an earlier comparison by Flor and Futagi. In that study, a previous contextual version of ConSpel recorded a correction F1 of 77.93. Microsoft Word with the ConSpel dictionary recorded 70.56, and Aspell recorded 51.83. The earlier ConSpel configuration included recurrence and handled each n-gram order with a separate ranker. Those figures provide background for the redesign of sequence scoring. The comparisons in the current experiment concern successive additions to the common ConSpel baseline.
What the ablations show
How far ordered context helps
The sequence experiments add longer n-grams cumulatively, so a configuration using trigrams also retains bigrams. With log counts, whole-corpus Top1 F1 rises from the baseline of 74.39 to 80.74 with bigrams, 83.13 with trigrams and 84.25 with four-grams. Each of these additions improves the preceding setting at p<.01. Including five-grams brings the score to 84.32, an increment the experiment does not distinguish statistically. The same ordering of gains appears on the shortlist measure. The additions through four-grams are significant at p<.02, with a small, nonsignificant increase on adding five-grams.
The results support two observations about local phrase evidence. The immediate neighbors give the largest first gain, and matches over a few more words can still help after that evidence is counted. Because the settings are cumulative, the comparison estimates what the longer spans add on top of shorter ones. It leaves open how well a ranker supplied only with long sequences would work. A higher-order match can refine a decision that already has short-phrase support, while the short windows can continue to inform cases where the longer query is missing.
The paper measures lookup coverage to investigate the leveling off. The system returns a usable value for 45% of queries for bigrams, 10% of those for trigrams, 2% of those for four-grams, and 0.5% of five-gram queries. These are rates over queries produced by the spellchecker, including the many sequences generated by substituting candidates that are poor fits. They are not the rates at which ordinary phrases in essays occur on the web. The decline gives a plausible reason for the smaller increments from longer spans. Even the relatively few four-gram matches yield a measurable benefit. The study does not isolate coverage from the other changes that come with increasing span length.
What frequency and association contribute
The association score over n-grams also improves markedly with short windows. Whole-corpus Top1 F1 is 82.21 with bigrams, 84.12 after adding trigrams and 84.77 after adding four-grams. The four-gram addition has p<.04. Adding five-grams brings the score to 84.10. The detailed whole-corpus comparison reports p<.03 for that decline, while the separate essay-group comparisons do not find significant declines from the five-gram addition. On InTop5 the association scores continue to rise in both groups through the longest setting, with no statistically significant improvement from five-grams over four-grams. For this ranker, a longer window can have different implications for placing an answer somewhere on the shortlist and selecting it as the winner.
The comparison of log counts with association scores is clearest within higher-quality essays. Using four-grams and shorter sequences, Top1 F1 is 87.31 with log counts and 88.37 with PNPMI. The paper reports p<.03 for the differences between the two methods in that group at the bigram, trigram and four-gram settings. It does not find significant differences between the methods in the lesser-quality group. Better performance for a score in one group therefore provides a more specific conclusion than an overall claim that association always ranks better than frequency.
The two sequence scores together outperform either of their best individual configurations on the whole corpus, with both comparisons significant at p<.01. This is evidence of complementarity even though the rankers query the same sequences in the same resource. A plausible reading is that the count and the association value emphasize different properties of a candidate phrase. The simultaneous use of both enables a better overall ordering in the reported tests. The experiment does not identify which specific properties of individual errors account for that advantage.
The essay-group comparison makes the combined result more precise. Combining the sequence scores is significantly better than log counts alone at p<.01 in both the higher- and lesser-quality groups. Against PNPMI alone, the combined setting has a significant advantage at p<.01 for higher-quality essays. The corresponding improvement does not reach significance in lesser-quality essays. The benefit of combining scores is accordingly strongest where there is direct evidence against both of the individual alternatives.
How much nearby vocabulary and repetition add
The semantic relatedness comparison tests how wide a neighborhood should contribute to the score. Flor varies the quota from 5 to 40 words on each side of the misspelling, in increments of 5. The scores across these settings are very similar and the differences are not significant. The shortest window tested, extending 5 words in each direction, already captures essentially the improvement observed with this method. Since smaller windows are outside that comparison, it gives no precise minimum amount of nearby text required for the gain.
The quality-group results offer another way to compare semantic relatedness and recurrence. With semantic relatedness added, the lesser-quality group moves from 72.36 to 76.28 on Top1 F1 and the higher-quality group moves from 78.58 to 82.17. With Dejavu, the corresponding scores are 76.26 and 82.31. The paper finds benefits over the group baselines but no significant difference between the groups in the size of the Top1 gain for either ranker. This differs from the pattern with sequence evidence, where the paper finds a larger gain for lesser-quality essays.
The recurrence result is for the Dejavu ranker as evaluated as a whole. The algorithm describes a direct search for repetitions and an advanced search of other candidate lists, but the reported experiment does not give separate scores for those parts. It therefore supports the contribution of the recurrence procedure alongside the baseline, without establishing how much of the improvement is due to correctly spelled repeats, inflected variants or agreement among proposed corrections.
How context scores interact
A useful ranker in isolation can hurt when added to another one. Adding Dejavu to the log-count ranker takes whole-corpus Top1 F1 from 84.32 to 83.39. The decline is significant at p<.01. Adding it to sequence PNPMI instead takes Top1 F1 from 84.77 to 85.36, with p<.05. The same check for repetitions has opposite effects depending on how the system scores local phrases. The experiment measures that interaction without attributing it to particular words or types of error.
Pairing semantic relatedness with prompt vocabulary also decreases Top1 F1 compared with semantic relatedness alone, at p<.01. Pairing Dejavu with either prompt vocabulary or semantic relatedness produces a small decrease from Dejavu alone on Top1 F1 without a statistically significant difference. The combination of semantic relatedness and Dejavu still yields an InTop5 F1 of 91.89, compared with 91.33 for semantic relatedness and 91.30 for Dejavu. Those observed scores illustrate why it matters to specify the decision being evaluated. Advancing a candidate onto the shortlist and promoting it above every alternative can respond differently to the same changes.
Adding semantic relatedness to either sequence score yields only a small, statistically inconclusive improvement. The same result holds when semantic relatedness is added to the pair of sequence rankers, both across the corpus and within each essay quality group. A score that can repair some decisions of the isolated baseline has fewer opportunities after the stronger local evidence has already rearranged the candidates. The results establish the small marginal gains under these combinations. They do not show how much that pattern is due to overlapping evidence, to the way weights were set or to disagreements among the rankers.
When the external vocabulary is informative
The prompt comparison varies two aspects of the evaluation setting together. The Integrated materials supply longer lists, and the task calls for writers to reuse the material those lists come from. The paper observes a clear gain for this setting and little gain over the whole corpus. This supports a conditional conclusion about prompt vocabulary. Its value in the experiment comes from a setting where the supplied material can anticipate the words a writer will need. The comparison cannot isolate list length as the explanation because the task and the relation of an essay to its source material change as well.
Within the Integrated subset, the reported Top1 F1 gain is 4.47 for the 452 lesser-quality essays and 7.16 for the 298 higher-quality essays. The difference in gain is significant at p<.01. For InTop5 F1 the gains are 2.21 and 3.01, respectively. Flor suggests that higher-quality essays might stay closer to the topic or reuse more of the source vocabulary. That explanation remains a possibility because the experiment measures spelling performance by group, without reporting a direct test of what language each writer borrowed from the materials.
Limitations
Limits the paper states
ConSpel’s detection procedure is restricted to a narrowly defined correction task. Its dictionaries and exclusions determine which tokens it flags, and its experiments focus on non-word errors occupying a single token. False alarms can come from gaps in the dictionaries or from creative uses of language. Errors that also happen to be names can pass through the dictionary check. The paper discusses applying contextual methods to real-word error detection and correction as future work. It also identifies a need for procedures that can consider the joined interpretation of a split word when the written pieces are separated and may contain additional mistakes.
The author describes short, generic writing prompts as a possible cause of the negligible whole-corpus result for external context. Even essays written to the same assignment can vary greatly in vocabulary and can stray from the topic. The using of longer reading and listening material succeeds in one important setting, but the paper leaves the relative contributions of vocabulary size and writing task open. It also leaves unresolved why semantic relatedness and Dejavu combine poorly on the main first-choice measure.
The study does not assign individual errors to causes such as mistyping or lack of knowledge of the correct spelling. It discusses the time pressure of the exams and possible unfamiliarity with the keyboard as contributing factors, without testing them. Non-word forms that could be interpreted as mistakes of morphology are included as misspellings without a separate classification. Accordingly, the corpus can support an analysis by edit distance, but the correction results do not establish what cognitive or mechanical process produced a given error.
Limits visible in the experimental design
The results characterize a selected corpus of timed GRE and TOEFL writing. The controlled mix of prompts and the range of essay scores make it possible to examine different settings within those exams. The same design gives limited evidence about other kinds of text, where spellings, names, punctuation and patterns of repetition could differ. The higher- and lesser-quality labels are based on holistic scores that reflect more than spelling or command of vocabulary. Differences between those groups cannot by themselves identify proficiency as the cause of a difference in how much a ranker helps.
The annotation scheme affects how to interpret the detection and correction figures. Exhaustive attention went to non-word misspellings, while real-word mistakes were marked less systematically. The evaluation consequently describes the task for which the reference set was prepared. Even there, annotators sometimes disagreed over the span or intended answer before adjudication. A system can put forward a plausible alternative that differs from the adjudicated response. The reported measures assess agreement with that reference, without quantifying how many disputed alternatives might be acceptable in practice.
Candidate generation is another boundary on the conclusions. Favoring a broad search is a reasonable response to severe misspellings, and the shortlist results show that the intended answer frequently survives near the top. InTop5 still cannot tell what happened to an answer outside the shortlist. It could have been generated and ranked lower, omitted by dictionary search, or lost because detection did not flag the error in the first place. A separate measure of candidate coverage before pruning would be needed to distinguish those paths across the corpus.
The author reports that ranker coefficients were chosen experimentally. The paper does not describe a separate held-out procedure for selecting all weights and settings before measuring the final configuration. The individual comparisons are informative about what happens within the reported experiments, but the best observed score alone does not establish how closely a new collection of essays would reproduce it. That question is especially relevant for comparisons where the advantage is small and several combinations were examined.
The same caution applies to the claim that a source of evidence helps. The result for semantic relatedness shows that paragraph co-occurrence can improve this baseline under the reported settings. It establishes neither that a candidate’s lexical meaning has been identified nor that a particular relation explains its success. The recurrence comparison gives evidence for the implemented ranker without separately validating each source of recurrence support. The prompt experiment demonstrates a task-specific advantage and leaves open how reliably external vocabulary could be inferred when no assignment materials are available.
The paper also reports that ConSpel runs locally on laptops and desktops through TrendStream. The database sizes and the number of possible candidates give some sense of the practical setup, but the experiments provide no comparative timing or memory figures for the different settings. The performance claims concern spelling detection and ranking quality under the conditions of the corpus. Whether a particular configuration meets the resource constraints of another application would require its own measurements.
What came after
The later works that cite this study take up different parts of the problem. Their titles establish their subjects and reported contributions. They do not establish whether each study reused ConSpel’s candidate generator, its contextual scores or its evaluation corpus.
Sorokin’s 2017 case study takes spelling correction into Russian and makes rich word morphology central to the question. Flor’s system already encounters morphology when it accepts different inflected forms and uses them as evidence of recurrence or prompt overlap. The Russian study places that issue in the foreground by focusing on spelling correction for a language characterized in the title as morphologically rich. The connection concerns the importance of representing word forms in correction. The citation alone does not identify which of Flor’s ways of using context the later study adopted. Spelling Correction for Morphologically Rich Language
Flor’s 2019 work again pairs English spelling correction with data for evaluating it. Its title identifies two contributions, a benchmark corpus of misspellings and a minimally supervised correction method. The continuity with ConSpel is clearest at the level of the research design. Both put the data used to assess spelling correction alongside a correction procedure, so the evidence for success can be understood in relation to the misspellings under study. The citation does not establish whether the later benchmark reuses the examination essays or whether the minimally supervised procedure uses the same combination of context scores. A Benchmark Corpus of English Misspellings
Trinh’s 2021 work presents a dataset and baselines for grammatical error correction in Russian. Its stated task is broader than the selection of a replacement for an unfamiliar token. The connection to Flor’s study lies in evaluating correction against an explicit dataset and baseline, and in the earlier observation that spelling can affect other judgments about a piece of writing. The citation establishes that ConSpel’s study is part of the background to this later work. It does not establish that the Russian baselines correct spelling in a separate stage or use the same notions of contextual fit. New Dataset and Strong Baselines for the Grammatical Error Correction of Russian
Cite
Cite as Michael Flor. 2012. Four types of context for automatic spelling correction.
@misc{michael2012four,
title = {{Four types of context for automatic spelling correction}},
author = {Michael Flor},
year = {2012},
url = {https://aclanthology.org/2012.tal-3.4/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/flor-2012-four-types-context-automatic-spelling/