99
Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley F. Chen, Markus Nussbaum-Thom Watson Group IBM T.J. Watson Research Center Yorktown Heights, New York, USA {picheny,bhuvana,stanchen,nussbaum}@us.ibm.com 17 February 2016

Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Lecture 5

The Big Picture/Language Modeling

Michael Picheny, Bhuvana Ramabhadran, Stanley F. Chen,Markus Nussbaum-Thom

Watson GroupIBM T.J. Watson Research CenterYorktown Heights, New York, USA

{picheny,bhuvana,stanchen,nussbaum}@us.ibm.com

17 February 2016

Page 2: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Administrivia

Slides posted before lecture may not match lecture.Lab 1

Not graded yet; will be graded by next lecture?Awards ceremony for evaluation next week.Grading: what’s up with the optional exercises?

Lab 2Due nine days from now (Friday, Feb. 26) at 6pm.Start early! Avail yourself of Piazza.

2 / 99

Page 3: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Feedback

Clear (4); mostly clear (2); unclear (3).Pace: fast (3); OK (2).Muddiest: HMM’s in general (1); Viterbi (1); FB (1).Comments (2+ votes):

want better/clearer examples (5)spend more time walking through examples (3)spend more time on high-level intuition before gettinginto details (3)good examples (2)

3 / 99

Page 5: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Part I

The HMM/GMM Framework

5 / 99

Page 6: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 Review from 10,000 Feet

2 The Model

3 Training

4 Decoding

5 Technical Details

6 / 99

Page 7: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

The Raw Data

0 0.5 1 1.5 2 2.5

x 104

−1

−0.5

0

0.5

What do we do with waveforms?7 / 99

Page 8: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Front End Processing

Convert waveform to features.

8 / 99

Page 9: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What Have We Gained?

Time domain⇒ frequency domain.Removed vocal-fold excitation.Made features independent.

9 / 99

Page 10: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

ASR 1.0: Dynamic Time Warping

10 / 99

Page 11: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Computing the Distance Between Utterances

Find “best” alignment between frames.Sum distances between aligned frames.Sum penalties for “weird” alignments.

11 / 99

Page 12: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

ASR 2.0: The HMM/GMM Framework

12 / 99

Page 13: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Notation

13 / 99

Page 14: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

How Do We Do Recognition?

xtest = test features; Pω(x) = word model.

(answer) =???

(answer) = arg maxω∈vocab

Pω(xtest)

Return the word whose model . . .Assigns the highest prob to the utterance.

14 / 99

Page 15: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Putting it All Together

Pω(x) = ???How do we actually train?How do we actually decode?

It’s a puzzlement by jubgo. Some rights reserved.

15 / 99

Page 16: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 Review from 10,000 Feet

2 The Model

3 Training

4 Decoding

5 Technical Details

16 / 99

Page 17: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

So What’s the Model?

Pω(x) =???

Frequency that word ω generates features x.Has something to do with HMM’s and GMM’s.

Untitled by Daniel Oines. Some rights reserved.

17 / 99

Page 18: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

A Word Is A Sequence of Sounds

e.g., the word ONE: W→ AH→ N.Phoneme inventory.

AA AE AH AO AW AX AXR AY BBD CH D DD DH DX EH ER EYF G GD HH IH IX IY JH K

KD L M N NG OW OY P PDR S SH T TD TH TS UH UWV W X Y Z ZH

What sounds make up TWO?What do we use to model sequences?

18 / 99

Page 19: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

HMM, v1.0

Outputs on arcs, not states.What’s the problem? What are the outputs?

19 / 99

Page 20: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

HMM, v2.0

What’s the problem? How many frames per phoneme?

20 / 99

Page 21: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

HMM, v3.0

Are we done?

21 / 99

Page 22: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Concept: Alignment⇔ Path

Path through HMM⇒ sequence of arcs, one per frame.Notation: A = a1 · · · aT .at = which arc generated frame t .

22 / 99

Page 23: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

The Game Plan

Express Pω(x), the total prob of x . . .In terms of Pω(x,A), the prob of a single path.How?

P(x) =∑

paths A

(path prob)

=∑

paths A

P(x,A)

Sum over all paths.

23 / 99

Page 24: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

How To Compute the Likelihood of a Path?

Path: A = a1 · · · aT .

P(x,A) =T∏

t=1

(arc prob)× (output prob)

=T∏

t=1

pat × P(~xt |at)

Multiply arc, output probs along path.24 / 99

Page 25: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What Do Output Probabilities Look Like?

Mixture of diagonal-covariance Gaussians.

P(~x |a) =∑

comp j

(mixture wgt)∏

dim d

(Gaussian for dim d)

=∑

comp j

pa,j

∏dim d

N (xd ;µa,j,d , σa,j,d)

25 / 99

Page 26: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

The Full Model

P(x) =∑

paths A

P(x,A)

=∑

paths A

T∏t=1

pat × P(~xt |at)

=∑

paths A

T∏t=1

pat

∑comp j

pat ,j

∏dim d

N (xt ,d ;µat ,j,d , σ2at ,j,d)

pa — transition probability for arc a.pa,j — mixture weight, j th component of GMM on arc a.µa,j,d — mean, d th dim, j th component, GMM on arc a.σ2

a,j,d — variance, d th dim, j th component, GMM on arc a.

26 / 99

Page 27: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Pop Quiz

What was the equation on the last slide?

27 / 99

Page 28: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 Review from 10,000 Feet

2 The Model

3 Training

4 Decoding

5 Technical Details

28 / 99

Page 29: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Training

How to create model Pω(x) from examples xω,1, xω,2, . . . ?

29 / 99

Page 30: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What is the Goal of Training?

To estimate parameters . . .To maximize likelihood of training data.

Crossfit 0303 by Runar Eilertsen. Some rights reserved.

30 / 99

Page 31: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What Are the Model Parameters?

pa — transition probability for arc a.pa,j — mixture weight, j th component of GMM on arc a.µa,j,d — mean, d th dim, j th component, GMM on arc a.σ2

a,j,d — variance, d th dim, j th component, GMM on arc a.

31 / 99

Page 32: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Warm-Up: Non-Hidden ML Estimation

e.g., Gaussian estimation, non-hidden Markov Models.How to do this? (Hint: ??? and ???.)

parameter description statisticpa arc prob # times arc takenpa,j mixture wgt # times component usedµa,j,d mean xd

σ2a,j,d variance x2

d

Count and normalize.i.e., collect a statistic; divide by normalizer count.

32 / 99

Page 33: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

How To Estimate Hidden Models?

The EM algorithm⇒ FB algorithm for HMM’s.Hill-climbing maximum-likelihood estimation.

Uphill Struggle by Ewan Cross. Some rights reserved.

33 / 99

Page 34: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

The EM Algorithm

Expectation step.Using current model, compute posterior counts . . .Prob that thing occurred at time t .

Maximization step.Like non-hidden MLE, except . . .Use fractional posterior counts instead of whole counts.

Repeat.

34 / 99

Page 35: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

E step: Calculating Posterior Counts

e.g., posterior count γ(a, t) of taking arc a at time t .

γ(a, t) =P(paths with arc a at time t)

P(all paths)

=1

P(x)× P(paths from start to src(a))×

P(arc a at time t)× P(paths from dst(a) to end)

=1

P(x)× α(src(a), t − 1)× pa × P(~xt |a)× β(dst(a), t)

Do Forward algorithm: α(S, t), P(x).Do Backward algorithm: β(S, t).Read off posterior counts.

35 / 99

Page 36: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

M step: Non-Hidden ML Estimation

Count and normalize.Same stats as non-hidden, except normalizer is fractional.e.g., arc prob pa

pa =(count of a)∑

src(a′)=src(a) (count of a′)=

∑t γ(a, t)∑

src(a′)=src(a)

∑t γ(a′, t)

e.g., single Gaussian, mean µa,d for dim d .

µa,d = (mean weighted by γ(a, t)) =

∑t γ(a, t)xt ,d∑

t γ(a, t)

36 / 99

Page 37: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 Review from 10,000 Feet

2 The Model

3 Training

4 Decoding

5 Technical Details

37 / 99

Page 38: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What is Decoding?

(answer) = arg maxω∈vocab

Pω(xtest)

38 / 99

Page 39: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What Algorithm?

(answer) = arg maxω∈vocab

Pω(xtest)

For each word ω, how to compute Pω(xtest)?Forward or Viterbi algorithm.

39 / 99

Page 40: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What Are We Trying To Compute?

P(x) =∑

paths A

P(x,A)

=∑

paths A

T∏t=1

pat × P(~xt |at)

=∑

paths A

T∏t=1

(arc cost)

40 / 99

Page 41: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Dynamic Programming

Shortest path problem.

(answer) = minpaths A

TA∑t=1

(edge length)

Forward algorithm.

P(x) =∑

paths A

T∏t=1

(arc cost)

Viterbi algorithm.

P(x) ≈ maxpaths A

T∏t=1

(arc cost)

Any semiring will do.41 / 99

Page 42: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Scaling

How does decoding time scale with vocab size?

42 / 99

Page 43: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

The One Big HMM Paradigm: Before

43 / 99

Page 44: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

The One Big HMM Paradigm: After

one

two

three

four

�ve

six

seveneight

nine

zero

How does this help us?

44 / 99

Page 45: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Pruning

What is time complexity of Forward/Viterbi?How many values α(S, t) to fill?

Idea: only fill k best cells at each frame.What is time complexity?How does this scale with vocab size?

45 / 99

Page 46: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

How Does This Change Decoding?

Run Forward/Viterbi once, on one big HMM . . .Instead of once for every word model.

Same algorithm; different graph!

one

two

three

four

�ve

six

seveneight

nine

zero

46 / 99

Page 47: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Forward or Viterbi?

What are we trying to compute?Total prob? Viterbi prob? Best word?

one

two

three

four

�ve

six

seveneight

nine

zero

47 / 99

Page 48: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Recovering the Word Identity

one

two

three

four

�ve

six

seveneight

nine

zero

48 / 99

Page 49: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 Review from 10,000 Feet

2 The Model

3 Training

4 Decoding

5 Technical Details

49 / 99

Page 50: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Hyperparameters

What is a hyperparameter?A tunable knob or something adjustable . . .That can’t be estimated with “normal” training.

Can you name some?

Number of states in each word HMM.HMM topology.Number of GMM components.

50 / 99

Page 51: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

“Estimating” Hyperparameters

How does one set hyperparameters?Just try different values⇒ expensive!

Testing value⇒ train whole HMM/GMM system.What criterion to optimize?

Normal parameter: Likelihood (smooth).Hyperparameters: Word-error rate (noisy).Gradient descent unreliable; grid search instead.

Ask an old-timer.What are good hyperparameter settings for ASR?

51 / 99

Page 52: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

How Many States?

Rule of thumb: three states per phoneme.A phoneme has a start, middle, and end?

Example: TWO is composed of phonemes T UW.Two phonemes⇒ six HMM states.

T1 T2 T3 UW1 UW2 UW3

g1/0.5 g2/0.5 g3/0.5 g4/0.5 g5/0.5 g6/0.5

g1/0.5 g2/0.5 g3/0.5 g4/0.5 g5/0.5 g6/0.5

What guarantee each state models intended sound?

52 / 99

Page 53: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Which HMM Topology?

A standard topology.Must say sounds of word in order.Can stay at each sound indefinitely.

g1/0.5 g2/0.5 g3/0.5 g4/0.5 g5/0.5 g6/0.5

g1/0.5 g2/0.5 g3/0.5 g4/0.5 g5/0.5 g6/0.5

Can we skip sounds, e.g., fifth?Use skip arcs ⇔ arcs with no output.Need to modify Forward, Viterbi, etc.

g1/0.4 g2/0.4 g3/0.4 g4/0.4 g5/0.4 g6/0.4

g1/0.4 g2/0.4 g3/0.4 g4/0.4 g5/0.4 g6/0.4

�/0.2 �/0.2 �/0.2 �/0.2 �/0.2

53 / 99

Page 54: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

The Smallest Number in the World

Demo.

54 / 99

Page 55: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Probabilities and Log Probabilities

P(x) =∑

paths A

T∏t=1

pat

∑comp j

pat ,j

∏dim d

N (xt ,d ;µat ,j,d , σ2at ,j,d)

1 sec of data⇒ T = 100⇒ Multiply 4,000 likelihoods.Easy to generate values below 10−307.Cannot store in C/C++ 64-bit double.

What to do?Solution: store log probs instead of probs.

Compute logα(S, t), not α(S, t).

55 / 99

Page 56: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Viterbi Easy, Forward Tricky

Viterbi algorithm

α̂(S, t) = maxS′

xt→SP(S′ xt→ S)× α̂(S′, t − 1)

log α̂(S, t) = maxS′

xt→S

[log P(S′ xt→ S) + log α̂(S′, t − 1)

]Forward algorithm

α(S, t) =∑

S′xt→S

P(S′ xt→ S)× α(S′, t − 1)

logα(S, t) = log∑

S′xt→S

exp[log P(S′ xt→ S) + logα(S′, t − 1)

]See Holmes, p. 153–154.

56 / 99

Page 57: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What Have We Learned So Far?

Single-word recognition.How to recognize a single word.e.g., can handle a digit, not a digit string.

