Elamur Research

Automatic Insertion of Accents in French Text

Paper · 1998 · Michel Simard

Summary

Removing accents from French can erase distinctions between words. The letters in a and à are the same once the accent is gone, but one form belongs to the verb avoir and the other is a preposition. A reader can usually tell which was intended from the sentence. Michel Simard’s paper asks how a program can make that choice for an existing document or as someone types. Both uses mattered because accents could disappear during electronic transmission, and entering them on a keyboard could be awkward.

The program, Reacc, starts with a dictionary indexed by spellings without accents. Some inputs have a unique match, such as francais, which takes a cedilla. Other inputs admit several spellings, including the possibility that the original letters are already correct. Reacc scores combinations of spellings using probabilities learned from French text. Its score draws on the grammatical properties of the words and how those properties tend to follow one another. To keep the search manageable, the program divides sentences into short stretches when there are too many combinations to examine together. It can carry words from a completed stretch forward as context.

The batch evaluation removes accents from a varied collection of 57,966 words and compares Reacc’s output with the originals. On that test, the distance between word errors depends on how much search the program is allowed to do. The reported average is 130 words when a stretch may contain up to 16 candidate combinations and 137 words at the most permissive setting tested. Running time rises sharply as the remaining gains become smaller. In a separate simulation on the same texts, a typing assistant that could reconsider the latest three words averaged 138 words between errors. The simulation assumes uninterrupted typing from beginning to end, with the typist supplying neither accents nor corrections.

The paper also describes a working Emacs prototype. It sends each accentuation request to a separate process so the user can continue typing, and it protects words that the user has accented or corrected. An error analysis explains where the remaining work lies. A frequent problem is choosing whether a word ends in e or é. Another is that the dictionary sometimes lacks the intended spelling altogether. Preliminary tests suggest that remembering a corrected spelling can help when the word recurs. The paper measures restoration on existing text and leaves the effect on people's typing speed and editing effort open.

Deep dive: Automatic Insertion of Accents in French Text

Michel Simard’s paper explains how Reacc restores missing French accents from context and how the same method can work while a person types. · about 33 minutes to read

The problem and its context

What disappears when the accents go

Accent restoration starts from a particular kind of damage. The letters of the intended word are still recognizable, but some distinctions in the written form have disappeared. A c may have lost its cedilla, for instance, and an e may have lost an acute accent. The program must decide where the marks belong and where the input already has the right spelling. In any document with many ordinary unaccented words, leaving letters alone is a large part of doing the job correctly.

The paper traces the supply of unaccented documents to both transmission and typing. Some software removed accents to avoid difficulties farther along an electronic mail route. The program that prepares a message may have a way to represent its accents, while another part of the route handles those characters differently. Typists faced a separate problem. A keyboard designed for another language might make accented letters difficult to enter, and the procedure could change with the computer, the keyboard, or the application. A person who knew perfectly well how to spell a word could still choose the easier keystrokes.

Readers often tolerate the result because the surrounding words supply much of the missing evidence. The paper gives a work-site example in which the letters of ferme can represent a verb in the present or the participle fermé. That choice goes together with how the rest of the sentence is read. In one reading, à cause introduces the cause of a closing. In the other, a causé says what the closed work site brought about. The accent choices help determine which event is being asserted and which event explains it. A program deciding on one spelling at a time from a fixed dictionary preference can overlook how the choices support one another.

Even when readers recover the intended meaning, removing accents can make a document slower to read and unsuitable for ordinary publication. It can also affect programs whose input is expected to follow French spelling. The paper points to such uses as information retrieval, information extraction, and machine translation. Restoring the accents is therefore a practical way to prepare a document for further processing, as well as a way to make its written form acceptable to readers.

The paper also describes damage that goes beyond accent omission. Older software could alter the encoded characters themselves, remove accented characters entirely, or replace all of them with a common placeholder. Those cases can take away information about which letter occupied a position, and sometimes about whether there was a letter at all. Reacc’s basic lookup assumes that a word survives in a form that can be used as a dictionary key. Simard sees a possibility of adapting the approach to other kinds of corruption. The problem studied in detail is the case where removing the marks leaves a usable spelling.

Why a dictionary is the starting point

For many words, a dictionary answers the whole question. There is no need to infer a grammatical role for ordinateur in order to leave its spelling alone. Likewise, a lookup can recover français from francais without examining the rest of the sentence. These examples show why it helps to define the set of possible spellings before drawing on context. Everything the program learns about neighboring words is unnecessary at a position with only one available output.

A dictionary also exposes the cases in which a decision is needed. The same lookup key may bring together different forms of a verb, different words, or spellings that already look identical except for the marks under consideration. One simple response is to choose whichever spelling occurs most frequently in correctly accented material. The paper illustrates the logic with de. The common preposition is an excellent default beside dé, the spelling that can denote a die or a thimble. Overall frequency can be strongly informative even though the rarer reading remains legitimate.

That approach favors the same spelling every time the stripped form occurs. Its usefulness depends on how strongly the alternatives are imbalanced and how often a particular document calls for an exception. At a position like a, a surrounding construction can favor either the verb or the preposition. At a position like cote, the grammatical category may stay the same while the intended subject matter changes. These are different demands on a system that uses context. The first can sometimes be handled by finding a more plausible sequence of grammatical categories. The second can require evidence about what the document is discussing.

The paper connects accent restoration to word sense disambiguation and to spelling and grammar checking. Accent restoration has a constrained source of ambiguity. The letters in the input restrict which alternatives are relevant, and several intended words can collapse to the same visible form. The system has to use the surviving letters and the surroundings together. Its output is a written spelling, so choosing between interpretations matters here when those interpretations lead to different forms.

What the earlier approaches used as evidence

Simard describes the method of El-Beze and colleagues as close to Reacc in its broad design. It generates possibilities using known words and evaluates them with a probabilistic account of grammatical sequences. The key distinction is the unit of decision. El-Beze and colleagues move through a fixed-width window and commit to a word and grammatical tag at the current position. Reacc assigns scores to complete spelling sequences within its chosen stretches. These designs make different commitments about which uncertainties should be resolved together. In the moving-window system, a tag chosen at one position enters the next decisions as part of their history.

The work by Yarowsky that Simard discusses draws on a wider variety of cues. It can use nearby words, grammatical categories around the ambiguous position, and words from a broader context. A decision list arranges such cues by their reliability and uses the strongest cue that applies to the current case. A cue can therefore be helpful even when its location is too far away for an adjacent-tag calculation. The distinction matters when two spellings are acceptable in the same local grammatical construction.

The paper also discusses Yarowsky’s comparison with a procedure based on the stochastic tagger in A Stochastic Parts Program and Noun Phrase Parser for Unrestricted Text. Such a tagger assigns a grammatical category to each word in a running text, a task known as part-of-speech tagging. Simard points out that grammatical interchangeability poses a particular difficulty for this kind of evidence. For instance, a time expression farther away can be useful when alternative verb tenses fit the words immediately around them. In the discussion of earlier work, such cases are described as common in Spanish and rarer in French, a reason to examine how far local grammatical information can take the French task.

What changes when the document is still being written

A batch program can wait until a sentence is finished and use the words on either side of an ambiguous position. The typing problem starts earlier. At the moment a user finishes a word, the rest of the sentence may be missing. In an existing document, there may be text to the right of the cursor, but it may belong to a different sentence from the one the user is composing. A typing assistant has to decide when the current word is complete enough to consider and how much text it should be allowed to revise when evidence arrives.

There is an editing reason for doing the work during composition. A separate restoration pass is possible after a document has been typed. On revisions or in collaborative writing, the same workflow can require repeated passes over pieces of text, followed each time by checks for changed spellings. An editor that restores accents during typing can place the decision near the moment the user is paying attention to the word. This also creates a responsibility for the editor. Once a person has made a spelling choice explicitly, automatic changes near that word need to respect it.

The method, step by step

From an input word to a set of spellings

Reacc handles a document as a sequence of words. For each position it looks up the spelling with the accents removed. The lookup returns a set of valid written forms. An input such as francais leads to français, while pousse can lead to pousse or poussé. The candidates for cote illustrate how several marked and unmarked forms can share a key. A candidate survives this stage because it is a known word form, even if it would make little sense in the sentence at hand.

The list came from an electronic French dictionary with grammatical information. Reacc’s generator drew on over 250,000 valid words from that resource. Indexing the forms under their stripped spellings gives the search a boundary. The program does not have to try every position where an accent might go and then decide whether the result is a French word. It can start directly from the dictionary entries that share the observed letters.

There is a fallback for an input whose stripped spelling has no entry. The generator passes it through unchanged. This avoids inventing forms for unfamiliar strings and preserves an unknown word that happened to be written correctly without accents. When a mark was lost from an unfamiliar word, the fallback leaves that loss unrepaired. A related failure can occur when a lookup succeeds but returns only other spellings. In either case, a candidate selector cannot recover the intended form through scoring alone. The generator defines the choices the selector will ever see.

How Reacc restores accents in a document

The steps in order.

How Reacc restores accents in a documentStep 1: Look up candidates under each stripped spelling1. Look up candidates under each stripped spellingStep 2: Keep unfamiliar input words as they appear2. Keep unfamiliar input words as they appearStep 3: Divide sentences to bound the candidate combinations3. Divide sentences to bound the candidate combinationsStep 4: Score each allowed spelling sequence4. Score each allowed spelling sequenceStep 5: Keep the highest scoring sequence5. Keep the highest scoring sequenceStep 6: Carry selected words into the next segment6. Carry selected words into the next segmentStep 7: Assemble the restored text7. Assemble the restored text

What the probabilities describe

Consider an ambiguous word with both a verb spelling and a preposition spelling. If the program knew which grammatical category belongs at that position, that knowledge could help it decide which word to write. Conversely, a candidate spelling can make one category much more plausible than another. Reacc represents these sources of information together. It evaluates each proposed sequence of words by asking how probable that sequence is under a Hidden Markov model, abbreviated HMM.

In the HMM, a text is represented at two levels. At one level there are tags, labels that describe grammatical properties. The labels can express distinctions such as a singular masculine common noun or a verb in a particular tense, person, and number. At the other level there are the written words. A tag has probabilities for the words that can appear under it. The tags are hidden in the sense that the system observes the words of the sequence it is scoring and must account for the possible tag sequences behind them.

The first probability in the score describes a grammatical transition.

P(tᵢ | hᵢ₋₁)

Here P denotes a probability and | means “given.” The symbol tᵢ denotes the tag at position i. The symbol hᵢ₋₁ denotes the history of tags used at that position, ending at position i − 1, immediately before the current one. In an N-tag HMM, where N gives the tag order of the system, the history contains the preceding N − 1 tags. Reacc uses a 2-tag HMM, so the immediately preceding tag supplies the transition context.

The other probability describes a written word given its grammatical tag.

P(wᵢ | tᵢ)

The symbol wᵢ is the proposed written word at position i, tᵢ is the tag at that position, and P and | again denote a probability and its condition. This term describes how plausible the written form is under that tag. A spelling associated with a particular kind of verb can receive support when that kind of verb fits the surrounding sequence. If alternative spellings can both use the same tag, their probabilities under that tag can still differ. For a frequent spelling, this is a way to retain the benefit of frequency evidence within a contextual calculation.

Reacc gives a score to a candidate sequence by adding the contributions of all possible tag sequences.

P(w) = ∑ₜ∈Tⁿ ∏ᵢ₌₁ⁿ P(tᵢ | hᵢ₋₁) P(wᵢ | tᵢ)

The symbol w stands for the entire sequence of written words, and P(w) is its probability. The length of the sequence is n. The tag alphabet T is the set of available labels, and Tⁿ is the set of tag sequences of length n. The variable t denotes one sequence in that set. The sum ∑ₜ∈Tⁿ adds the contribution of every such sequence, with ∈ meaning that t belongs to the set. The product ∏ᵢ₌₁ⁿ multiplies the contributions across positions, from the first position through position n. At each position, the two factors are the probability of its tag given the history and the probability of its written word given the tag. Their adjacent placement denotes multiplication.

The distinction between a word sequence and a tag sequence is important. A spelling can be compatible with several grammatical analyses. For Reacc’s purpose, those analyses can all contribute evidence for writing the word that way. The candidate being compared with its rivals is the written sequence. The program adds up the support associated with different analyses of that sequence before comparing it with another proposed output.

The formula also shows a route by which words to the right can matter even though the transitions go forward. A later word has a probability under the tag assigned to its position. A candidate for an earlier word can make that later tag sequence more or less probable. Once the program scores the entire stretch, the evidence from a later word can favor one earlier spelling. The paper exploits this property in the editor by letting an earlier spelling change when the user has just completed another word.

How the search stays manageable

There are two different collections of possibilities in this procedure. For a fixed sequence of written words, there are many possible grammatical tag sequences. Separately, for a fixed input with no accents, there are many possible sequences of written words. The paper cites an algorithm that calculates the probability of a given written sequence in polynomial time, avoiding direct enumeration of the full sum. The calculation for a single written sequence and the search over competing written sequences are separate computational jobs.

The latter search can grow rapidly as ambiguous positions accumulate. A position with a single spelling leaves the number of candidate sequences unchanged. Adding a position with several spellings creates a new branch for each of those possibilities behind every sequence already under consideration. A sentence with a cluster of ambiguities can be more expensive to process than a longer sentence with mostly fixed words. The paper therefore regulates the number of combinations considered in a segment, a measure attached to the actual choices the dictionary has generated.

Reacc treats sentences independently and may divide them further. Its segmentation heuristic tries to respect likely boundaries in the sentence while keeping the search within a fixed budget. A comma or other internal punctuation can suggest a relatively independent stretch. The paper also considers splits around regions of low ambiguity when there is no useful punctuation. The parameter S is the maximum number of spelling combinations that the program will search within a segment. With that cap in place, the paper argues that the overall restoration procedure can run in polynomial time.

Once it has chosen a segment, the program scores its spelling combinations and takes the highest-scoring one. That choice fixes the words returned for that stretch. A split can nevertheless fall between words whose interpretation is related. If a relevant cue lies on the other side, the score computed on the stretch alone can differ from the score it would receive inside the complete sentence.

