Morphological analysis and finite-state transducers
Morphological analysis breaks words into morphemes and features; finite-state transducers (FSTs) implement analyzers/generators by composing a lexicon FST with rule FSTs using regular relations and composition.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Morphological analysis is how an engineer converts word forms (like "dogs" or "running") into structured representations (lemma + grammatical features) used in downstream NLP (POS tagging, parsing, machine translation, IR). Finite-state transducers are the practical, efficient machine structures used in many morphological analyzers and stemmers because they are fast, compact and can be composed with spelling/phonology rules.
Key ideas
- Inflection: change in word form to express grammatical features (tense, number, case). Derivation: formation of a new word with changed meaning or POS (happy → happiness).
- Morphotactics: rules that control the order and co-occurrence of morphemes for a language (which affixes may follow a stem and in what order).
- Morphophonology: phonological changes triggered by morphology (e.g., consonant mutation, vowel alternation,
knife→knives).
Finite-state machines
- Finite-state automaton (FSA): a machine that accepts a regular language. Defined formally below.
- Finite-state transducer (FST): a finite automaton extended with output symbols on transitions. It defines a relation between input strings and output strings; used to map surface forms to analyses (and back).
Formal definition of an FST (boolean/unweighted):
- An FST is a 6-tuple (Q, Σ, Γ, q0, F, δ) where
- Q is a finite set of states.
- Σ is the input alphabet (e.g., lexical symbols for generation or surface symbols for analysis).
- Γ is the output alphabet (e.g., surface symbols for generation or lexical/analysis symbols for analysis).
- q0 ∈ Q is the start state.
- F ⊆ Q is the set of final states.
- δ ⊆ Q × (Σ ∪ {ε}) × (Γ ∪ {ε}) × Q is the transition relation. A transition is written q --a:b--> r meaning on input symbol a (or ε) the machine outputs b (or ε) and moves to r.
Meaning: the machine accepts a pair (x, y) if there exists a path from q0 to some final state that reads x (concatenation of input labels, ignoring ε) and produces y (concatenation of output labels).
Key properties and theorems (short, exact statements):
- Regular relations: The set of input-output pairs defined by an FST is called a regular relation.
- Closure under composition: If R1 and R2 are regular relations realized by FSTs T1 and T2, then the composition R1 ∘ R2 = {(x,z) | ∃y such that (x,y)∈R1 and (y,z)∈R2} is also a regular relation and can be realized by constructing an FST T = T1 ∘ T2. (Assumption: the intermediate alphabet is the output alphabet of T1 and the input alphabet of T2.)
- Determinisation and minimisation: Determinisation and minimisation algorithms exist for FSAs. For transducers, determinisation/minimisation require extra conditions (e.g., being subsequential/having the twins property); mere functionality is not sufficient and not all FSTs determinise. (State this exact caveat in exam answers.)
Two-level morphology (Koskenniemi)
- Two-level morphology: a framework where morphological analysis is modelled as parallel constraints between a lexical level and a surface level. Each lexical symbol is linked to a surface symbol; rules are constraints of the form
lexical:surface <=> left_context _ right_context. - Implementation: Two-level rules can be compiled to FSTs. The analyzer is built by composing the lexicon FST with the rule FSTs.
How to build an analyzer (high level, step-by-step university-style):
- Create a lexicon FST that maps stems+morpheme-sequences (lexical) to surface strings where most transitions are identity (input=output) except where morphological alternation is specified.
- Create rewrite/rule FSTs for morphophonological rules (e.g., vowel change, insertion, deletion), usually implemented as mappings from lexical symbols to surface symbols with contexts.
- Compose: Analyser = Lexicon ∘ Rules_compiled. Composition applies rules to lexical forms to yield allowed surface forms. For analysis (surface→lexical), invert direction or build transducer that maps surface to lexical.
Diagram to draw for an exam: Draw three boxes left-to-right labeled Lexicon FST, Rule FST, Result FST. Inside each box draw a small automaton: a start state arrow to states labelled with characters; show one path for stem characters with input=output transitions (label a:a) and one outgoing transition that passes a morphological marker (+PL:+PL) to be realized by the rule transducer. Show composition arrows between boxes with the formal composition equation beneath.
Assumptions often required in proofs/exams:
- Alphabets are finite.
- Rules are regular (can be expressed by FST) when compiling to FSTs.
- For composition closure proof, assume intermediate alphabet matches.
Formulas
FST = (Q, Σ, Γ, q0, F, δ) — definition of a finite-state transducer; Q: states (no unit), Σ: input alphabet, Γ: output alphabet, q0: start state, F: final states, δ: transition relation.
δ ⊆ Q × (Σ ∪ {ε}) × (Γ ∪ {ε}) × Q — each transition consumes an input symbol or ε and produces an output symbol or ε.
(T1 ∘ T2)(x, z) = ∃y [T1(x, y) ∧ T2(y, z)] — composition of relations (boolean case). x, y, z are strings over corresponding alphabets.
(Weighted case) w_{T1∘T2}(x,z) = ⊕_{y} (w_{T1}(x,y) ⊗ w_{T2}(y,z)) — composition uses semiring sum/product; ⊕ and ⊗ are semiring operations (depends on weight semiring).
size(FST) often measured in number of states/transitions (no units).
Syntax to remember (typical tools):
- xfst/foma style: rewrite rules look like
A -> B || L _ R ;and lexica are defined with LEXICON blocks; these examples are schematic only — verify exact tool syntax when coding.
Worked examples
- Model answer: Build a simple FST that maps English regular plural surface forms to analysis (lemma+NUMBER=PL).
- Question: Show an analyzer that maps
dogs→dog+NOUN+PLandfoxes→fox+NOUN+PL. - Steps (constructive):
- Lexicon FST: for each lemma (dog, fox) add a path: start --d:d--> --o:o--> --g:g--> final_lemma where at final_lemma add a transition that consumes the tag
+NOUNon the input and deletes it on the output (write+NOUN:ε) and go to a state where the plural suffix is generated. - Plural suffix rules: two options: if lemma ends with
s/x/ch/shthen surface addses, else adds. Implement this as rule FST that takes morphological marker+PLon lexicon side and producessoreson surface side conditioned on preceding character. - Compose Lexicon ∘ PluralRule to obtain mapping from lexical forms to surface forms. For analysis (surface→lexical), invert the composed transducer.
- Lexicon FST: for each lemma (dog, fox) add a path: start --d:d--> --o:o--> --g:g--> final_lemma where at final_lemma add a transition that consumes the tag
- Diagram to draw: show automaton for
dogwith transitions labelledd:d,o:o,g:g, then+NOUN:ε, then+PL:+PLtransitions. Then show rule FST that maps+PLtosoresdepending on preceding symbol. Then show composition result generatingdogsandfoxes. - Key remark: irregulars like
mouse→micerequire explicit entries in the lexicon mapping lexicalmouse+PLto surfacemice(no rule).
- Model answer: Explain one two-level rule and show how it compiles.
- Example rule:
f:v <=> _ e(simplified: lexicalfmaps to surfacevbefore ane, as in knife → knives where 'fe' becomes 'ves'). Two-level rule writtenf:v <=> _ emeans when lexical symbolfappears immediately before a surfacee, it can appear asvon the surface side; outside that context, allowf:fmapping. Compilation: create an FST that permits pairs where input symbolvpairs with lexicalfin that context; outside that context, allowf:fmapping. Compose with lexicon. - Final model answer must state that most two-level rules are local and compile to small FSTs; give the composition step.
- Short proof/model derivation: Show that composition yields regular relation. Outline: construct product-state automaton whose states are (q1,q2) and whose transitions match outputs of T1 to inputs of T2; this finite product construction yields an FST for composition. (Exam expects product construction description and why finite.)
Common mistakes
- Assuming any FST can be determinised/minimised: determinisation for transducers requires conditions (functional/subsequential); many students incorrectly apply FSA minimisation directly to arbitrary FSTs.
- Mixing up direction: analyzer (surface→lexical) vs generator (lexical→surface). The same FST may be invertible, but inversion is a separate operation.
- Forgetting to include ε-transitions explicitly when showing transitions that insert or delete symbols.
For your exam
Kinds of questions:
- Definitions: morpheme, lemma, FST, two-level rule. Full marks require concise definitions and a short example.
- Short notes: explain morphotactics, morphophonology, two-level morphology — include examples and implementation idea with FSTs.
- Derivations/proofs: show closure under composition by product construction — include state-pair construction and reason why finite.
- Programs/diagrams: draw an FST for a small lexicon; show composition boxes. If asked to write tool commands, name typical tools (xfst, foma, OpenFst/Pynini) and show example syntax (but verify exact tool syntax).
- Practical question: given a lexicon and rule, show step-by-step how analyzer maps a surface form to lemma+features — show path and outputs.
What full-marks answers include: formal definitions, an explicit small FST or diagram, clear composition explanation, treatment of irregulars, and notes on determinisation/minimisation caveats. Also note that analyzers are typically ambiguous (one surface form may map to multiple analyses) and practical systems handle disambiguation separately or with weights.
Quick check
- What is a morpheme?
- Write the formal tuple for an FST.
- State the composition rule for two relations represented by FSTs.
Answers: A morpheme is the smallest meaningful unit of language;
FST = (Q, Σ, Γ, q0, F, δ)withδ ⊆ Q × (Σ ∪ {ε}) × (Γ ∪ {ε}) × Q;(T1 ∘ T2)(x,z) = ∃y [T1(x,y) ∧ T2(y,z)].
Note: verify tool-specific syntax when coding and check language-specific irregular patterns if you use them in examples.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?