A Conditional Random Field Framework for Thai Morphological Analysis
Paper · 2006 · Canasai Kruengkrai, Virach Sornlertlamvanich and Hitoshi Isahara
Summary
Thai text generally leaves the reader to infer where one word ends and the next begins. For a computer, that uncertainty also affects the assignment of grammatical categories. A character span that looks like a noun when read as one word can yield different categories if it is split into smaller pieces. The authors address these decisions together. They generate competing readings of the same stretch of Thai text and use a conditional random field, or CRF, to help choose a sequence of words and their grammatical tags. The two tasks are word segmentation and part-of-speech tagging.
The system starts by looking for the longest dictionary match at each point in the input. It then revisits that first segmentation to find alternatives. The resulting candidates can be represented as a lattice, a network of paths in which each complete route is a way to divide the same text into words. For each candidate word sequence, the system uses the Viterbi algorithm to find its strongest tag sequence. The paper then compares two ways of choosing among these tagged candidates. One uses the score at the end of Viterbi search. The other estimates confidence by comparing the weight of the selected tags with the total weight of the tag sequences possible for the same candidate words.
The evaluation uses ORCHID, a corpus of Thai sentences with annotated words and tags. The authors remove the test tags and join the words in each test sentence, so the system must recover both kinds of information. The confidence-based system, CRF-CE, reaches 83.568% F₁ for segmentation and 79.342% F₁ when a correct answer requires both the right word span and the right tag. Both are the highest F₁ scores in their respective comparisons. The Viterbi-based system recovers more of the reference tokens on both measures, but it also produces many more incorrect predictions relative to the number it returns. The authors observe that its choices frequently contain more pieces. Its F₁ falls below both dictionary-matching baselines on both tasks.
The experiment exposes a distinction between assigning tags to a proposed set of words and deciding which set of words to accept. Viterbi search gives the best tag sequence for a fixed word sequence. The confidence calculation puts that sequence’s weight in the context of the other tags those words could receive. In this preliminary evaluation, the latter comparison gives a better balance of precision and recall. The authors use a small set of feature types and identify richer features and unknown-word handling as work still to be done.
Deep dive: A Conditional Random Field Framework for Thai Morphological Analysis
Kruengkrai and colleagues use conditional random fields to recover Thai word boundaries and grammatical tags, comparing two ways to rank candidate analyses. · about 35 minutes to read
The problem and its context
When the text does not supply the units
A Thai morphological analyzer needs to decide what it will treat as a word before it can attach a word-level grammatical category. In the paper’s formulation, the starting point is an ordered character sequence. The output identifies spans of those characters and assigns a part-of-speech tag to each span. A tag describes a grammatical category, such as a noun or a verb. As soon as an analyzer moves a boundary, it changes which character span needs a tag. In some cases it also changes how many tags the output needs. This dependence between the two decisions is central to the paper’s treatment of tokenization.
The authors introduce morphology as a broader activity that can include breaking text into morphemes and analyzing word formation. Their experiment gives the task a narrower, observable target. It asks for the word divisions and part-of-speech labels found in an annotated corpus. A morpheme is a unit of word structure, and a candidate word can have an internal division into smaller lexical pieces. The system needs that possibility when generating alternatives. The final evaluation, however, can judge the proposed division directly against the corpus’s word boundaries without asking the system to separately describe every word’s internal structure.
For languages such as English, the authors point to white space and punctuation as cues that often allow analysis to start with words. For Thai, Chinese and Japanese, their starting observation is that writing does not use white space to mark every word boundary. They also distinguish the kinds of units their cited predecessors used. In their account of Chinese, a character can itself act as a morpheme, making it possible to assign labels to a fixed character sequence and use those labels to encode segmentation. Thai words are written with consonants and vowels, and the paper treats word-level categories as more practical than grammatical tags for individual characters. The relevant Chinese precedent is Chinese Segmentation and New Word Detection using Conditional Random Fields.
This difference affects what a statistical procedure is asked to condition on. If a system works over characters, the sequence of input units stays the same when their labels change. In the Thai framework, the units seen by the tagger are words, and different decisions about boundaries give it different words. Even the length of its observation sequence can change. The authors therefore need a representation that preserves alternative segmentations and a scoring procedure that can choose among them. They describe their design as closer to the Japanese work in Applying Conditional Random Fields to Japanese Morphological Analysis.
Earlier approaches to finding and labeling words
The paper describes a tradition of treating Thai segmentation and tagging as separate tasks. Sornlertlamvanich’s maximum matching procedure consults a list that can be constructed from distinct dictionary headwords. It considers different divisions, tries to limit the occurrence of unknown words and favors a division with fewer tokens. This provides a way to rank candidates from their lexical coverage and number of pieces. The criterion leaves the grammatical category of each candidate word to a separate stage. The new framework retains the usefulness of a word list while allowing the tags to participate in the final choice of a segmentation.
Kawtrakul and Thumkanon used a different source of guidance. They estimated probabilities of groups of words from an already segmented corpus and used a trigram Markov approach to choose a division. The move was from a matching heuristic to a preference learned from sequences observed in text. In the paper’s discussion, however, some boundary ambiguities call for linguistic information beyond those word statistics. This motivates a score that can respond to the grammatical reading of the candidate. The cited study is A Statistical Approach to Thai Morphological Analyzer.
The closest Thai precedents in the paper already make use of context or combine tasks. Meknavin and colleagues studied segmentation with grammatical tags under a generative approach, choosing a segmentation by the marginal probability of its word sequence. The paper also credits them with a feature-based treatment of ambiguous divisions. To learn which contextual features characterize unknown words, Charoenpornsawat applied the Winnow algorithm. For part-of-speech tagging in Thai, Murata and colleagues compared support vector machines, decision lists, and maximum entropy. These examples matter because the contribution here is a particular way to represent the alternatives, learn tag preferences and make the final decision. Segmentation ambiguity and the value of grammatical or contextual evidence were already recognized.
Other work reviewed by the authors started with finer units. The paper describes approaches that first use morphological rules to identify syllables or morphemes and then try to reconstruct words from them. Jaruskulchai used minimum description length to select combinations of morphemes. Aroonmanakun used collocation statistics to decide which syllables should be joined. Both lines address the relation between smaller units and words. The distinction the authors draw is that those procedures do not directly combine word recovery and part-of-speech assignment in the same framework.
Why condition on the observations?
The paper situates its approach within supervised sequence learning. In this setting, the training material supplies an input sequence and its correct output labels. When predicting a new sequence, a useful decision at one position can depend on what surrounds it. The grammatical category of a word, for instance, may fit some preceding categories better than others. The authors introduce hidden Markov methods as a widely used way of expressing these dependencies, with a joint probability over both observations and tags. Tractable inference in the generative setting described by the paper calls for independence assumptions about the observations.
For the authors, those assumptions limit how easily an analysis can draw on several pieces of evidence about the same text. A prefix, a suffix and the surrounding words can provide overlapping information. A conditional probability asks how the tags are distributed given the observations, leaving the probability of the observed words themselves outside that calculation. This formulation gives feature functions access to the input when they assess a label or a transition between labels. The experiments eventually use simpler features than the range of evidence discussed in the introduction, so this flexibility describes the framework’s capacity.
The authors also consider where the tag probabilities are normalized. Maximum entropy Markov methods learn transitions to the current tag given the previous tag and observations, using separately normalized next-state decisions. The paper cites label bias as a problem with that arrangement. With a CRF, complete tag chains for a fixed observation sequence share a normalization term. They compete as whole analyses, even though their scores can be assembled from local features. This gives the system a principled way to compare taggings over the same words. The Thai task adds a further question because the competing segmentations alter those words.
The method, step by step
From characters to candidate word sequences
A lattice makes the ambiguity visible. Picture the input as a line of characters. A candidate word spans a portion of that line, and a complete path covers the input through successive spans. Several paths may share most of their words and differ over a short stretch. Others may divide that stretch into different numbers of pieces. Once tags are attached, a route also specifies the grammatical interpretation of each word. This representation allows alternatives to remain available until the path-selection stage.
The initial route comes from longest matching. Starting at the current character, the procedure finds the longest prefix that occurs in the word list and places a boundary after it. The next search begins at the following character. If there is no match, the procedure passes over the current character and tries to match from the next one. The search continues until it has traversed the input. At this point the procedure has a starting segmentation. It has made each match using the current position and the lexicon, so an early choice may still have another plausible reading.
Backtracking revisits the tokens on that first path from left to right. Where the procedure finds that a token cannot be split further into lexical pieces, it keeps the token. If a smaller match is possible, the paper describes saving the first match and restarting longest matching immediately after it. This opens a different route through the remaining characters. In the course of reconsidering these matches, the system can also create unknown tokens consisting of individual characters or longer spans. The paper presents backtracking as an efficient route to alternatives that would otherwise require more exhaustive searching.
The paper’s example shows what those alternatives look like. One route contains เทคนิค followed by ปัญญาประดิษฐ์. Another keeps ปัญญาประดิษฐ์ together while replacing เทคนิค with เท, ค and นิค. Yet another keeps เทคนิค intact and divides ปัญญาประดิษฐ์ into ปัญญา and ประดิษฐ์. The example identifies the intact ปัญญาประดิษฐ์ with the tag NCMN, whereas the route with the internal boundary has ปัญญา tagged NCMN and ประดิษฐ์ tagged VACT. Most of the phrase can stay fixed while an ambiguity in a small stretch changes both the segmentation and the tag sequence.
The same example has a route that ends with แปลภาษา tagged VACT and another in which the ending is divided into แปล with VACT and ภาษา with NCMN. That is a second kind of local change with a consequence for the entire path. Adding a boundary brings in an additional tag and changes which adjacent tags the scorer sees. An evaluation of that decision must ask both whether the resulting spans are words in the reference and whether their tags are correct.
From Thai characters to a tagged word path
The steps in order.
Keeping the tag search manageable
In principle, each word on a candidate path can be paired with each tag allowed for it. Every combination across the words then gives a different tagged route. Listing all of those routes would make the search much larger, so the implementation retains the strongest tag sequence for each candidate segmentation. It obtains that sequence with Viterbi search. This means that an alternative tagging can influence the confidence calculation even if it is ineligible to become the returned analysis for that particular word sequence.
The paper thus uses joint analysis in a specific sense. Several possible divisions survive long enough for grammatical evidence to affect the final choice. Internally, the procedure still separates candidate generation, best-tag search for each candidate and ranking across candidates. The probability equations describe what happens once a word sequence is fixed. Applying them repeatedly to different word sequences is a separate operation. This distinction explains why the same tagger can serve both decoders and the final outputs can still differ.
There is also a change in notation between stages. Early in the discussion, the object presented to the lattice constructor is a character string. In the CRF equations, the observation sequence is one candidate list of words. Two lists that cover exactly the same characters can therefore be different observations for the CRF. The tag chain for a candidate contains a tag for every word in that candidate. The assumption that words and tags have the same length applies within a candidate, even when the competing candidates have different lengths.
Giving a tag sequence a weight
The paper builds the CRF from an undirected graph. In a chain, a tag occupies each node and successive tags are connected. A clique is a group of nodes whose members are all connected to each other. A clique potential gives a weight to a local assignment of tags. The starting graph-level equation expresses the probability of a full assignment as the product of these local weights, divided by the total weight available across assignments.
p(y) = (1 / Z) ∏[Cᵢ ∈ 𝒞] ψ_Cᵢ(y_Cᵢ)
Here p(y) is the probability of the full tag assignment y. The collection 𝒞 contains the graph’s cliques, and Cᵢ is the clique indexed by i. The symbol ∈ denotes membership, y_Cᵢ is the portion of the assignment belonging to that clique, and ψ_Cᵢ is its potential function. The product sign ∏ multiplies the potentials over the cliques. The denominator Z is the partition function, which normalizes the weights.
Z = ∑_y ∏[Cᵢ ∈ 𝒞] ψ_Cᵢ(y_Cᵢ)
The sum ∑_y ranges over possible full assignments y. For each assignment, ∏ again multiplies the local potentials ψ_Cᵢ, evaluated at the tags y_Cᵢ of every clique Cᵢ in 𝒞. Adding all such products yields Z. This construction makes the probabilities sum to 1 because the same collection of weights appears in their numerators and in their shared denominator.
Each local weight can be built from features. A feature records whether, or to what numerical extent, some property of the local assignment holds. The learned weight determines how much that property contributes. The paper describes the potential as a product of exponentials of weighted feature values, equivalently the exponential of their sum.
ψ_Cᵢ(y_Cᵢ) = ∏_k exp{λₖ fₖ(y_Cᵢ)} = exp{∑[k = 1 to K] λₖ fₖ(y_Cᵢ)}
The potential ψ_Cᵢ applies to the assignment y_Cᵢ at clique Cᵢ. The index k identifies a feature, K is the total number of features, fₖ is its function and λₖ is its learned weight. The notation exp means exponentiation with the natural exponential function. The product ∏_k and sum ∑ run through the features. Writing the potential in this form lets the individual feature contributions add inside the exponent while producing a positive factor for use in the probability calculation.
For tagging, the feature functions depend on the observations. A state feature uses the current tag together with information from the observation sequence and its position. A transition feature also checks the previous tag. The chain is first-order with respect to the labels because the local tag dependence is between adjacent positions. A feature’s access to the observations is a separate matter. The paper’s general definition lets a function see the observation sequence even though the implemented state features use a basic representation of the tokenized words.
p_λ(y | x) = (1 / Z_λ(x)) exp{∑[t = 1 to T] ∑[k = 1 to K] λₖ fₖ(yₜ₋₁, yₜ, x, t)}
In this formula, x is the candidate word sequence, y is the corresponding sequence of proposed tags, and the bar in p_λ(y | x) means that the probability of y is conditional on x. The subscript λ indicates the learned collection of weights. The position t runs through the common length T of the words and tags. The symbols yₜ₋₁ and yₜ denote the previous and current tags. For feature index k, the function fₖ uses those tags, the observations x and the position t. A state feature can leave the previous tag unused. Its contribution, like that of a transition feature, is multiplied by λₖ. There are K features. The sums collect contributions across positions and features, and exp converts the total into a sequence weight. Z_λ(x) is the conditional partition function.
Z_λ(x) = ∑_y exp{∑[t = 1 to T] ∑[k = 1 to K] λₖ fₖ(yₜ₋₁, yₜ, x, t)}
The outer sum ∑_y evaluates every tag chain y for the fixed words x. The inner sums use position t up to the sequence length T and feature index k up to K. Each term multiplies the learned weight λₖ by the feature value fₖ for the adjacent tags yₜ₋₁ and yₜ, the observations x and position t. The exponential exp gives the weight of that chain. Their sum is Z_λ(x), which depends on x and the weights λ and is common to all taggings of that x. A different segmentation can yield a different denominator because its sequence of words has changed.
Learning from annotated words and tags
The training examples pair words already divided by the corpus annotation with their reference tags. This makes it possible to learn features that give weight to the correct tag chain for an observed word sequence. The paper first describes maximum likelihood. Its objective rewards weights that give high probabilities to the annotated label sequences in the training examples, conditional on their known words.
ℓ(λ; D) = log p(D | λ) = log ∏[i = 1 to N] p_λ(y⁽ⁱ⁾ | x⁽ⁱ⁾) = ∑[i = 1 to N] log p_λ(y⁽ⁱ⁾ | x⁽ⁱ⁾)
Here ℓ denotes the log-likelihood as a function of weights λ and training data D. The notation p(D | λ) denotes the likelihood of the data under those weights, using the conditional tag probabilities for its examples. The index i runs over the N training samples. The superscript (i) marks the sample, with x⁽ⁱ⁾ its observed words and y⁽ⁱ⁾ its annotated tags. The bar indicates the conditioning observations or weights. The product ∏ multiplies sample probabilities, while log is the logarithm that turns that product into the sum ∑ of their logarithms.
The authors use a penalized objective to limit overfitting. The underlying idea is to balance the fit to the training tags with a preference for weights that stay modest in magnitude. The paper expresses this as maximum a posteriori estimation, meaning that the weights are chosen by their posterior value after combining evidence from the examples with a prior. The prior is spherical Gaussian. Its penalty depends on the squared size of the weights, with the same scale across features.
log p(λ | D) = log p(D | λ) + log p(λ)
On the left, log p(λ | D) is the log posterior for the weights λ given the training data D, in the objective’s notation. The term log p(D | λ) is the log-likelihood contribution and log p(λ) is the log prior contribution. The + sign combines the terms. The expression omits an additive normalization constant that is fixed with respect to the weights and therefore has no effect on the optimum.
log p(λ | D) = ∑[i = 1 to N] log p_λ(y⁽ⁱ⁾ | x⁽ⁱ⁾) − ∑[k = 1 to K] λₖ² / (2σ²)
The first sum gives the log conditional probability of the reference tags y⁽ⁱ⁾ for the reference words x⁽ⁱ⁾, over the N examples indexed by i in D. The symbol p_λ specifies the probabilities under the current weights λ. The second sum goes over the K feature weights indexed by k. The superscript ² squares the individual weight λₖ and the prior’s scale σ. The denominator 2σ² sets the strength of the Gaussian penalty. The minus sign makes larger squared weights cost more in the maximization. As in the preceding equation, log denotes the logarithm, and the posterior objective is written up to a constant.
The same score can be written with a vector of global feature values. A component of this vector accumulates the value of one feature over the length of the sequence. This gives a compact expression for a calculation that still depends on every position.
exp{∑[t = 1 to T] ∑[k = 1 to K] λₖ fₖ(yₜ₋₁, yₜ, x, t)} = exp{λ · F(y, x)}
The left-hand side uses the tag chain y, with adjacent tags yₜ₋₁ and yₜ, and the word observations x. Position t runs up to their length T. Feature fₖ has index k among K features and learned weight λₖ. The sum signs accumulate the weighted feature values. On the right, F(y, x) is the vector of sequence-wide feature values and λ is the vector of corresponding weights. The dot · takes their dot product, and exp is the exponential on both sides.
log p(λ | D) = ∑[i = 1 to N] [λ · F(y⁽ⁱ⁾, x⁽ⁱ⁾) − log Z_λ(x⁽ⁱ⁾)] − ‖λ‖² / (2σ²)
The left-hand side denotes the penalized posterior objective for weights λ and data D. In the sum over N training examples, i selects the reference tags y⁽ⁱ⁾ and words x⁽ⁱ⁾. Their feature vector is F(y⁽ⁱ⁾, x⁽ⁱ⁾). The dot · combines that vector with λ. The first subtraction removes the logarithm of the conditional partition function Z_λ for that example’s words. The paper abbreviates the observation argument in this form of the objective. The notation ‖λ‖² gives the sum of squared weights, σ is the prior’s scale and 2σ² is the penalty’s denominator. The final subtraction applies the penalty to the complete training objective.
The implementation uses L-BFGS, a limited-memory numerical optimization method, to maximize the objective. The training calculation evaluates the objective and its gradient, which describes how changes in the weights affect the objective. Since the sample contributions can be evaluated independently for a given weight setting, the authors distribute training examples among processors. Their implementation is in C and uses MPI for communication. At the end of an iteration the contributions are summed and the totals distributed to the processors. The paper describes how the training calculation is parallelized.
Finding the best tags for one segmentation
Once the weights have been learned, each segmentation presents a particular list of words to the tagger. Viterbi search finds the highest-scoring tag chain for that list. A direct search could evaluate every full chain. The first-order structure lets Viterbi retain the best prefix that reaches each possible tag at each position. Prefixes that end at the same tag have the same options for continuing from there, so the lower-scoring prefixes can be dropped for the purpose of finding the best complete chain.
y* = arg max_y p_λ(y | x)
The symbol y* denotes a highest-probability tag chain. The operator arg max_y returns the chain y at which the conditional probability p_λ(y | x) is greatest for the fixed words x and learned weights λ. The bar indicates conditioning on x. All of these chains share the same denominator, so within this search the ranking can use the weights that appear before normalization.
δₜ₊₁(yᵢ) = max_y′ [δₜ(y′) exp{∑_k λₖ fₖ(y′, yᵢ, x, t)}]
The value δₜ(y′) records the best partial weight at position t among paths ending in the predecessor tag y′. The recurrence computes δₜ₊₁(yᵢ), the best weight reaching candidate tag yᵢ at the next step. Here i indexes possible tags, and t + 1 indicates the position after t in the paper’s recurrence. The maximum max_y′ considers each possible predecessor. The sum ∑_k combines the contributions of features indexed by k, each weighted by λₖ. The function fₖ evaluates the predecessor y′, destination yᵢ, observations x and recurrence position t. The exponential exp gives the weight of this local extension. Multiplying by the best preceding weight gives a candidate for the new entry.
p* = arg max_i δ_T(yᵢ)
The paper uses p* here for the outcome of choosing the final tag. The operator arg max_i identifies the index i of the tag yᵢ with the greatest terminal weight δ_T(yᵢ) at the last position T. The winning entry’s value is the score, and the chosen final tag is the starting point for tracing the stored predecessors back through the chain. That backtrace recovers y*. For the CRF-Viterbi decoder, the paper takes the winning terminal score for each word sequence and chooses the complete word-and-tag path with the highest such score.
The expression for the best tag chain optimizes a conditional probability for fixed words, while the displayed Viterbi recurrence propagates weights without inserting the partition function. Those two descriptions agree about which tag chain should win on a given segmentation. At the stage of comparing segmentations, normalization can change the ordering. A high terminal weight can arise for a tag chain whose rivals on the same words also have high weight. The confidence calculation brings those rivals into the comparison.
Measuring confidence in the chosen tags
Confidence estimation assigns a fraction to the proposed tagged path. The denominator is the total weight of tag sequences over that candidate’s words. The numerator is the weight of the sequences that satisfy the candidate’s tag constraints. In this study, each segmented token on the path has a specified tag, so the constraints apply to the whole path. The figure illustrates such a restriction with a highlighted route through the lattice.
CE = Z′_λ(x) / Z_λ(x)
Here CE is the confidence estimate. The observations x are the words on the candidate path, and λ denotes the learned weights. The denominator Z_λ(x) is the unrestricted partition function for those words. The prime ′ in Z′_λ(x) marks the constrained partition function for the same observations and weights. The division measures how much of the total tag weight is compatible with the constraints. Each candidate word sequence has its own calculation. In particular, the total in the denominator ranges over its taggings, while the choice among different word sequences occurs after confidence has been calculated.
The unrestricted sum can be obtained with a forward calculation. It traverses the same chain used for Viterbi. At a given tag and position, it adds the contributions arriving from all predecessor tags. Partial tag chains that reach the same tag can be combined into a single total, because their remaining possible extensions are shared.
αₜ₊₁(yᵢ) = ∑_y′ [αₜ(y′) exp{∑_k λₖ fₖ(y′, yᵢ, x, t)}]
The forward value αₜ(y′) is the accumulated weight of paths ending in predecessor tag y′ at position t. The next entry αₜ₊₁(yᵢ) collects weight arriving at tag yᵢ, indexed by i, at the next step. The outer sum ∑_y′ adds the contributions from all predecessor tags. The inner sum ∑_k weights feature functions fₖ by their parameters λₖ. These functions see the tag pair y′ and yᵢ, the observations x and the position t. The exponential exp gives the local extension weight, and the product inside the square brackets applies it to the weight already accumulated at the predecessor.
Z_λ(x) = ∑_i α_T(yᵢ)
The sum ∑_i ranges over the possible final tags yᵢ. The value α_T(yᵢ) collects the weight of all chains that end in that tag at the last position T. Together they supply Z_λ(x), the unrestricted total for word sequence x with weights λ. This is the same total defined by enumerating tag chains in the conditional probability formula.
The constrained forward calculation uses the same addition but admits only compatible tags along the prescribed stretch. At a constrained position, a candidate destination tag that differs from the prescribed tag receives zero weight. Any path that arrives there through a disagreement therefore makes no contribution to the final constrained total.
α′ₜ₊₁(yᵢ) = { ∑_y′ [α′ₜ(y′) exp{∑_k λₖ fₖ(y′, yᵢ, x, t)}] if yᵢ = yₜ₊₁
{ 0 otherwise
The prime ′ marks the constrained forward values α′ₜ(y′) and α′ₜ₊₁(yᵢ). The index t indicates the current step, and t + 1 indicates the following one. The tag yₜ₊₁ is the one required at that following position, and yᵢ is the candidate destination indexed by i. If they agree, the sum ∑_y′ adds over predecessor tags y′. As before, exp converts the sum over k of weights λₖ times feature values fₖ into the local extension weight. The feature arguments give the predecessor, destination, word sequence x and position t. Otherwise 0 removes the contribution at the incompatible tag. Because the experiment constrains the entire path, the test against the specified tag applies throughout the candidate.
Z′_λ(x) = ∑_i α′_T(yᵢ)
The sum ∑_i adds the constrained forward values α′_T for final tags yᵢ at the last position T. The result Z′_λ(x) is the constrained total for the observations x with weights λ. The prime distinguishes both quantities from their unrestricted versions. The decoder ranks the word-and-tag candidates by the resulting confidence values and returns the words and tags of the winning path.
With every tag specified, the confidence value has a straightforward interpretation. It is the conditional probability assigned to the chosen tag chain given that candidate’s words. A sequence with substantial raw weight can score poorly on this measure when the same words also support several other strong taggings. Conversely, a candidate can do well when the chosen tagging accounts for much of the available weight on its own words. The framework uses this concentration of tag evidence as a criterion for comparing candidate segmentations.
Experiments and results
What the test asks the system to recover
The authors use ORCHID, a Thai corpus with word boundaries and part-of-speech labels. The corpus was constructed at the Linguistics and Knowledge Science Laboratory under Thailand’s National Electronics and Computer Technology Center. The portion described in the experiments has 23,125 sentences and 46 tags. The authors randomly assign 80% of the corpus to training and 20% to testing, giving 18,500 training sentences and 4,625 test sentences. The corpus statistics list 274,469 training tokens and 68,168 test tokens. The corresponding counts reported for ambiguous tokens are 205,271 in training and 45,559 in testing.
The authors keep the reference words and tags for scoring, but make the input by stripping off the test tags and concatenating the words within each sentence. The system sees the character sequence for a whole sentence. A successful output reconstructs its token spans and adds the corpus’s tag to each span. This procedure gives a clear reference against which to count correct tokens, and it fixes the sentence divisions at evaluation time. Its ambiguity comes from the words inside those divisions.
The experimental CRF uses state features based on words from the tokenized training material and transition features reflecting the first-order tag chain. The authors add unknown-word features for words that occur less than 4 times in the training material. The statistics list 19,708 state and transition features together. The candidate generator uses a separate lexical resource, LEXiTRON, with 32,363 words in the paper’s count. The threshold for a state feature and the contents of the word list serve distinct purposes. A word can be proposed as a span through the dictionary search, while the tagger’s treatment of that span depends on the evidence available from its own training.
The learned weights come from the annotated training sequences. The experiments then use these weights in the tag search and compare alternative rules for ranking the results. This is a relatively simple feature setup for the question the paper asks. It permits the experiment to examine what happens when the scoring criterion changes while the general lattice-and-tagging framework stays in place. The authors describe running the parallel trainer on a Linux cluster of 10 nodes, each with an Intel Xeon at 3 GHz and 4 Gbytes of RAM.
What the baselines and metrics count
Longest matching, abbreviated LM, is one baseline. It chooses its successive word divisions by using the longest available match. Maximum matching, or MM, is the other segmentation baseline. It considers candidate divisions under the matching criteria described in the related work. These comparisons help distinguish a gain over a locally chosen dictionary segmentation from a gain over a dictionary procedure that already considers alternative divisions.
For the tagging evaluation, both matching baselines use the unigram baseline, abbreviated UB. UB assigns a word its most likely tag as estimated from the training data. Under this rule the decision for a token uses its word identity. A chain-based transition score can instead incorporate which tags are adjacent in the candidate. The tagging results label the baselines LM-UB and MM-UB to show that their segmentation procedures are followed by the same kind of word-level tag assignment. CRF-Viterbi and CRF-CE combine recovery of the segmentation with the search over grammatical tags.
Both evaluations report precision, recall and F₁. The definition of a correct token depends on which evaluation is being scored. For segmentation, the system must recover a reference token in the same sentence, with the correct boundaries. For the tagging result, it must recover that token and also assign its annotated tag. An incorrect split may therefore produce several predictions with no matching reference spans even if their grammatical categories would make sense for the pieces in isolation.
Precision = number of correct tokens / number of recovered tokens
The numerator counts tokens that satisfy the correctness rule for the evaluation in question. The denominator counts every token returned by the algorithm, and / divides the former count by the latter. Precision asks how often a predicted token can be accepted under the reference. The paper reports it as a percentage.
Recall = number of correct tokens / number of tokens in the test set
The same kind of correct token supplies the numerator. The denominator now counts the reference tokens in the test set. Division by that total gives the share of annotated tokens recovered, again reported as a percentage. Precision and recall can move in different directions because they describe success against different totals.
F₁ = (2 · Precision · Recall) / (Precision + Recall)
Here F₁ is the combined measure of precision and recall. The numerator multiplies Precision and Recall, using ·, and scales their product by 2. The denominator uses + to add the two metrics, and / divides by that sum. The score reflects their balance. A system can recover many annotated tokens and still fare poorly on F₁ if its output also contains enough wrong predictions to depress precision.
Word segmentation
Word segmentation F₁ on the ORCHID test split
Confidence-based path selection leads the comparison, while Viterbi-based selection trails both matching baselines.
The numbers
| System or setting | F₁ % |
|---|---|
| Longest matching | 82.389 |
| Maximum matching | 82.846 |
| CRF-Viterbi | 79.157 |
| CRF-CE (this paper) | 83.568 |
For ORCHID segmentation, longest matching records 82.717% precision and 82.059% recall. Maximum matching records 83.305% precision and 82.392% recall. Maximum matching is ahead of longest matching on all the reported segmentation measures. The two baselines also give a useful point of reference for the CRF results. Both operate on the boundary problem directly, and their precision and recall sit relatively close to one another.
CRF-Viterbi records 74.727% precision and 84.147% recall on the ORCHID segmentation test. Its recall is the highest in the comparison and its precision is the lowest. Its F₁ is 79.157%, below either matching baseline. This outcome is possible because recall rewards finding reference tokens wherever the system manages to preserve them. Predictions that fail to match the reference reduce precision, even when many other reference spans do appear in the output. Recovering a large share of reference spans therefore leaves open how reliable the predicted spans are overall.
CRF-CE produces 83.991% precision and 83.149% recall on the same segmentation test. Its precision leads the comparison and its recall lies below CRF-Viterbi’s but above both matching baselines. Its resulting F₁ is 83.568%. The highest F₁ is thus associated with a decoder that gives up some recall relative to the Viterbi-based ranking and returns a more reliable set of predicted spans. The paper treats that tradeoff as important because a useful segmentation must preserve reference words while avoiding extra or misplaced boundaries.
Word boundaries and grammatical tags together
Joint word-and-tag F₁ on the ORCHID test split
Confidence-based path selection achieves the highest F₁ when both the word span and its tag must match.
The numbers
| System or setting | F₁ % |
|---|---|
| Longest matching with unigram tags | 75.413 |
| Maximum matching with unigram tags | 75.851 |
| CRF-Viterbi | 75.162 |
| CRF-CE (this paper) | 79.342 |
With both the span and its label required to match, LM-UB reaches 75.715% precision and 75.113% recall on the ORCHID test split. MM-UB reaches 76.272% precision and 75.436% recall. The stronger of the matching baselines remains maximum matching after the unigram tagger is attached. These scores describe the complete pipeline for each baseline. A reference word that the segmenter fails to recover cannot earn credit through the unigram assignment.
CRF-Viterbi reaches 70.955% precision and 79.900% recall on the joint test. As in segmentation alone, the result combines the highest recall with the lowest precision in its comparison. Its 75.162% F₁ is below both matching baselines. The result shows that a decoder can recover more reference tokens with their correct tags while still giving the weakest combined score among the tested systems. The extra success in recall comes alongside a comparatively large share of incorrect predicted word-and-tag pairs.
CRF-CE reaches 79.744% precision and 78.945% recall when the test requires correct boundaries and tags. Its 79.342% F₁ is the highest for that task. The joint table gives evidence about the quality of the complete output, from boundary choices through grammatical labeling. The segmentation table reports boundary recovery separately. Comparing the two tables shows how systems fare when the tagging requirement is added, while the experiment leaves open their tag accuracy when every system is given the reference word divisions.
What the ablations show
The paper reports no feature ablation, and its main diagnostic comparisons are the change in path-ranking criterion and the authors’ inspection of the segmentations selected by Viterbi scoring.
What changes when the final score changes
The closest thing to a controlled intervention is the comparison between CRF-Viterbi and CRF-CE. Both work from candidate word sequences, and both use Viterbi to identify the strongest tagging within each candidate. The intervention comes after that operation. The Viterbi-based decoder compares terminal scores across candidates. The confidence decoder evaluates those chosen taggings against the total weight available on their respective word sequences. Their different performance can therefore be associated with the rule that selects the winning word-and-tag path within the tested framework.
The direction of the change is consistent across the two tasks. CRF-CE ranks ahead on precision and F₁ for segmentation alone and for the stricter word-and-tag evaluation. CRF-Viterbi ranks ahead on recall in both. This is informative because the tag chain produced for a given list of words is already the chain Viterbi prefers. Confidence can improve the final analysis by preferring a different list of words, with its own best tagging. The improvement takes place at the point where the system chooses between observations generated from the same characters.
The mathematical comparison also clarifies why the confidence criterion can reorder the paths. On fixed words, all tag sequences share a denominator, so it has no effect on which chain maximizes the conditional probability. Across different proposed words, the denominator varies. A candidate whose strongest tag sequence has a large terminal weight may have considerable weight assigned to its other tag sequences as well. Confidence asks what fraction of the total the strongest chain accounts for. The results support that fraction as a useful ranking criterion on this test split. The experiment does not individually vary the word sequences’ lengths, their lexical content or the uncertainty of the tag alternatives.
The authors’ inspection of oversegmentation
The authors examine the segmentation output after seeing CRF-Viterbi’s low precision. They observe that the decoder frequently favors paths with more tokens. The phrase in the example gives a concrete way to understand what that means. A path that preserves ปัญญาประดิษฐ์ as a unit can compete with one that splits it into ปัญญา and ประดิษฐ์. A candidate may similarly preserve much of the rest of the input while dividing another stretch into smaller pieces. When those pieces fail to coincide with reference tokens, the predictions for them count against precision. Correct spans elsewhere in the same sentence still contribute to recall.
The authors connect this tendency with the relatively high recall and low precision of CRF-Viterbi. The aggregate scores and the inspected behavior are consistent with a system that retrieves many annotated tokens but predicts numerous extra or differently divided ones. The scores by themselves do not measure path length or count how frequently a boundary was added. The evidence for a preference for paths with more pieces comes from the authors’ inspection. That distinction matters because precision and recall compress several types of boundary error into counts under the same correctness rule.
The paper suggests that ambiguity in the observed word sequence may account for the trouble with comparing terminal scores. Its discussion also says that confidence-based choices appear independent of the number of segmented pieces. That is a qualitative observation about the preliminary tests. The confidence formula still depends on a word sequence, and the tag sequences in its numerator and denominator depend on the number of words. The observation is best read as a description of how the decoder behaved on the material the authors examined. The paper leaves the relation between confidence and path length as an empirical question for more detailed testing.
What the matching controls add
The dictionary baselines locate the contribution more precisely. Maximum matching already considers alternatives and uses lexical coverage and token count to select a result. It improves on longest matching on the segmentation test. When both matching systems receive the unigram tagger, the maximum-matching version also does better on the joint test. This makes maximum matching a particularly useful comparison for a framework that also starts from a dictionary. The stronger matching baseline already gains something from considering more than the immediate longest prefix.
CRF-Viterbi’s low F₁ shows that adding a learned chain scorer to candidate-based segmentation can yield poorer final decisions with the particular cross-candidate ranking used here. CRF-CE’s lead shows that the architecture can also make boundary decisions that improve the balance of precision and recall over the matching rules. The comparison between the CRF variants isolates the change in decoding criterion more closely than either comparison with a baseline. Against LM or MM, candidate generation, tag features and the final scoring rule differ together, so the paper’s system comparisons leave their individual contributions unresolved.
The stricter joint evaluation further shows that the confidence decoder’s gains survive the requirement to get the tag right. This matters because a better choice of words could still leave a poor grammatical analysis. The observed gains apply to complete word-and-tag recovery. Their division between better boundaries and better labels for boundaries that both decoders recover remains open. Answering that would require comparing tag decisions on common spans or running the taggers with reference segmentation fixed. The paper’s two tasks establish the quality of different aspects of the returned analysis without that finer attribution.
Limitations
Limits the authors identify
The paper presents the experiments as preliminary. The authors emphasize that they trained with basic features, even though a CRF can incorporate overlapping signals from the observed text. Their state representation uses tokenized words and the treatment for infrequent words. Their transition representation uses the first-order assumption on tags. The conclusion proposes exploring feature induction, which would let the training process discover useful feature combinations or patterns. The paper leaves the effect of richer evidence unmeasured in this Thai framework.
Unknown words are a separate issue in the conclusion. The matching and backtracking procedure can produce spans with unknown tokens, and training uses features for infrequent words. These mechanisms allow the system to process candidates whose words lack strong lexical evidence. The authors still identify explicit treatment of unknown words as future work. In particular, they refer to the cited Chinese work’s use of confidence estimation for detecting unknown words, while the confidence calculation tested here ranks entire tagged paths. The Thai results contain no separate evaluation of unknown-word detection or recovery.
The authors also qualify their interpretation of the Viterbi outcome. They suggest that word ambiguity may be responsible for incorrect choices under the global terminal score and report that paths with more pieces often win. They describe the alternative as promising on ORCHID. These are limited claims about the reported experiments. The inspection does not give a frequency of oversegmentation by sentence type or a measured relationship between score and the number of segments. It supplies a plausible account of a result the main tables make visible through precision and recall.
What the setup leaves open
The test is a random split of one annotated corpus. The published numbers describe the ability to reverse a specific conversion of ORCHID sentences into character strings. They measure agreement with the annotated word spans and tags, given sentence boundaries. Application to text with other lexical coverage, other annotation choices or missing sentence divisions would introduce conditions outside this experiment. The paper reports a single split, so uncertainty over alternative splits and variation across different collections cannot be read from the scores.
The candidate generator controls which segmentations are available to the decoders. If it fails to propose a reference path, even a ranking rule that always picks the best available path cannot recover that missing analysis. The paper describes longest matching, backtracking and the treatment of unmatched characters, but gives no separate count of how often the reference segmentation is present among its candidates. The overall segmentation scores combine candidate coverage with the ability to choose correctly from the available paths. A reader can identify those as distinct sources of error without being able to assign the observed errors to either one from the tables.
For each segmentation, the implementation retains its strongest tagging. This restriction keeps the search tractable and has a clear relationship to the confidence calculation. For the fixed word path, complete tag sequences have the same denominator, so the strongest tag weight also has the strongest confidence among complete taggings of those words. The main restriction for word-boundary recovery is therefore the set of proposed word sequences. For a different objective that took account of partial tag matches or used a different constraint, the relationship between the best complete tag path and the most useful output would need its own analysis. The evaluation here concerns the outputs of the specific decoders implemented.
A further limit follows from the meaning of the confidence value. The ratio measures support for a tagging conditional on a candidate’s words. Its denominator does not include the probability mass of other segmentations of the character string. It supplies a way to rank the proposed readings, with empirical support from the test scores. It does not establish that the winning reading has a calibrated probability of being the correct segmentation. The study also gives no calibration analysis comparing stated confidence with observed correctness. The normalized tag probability and its practical value for ranking word paths are separate questions.
The results give no direct measure of how frequently the tagger gets the category right when it is handed the correct words. The strict scoring rule is appropriate for a system that must recover both kinds of information from characters, because it denies credit when a category is assigned to the wrong span. Its consequence is that the joint score incorporates boundary errors as well as tag errors. The paper’s segmentation-only results help describe the boundary side. A separate breakdown by reference span, tag or ambiguous token would be needed to trace particular grammatical gains, and the aggregate results leave those details open.
The implementation discussion shows how examples are distributed and their training contributions combined. It does not include elapsed training times, comparisons of search speed, or a reported relation between throughput and the number of processors. Similarly, the lattice description explains how backtracking and dynamic programming avoid listing redundant possibilities without quantifying the size of the candidate space on the test set. This leaves computational efficiency as an architectural motivation supported by the design of the procedures. The empirical comparisons establish differences in the outputs under the reported scoring rules.
What came after
The paper’s conclusion identifies feature induction and unknown-word detection as directions for extending the framework. Feature induction would address the limited evidence used to score a candidate’s words and tags. Unknown-word detection would address a different point in the pipeline, where useful pieces of text may be poorly represented in the lexicon or training examples. The paper’s reference to confidence-based new-word detection concerns earlier Chinese research. Its Thai experiment applies confidence to the complete analysis of a candidate sentence.
There is no documented follow-up study to attribute to this framework here. The two proposed directions therefore describe the authors’ research agenda at the end of the paper. The reported contribution remains the preliminary ORCHID comparison, in which the choice of score across alternative word sequences changes the precision and recall of both Thai word segmentation and grammatical tagging.
Cite
Cite as Canasai Kruengkrai, Virach Sornlertlamvanich and Hitoshi Isahara. 2006. A Conditional Random Field Framework for Thai Morphological Analysis. Proceedings of the Fifth International Conference on Language Resources and Evaluation (LREC'06).
@inproceedings{kruengkrai2006conditional,
title = {{A Conditional Random Field Framework for Thai Morphological Analysis}},
author = {Canasai Kruengkrai, Virach Sornlertlamvanich and Hitoshi Isahara},
booktitle = {Proceedings of the Fifth International Conference on Language Resources and Evaluation (LREC'06)},
year = {2006},
url = {https://aclanthology.org/L06-1069/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/kruengkrai-2006-conditional-random-field-framework-thai/