To give each stretch some connection with what precedes it, Reacc processes segments from left to right. It puts a few words already selected for the previous segment before the new material and uses them as context for scoring. Those words have spelling choices already made. They are discarded from the new segment’s output when the document is put back together, so the assembled text contains them in their original place. This makes part of the preceding context available while keeping the enumeration focused on the unresolved region. It also means that accentuation chosen earlier can influence a later decision, a property that matters when the system is used in an editor.

How the probabilities were estimated

Reacc uses approximately 350 morphosyntactic tags. The term morphosyntactic describes labels that express both a word’s grammatical category and properties of its form, such as number or person. Using this inventory lets the score distinguish forms whose written difference is small but whose grammatical uses differ. The score can give different support to a finite verb and a participle when the labels associated with them have different probabilities in the observed surroundings.

The initial estimates came from a 60,000-word extract of the Canadian Hansard with tags assigned by hand. With tags supplied, the developers could count how frequently a tag followed another and how often a word appeared under a given tag. These counts give initial estimates for the two kinds of probability in the sequence score. The hand-tagged sample anchors the grammatical categories in observations where the tags are known.

The estimates were then refined on a 3 million word corpus without assigned tags. That corpus contained equal parts of parliamentary Hansards, Canadian National Defense documents, and French press reviews from Radio France International. The paper uses Baum-Welch reestimation for this step. In this procedure, the current probabilities provide estimates of the underlying tag and transition occurrences compatible with the observed words. Those estimates in turn allow the probabilities to be updated. The procedure lets the system draw on a larger body of French without requiring a person to tag every word in it.

The training procedure and the dictionary contribute different information. Tagged and untagged running text supply evidence for how spellings and grammatical tags are used. The dictionary determines which spellings the generator can propose. A word can be valid enough to appear in the dictionary and still be uncommon in the training material. Conversely, improving the score of a sequence cannot produce a word that was excluded from the candidate list. The paper implements the restoration procedure as the Reacc program and a C function library, with the hypothesis generator and probability estimates passed in as resources for the program.

How the fixed-window comparison works

The earlier El-Beze method is useful for clarifying what Reacc’s sequence probability accomplishes. In that method the candidate at an input position consists of a word paired with a grammatical tag. Its scoring objective for a complete sequence of such pairs is a product of word and tag probabilities.

∏ᵢ₌₁ⁿ P(wᵢⱼᵢ | tᵢⱼᵢ) P(tᵢⱼᵢ | t₍ᵢ₋₁₎ⱼᵢ₋₁, t₍ᵢ₋₂₎ⱼᵢ₋₂)

Here i indexes word positions up to sequence length n, and jᵢ indexes the chosen candidate pair at position i. The pair consists of word wᵢⱼᵢ and tag tᵢⱼᵢ. The tags t₍ᵢ₋₁₎ⱼᵢ₋₁ and t₍ᵢ₋₂₎ⱼᵢ₋₂ are the tags in the chosen pairs at the preceding positions. The comma lists the two tags on which the transition probability depends. The symbol ∏ᵢ₌₁ⁿ multiplies the terms across the sequence. As in Reacc’s formula, P is probability and | introduces the condition. Here each factor attaches to a particular tag choice. The objective scores that choice alongside its word.

El-Beze and colleagues make the calculation practical by optimizing locally as they move to the right. At the current position they use the following part of the product.

pᵢ × pᵢ₊₁ × pᵢ₊₂

The factor pᵢ denotes the product of the word probability and tag transition probability at position i in the preceding formula. The factors pᵢ₊₁ and pᵢ₊₂ are the corresponding products at the next positions, and × denotes multiplication. The local calculation includes the later factors because the tag at the current position can affect their transition histories. After a word and tag are selected at the current position, later decisions use that selected tag. Reacc’s procedure instead keeps the grammatical analyses as possibilities inside the score for a written stretch. It combines their probabilities before committing to an output spelling for the stretch.

How the editor gives the procedure a place to work

The simplest adaptation to typing would run Reacc again after every edit on the entire document. The batch design already gives a way to narrow that work. Because sentences are treated independently, changes within a sentence are relevant to scoring that sentence. Narrowing the recalculation to the old segment that contains the edit is less straightforward. The edit can change where the segmentation algorithm places a boundary. It can also change which completed words are carried into a following stretch.

The typing procedure uses a more local notion of what ought to be revised. It waits for a word to be completed before launching a round of restoration. It then considers the part of the current sentence to the left of the edit, with a limited set of recent words eligible to change. That set is called the AAI window, where AAI stands for automatic accent insertion. Its width, W, is measured in words. A separate context window can supply earlier words from the same sentence. These can inform the decision while their spellings stay fixed.

