Finite-state transducer explained

A finite-state transducer (FST) is a finite-state machine with two memory tapes, following the terminology for Turing machines: an input tape and an output tape. This contrasts with an ordinary finite-state automaton, which has a single tape. An FST is a type of finite-state automaton (FSA) that maps between two sets of symbols.[1] An FST is more general than an FSA. An FSA defines a formal language by defining a set of accepted strings, while an FST defines a relation between sets of strings.

An FST will read a set of strings on the input tape and generates a set of relations on the output tape. An FST can be thought of as a translator or relater between strings in a set.

In morphological parsing, an example would be inputting a string of letters into the FST, the FST would then output a string of morphemes.

Overview

An automaton can be said to recognize a string if we view the content of its tape as input. In other words, the automaton computes a function that maps strings into the set . Alternatively, we can say that an automaton generates strings, which means viewing its tape as an output tape. On this view, the automaton generates a formal language, which is a set of strings. The two views of automata are equivalent: the function that the automaton computes is precisely the indicator function of the set of strings it generates. The class of languages generated by finite automata is known as the class of regular languages.

The two tapes of a transducer are typically viewed as an input tape and an output tape. On this view, a transducer is said to transduce (i.e., translate) the contents of its input tape to its output tape, by accepting a string on its input tape and generating another string on its output tape. It may do so nondeterministically and it may produce more than one output for each input string. A transducer may also produce no output for a given input string, in which case it is said to reject the input. In general, a transducer computes a relation between two formal languages.

Each string-to-string finite-state transducer relates the input alphabet Σ to the output alphabet Γ. Relations R on Σ*×Γ* that can be implemented as finite-state transducers are called rational relations. Rational relations that are partial functions, i.e. that relate every input string from Σ* to at most one Γ*, are called rational functions.

Finite-state transducers are often used for phonological and morphological analysis in natural language processing research and applications. Pioneers in this field include Ronald Kaplan, Lauri Karttunen, Martin Kay and Kimmo Koskenniemi.A common way of using transducers is in a so-called "cascade", where transducers for various operations are combined into a single transducer by repeated application of the composition operator (defined below).

Formal construction

Formally, a finite transducer T is a 6-tuple such that:

\delta\subseteqQ x (\Sigma\cup\{\epsilon\}) x (\Gamma\cup\{\epsilon\}) x Q

(where ε is the empty string) is the transition relation.

We can view (Q, δ) as a labeled directed graph, known as the transition graph of T: the set of vertices is Q, and

(q,a,b,r)\in\delta

means that there is a labeled edge going from vertex q to vertex r. We also say that a is the input label and b the output label of that edge.

NOTE: This definition of finite transducer is also called letter transducer (Roche and Schabes 1997); alternative definitions are possible, but can all be converted into transducers following this one.

Define the extended transition relation

\delta*

as the smallest set such that:

\delta\subseteq\delta*

;

(q,\epsilon,\epsilon,q)\in\delta*

for all

q\inQ

; and

(q,x,y,r)\in\delta*

and

(r,a,b,s)\in\delta

then

(q,xa,yb,s)\in\delta*

.

The extended transition relation is essentially the reflexive transitive closure of the transition graph that has been augmented to take edge labels into account. The elements of

\delta*

are known as paths. The edge labels of a path are obtained by concatenating the edge labels of its constituent transitions in order.

The behavior of the transducer T is the rational relation [''T''] defined as follows:

x[T]y

if and only if there exists

i\inI

and

f\inF

such that

(i,x,y,f)\in\delta*

. This is to say that T transduces a string

x\in\Sigma*

into a string

y\in\Gamma*

if there exists a path from an initial state to a final state whose input label is x and whose output label is y.

Weighted automata

See also: Rational series. Finite State Transducers can be weighted, where each transition is labelled with a weight in addition to the input and output labels. A Weighted Finite State Transducer (WFST) over a set K of weights can be defined similarly to an unweighted one as an 8-tuple, where:

E\subseteqQ x (\Sigma\cup\{\epsilon\}) x (\Gamma\cup\{\epsilon\}) x Q x K

(where ε is the empty string) is the finite set of transitions;

λ:IK

maps initial states to weights;

\rho:FK

maps final states to weights.In order to make certain operations on WFSTs well-defined, it is convenient to require the set of weights to form a semiring.[2] Two typical semirings used in practice are the log semiring and tropical semiring: nondeterministic automata may be regarded as having weights in the Boolean semiring.[3]