What’s this good for?

Old-time voice dialing.Recognizing digits in old-time phone menus.Not much else.

Old-timey cell phones by Vaguely Artistic. Some rights reserved.

57 / 99

Page 58: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Part II

Continuous Word ASR

58 / 99

Page 59: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 Single Word To Continuous Word ASR

2 One More Thing

3 Discussion

59 / 99

Page 60: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Next Step: Isolated Word Recognition

It’s . . . when . . . you . . . talk . . . like . . . this.

60 / 99

Page 61: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Training Data, Test Data

What you need: silence-based segmenter.Chop up training data.

Chop up test data.Reduces to single-word ASR.

61 / 99

Page 62: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Continuous Word Recognition

It’s when you talk like this.

62 / 99

Page 63: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Continuous Word Recognition

Single word.Find word model with highest prob:

arg maxω∈vocab

Pω(xtest)

V -way classification.Continuous word.

Find word sequence with highest prob:

arg maxω∈vocab∗

P(xtest|ω)

∞-way classification.This sounds hard.

63 / 99

Page 64: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Decoding Continuous Word Data

Have single-word models Pω(x).How to decode continuous words?

64 / 99

Page 65: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

One Big HMM Paradigm

How to modify HMM . . .To accept word sequences instead of single words?

one

two

three

four

�ve

six

seveneight

nine

zero

Loop!65 / 99

Page 66: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What Do We Need To Change in Viterbi?

Nada.

66 / 99

Page 67: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Training on Continuous Word Data

Isolated word.

Continuous word.

Don’t know where words begin and end!67 / 99

Page 68: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

How Does Training Work Again?

Isolated word.

Continuous word: what to do?

Idea: concatenate HMM’s!

68 / 99

Page 69: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What Do We Need To Change in FB?

Nada.

69 / 99

Page 70: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Recap: Continuous Word ASR

Use “one big HMM” paradigm for decoding.Modify HMM’s for decoding and training in intuitive way.Everything just works!

70 / 99

Page 71: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 Single Word To Continuous Word ASR

2 One More Thing

3 Discussion

71 / 99

Page 72: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

One More Thing

What happens if we feed isolated speech . . .Into our continuous word system?

one

two

three

four

�ve

six

seveneight

nine

zero

72 / 99

Page 73: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What To Do About Silence?

Treat silence as just another word (∼SIL).How to design HMM for silence?

g1/0.4 g2/0.4 g3/0.4

g1/0.4 g2/0.4 g3/0.4

�/0.2 �/0.2

73 / 99

Page 74: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Silence In Decoding

Where may silence occur?How many silences can occur in a row?Rule of thumb: unnecessary freedom should be avoided.

cf. Patriot Act.

HMMsil HMMsilHMMsil

HMMone

HMMtwo

HMMthree

. . . . . .

HMMone

HMMtwo

HMMthree

. . . . . .

HMMsil

HMMsil

HMMsil

HMMone

HMMtwo

HMMthree

. . . . . .

HMMone

HMMtwo

HMMthree

. . . . . .

74 / 99

Page 75: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Silence In Training

Usually not included in transcripts.e.g., HMM for transcript: ONE TWO

HMMsil HMMtwo HMMsil HMMone HMMsil

HMMtwo HMMone

Lab 2: graphs constructed for you.

75 / 99

Page 76: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Recap: Silence

Don’t forget about silence!Silence can be modeled as just another word.Generalization: noises, music, filled pauses.

Silence by Alberto Ortiz. Some rights reserved.

76 / 99

Page 77: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 Single Word To Continuous Word ASR

2 One More Thing

3 Discussion

77 / 99

Page 78: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

HMM/GMM Systems Are Easy To Use

List of inputs.Hyperparameters.

HMM topology, # states; # GMM components.What else?∗

Utterances with transcripts.Automatically induces word begin/ends, silences.

Period.

∗Small vocabulary only.78 / 99

Page 79: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

HMM/GMM Systems Are Flexible

Same algorithms for:Single word, isolated word, continuous word ASR.

Just change how HMM is created!

79 / 99

Page 80: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

HMM/GMM Systems Are Scalable

As training data, vocabulary grows.In decoding speed.

Pruning⇒ time grows slowly.∗

In model size.Number of parameters grow slowly.∗

∗When using large-vocab methods described in next few lectures.80 / 99

Page 81: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

HMM/GMM’s Are The Bomb

State of art since invented in 1980’s.That’s 30+ years!

Until a couple years ago . . .Basically every production system was HMM/GMM.Most probably still are.