This division lets the editor delay a commitment without letting changes spread too far from the cursor. Suppose the program gives the most recently completed word an accent and the next word makes a different spelling more plausible. With room for both in the editable window, the second scoring round can reconsider the first. Earlier text can serve as evidence even when the editor has passed the point at which it will revise it. The intended effect is to keep visible changes in the area the typist is likely to be watching.

The Emacs prototype, called Reacc-mode, is a minor mode that adds restoration to the editor’s usual operations. Emacs and the accentuation program are separate processes. When Emacs requests restoration, it sends the eligible words along with information such as their context and position. It then gives control back to the typist. The restoration program scores the request in the background and returns the proposed words. Emacs inserts the result when it arrives. This arrangement keeps the scoring procedure out of the immediate response to a keystroke.

To decide when to send a request, Emacs uses properties attached to individual characters. Characters inserted by Reacc receive a mark that identifies them as automatically processed. Characters typed by the user do not receive that mark when entered. After a space or newline, the editor examines the word immediately before the cursor. If its characters are all unmarked, the editor has a signal that a fresh word may be ready for restoration. The delimiter is a practical substitute for trying to infer completion after each letter, when an unfinished fragment may resemble some other valid word.

The character properties also provide a way to protect explicit choices. If a new unmarked word already contains an accented character, the editor can recognize that the typist supplied a mark. A mixture of automatically marked and unmarked characters can signal that the typist has edited an automatically processed word. In these cases the mode marks the word as user-validated and protects it from future restoration. The paper treats the mixed-mark pattern as an indicator of correction, since recognizing the user’s intent is harder than observing a newly typed accent.

Existing text receives the validated mark when Reacc-mode is enabled. During later rounds, text outside the active window also receives that mark. These rules make the normal course of appending words easy to handle and limit where a result can make changes during more complex edits. They also give the term correction a concrete consequence in the prototype. A spelling that the editor has recognized as a user choice is held fixed when nearby text is processed.

Experiments and results

The reference and the frequency baselines

The batch evaluation starts from correctly accented documents. A program removes the accents, producing the input that Reacc must restore. The original document is retained as the reference. The evaluation compares the restored output with that reference and counts words whose spellings differ. This is a word error measure. The unit being counted is the word with a discrepancy, regardless of how many accent choices would need to change inside it. The paper also presents the average distance between errors in words, which describes how often a reader moving through the output encounters a discrepancy.

The batch test corpus contains 57,966 words according to the UNIX word-counting utility. Some of its documents come from the same sources that supplied the training collections, but those test documents are distinct from the training documents. The test also includes different kinds of material. Its mix covers institutional records, manuals, court transcripts, and literary writing. This design lets the reported error distance describe a combined test over varied text. The corpus-level figures give the different kinds of documents their influence through the words they contribute.

Simard gives two points of comparison for deciding how much a contextual procedure is needed. Approximately 85% of words in French text are described as having no accents in the first place. For more than half of the other words, the form without marks suffices to determine the accented version. The resulting estimate for a good dictionary is almost 95% success, or an error approximately every 20 words. This is an account of how much deterministic lookup can accomplish, before attempting contextual disambiguation.

The next baseline uses frequencies from an accented corpus to resolve every ambiguous spelling in the same way each time. For each set of alternatives, the program chooses the most frequent one. The reported success for that simple strategy is roughly 97%, with roughly one word error per 35 words. The paper gives these figures as approximate benchmarks for the basic task. Its detailed test-corpus results come from the runs of Reacc at different search budgets.

Batch restoration at different search budgets

In the batch runs the dictionary and learned probability estimates remain in place while the segment budget varies. At S = 2, there are 821 word errors and the reported mean distance between errors is 70 words. At S = 16, the output has 441 word errors and the reported distance reaches 130 words. With S = 128, the table reports 420 word errors and a distance of 137 words. All of these results concern restoration of the same 57,966-word test corpus after accent removal.

Reacc segment budgets on the batch test corpus by average distance between errors

Allowing more spelling combinations increases the distance between errors, with smaller gains at the upper end.

Reacc segment budgets on the batch test corpus by average distance between errorsS = 2: 70S = 270S = 4: 103S = 4103S = 8: 124S = 8124S = 16: 130S = 16130S = 32: 134S = 32134S = 64: 136S = 64136S = 128 (this paper): 137S = 128 (this paper)137
The numbers
System or settingwords between errors
S = 270
S = 4103
S = 8124
S = 16130
S = 32134
S = 64136
S = 128 (this paper)137

The computer used for these tests was a SparcSTATION 10 with 32 MB of memory. The timing measures whole runs of the test material. The run at S = 2 took 68 seconds, and the run at S = 16 took 169 seconds. With S = 32, the running time reached 277 seconds. At S = 128, where the measured quality was highest, the run took 731 seconds. The wider search therefore had a substantial cost even in the part of the series where the error distance changed only slightly.

Selected Reacc segment budgets on the batch test corpus by running time

The most permissive segment budget takes much longer to process the test corpus.

Selected Reacc segment budgets on the batch test corpus by running timeS = 2 (this paper): 68S = 2 (this paper)68S = 16: 169S = 16169S = 32: 277S = 32277S = 128: 731S = 128731
The numbers
System or settingseconds
S = 2 (this paper)68
S = 16169
S = 32277
S = 128731

The paper identifies settings around S = 16 or S = 32 as practical choices, depending on the job and resources. It gives a throughput range of 10,000 to 20,000 words per minute in that vicinity. The conclusion also describes throughput of approximately 20,000 words per minute on the test machine and associates its performance figures with S = 16. Throughput here describes batch text processing. It supports an estimate of how much repeated work an editor can afford, while the individual timing figures describe the particular runs over the full corpus.

El-Beze and colleagues reported somewhat better restoration results in their experiments. Simard mentions their use of a richer tag history as one possible reason. Their test corpus had a little over 8000 words, and their average error distances ranged between 100 and 600 words across texts. The difference in test material and the variation among those texts make the comparison indirect. The paper likewise declines to compare a corpus-wide restoration score with Yarowsky’s decision-list evaluation, which concerns selected ambiguities and focuses mainly on Spanish. Those earlier results help locate the approach among other methods, but the frequency baseline and the Reacc setting comparisons are the relevant figures for examining its own evaluation.

A simulated typing session

For the on-the-fly evaluation, the program receives the same test corpus in the order a person would type it from beginning to end. The simulated typist provides no accents and makes no ordinary typing errors. The simulation also withholds corrections to the accents placed by the system. It measures how the procedure behaves when each successive word arrives as expected and the editor must rely on that input alone. The segment budget is S = 16 in every run of this series.

The variable is W, the number of words eligible for revision at each round. With W = 1, the simulation reports 1125 word errors and an average distance of 52 words between them. At W = 2, it reports 461 word errors and a distance of 126 words. At W = 3, those figures are 420 errors and 138 words. The wider settings in the table reach a reported error distance of 139 words. These are final accent errors on the simulated text, after the allowed rounds of reconsideration.

Editable window sizes in the typing simulation by average distance between errors

The main gain comes from allowing recent spellings to be revised, and the reported distance soon levels off.

Editable window sizes in the typing simulation by average distance between errorsW = 1: 52W = 152W = 2: 126W = 2126W = 3: 138W = 3138W = 4 (this paper): 139W = 4 (this paper)139W = 8: 139W = 8139W = 16: 139W = 16139
The numbers
System or settingwords between errors
W = 152
W = 2126
W = 3138
W = 4 (this paper)139
W = 8139
W = 16139

The star marks the smallest tested window at the highest reported average distance. The result with W = 3 is comparable to the batch measurements, including the settings where the batch program can use much larger segments. The simulation gives one piece of evidence for choosing a small window: on these texts, it can keep most of the observed benefit while limiting how far back visible changes occur. The additional question of what users notice in that region is a question about editing behavior.

The paper argues that the restoration procedure is fast enough to be considered for real-time use by comparing batch throughput with typical typing demands. Only a small number of typists, it notes, can type at a rate exceeding 100 words per minute. The Emacs prototype also moves the calculation to a separate process, so continued typing and receipt of a restoration result are handled independently. Simard reports favorable early feedback after the prototype was made available in the university’s computer science department. That report accompanies the simulation and implementation account. The paper’s quantitative results concern the accent errors and batch running times.

What the ablations show

Giving an ambiguity more room

The segment-budget sweep changes how many combinations Reacc may score while using the same dictionary and probability estimates. A tight budget forces more breaks when ambiguities collect in one place. Increasing the budget gives more of those ambiguities a chance to be resolved in the same scoring calculation. The batch series shows the benefit of this additional room most clearly near the low end of the budget. The distance between errors grows substantially as the cap moves from S = 2 through S = 8. Further increases give smaller gains and longer runs.

The sweep supports the case for searching beyond very small stretches. It also suggests that room for additional combinations has limited value once the program can handle most of the nearby ambiguities together. A larger allowance can change both the placement of segment boundaries and the set of spelling choices evaluated jointly. The comparison varies those effects together. It does not reveal how many errors came from a particular bad boundary, whether punctuation supplied the right split, or how frequently the carried context rescued a choice.

The paper’s two main settings, the batch budget and the typing window, control different parts of the procedure. The batch budget constrains the number of spelling combinations. The typing window constrains the number of words eligible to change after an edit. A window of fixed word length can be simple or difficult to score depending on the number of spellings each word admits. The paper suggests that a small editable window may match batch performance in part because it usually leaves little need to subdivide the candidate search. This is an explanation offered for the observed results, with further experimentation needed to establish how closely the two procedures correspond.

Letting a new word reopen a recent choice

