Phonology and speech applications with weighted automata
Mans Hulden
- Dept. of Linguistics
Phonology and speech applications with weighted automata Natural - - PowerPoint PPT Presentation
Phonology and speech applications with weighted automata Natural Language Processing LING/CSCI 5832 Mans Hulden Dept. of Linguistics mans.hulden@colorado.edu Feb 19 2014 Overview (1) Recap unweighted finite automata and transducers (2)
1 2
a b d 1 c 2 a 3 <a:b> b d c a b c d
@ <+:0>
10 u i 5 a 2 s 1 d 9 <+:0> 8 e 3 e 4 m i 6 u 7 tNOISY CHANNEL
word
noisy word
SOURCE DECODER
guess at
word
NOISY CHANNEL
word
noisy word
SOURCE DECODER
guess at
word
w V
NOISY CHANNEL
word
noisy word
SOURCE DECODER
guess at
word
w V
NOISY CHANNEL
word
noisy word
SOURCE DECODER
guess at
word
w V
We can see this by substituting (5. ˆ w argmax
w V
P O w P w P O The probabilities on the righ
NOISY CHANNEL
word
noisy word
SOURCE DECODER
guess at
word
w V
ˆ w argmax
w V
P O w P w P O argmax
w V
P O w P w To summarize, the most probable word w given som #3. ˆ w argmax
w V
likelihood P O w prior P w tions we will show how to compute the
@ <+:0>
NOISY CHANNEL
word
noisy word
NOISY CHANNEL
word
noisy word
NOISY CHANNEL
word
noisy word
0.1 0.7 0.3 0.9 [a 0.3] [b 0.7] [a 0.2] [b 0.8] [a 0.8] [b 0.2] [a 0.9] [b 0.1] 0.04 0.36 0.42 0.18 0.7 0.9 0.1 0.3 11 12 21 22
⇒
0.04 0.36 0.42 0.18 11 12 21 22 a 0.09 b 0.21 b 0.18 b 0.08 a 0.02 a 0.27 b 0.03 b 0.49 a 0.21 a 0.72 b 0.72 a 0.18 b 0.02 a 0.08 a 0.63 b 0.07
As always, we would prefer using(negative) logprobs, since this makes calculations easier:
Since the more probable is now numerically smaller, we call them weights
A semiring (K, ⊕, ⊗, 0, 1) = a ring that may lack negation.
labeled with that sequence).
stituent transitions). Semiring Set ⊕ ⊗ 1 Boolean {0, 1} ∨ ∧ 1 Probability R+ + × 1 Log R ∪ {−∞, +∞} ⊕log + +∞ Tropical R ∪ {−∞, +∞} min + +∞ String Σ∗ ∪ {∞} ∧ · ∞
The string semiring is a left semiring.
⊗ respecti and s ⊗ 1, additional constraints
Also, s ⊗ 0
1/2 a/1 b/4 2 a/2 b/1 3/2 b/1 c/3 b/3 c/5
Probability semiring (R+, +, ×, 0, 1) Tropical semiring (R+ ∪ {∞}, min, +, ∞, 0) [ [A] ](ab) = 14 [ [A] ](ab) = 4 (1 × 1 × 2 + 2 × 3 × 2 = 14) (min(1 + 1 + 2, 3 + 2 + 2) = 4)
Σ Σ is an automaton, Initial output function , Output function : Σ , Final output function , Function : Σ associated with : .
1/2 a:ε/1 2 a:r/3 3/2 b:r/2 b:ε/2 c:s/1 Probability semiring (R+, +, ×, 0, 1) Tropical semiring (R+ ∪ {∞}, min, +, ∞, 0) [ [T] ](ab, r) = 16 [ [T] ](ab, r) = 5 (1 × 2 × 2 + 3 × 2 × 2 = 16) (min(1 + 2 + 2, 3 + 2 + 2) = 5)
Σ ∆ Finite alphabets Σ and ∆, Finite set of states , Transition function : Σ 2 , Output function : Σ Σ , set of initial states, set of final states. defines a relation: Σ
2 :
Union: Example
b/1 1 a/3 a/5 2 b/2 b/6 3 /0 a/4 a/3 b/7 1 b/5 3 a/3 c/0 2 b/2 c/1 4 b/3 a/6 5 /0 a/4
1 b/5 3 a/3 c/0 2 b/2 c/1 4 b/3 a/6 5 /0 a/4 6 b/1 7 a/3 a/5 8 b/2 b/6 9 /0 a/4 a/3 b/7 10 ε/0 ε/0
x y
z
x z
x y
z
x z
1 a:a/3 2 b:ε/1 3 c:ε/4 4 d:d/2 1 a:d/5 2 :e ε /7 3 d:a/6
(0,0) (1,1) a:d/15 (2,2) b:e/7 (3,2) c:ε/4 (4,3) d:a/12
Toy language model (16 states, 53 trans
Determinization: Motivation (3)
1 which/69.9 2 flights/53.1 3 flight/53.2 4 leave/64.6 5 leaves/62.3 6 leave/63.6 7 leaves/67.6 8 /0 Detroit/103 Detroit/105 Detroit/105 Detroit/101
1 a:0 b:1 d:0 2 a:3 4 b:2 3 c:2 5 c:1 d:4 6 e:3 c:1 7 e:1 d:3 e:2 1 a:6 b:7 d:0 2 a:3 4 b:0 3 c:0 5 c:0 d:6 6 e:0 c:1 7 e:0 d:6 e:0 1 a:6 b:7 d:0 2 a:3 b:0 3 c:0 d:6 4 e:0 c:1 5 e:0
1 a:d/5 2 :e ε /7 3 d:a/6
$LM = ( the<3.3123733563043>| you<3.40834334278697>| i<3.47764362842074>| a<3.62151061674717>| to<3.74035111367985>| and<4.12455498051775>|
...
Unigram model from The Simpsons word frequency list (http://pastebin.com/anKcMdvk)
http://www.kleene-lang.org/
$rep = . ; $ins = "":.; $del = .:""; $chg = .:.-.; $EM = ( $rep<0.0> | $ins<1.0> | $del<1.0> | $chg<1.0> )*;
Simple error model (insertion/deletion/replacements have a weight of one)
$corr = $^shortestPath( (cxat) _o_$EM _o_ $LM );
$rep = . ; $ins = "":.; $del = .:""; $chg = .:.-.; $EM = ( $rep<0.0> | $ins<1.0> | $del<1.0> | $chg<1.0> )*;
Simple error model (insertion/deletion/replacements have a weight of one)
$corr = $^shortestPath( (cxat) _o_$EM _o_ $LM );
$rep = . ; $ins = "":.; $del = .:""; $chg = .:.-.; $EM = ( $rep<0.0> | $ins<1.0> | $del<1.0> | $chg<1.0> )*;
Simple error model (insertion/deletion/replacements have a weight of one)
$corr = $^shortestPath( (cxat) _o_$EM _o_ $LM );
Search through space of all possible sentences.
phones words A D
M
O
Recognition from observations o by composition: – Observations: s s 1 if s
– Acoustic-phone transducer: a p a p – Pronunciation dictionary: p w p w – Language model: w w w Recognition: ˆ w argmax
w
RES
[ɪf]/0.0001
if/0.000034
if/0.0000045
Quantized observations:
. . .
t1 t2 t0
tn
Phone model : observations phones
ε:π/p2f
. . . . . . . . . . . . . . .
s0 s1 s2
Acoustic transducer: Word pronunciations
data : phones
words
d:ε/1 ey:ε/.4 ae:ε/.6 dx:ε/.8 t:ε/.2
ax:"data"/1
Dictionary: