Conditional Random Fields for Word Hyphenation

Nikolaos Trogkanis, Charles ElkanACL 2010

Abstract

Hyphenation is a critical component of digital typography, traditionally handled by rule-based or pattern-matching systems like the Liang/Knuth algorithm in $\TeX$. This paper presents a modern approach using Linear-Chain Conditional Random Fields (CRFs) to treat hyphenation as a sequence labeling task. By leveraging character n-gram features and a tunable probability threshold, the proposed model significantly reduces "spurious" hyphenation errors—the most disruptive type for readers—compared to legacy systems and commercial alternatives. Evaluation on English and Dutch datasets demonstrates that CRFs achieve superior accuracy and provide a robust framework for balancing precision and recall in hyphenation.

Introduction

Word hyphenation—the process of identifying allowable split points at the end of a line—is essential for high-quality text justification. For over 25 years, the gold standard has been the $\TeX$ hyphenation algorithm. While efficient, $\TeX$ relies on hand-tuned patterns that often struggle with proper nouns, complex morphology, or words outside its original training set.

This research re-frames hyphenation as a structured learning problem. Unlike traditional classifiers that treat each potential split point independently, hyphenation decisions are inherently sequential; the probability of a hyphen at one position is strongly correlated with neighboring labels. Furthermore, the cost of errors is asymmetric: a "spurious" hyphen (false positive) is significantly more disruptive to a reader than an "omitted" hyphen (false negative).

Methodology

The authors propose using Linear-Chain Conditional Random Fields (CRFs) to tag each character in a word with a binary label indicating whether a hyphen is allowed.

Feature Engineering

Rather than relying on complex linguistic rules, the model utilizes simple character n-grams (substrings of length 2 to 5) surrounding the target position. This allows the model to implicitly learn the phonological and morphological rules of a language from raw data.

Risk Management via Thresholding

To address the asymmetric cost of errors, the authors employ the forward-backward algorithm to calculate the specific probability of a hyphen at every position. By applying a high probability threshold (e.g., $p > 0.99$), the system can be tuned to prioritize precision, ensuring that nearly every hyphen placed is typographically correct, even if some valid points are missed.

Experimental Results

The model was evaluated using the CELEX European lexical resource, covering 65,828 English words and 293,681 Dutch words. Performance was measured using two primary metrics: the Omitted Letter Error Rate (OLER) and the Spurious Letter Error Rate (SLER).

Comparison of Omitted Letter Error Rate (OLER) and Spurious Letter Error Rate (SLER) for English and Dutch across varying probability thresholds.

As illustrated in the figure above, the CRF approach (solid teal line) demonstrates a unique ability to minimize SLER as the probability threshold increases. In English, at a 0.99 threshold, the CRF achieved a "serious" error rate (SLER) of only 0.04%, a six-fold improvement over the standard $\TeX$ American English patterns (0.24%). In Dutch, the results were even more pronounced, with SLER dropping as low as 0.005%.

While the OLER naturally increases as the threshold rises, the CRF remains competitive with or superior to legacy methods like PATGEN and commercial systems like TALO. At the word level, the CRF achieved an English accuracy of 96.33%, surpassing previous state-of-the-art structured SVMs.

Discussion and Conclusion

The transition from hand-crafted patterns to CRFs represents a significant modernization of hyphenation technology. The CRF model successfully captures the sequential dependencies of language while providing a tunable mechanism for risk management. Although the CRF is approximately 10x slower than the $\TeX$ trie-based method, its processing speed (~0.38 ms per word) remains well within the requirements for real-time document rendering.

Future work may involve extending the model to handle contextual ambiguity (e.g., distinguishing between the noun in-va-lid and the adjective in-val-id) and optimizing training speeds for even larger multi-lingual datasets.

Summary updated

BibTeX
@inproceedings{trogkanis2010conditional,
  author = {Nikolaos Trogkanis and Charles Elkan},
  title = {{Conditional Random Fields for Word Hyphenation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2010},
}
Figure