The simulation varies W while holding S = 16 fixed. With W = 1, the next word cannot change the spelling just assigned to the previous one. With W = 2, that previous word is again eligible for modification when the next word arrives. The paper reports that the change to W = 2 reduces the error count by almost 60%. The same restoration mechanism is operating in each run. The extra opportunity to revise a recent choice is the experimental change.

This matters even if earlier words are supplied as context. Context before the current word can improve an immediate decision, but it cannot retroactively apply new evidence to a spelling already outside the editable window. By enlarging the editable part, the system can use the word that has just arrived to choose among recent spellings. On the simulated texts, that capability supplies much of the difference between restoring each completed word and using a brief period of reconsideration.

The measured gain slows once the window has three or four words. This is evidence about final restoration quality under the left-to-right scenario. The design also has a human rationale. The authors expect people to be able to monitor a small stretch near the point of typing, notice a surprising change, and correct it. The quality sweep measures the first part of that design choice, the amount of revision access the algorithm needs on the test. Confirming the second part would require observing which changes users see and correct.

Reading the remaining batch errors

The error analysis examines the batch run at S = 16. Of its 441 word errors, 171 involve the choice between a plain final e and an acute-accented é. The paper gives this category as 38.8% of the errors. It frequently involves a choice between a finite form and a participle, as with aime and aimé. The category is defined broadly by the spelling distinction, so the count covers other grammatical cases as well. The grouping identifies an orthographic decision that merits attention without assigning a single cause to all the instances.

Another 111 errors, or 25.2%, concern spellings absent from the generator’s candidate list. The paper observes that proper names account for nearly half of this group. Technical documents also bring abbreviations, foreign words, and newly coined forms into the test. The count diagnoses a limit before the scoring stage. If the intended form was unavailable among the choices, using a larger segment or different grammatical probabilities would still leave it unavailable. Dictionary coverage matters even in a system whose main innovation is how it ranks spellings.

The distinction between à and a accounts for 69 errors, or 15.7%. This group is centered on a particular preposition and a particular form of a verb. A correction to one of these words can depend on which construction the larger stretch supports, as in the work-site example. The fact that this single distinction forms a separate category also shows how unevenly particular ambiguities contribute to a corpus-wide count. The paper groups 90 errors under other cases, reported as 20.4%.

These groups help distinguish remedies that the aggregate figures bring together. At a missing-candidate position, the generator must acquire the form before any scoring change can help. At a final-e ambiguity with both spellings available, the question is how the system uses the evidence that favors one form. The analysis is a classification of observed errors. It leaves open which scoring or segmentation change would fix each instance.

Remembering a correction

The paper tests an elementary way to use corrections to unfamiliar words. When a user corrects a word and the corrected spelling is unknown to the generator, the spellings available at future occurrences can be expanded. If people correct such a mistake on its first appearance, the system can use the corrected form as a candidate on subsequent appearances. The mechanism addresses recurring gaps in the dictionary, where repeated errors would otherwise have the same cause.

In preliminary experiments the average distance between errors went from 138 to 156 words. The paper describes this as a reduction of almost 12% in the total error count. The test corpus is heterogeneous by design, and Simard observes that unknown words recur infrequently in it. The paper conjectures that the benefit might be larger in equally long material on a more consistent subject. The reported changes are from the preliminary experiment, while the observation about a more homogeneous text gives a reason to test the mechanism in another setting.

The paper identifies a separate case where remembering a new dictionary entry would leave the underlying difficulty intact. Both cote and côte exist, and both can be feminine singular common nouns. The training material strongly favors côte, which has several senses. A user writing about the stock market may repeatedly intend cote. Grammatical fit then offers little reason to change the output, even when the immediate wording is entirely natural for the intended spelling.

For this case Simard describes an experiment inspired by earlier speech recognition work by Kuhn and De Mori. The approach would estimate local word probabilities from the developing context and use those probabilities alongside the fixed HMM score. The local component described in the paper is a unigram, which here means that it estimates probabilities for words individually. The idea is to give the current document some influence over a preference learned from the training corpus. The paper characterizes its initial results as encouraging and gives no quantitative result for that experiment. The measured correction result applies to expanding the candidate list.

Limitations

Limits identified in the paper

Segmentation is a calculated compromise. Simard explicitly notes that the need to bound search can place a split at a poor location. The solution of passing selected words forward supplies some left context, but the words already chosen remain fixed. An early error can shape a later probability calculation. The typing system’s ability to accept a correction may help in this situation because the corrected word can then enter the following context in its intended form. The paper presents that benefit as a reason to exploit feedback.

The dictionary has limitations in both directions. It misses some valid forms, as the error counts show, and it includes rare entries that Simard suspects may slow processing without being useful in ordinary text. A listed form adds work when it shares its stripped spelling with other forms in the same region. A missing form makes the right answer inaccessible to the selector. The paper discusses both effects but gives no comparison across dictionaries of different sizes or coverage.