BOMB by Apionid. Some rights reserved.

81 / 99

Page 82: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Segue: What Have We Learned So Far?

Small-vocabulary continuous speech recognition.What’s this good for?

Digit strings.Not much else.

What’s next: large-vocabulary CSR.

82 / 99

Page 83: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Part III

Language Modeling

83 / 99

Page 84: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Where Are We?

1 The Fundamental Equation of Speech Recognition

84 / 99

Page 85: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Demo

85 / 99

Page 86: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What’s the Point?

ASR works better if you say something “expected”.Otherwise, it doesn’t do that well.

86 / 99

Page 87: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Wreck a Nice Peach?

Demo.THIS IS OUR ROOM FOR A FOUR HOUR PERIOD .THIS IS HOUR ROOM FOUR A FOR OUR . PERIOD

IT IS EASY TO RECOGNIZE SPEECH .IT IS EASY TO WRECK A NICE PEACH .

Homophones; acoustically ambiguous speech.How does it get it right . . .

Even though acoustics for pair is same?(What if want other member of pair?)

Need to model “expected” word sequences!

87 / 99

Page 88: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

How Do We Do Recognition?

xtest = test features; P(x|ω) = HMM/GMM model.

(answer) =???

(answer) = arg maxω∈vocab∗

P(xtest|ω)

Return the word sequence that . . .Assigns the highest prob to the utterance.

88 / 99

Page 89: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Does This Prefer Likely Word Sequences?

e.g., P(xtest|OUR ROOM) vs. P(xtest|HOUR ROOM).If I say AA R R UW M, how do these compare?They should be about the same.

89 / 99

Page 90: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

How Do We Fix This?

Want term P(ω).Prior over word sequences; prefers likely sequences.

What HMM/GMM’s give us: P(x|ω).Old: word sequence that maximizes likelihood of feats.

(answer) = arg maxω

P(x|ω)

Idea: most likely word sequence given feats!?

(answer) = arg maxω

P(ω|x)

90 / 99

Page 91: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Bayes’ Rule

The rule:

P(x, ω) = P(ω)P(x|ω) = P(x)P(ω|x)

P(ω|x) =P(ω)P(x|ω)

P(x)

Substituting:

(answer) = arg maxω

P(ω|x)

= arg maxω

P(ω)P(x|ω)

P(x)

= arg maxω

P(ω)P(x|ω)

91 / 99

Page 92: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

The Fundamental Equation of ASR

Old way:(answer) = arg max

ωP(x|ω)

New way:

(answer) = arg maxω

P(ω|x) = arg maxω

P(ω)P(x|ω)

Added term P(ω), just like we wanted.

92 / 99

Page 93: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Remember This!

(answer) = arg maxω

(language model)× (acoustic model)

= arg maxω

(prior prob over words)× P(feats|words)

= arg maxω

P(ω)P(x|ω)

Forgot What I Wanted to Remember by Flood G.. Some rights reserved.93 / 99

Page 94: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Does This Fix Our Problem?

(answer) = arg maxω

(language model)× (acoustic model)

= arg maxω

P(ω)P(x|ω)

What about homophones?THIS IS OUR ROOM FOR A FOUR HOUR PERIOD .THIS IS HOUR ROOM FOUR A FOR OUR . PERIOD

What about confusable sequences in general?IT IS EASY TO RECOGNIZE SPEECH .IT IS EASY TO WRECK A NICE PEACH .

94 / 99

Page 95: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Language Modeling: Goals

Describe which word sequences are likely.Eliminate nonsense; restrict choices given to AM.

The fewer choices, the better you do!Save acoustic model’s ass.

95 / 99

Page 96: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Pop Quiz

What is the fundamental equation of ASR?

96 / 99

Page 97: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Part IV

Epilogue

97 / 99

Page 98: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

What’s Next

Language modeling: on the road to LVCSR.Lecture 6: Pronunciation modeling.

Acoustic modeling for LVCSR.Lectures 7, 8: Training, finite-state transducers, search.

Efficient training and decoding for LVCSR.

98 / 99

Page 99: Lecture 5 - The Big Picture/Language Modelingstanchen/spring16/e6870/slides/lecture5.pdf · Lecture 5 The Big Picture/Language Modeling Michael Picheny, Bhuvana Ramabhadran, Stanley

Course Feedback

1 Was this lecture mostly clear or unclear? What was themuddiest topic?

2 Comments on difficulty of Lab 1?3 Other feedback (pace, content, atmosphere)?

99 / 99