13.11.2014 Views

Introduction to Computational Linguistics

Introduction to Computational Linguistics

Introduction to Computational Linguistics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

15. Finite State Transducers 56<br />

(Here, A ε := A ∪ {ε}, and ε := B ∪ {ε}.) We write q → a:b<br />

q ′ if δ(a, q, b, q ′ ) ∈ δ. We<br />

say in this case that T makes a transition from q <strong>to</strong> q ′ given input a, and that it<br />

outputs b. Again, it is possible <strong>to</strong> define this notation for strings. So, if q −→ ⃗u:⃗v<br />

q ′<br />

and q ′ ⃗x:⃗y<br />

−→ q ′′ then we write q ⃗u⃗x:⃗v⃗y<br />

−→ q ′′ .<br />

It is not hard <strong>to</strong> show that a finite state transducer from A <strong>to</strong> B is equivalent <strong>to</strong><br />

a finite state au<strong>to</strong>ma<strong>to</strong>n over A × B. Namely, put<br />

(146) A := 〈A × B, Q, i 0 , F, θ〉<br />

where q ′ ∈ θ(q, 〈a, b〉) iff 〈a, q, b, q ′ 〉 ∈ δ. Now define<br />

(147) 〈⃗u,⃗v〉 · 〈⃗x,⃗y〉 := 〈⃗u⃗x, ⃗x⃗y〉<br />

⃗x:⃗y<br />

Then one can show that q −→ q ′ in T if and only if q −→ 〈⃗x,⃗y〉<br />

q ′ in A. Thus, the<br />

theory of finite state au<strong>to</strong>mata can be used here. Transducers have been introduced<br />

as devices that translate languages. We shall see many examples below. Here,<br />

we shall indicate a simple one. Suppose that the input is A := {a, b, c, d} and<br />

B := {0, 1}. We want <strong>to</strong> translate words over A in<strong>to</strong> words over B in the following<br />

way. a is translated by 00, b by 01, c by 10 and d by 11. Here is how this is done.<br />

The set of states is {0, 1, 2}. The initial state is 0 and the accepting states are {0}.<br />

The transitions are<br />

(148)<br />

〈0, a, 1, 0〉, 〈0, b, 2, 0〉, 〈0, c, 1, 1〉, 〈0, d, 2, 1〉,<br />

〈1, ε, 0, 0〉, 〈2, ε, 0, 1〉<br />

This means the following. Upon input a, the machine enters state 1, and outputs<br />

the letter 0. It is not in an accepting state, so it has <strong>to</strong> go on. There is only one<br />

way: it reads no input, returns <strong>to</strong> state 0 and outputs the letter 0. Now it is back<br />

<strong>to</strong> where is was. It has read the letter a and mapped it <strong>to</strong> the word 00. Similarly it<br />

maps b <strong>to</strong> 01, c <strong>to</strong> 10 and d <strong>to</strong> 11.<br />

Let us write R T for the following relation.<br />

(149) R T := {〈⃗x,⃗y〉 : i 0<br />

⃗x:⃗y<br />

−→ q ∈ F}<br />

Then, for every word ⃗x, put<br />

(150) R T (⃗x) := {⃗y : ⃗x R T ⃗y}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!