Spelling Correction for Morphologically Rich Language: a Case Study of Russian
Paper · 2017 · Alexey Sorokin
Summary
A spelling error can leave behind a perfectly good word. In one Russian example, a writer uses the word for pastel where the sentence is about a soft, comfortable bed. A dictionary accepts both words. The surrounding sentence supplies the reason to change one to the other. Alexey Sorokin’s paper tackles this problem in Russian social media writing, where ordinary typos appear alongside informal spellings, missing hyphens, and spaces inserted inside words. Russian gives a spellchecker another source of evidence. The case, number, and gender expressed by a word form can make it a good or poor fit for its neighbors, a central concern of morphology.
The corrector starts by proposing alternatives throughout a sentence. It looks for nearby dictionary spellings, words with similar pronunciations, changes to spaces and hyphens, and familiar informal forms. It can also preserve the original wording. It builds a shortlist of whole sentences using estimates of how plausible the words are in sequence and how likely the proposed spelling errors would be. A second scoring pass can then take account of the grammatical tags of the proposed words and whether their base forms tend to appear in the same sentences. The first pass gets its evidence about word sequences from a language model.
On the SpellRuEval-2016 test set, the previous competition winner achieved 70.32% sentence accuracy and an F1 score of 75.07. Sorokin’s strongest configuration reached 78.44% sentence accuracy and 84.40 F1. Increasing the amount of text used to learn word sequences produced the largest improvement in the comparisons. Grammatical information also helped. With the larger text collection, adding the grammatical tag score to the word-level system raised sentence accuracy from 76.99% to 78.34%. Evidence from words occurring together gave the strongest configuration a further, smaller gain on that measure.
The paper also examines decisions the corrector still gets wrong. A preposition can make the intended case of the next noun clear, which explains why the tag score helps in some sentences. More ambitious features that try to find subjects or check agreement across a sentence lowered performance in the tested implementation. Rare but grammatical alternatives can also remain difficult to distinguish. The Russian results therefore show where a shortlist and a second scoring pass help, and which decisions still demand linguistic evidence the system has trouble representing.
Deep dive: Spelling Correction for Morphologically Rich Language: a Case Study of Russian
Alexey Sorokin’s Russian spelling corrector ranks whole sentences using word sequences, grammatical forms, and clues from words that occur together. · about 33 minutes to read
The problem and its context
What a dictionary can tell a spellchecker
The practical task begins with a sentence whose condition is unknown. It may contain a typing slip, a conventional word written in a conversational way, an accidental space, or a spelling that changes one ordinary word into another. It may also be correct as written. The spellchecker has to decide where a change is warranted and what that change should be. Those decisions interact. A word that initially looks suspicious might become plausible when its neighbor is repaired. A sequence of apparently ordinary words might become easier to understand when a misplaced space is removed.
Spelling correction already had uses in search queries, browsers, and editors. The paper gives special attention to its use in collections of web writing. Blogs, forums, and similar sources can furnish large collections of language as people use it. The scale of those collections leaves limited room for manual correction. Their unfamiliar forms may reflect mechanical slips or differences in writing conventions, including variation associated with dialect and social groups. A useful system for this setting has to handle uncertainty about whether an unfamiliar string is an error in the first place.
That uncertainty matters for downstream processing. An unexpected spelling can interfere with recovering a word’s dictionary form, assigning it a syntactic analysis, or finding the information expressed around it. A system that changes an acceptable spelling can introduce a problem of its own. The paper frames the practical aim as reliable correction of clear mistakes in naturally occurring web text. That aim helps explain its interest in clean sentences, dictionary words, and names as well as obvious typos. The downstream tasks it mentions include lemmatization, parsing, and information extraction.
Russian is a useful test for that purpose because several forms of the same vocabulary item may all be standard Russian, yet fit different grammatical environments. Nouns have case forms, and verbs vary in ways that can matter to a correction. Russian also permits relatively flexible word order. The words whose forms constrain one another may occur close together or at some distance. The paper’s design makes those two situations experimentally distinguishable. It can score local sequences of grammatical categories, and it can separately try features intended to find grammatical partners farther away.
How earlier systems divided the work
One line of earlier research asked which intended word was close enough in spelling to be worth considering. Edit distance makes that question concrete by counting changes such as inserting, deleting, or replacing characters. The paper cites a review reporting that about 80% of errors lie at a distance of 1 edit. It also describes work that assigns different weights to different edits. A change that writers often make can then count as better evidence for a proposed correction than a less plausible change of the same length. Kernighan and colleagues and Brill and Moore are examples in the paper’s discussion of weighted errors. A Spelling Correction Program Based on a Noisy Channel Model
Other work brought pronunciation into candidate generation or scoring. This gives a corrector a way to consider spellings whose connection is easier to recognize by sound than by inspecting their letters. The paper also describes earlier correction systems that use probabilities of word sequences. In the noisy-channel account, the written sentence is treated as an imperfect observation of an intended sentence. One estimate concerns how probable the intended wording would be. Another concerns how readily that wording could give rise to the observed spelling. Earlier approaches obtained word-sequence evidence from an n-gram, a sequence of consecutive items used to estimate what fits in a local context.
Context can inform decisions in other ways. The paper discusses a Winnow-based approach by Golding and Roth and work by Hirst and Budanitsky that uses lexical cohesion. It also describes systems that let a final classifier weigh several kinds of evidence. Flor’s work emphasizes semantic information, while Schaback and Li combine clues involving syntax, pronunciation, and meaning. These examples give Sorokin a precedent for using a learned scoring rule after possible corrections have been identified. A Winnow-Based Approach to Context-Sensitive Spelling Correction
The scope of those correction tasks is important. An experiment with a pre-defined confusion set can ask a system to select the word that belongs in context. The experiment supplies both the location of the ambiguity and the vocabulary choices. An experiment with randomly inserted typos can test recovery from controlled corruption. The random procedure determines which kinds of mistakes are available to recover. The paper argues for a complementary test on mistakes people actually made, with the corrector responsible for finding the relevant positions and generating replacements. That puts detection, candidate quality, and ranking into the same evaluation.
The paper identifies sentence-level Chinese correction by Xiong and colleagues as a closer architectural precedent. Its discussion also places the Russian work alongside a feature-based Czech system that corrects words in context, unsupervised Slovak correction, and a Russian system designed for search queries. Sorokin’s own immediate starting point is earlier work with Shavrina on Russian social media text. That system already reranked alternatives. The question here is whether the additional evidence available from grammatical categories and word associations improves the choices made by a Russian corrector.
The SpellRuEval-2016 competition supplies the development and test material needed to ask that question on a common task. It also supplies an earlier winner as a point of comparison. The paper’s aim is consequently both practical and experimental. It proposes a way to turn an unmarked sentence into a correction, then varies what the system knows about words and their context to examine which information bears on that decision.
The method, step by step
From an observed sentence to a shortlist
The starting point is a written sentence. The system examines each word position for possible changes and considers adjacent words when a correction might join them. At this point a candidate is a possibility, independent of whether the system ultimately identifies an error there. Keeping the input wording available lets the hypotheses include sentences in which a position, or the entire sentence, stays as written. Detection happens through the eventual choice of sentence.
A candidate can differ from the input by a letter, by the placement of a word boundary, or by a more distinctive change learned from familiar informal spellings. The search has to combine choices across positions. If a writer makes several mistakes, a hypothesis can repair them together. A split or a join can also affect which words count as neighbors for the next scoring decision. The product of the search is a shortlist of possible corrected sentences. The last stage evaluates each of those sentences using features that can summarize evidence across its full length.
From a Russian sentence to a selected correction
The steps in order.
The shortlist gives the stages different responsibilities. Candidate generation controls what the search can consider. The first score guides the search towards promising combinations. The reranker weighs evidence for the combinations that remain. If the proposed correction never entered the search, or was dropped before the shortlist was formed, the reranker has no opportunity to select it. If it reaches the shortlist, evidence that was absent from the early score can change its place.
Spelling, sound, and word boundaries
The first source of candidates is dictionary lookup around the observed spelling. The system accepts dictionary words at a Levenshtein distance of 1 from it. In this use, the distance is the minimum number of single-character insertions, deletions, or substitutions needed to turn one string into the other. Finding a dictionary form after a small edit establishes a plausible alternative. Its place in the sentence still determines whether it is a good correction.
A phonetic procedure provides a second source. Sorokin uses the METAPHONE-style coding method from his work with Shavrina. It encodes a spelling in a form intended to capture pronunciation similarities. A dictionary word with the same code can enter the search. The spelling search and the phonetic search thus use different criteria for admitting a word. A sound-based proposal has to compete with alternatives admitted on the basis of their letters.
The third source concerns spaces and hyphens. One input item may turn into dictionary words after insertion of a boundary. Neighboring items may also be considered together when removing a space or changing a hyphen would yield a plausible dictionary form. Rules cover recurring patterns, including informal spellings with the ending -цца. The paper illustrates that pattern with нравицца as input and нравится as a candidate. A rule can bring this alternative into the search because the paper identifies the recurring spelling pattern in advance.
Finally, a hand-written list maps particular conversational spellings to standard forms. Examples include ваще to вообще and оч to очень. This list gives the corrector a way to consider common forms whose relationship may be poorly served by a search limited to a single letter change. Every route into the candidate set creates a possibility to be scored with the words around it.
These sources draw on several kinds of prior knowledge. The dictionary defines a large inventory of forms. The phonetic encoding expresses a way of linking different spellings. The boundary operations express how a word or its components might have been separated in writing. The informal rules and list encode specific patterns seen in the language. The paper uses the ABBYY Compreno dictionary, which it describes as containing about 3,7 mln word forms. That inventory also supplies grammatical analyses later in the method.
The first score and the direction of an error
The corrector starts from visible text and searches towards the wording the writer may have intended. The error probabilities describe the reverse direction. If the system is considering a dictionary word as the intended form, it asks how probable it is that someone intending that word would have typed the observed form. This is the channel in the noisy-channel account. An error category seen more often in the development material is assigned a probability in proportion to its observed frequency. The paper does this for categories that include ordinary edit corrections, phonetic corrections, and space changes.
At sentence level, the channel score accompanies a probability for the proposed wording. Written as a ranking relation, the paper’s expression is:
p(s | t) ∝ p(t | s) p(s) = [∏ᵢ p(tᵢ | sᵢ)] p(s)
Here s is a proposed intended sentence and t is the observed sentence. The notation p denotes a probability, and | introduces the condition. Thus p(s | t) is the probability of that intended sentence given the observed one. The relation ∝ says the right-hand expression is proportional to it when the observation is fixed. The observation’s normalizing probability is common to all hypotheses for that input, so the product suffices to order them. The equality expands p(t | s), the probability of the observed sentence given the proposed one. The index i runs over aligned groups, with sᵢ an intended group and tᵢ its observed counterpart. The product sign ∏ᵢ multiplies their conditional probabilities. The brackets delimit that product, and the adjacent factor p(s) is the probability assigned to the proposed word sequence.
The aligned group matters because the correction can change the number of written words. A group accounts for a correspondence between pieces of the proposed and observed sentences even when a space divides those pieces differently. Multiplying local channel probabilities treats the error contributions of the groups as separable once the proposed sentence and alignment are fixed. The word-sequence probability provides another kind of dependence. It can favor a candidate whose spelling is a somewhat less obvious repair when the resulting words fit their neighbors better.
The first word-sequence score is a trigram probability. As the search extends a proposed sentence, it evaluates a word using the preceding pair. Sorokin describes an equivalent hidden Markov representation in which states keep track of pairs of words and candidate words are output symbols. The pair is the part of the proposed sentence that the search needs to carry forward to give the next word its contextual score. The word trigrams use Kneser–Ney smoothing, which lets the estimate assign probability to sequences with little direct support in the training text. The implementation uses KenLM.
The system uses beam search to collect the leading complete hypotheses. As it extends partial sentences, it keeps a limited set according to the initial score. This is how it avoids having to finish every combination implied by the candidate sets. It also makes early scoring consequential. A candidate can have good grammatical or semantic support that the reranker would recognize, yet have weak enough support from the channel and word sequences to disappear during search. The size of the shortlist evaluated in the ranking metrics is specified separately from this search procedure.
What the second score can inspect
For each sentence that survives, the system computes numerical features. The basic group includes sentence length and the scores already obtained from the channel and word trigrams. Carrying these scores forward allows the final scoring rule to learn how much trust to place in the evidence used during search. It can also consider that evidence alongside measures that describe the changes more specifically.
A weighted edit distance is one of those measures. Whereas the early channel assigns probabilities to broad error categories, the weighted distance can reflect the relative plausibility of particular edits. Sorokin learns it from the SpellRuEval development set using the approach of Brill and Moore. This introduces distinctions the simple channel score leaves out while keeping them available to the final decision.
The feature set counts words with properties such as being absent from the vocabulary, being long or short, or being capitalized. It also counts changes involving those categories. A count of a category describes the opportunities for correction in a sentence. A count of actual changes describes what the hypothesis did with those opportunities. Those values can differ between plausible edits and overcorrection. In particular, changing a dictionary word requires evidence strong enough to offset the learned reluctance to edit words that already have an accepted spelling.
Possible and actual word-boundary changes are also available as counts. The paper describes measuring how often a word can be split into dictionary items and how frequently a proposed sentence actually makes such a split. It likewise considers adjacent words that can become a single dictionary form through removal of a space or insertion of a hyphen. The author tried narrower counts for familiar patterns involving по. Most of these more specialized boundary features were dropped after they proved noisy in the experiments.
The paper lists 31 features as basic, 9 as morphological, and 6 as semantic, with one additional feature spanning morphology and semantics. A hypothesis can therefore be represented by a vector with up to 47 dimensions. The broad inventory includes experimental features as well as the evidence that proved most useful. In the main comparison, the central morphological addition is a score for the sequence of tags. The paper treats its additional counts of grammatical relationships separately when it discusses the attempts that deteriorated performance.
Scoring a sequence of grammatical tags
A word form may admit several grammatical readings. The system retrieves analyses from the dictionary and initially gives the available tags for a word equal probability. A suffix classifier guesses tags and their probabilities for a word outside the dictionary. The system evaluates possible tag sequences for the proposed sentence and takes the most probable sequence. It converts that sequence’s probability to a negative logarithm, so a less probable grammatical sequence yields a larger cost. The reranker receives the cost as a feature.
The tags preserve selected distinctions. For nouns, the system retains gender, number, and case. Adjectives also carry distinctions for short forms and degree of comparison. The retained verb distinction is mood, and the tag for a preposition records case. Participles are handled with adjectives. A pronoun can be treated as noun-like or adjective-like according to its role. These tags let different words contribute to the same grammatical pattern. The grammatical evidence is estimated from sequences of these tags after assigning each item a part of speech.
Like the word score, the grammatical score uses trigrams. Its symbols are tags that can recur across many distinct words. This is useful when an intended word sequence is rare in the large text collection but the corresponding tag sequence is familiar. It also gives the reranker a view of adjacent grammatical categories even if the candidate is a word with a legitimate spelling and meaning. The relevant question is whether that particular form can follow its neighbors naturally.
The grammatical score is soft evidence. It summarizes how plausible a candidate’s best tag sequence is according to the training data. The choice of tags, the restriction to local sequences, and the assignment of more than one possible reading all affect the score. The feature is consequently suited to distinguishing alternatives when their locally visible grammatical patterns differ. It can provide limited leverage when different proposed words share the same tags or when the decisive relationship extends beyond those local sequences.
Scoring words that occur together
The semantic evidence comes from which vocabulary items tend to appear in the same sentence. The system uses lemmas, or dictionary base forms, so that occurrences of several inflected forms can support a single association. It collects these statistics for nouns, adjectives, verbs, and adverbs. A candidate correction can preserve the same grammatical pattern as the input while substituting a different lemma. In that situation, the change can alter its associations with the sentence even when the tags provide little reason to prefer it. The unit counted in those associations is the lemma.
First, the system selects lemmas that occur at least 100 times in the training material for these statistics. It then counts how frequently the members of a pair appear in the same sentence. A pair must be observed at least 20 times to remain eligible. The last filter asks whether the presence of one lemma makes the other substantially more probable. The second member is retained as a match for the first when its probability in sentences containing the first is at least 3 times its probability without that condition.
The quantity used for that comparison and for the subsequent features is written as:
p(l₂ | l₁)
Here l₁ is the lemma whose presence defines the context, and l₂ is the lemma whose occurrence is being estimated. The subscripts identify the roles of the lemmas. The symbol p denotes probability, and | means the estimate is conditioned on the sentence containing l₁. This direction matters because the unconditional frequency used for judging the strength of the association is the frequency of l₂. The same raw cooccurrence can therefore yield different evidence depending on which lemma serves as the condition.
A lemma counts as frequent for the sentence features if it has at least one match in the retained association inventory. One feature counts words whose lemma has a matching partner elsewhere in the candidate sentence. Another takes the average number of partners for the frequent lemmas in that sentence. The system also summarizes the largest and average conditional probabilities for partners, averaging these summaries over the conditioning lemmas. Finally, it records the number of frequent lemmas and whether there is any such lemma at all.
The features describe how much statistical support is present and how widely it is distributed. A strong association between a pair is one form of evidence. Several words in a candidate with partners of their own provide another. A candidate with few lemmas represented in the inventories offers little opportunity for either kind of evidence. The additional feature that spans morphology and semantics scores the lemmatized sentence with unigram probabilities. It captures how common the lemmas are individually, whereas the cooccurrence features concern the support they give each other.
How the reranker learns its preferences
The final decision is a linear score. A hypothesis receives the sum of its feature values multiplied by their learned weights, and the hypothesis with the highest score is returned. In the notation of the paper, the score is:
⟨w, uᵢ⟩
Here uᵢ is the feature vector for hypothesis i, and w is the vector of feature weights. The subscript identifies the hypothesis. The angle brackets denote a scalar product, also called a dot product. Corresponding entries in w and uᵢ are multiplied and those products are added. A feature with a positive weight contributes more as its value increases. A negative weight makes a large value count against the candidate.
For training, the system generates alternative sentences for the development inputs. The construction described in the paper compares the correct hypothesis with each of the others for the same sentence. The correct hypothesis is represented by u₀. If uᵢ is an alternative, a positive training example is the following vector:
u₀ − uᵢ
The subscript 0 designates the correct hypothesis, and i designates one of the competing hypotheses. The minus sign means that the competitor’s feature values are subtracted from the correct hypothesis’s values, coordinate by coordinate. Each coordinate shows how the correct hypothesis and that particular competitor differ on one feature. The preference is specific to a pair of alternatives for the same input.
The reverse comparison is used as a negative training example:
uᵢ − u₀
The vectors represent the same hypotheses as before. Reversing the subtraction reverses the sign of every feature difference. The learner thus sees both directions of the preference. A weight vector that scores the positive difference above the reverse direction is learning evidence that favors the correct sentence over its competitor.
The author uses logistic regression from scikit-learn for the final reranking. A linear support vector machine gave nearly the same results in the paper’s account, while the perceptron performed worse. The strongest reported training arrangement estimates the feature contributions in stages. It learns the word-level score first and then uses that score alongside the grammatical score. Semantic evidence is introduced after learning the weight of the grammatical contribution. In this arrangement, an existing score represents the accumulated evidence from the earlier stage and the next stage learns how much the new information should affect the ranking.
Experiments and results
The sentences and the training material
The evaluation uses SpellRuEval-2016, with 2001 development sentences and 2009 test sentences in the paper’s main description of the splits. The sentences come from the LiveJournal portion of the General Internet Corpus of Russian, abbreviated GICR. They contain naturally occurring writing. The development set is used to train the reranker, estimate error behavior, and test the hand-written candidate rules. The test split evaluates the resulting correction system.
The examples show why a benchmark of complete sentences is useful. The typo преложила can be repaired to предложила. Informal ниче can be standardized to ничего. A short passage may contain both a conventional spelling error and an incorrect division into words, as in the case with сожелению and на долга, whose intended forms are сожалению and ненадолго. The form помоему calls for the hyphenated по-моему. The пастель and постель example presents a different problem because both are legitimate vocabulary. The test material also includes clean sentences, for which preserving the input is the correct outcome.
The word trigram probabilities were estimated from a 25mln-word GICR subset that the author says was disjoint from the SpellRuEval development and test material. A 5mln-word subset of that corpus furnished the cooccurrence counts and was used for the smaller word-trigram condition. Comparing those conditions varies the amount of running text behind the initial word-sequence scores. It also changes the word-trigram feature that the last stage receives. The morphological trigram was trained separately on 10,000 sentences from the Golden Standard part of GICR, using the reduced tags described above.
The external comparison is with the previous competition winner, the system by Sorokin and Shavrina. The internal comparisons distinguish the feature groups. WORD-LEVEL uses the basic features. MORPHO adds the grammatical score. SEM adds semantic evidence to the word-level features. MORPHOSEM uses both the morphological and semantic information. All these feature configurations are reported for each size of the word-trigram training collection. The previous winner appears as a single reference row.
What is counted as success
The official competition script reports token correction precision, token correction recall, and their harmonic mean, F1. For precision, the denominator counts attempted changes. A replacement that is wrong counts against the system whether it was applied to a genuine misspelling or to a word that should have stayed as written. For recall, the denominator tracks the actual errors. An error left unchanged and an error repaired incorrectly both count as a failure to recover the intended token.
The paper writes precision as:
Precision = T / (T + F + W)
Here T is the number of exact corrections, F is the number of true errors that were changed to the wrong form, and W is the number of false alarms, where a correct form was changed. The plus signs combine the categories of attempted correction. The parentheses group that total, / means division, and = identifies the resulting fraction as precision.
Recall is written as:
Recall = T / (T + F + M)
Here T again counts exact corrections, F counts actual errors changed incorrectly, and M counts actual errors the system missed. The plus signs and parentheses group the genuine errors in the denominator. The division gives the fraction of genuine errors fixed exactly. F1 combines the resulting precision and recall into a single measure by taking their harmonic mean.
Sentence accuracy counts outputs that are correct in their entirety. A sentence with several necessary repairs counts as correct when all of them are made and the rest of the sentence is preserved as required. A clean input can count as correct by staying unchanged. Sorokin emphasizes sentence accuracy because it directly measures the choice that the reranker is trained to make. The distinction between an unsuccessful attempted repair and an omission is also visible in the token metrics. Both lower recall, and an unsuccessful attempt additionally enters the precision denominator.
Two measures examine the ordered shortlist. Coverage records whether the correct sentence appears among the top 5 hypotheses considered in evaluation. Mean reciprocal rank, or MRR, gives more credit when a correct hypothesis appears closer to the top. A correct sentence found somewhere in that window contributes to coverage, and its position matters to MRR. Together with sentence accuracy, these measures help distinguish the presence of a usable hypothesis from the system’s ability to rank it first. They are part of the paper’s evaluation and benchmarks comparison.
The results on the test split
Feature configurations on the SpellRuEval test set by sentence accuracy
The larger word-trigram training collection improves every feature configuration, and the strongest result uses morphology and semantics together.
The numbers
| System or setting | sentence accuracy % |
|---|---|
| Previous competition winner | 70.32 |
| WORD-LEVEL, smaller collection | 74.35 |
| WORD-LEVEL, larger collection | 76.99 |
| MORPHO, smaller collection | 75.85 |
| MORPHO, larger collection | 78.34 |
| SEM, smaller collection | 74.65 |
| SEM, larger collection | 77.14 |
| MORPHOSEM, smaller collection | 76.20 |
| MORPHOSEM, larger collection (this paper) | 78.44 |
The previous competition winner recorded test precision of 81.98, recall of 69.25, and F1 of 75.07. The larger WORD-LEVEL configuration had precision of 89.89, recall of 76.86, and F1 of 82.87. The result establishes that the new system’s advantage over the competition reference was already present in its word-level configuration. Because the comparison is between complete systems, the change from the earlier winner cannot be attributed to a single feature. The internal pairs give a closer view of the additions.
With the larger word-trigram collection, MORPHO records 89.35 precision and 79.69 recall, giving F1 of 84.24. The corresponding SEM configuration records 89.94 precision and 77.21 recall, with F1 of 83.09. MORPHOSEM reaches 89.89 precision and 79.54 recall, with F1 of 84.40. The strongest sentence-accuracy and F1 configuration is therefore distinct from the configuration with the highest individual precision or recall. The best choice depends on which outcome the measure rewards.
The same ordering by sentence accuracy and F1 is visible with the smaller word-trigram collection. On the test split, WORD-LEVEL reaches 80.15 F1, MORPHO reaches 81.29, SEM reaches 80.46, and MORPHOSEM reaches 81.54. The size comparison and the feature comparison answer different questions. Increasing the text collection improves the word-sequence estimates available to the search and reranker. Adding features gives the final decision additional evidence about candidates. Among these configurations, the larger collection and richer features work together.
The ranking diagnostics add context to the sentence results. For the larger WORD-LEVEL configuration, the reported MRR is 83.95 and top-5 coverage is 93.23. In the larger MORPHOSEM configuration, those values are 84.88 and 93.33. In the smaller WORD-LEVEL configuration they are 81.09 and 90.54. The gap between the sentence accuracy and coverage entries in the same configuration shows that a substantial set of test cases had the intended wording within reach of the final ranking. Coverage also falls short of complete recovery. Some inputs require better candidate generation or search before a final scorer can help.
What the ablations show
More text has the broadest effect
The clearest comparison holds the feature group fixed and changes the amount of training text behind the word trigrams. All the feature groups improve in test sentence accuracy with the larger collection. The same is true of their F1 results. For MORPHOSEM, the smaller collection gives 76.20% test sentence accuracy and 81.54 F1. The larger collection gives 78.44% and 84.40 F1. The effect can also be seen with the basic features alone, so the stronger word counts are useful even before a grammatical or semantic score is introduced.
The larger collection also improves shortlist coverage within every feature group. This matters because the word trigram probabilities are used during search as well as in the later scoring vector. A better estimate of local word sequences can keep the intended sentence in contention while the search is still choosing which paths to extend. It can then help the final scorer favor that sentence. The reported comparison captures the combined effect of improving that information. It does not measure a version in which only the search or only the reranker receives the larger-corpus statistics.
Sorokin describes the contribution of the more complex features as especially consequential when the word evidence is based on less text. The individual measurements show why it helps to specify the metric when making that comparison. On sentence accuracy, the smaller collection’s WORD-LEVEL and MORPHOSEM results are 74.35% and 76.20%. With the larger collection, they are 76.99% and 78.44%. On F1 the corresponding endpoints are 80.15 and 81.54 for the smaller collection, and 82.87 and 84.40 for the larger one. The tables show gains from the complex features in both conditions, with the size of the gain varying by measure.
Local morphology helps explain a real-word repair
The larger-corpus comparison between WORD-LEVEL and MORPHO illustrates where gains arise. Adding the grammatical tag score increases test recall from 76.86 to 79.69, while precision moves from 89.89 to 89.35. The resulting F1 goes from 82.87 to 84.24. Sentence accuracy goes from 76.99% to 78.34%. The paper characterizes the improvement for this larger-corpus comparison as an error reduction of 8% in terms of F1 and 5.9% in terms of sentence accuracy.
The author illustrates the mechanism with the Russian preposition к. The input puts сожаления after it, a singular genitive form of a noun meaning regret. The intended expression uses singular dative сожалению. The preposition calls for the dative in the example. At the level of dictionary membership, either noun form is acceptable. At the level of the local grammatical sequence, one form supplies the case expected by the preceding preposition.
Word trigrams already favor the intended expression in this example. The corrector still needs to justify a change to a word with a valid dictionary entry. The grammatical tag sequence gives it additional grounds. The combination of a dative-requiring preposition and a dative noun is a recurring grammatical pattern across words. Evidence for that pattern can accumulate across different vocabulary items. An unlikely local tag sequence can therefore provide a stronger reason to edit than the probability of the particular word sequence alone.
This example concerns a local relationship that the selected tags express directly. The experiment, in turn, measures a change in the balance of errors across the benchmark. The example explains a route by which some true corrections become easier. The metrics show that, in aggregate, the tested score recovers more errors at a small cost to correction precision in the larger-corpus MORPHO configuration. The morphology result concerns ranking among already generated alternatives. A word form the candidate generator never proposes remains out of reach.
Broader agreement proved harder to turn into features
Russian agreement and case government suggested checks that could look beyond neighboring words. A preposition restricts the case of the noun it governs. An adjective may agree with its noun in case, number, and gender. A verb’s grammatical form can depend on its subject, and a verbal form can be plausible or implausible depending on the larger construction. The paper’s example of нравится and нравиться shows why this is relevant to spelling. The choice between a finite form and an infinitive can hinge on the role of the verb in the sentence.
The author tested counts for prepositions with and without a compatible noun to the right, and analogous counts for adjectives. Further counts concerned infinitives with and without a plausible head and indicative verbs with and without an agreeing subject. For each group, the total count gives a sense of how many instances could exhibit the relationship. The count of departures records the apparent failures under the operational test.
These additions lowered correction quality. The author raises overfitting as a possible explanation and describes specific ways the counts can misread good sentences. An adjective can follow the noun it describes. A grammatical clause may leave its subject unexpressed, and an impersonal verb can occur without the kind of subject the feature expects. A valid sentence may then look worse under a count based on the presence or position of an expected word.
A boundary example shows a subtler interaction. The valid adverb вправду resembles a sequence of a preposition and a noun, в правду. A feature that rewards apparent case compatibility in the resulting prepositional phrase can give the system a reason to split the adverb. The grammatical observation about a preposition and its dependent can be correct in isolation while encouraging an incorrect segmentation. The test of broader agreement is thus also a test of the way the relevant items are identified in candidate sentences. Sorokin suggests that a more careful treatment could draw on constraint grammars.
The narrowly targeted hyphen and space counts met a related problem at the feature-design stage. The author tried measuring occurrences of по and its patterns of attachment, hoping to improve decisions for familiar joined, separated, and hyphenated spellings. Most such counts were omitted after they appeared noisy. The paper gives no isolated result for each proposed count. The evidence here supports dropping those tested measurements from the final feature set and leaves their individual contributions unspecified.
Semantic evidence helps when it can be learned and found
SEM, the comparison that adds semantic evidence to the basic features, reaches 77.14% sentence accuracy with the larger word-trigram collection, compared with 76.99% for WORD-LEVEL. MORPHOSEM reaches 78.44% under the same corpus condition, compared with 78.34% for MORPHO. These results show modest gains on that metric from the cooccurrence evidence in the configurations where it was successfully incorporated. With the larger collection, adding semantics to MORPHO raises test precision from 89.35 to 89.89, while recall moves from 79.69 to 79.54. The combined result improves F1 and sentence accuracy without providing a uniform improvement in every measure.
The way the weights are estimated is part of this comparison. The reported morphology result uses a word-level ranker trained first. Its score accompanies the tag probability feature when the next step is fitted. The paper says the error reduction is about twice less when the morphology contribution is learned without that staging. It also reports no gain from trying to determine semantic weights jointly with the basic word-level features. Its strongest arrangement adds the semantic contribution after estimating the weight of the grammar score. The benefit demonstrated by the experiment belongs to the combination of the features and that training procedure.
The error analysis highlights the kind of case the semantic features were intended to help. The author attributes about one third of algorithm errors to a broad semantic category in which competing forms may be rare and share their grammatical category. An example uses достегает, glossed as lashes, where достигает, meaning reaches, is intended. The sentence concerns the geographical reach of someone’s performances. Both forms can be treated as verbs of the required shape, and the observed one is a dictionary word. Correcting it therefore requires sufficiently strong evidence elsewhere.
In that example, the intended verb has weak cooccurrence support from the relevant words for geography and performance. The word trigram score is better for the intended version, yet the increase fails to overcome the cost of changing the dictionary word. This makes the failure informative about coverage of evidence. The scorer has a place for a semantic association if the training collection supplies one. A pair whose frequency or association strength falls below the required thresholds contributes little to this decision. The system’s ability to recover an intended meaning depends partly on whether the relevant wording is represented in the retained statistics.
Less annotated development data changes the comparison
The paper also varies the amount of development material used to fit the reranker. This concerns annotated correction sentences, a different resource from the running text used for trigrams. The author reports averages across 10 independent runs. For the condition with 200 development sentences, the comparison includes WORD-LEVEL, MORPHO, and MORPHOSEM.
SpellRuEval test sentence accuracy with 200 development sentences
In the smallest reported development condition, the morphology configuration leads the combined feature configuration.
The numbers
| System or setting | sentence accuracy % |
|---|---|
| WORD-LEVEL | 74.88 |
| MORPHO (this paper) | 75.70 |
| MORPHOSEM | 75.44 |
In the 200-sentence development condition, the test F1 scores are 80.85 for WORD-LEVEL, 81.66 for MORPHO, and 81.44 for MORPHOSEM. Test recall reaches 76.35 for MORPHOSEM, alongside precision of 87.30. MORPHO gives recall of 76.06 and precision of 88.19. The semantic addition changes the balance of recovered errors and attempted changes, and the smaller sample yields a lower F1 and sentence accuracy for the combined configuration than for MORPHO.
With the full development material, the test sentence-accuracy entries for these configurations are 76.99%, 78.34%, and 78.44%, respectively. The author interprets the development-size comparison as evidence that the more complex feature weights benefit from additional annotated data. The smaller sample still supports a functioning reranker on this benchmark. It provides weaker grounds for estimating how much the cooccurrence evidence should influence a decision after the word-level and grammatical evidence have been considered. This learning comparison applies to reranker fitting within the rest of the reported data setup, including its dictionary and corpus statistics.
Limitations
Limits the author identifies
The paper identifies the restricted reach of local tag sequences as a limit. The relationships used to explain Russian spelling decisions can span intervening words. A local trigram only sees a grammatical relationship directly when the relevant tags fit within its span. The selected tag inventory further determines which contrasts are visible. The paper reports that about 30 of 559 sentences discussed as unsuccessfully corrected in the test error analysis had an error in the verb form. The count concerns the error analysis and illustrates a recognizable problem for further study.
The attempt to recover longer relationships with simple counts highlights the challenge. The author describes possible overfitting and gives examples where grammatical flexibility makes it difficult to define a reliable count. A correct subject may be unexpressed. An adjective may occur on either side of its noun. The constituent that a preposition introduces can be hard to identify in a mechanically generated candidate sentence. More adequate representations of those relationships are proposed as future work.
The author also identifies a limit of direct word cooccurrence. For the example about performances reaching countries, broader lexical classes might provide evidence from similar phrases involving different country names. The paper proposes class-based or factored probabilities with semantic classification as a possible direction and leaves the approach unimplemented. It also proposes evaluating neural language models, with the aim of improving the handling of more distant contextual evidence. The Russian results concern the tested word and tag trigrams and the reported features.
Transfer is another open question in the author’s account. The architecture can accept language-specific proposals and new sentence-level features. The paper suggests diacritic errors in Czech as an example of what a candidate generator might be adapted to handle. Applying the system to other languages with complex morphology and testing the same feature types are stated directions for further work. The conclusion also proposes a finite-state reimplementation, based on the nature of candidate search and ranking. The evaluation measures the Russian implementation described in the experiments.
Limits of the experimental setup
The benchmark measures corrections on LiveJournal sentences from GICR. The disjoint corpus material supports the word probabilities without directly sharing development or test sentences, according to the paper. It still comes from the same broader corpus. The test therefore gives evidence about this setting. Transfer across sources, writing conventions, and kinds of text would require additional measurements. Applications mentioned in the motivation, such as search, browser correction, and downstream linguistic analysis, have success measures of their own.
Candidate availability and final selection are partly distinguishable from the reported metrics. A correct sentence in the top 5 was available at the end of ranking, so a lower placement is evidence of a selection error. When the correct sentence is missing from that window, the metric combines several possibilities. The spelling or segmentation might never have been proposed, a partial path might have been dropped during beam search, or a complete candidate might rank below the evaluation window. The table leaves the relative frequency of those causes open.
The comparison with the previous winner establishes the results of complete systems on the same benchmark. The internal experiments then vary word-sequence training size and groups of features. They provide less detail about the individual candidate sources. There is no reported isolation of the dictionary lookup, phonetic coding, informal list, and boundary rules that would quantify the contribution of each to test performance. The effects of most individual semantic features are also grouped together, and the extended grammatical checks are discussed without a numeric breakdown by check.
The development-size experiment measures what can be achieved with limited correction annotations after other resources are in place. The dictionary supplies candidate forms and analyses, the tag probabilities use separately annotated sentences, and the word and cooccurrence probabilities use substantially larger collections of running text. The dictionary is described as closed. Those dependencies matter when assessing what it would take to reproduce the setup or adapt it to a language with different resources.
Some descriptive counts in the paper have narrower interpretations than the main test metrics. The benchmark examples report 799 clean sentences out of 2007 without explaining the relationship between that denominator and the stated split sizes. The figure is therefore difficult to assign to a particular split. The reported test accuracy and the token metrics are the direct measures for comparing the tested systems. The rounded counts in the error discussion describe particular categories of failure and serve a different purpose from those metrics.
What came after
Sorokin evaluates a corrector against the intended sentence used in a spelling competition. Later citing work on multi-reference benchmarks for Russian grammatical correction takes up a related evaluation question. A reference is an accepted version against which a system’s output can be judged. A multi-reference benchmark makes room for several accepted versions, a meaningful distinction when the task extends from a specific misspelling to grammatical revisions that can be expressed in different ways. The connection to Sorokin’s experiment lies in how a benchmark judges a proposed sentence. The later work’s title identifies its focus on benchmark design for grammatical error correction and learner language. Multi-reference benchmarks for Russian grammatical correction
Another citing paper, Russian Generative Spelling, Punctuation and Capitalization Correction, expands the stated correction scope to include punctuation and capital letters alongside spelling. In Sorokin’s experiments, capitalization is evidence the scorer can use when deciding whether to change a word. The later title places capitalization among the things the system is meant to correct. It also identifies its approach as generative, while Sorokin’s paper describes the construction and ranking of a shortlist. The link between the two works is the problem of recovering intended Russian writing when the observed form needs repair. Russian Generative Spelling, Punctuation and Capitalization Correction
Cite
Cite as Alexey Sorokin. 2017. Spelling Correction for Morphologically Rich Language: a Case Study of Russian. Proceedings of the 6th Workshop on Balto-Slavic Natural Language Processing.
@inproceedings{alexey2017spelling,
title = {{Spelling Correction for Morphologically Rich Language: a Case Study of Russian}},
author = {Alexey Sorokin},
booktitle = {Proceedings of the 6th Workshop on Balto-Slavic Natural Language Processing},
year = {2017},
doi = {10.18653/v1/w17-1408},
url = {https://doi.org/10.18653/v1/w17-1408}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/sorokin-2017-spelling-correction-morphologically-rich-language/