Simard also identifies a weakness in repeated choices between grammatically interchangeable words. If local grammar accommodates either spelling, training frequency can dominate each decision. A text on a particular subject may legitimately call for the less frequent spelling every time. The reported work on local word probabilities remains preliminary, and the decision-list discussion gives examples of other cues that might be relevant. These remarks locate a limit of the evidence used in the main system.

The paper expressly distinguishes accentuation quality from ease of typing. A study of whether the tool changes typing speed would require an experimental protocol involving typists and the correction work they perform. The simulation measures final discrepancies in a particular editing session instead. Its typist writes continuously in order, enters the intended base letters without mistakes, and leaves the system’s accent choices uncorrected. The usefulness of a wider revision window for that scenario is directly measured. Its effect on attention and editing time in ordinary use is left open by the paper.

The comparison with prior work is qualified for similar reasons. El-Beze and colleagues used a smaller collection whose results varied widely from one text to another. Yarowsky’s experiments on selected ambiguities do not yield the overall measure used for Reacc. Simard also notes that Yarowsky’s tag-based comparison had to rely on an improvised tag inventory in the absence of a manually tagged training collection. The reports differ in training conditions, scope, and evaluation, so the paper can describe their relative behavior only within the comparisons actually made.

Limits visible in the evaluation design

The reference consists of existing, correctly accented material that is deliberately stripped. This has an advantage for evaluation. Every output word can be checked against an attested original. It also defines the class of input covered by the reported scores. An error made while typing can change the base letters, and character corruption can destroy letters that the generator needs for lookup. The batch error distances are measurements for accent removal and restoration under the paper’s procedure. Simard suggests possible adaptation to other damage and languages, with empirical questions about candidate generation and contextual scoring still open in those settings.

Matching the original is a strict and clear criterion. The work-site example also illustrates that more than one reading can sometimes be coherent after the accents are removed. In such a case, a different coherent reading still produces a discrepancy against the reference. This is appropriate if the task is to recover what the original writer wrote. The aggregate error count gives no separate credit for a defensible alternative reading, and it does not indicate how frequently apparent errors of that kind occur.

The corpus mixes several kinds of text, and some test sources resemble sources used in training even though the documents themselves are held apart. This tests restoration across a broader blend than a single collection would supply. Because the main results are reported for the combined corpus, they give limited information about performance on a document from any one genre. Proper names, abbreviations, and unusual words can be concentrated differently across documents. Separate measurements would be needed to tell how much those differences affect a user working largely with one type of text.

The search-budget results measure the behavior of the implemented procedure as a whole. They show how quality and cost change with the cap on combinations. They do not compare an exhaustive solution for complete sentences with the heuristic segmentation across the corpus. Likewise, the paper gives no controlled comparison with and without the preceding words supplied at each split. The usefulness of carrying those words forward is reported as a practical observation. The size of its contribution is unmeasured in the displayed results.

The editor experiments and implementation description answer different questions. A final error count can record a good outcome even if the program displayed a fleeting wrong spelling and fixed it when the next word arrived. That fluctuation could matter to someone watching the cursor. More complex actions, such as inserting text in the middle of a sentence or correcting an automatically accented word, are supported by the editor’s marking rules. The simulation contains no such actions. The paper’s report that the separate process keeps interaction responsive is an observation about the prototype, alongside timings for batch runs. It gives no distribution of response times for individual requests in ordinary editing.

Finally, the preliminary dictionary experiment depends on when a corrected form becomes available and whether it occurs again. Its improvement shows what can happen when the candidate generator learns from corrections in the experimental conditions. It does not quantify how many corrections people would actually enter, how rapidly they would do so, or how much additional work they would accept. The proposal for local word probabilities raises its own question about how much nearby text is needed to establish a reliable preference. The main batch and simulation results use the fixed trained probabilities, so they provide a reference for those questions.

What came after

There are no documented follow-up papers to discuss. The paper ends with Reacc available as a batch program and C library, and with Reacc-mode in use as an Emacs prototype. Simard reports that integration into a word processor was being considered and describes preliminary work on adapting spelling preferences to the current text. Those are research and implementation directions announced in the paper. A completed integration or a later evaluation of those directions is unreported.

Cite

Cite as Michel Simard. 1998. Automatic Insertion of Accents in French Text. Proceedings of the Third Conference on Empirical Methods for Natural Language Processing.

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

@inproceedings{michel1998automatic,
  title = {{Automatic Insertion of Accents in French Text}},
  author = {Michel Simard},
  booktitle = {Proceedings of the Third Conference on Empirical Methods for Natural Language Processing},
  year = {1998},
  url = {https://aclanthology.org/W98-1504/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/simard-1998-automatic-insertion-accents-french-text/