Stochastic FST

Stochastic FSTs (also known as probabilistic FSTs or statistical FSTs) are presumably a form of weighted FST.

Operations on finite-state transducers

The following operations defined on finite automata also apply to finite transducers:

T\cupS

such that

x[T\cupS]y

if and only if

x[T]y

or

x[S]y

.

TS

such that

x[TS]y

if and only if there exist

x1,x2,y1,y2

with

x=x1x2,y=y1y2,x1[T]y1

and

x2[S]y2.

T*

with the following properties:[4]

and

x[T*]y

does not hold unless mandated by or .

T\circS

on Σ and Δ such that

x[T\circS]z

if and only if there exists a string

y\in\Gamma*

such that

x[T]y

and

y[S]z

. This operation extends to the weighted case.

This definition uses the same notation used in mathematics for relation composition. However, the conventional reading for relation composition is the other way around: given two relations and,

(x,z)\inT\circS

when there exist some such that

(x,y)\inS

and

(y,z)\inT.

\pi1

preserves the input tape, and

\pi2

preserves the output tape. The first projection,

\pi1

is defined as follows:

Given a transducer, there exists a finite automaton

\pi1T

such that

\pi1T

accepts x if and only if there exists a string y for which

x[T]y.

The second projection,

\pi2

is defined similarly.

Additional properties of finite-state transducers

L=(\Sigma\cup\{\epsilon\}) x (\Gamma\cup\{\epsilon\})

, finite-state transducers are isomorphic to NDFA over the alphabet

L

, and may therefore be determinized (turned into deterministic finite automata over the alphabet

L=[(\Sigma\cup\{\epsilon\}) x \Gamma]\cup[\Sigma x (\Gamma\cup\{\epsilon\})]

) and subsequently minimized so that they have the minimum number of states.

Applications

FSTs are used in the lexical analysis phase of compilers to associate semantic value with the discovered tokens.[6]

Context-sensitive rewriting rules of the form ab / c _ d, used in linguistics to model phonological rules and sound change, are computationally equivalent to finite-state transducers, provided that application is nonrecursive, i.e. the rule is not allowed to rewrite the same substring twice.[7]

Weighted FSTs found applications in natural language processing, including machine translation, and in machine learning.[8] [9] An implementation for part-of-speech tagging can be found as one component of the OpenGrm[10] library.

See also

References

External links

Further reading

Notes and References

  1. Book: Jurafsky, Daniel. Speech and Language Processing. Pearson. 2009. 9789332518414.
  2. Book: Berstel . Jean . Reutenauer . Christophe . Noncommutative rational series with applications . Encyclopedia of Mathematics and Its Applications . 137 . Cambridge . . 2011 . 978-0-521-19022-0 . 1250.68007 . 16 .
  3. Book: Lothaire, M. . M. Lothaire . Applied combinatorics on words . . Encyclopedia of Mathematics and Its Applications . 105 . Cambridge . . 2005 . 0-521-84802-4 . 1133.68067 . 211 .
  4. Book: Computer Aided Verification . Boigelot . Bernard . Legay . Axel . Wolper . Pierre . Iterating Transducers in the Large . Lecture Notes in Computer Science . 2003 . 2725 . 223–235 . Springer Berlin Heidelberg . 0302-9743 . 1611-3349 . 10.1007/978-3-540-45069-6_24 . 978-3-540-40524-5 .
  5. Web site: Determinization of Transducers.
  6. Book: Charles N. Fischer. Ron K. Cytron. Richard J. LeBlanc, Jr.. Crafting a Compiler. Addison-Wesley. 978-0-13-606705-4. Scanning - Theory and Practice. 2010 .
  7. Web site: Regular Models of Phonological Rule Systems . August 25, 2012 . https://web.archive.org/web/20101011225829/http://acl.ldc.upenn.edu/J/J94/J94-3001.pdf . October 11, 2010 . dead .
  8. Book: Manfred Droste . Werner Kuich . Heiko Vogler . Handbook of Weighted Automata. 2009. Springer Science & Business Media. 978-3-642-01492-5. Applications of Weighted Automata in Natural Language Processing. Kevin Knight . Jonathan May .
  9. Web site: Learning with Weighted Transducers. April 29, 2017.
  10. http://opengrm.org/ OpenGrm