Data-Intensive Computing with MapReduce
|
|
- Stephany Adams
- 5 years ago
- Views:
Transcription
1 Data-Intensive Computing with MapReduce Session 8: Sequence Labeling Jimmy Lin University of Maryland Thursday, March 14, 2013 This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States See for details
2 Source: Wikipedia (The Scream)
3 Today s Agenda Sequence labeling Midterm Final projects
4 Sequences Everywhere! Examples of sequences l Waveforms in utterances l Letters in words l Words in sentences l Bases in DNA l Proteins in amino acids l Actions in video l Closing prices in the stock market All share the property of having structural dependencies
5 Sequence Labeling Given a sequence of observations, assign a label to each observation l Observations can be discrete or continuous, scalar or vector l Assume labels are drawn from a discrete finite set Sample applications: l Speech recognition l POS tagging l Handwriting recognition l Video analysis l Protein secondary structure detection
6 Approaches Treat as a classification problem? l Make decisions about each observation independently Can we do better? As with before, lots of background material before we get to MapReduce!
7 MapReduce Implementation: Mapper 1: class Mapper 2: method Initialize(integer iteration) P T 3: hs, Oi ReadModel i=1\o 4: ha, B, i ReadModelParams(iteration) ˆbj (v k )= t =v k P T 5: method Map(sample id, sequence x) i=1 6: Forward(x, ). cf. Section P6.2.2 T 1 7: Backward(x, ). âcf. ij Section = P : I new AssociativeArray. Initial state expectations T 1 9: for all q 2S do. Loop over states 10: I{q} 1 (q) 1(q) 11: O new AssociativeArray of AssociativeArray. Emissions 12: for t =1to x do. Loop over observations 13: for all q 2S do. Loop over states 14: O{q}{x t } O{q}{x t } + t (q) t(q) 15: t t +1 16: T new AssociativeArray of AssociativeArray. Transitions 17: for t =1to x 1 do. Loop over observations 18: for all q 2S do. Loop over states 19: for all r 2S do. Loop over states 20: T {q}{r} T {q}{r} + t (q) A q (r) B r (x t+1 ) t+1(r) 21: t t +1 22: Emit(string initial, stripe I) 23: for all q 2S do. Loop over states 24: Emit(string emit from + q, stripe O{q}) 25: Emit(string transit from + q, stripe T {q}) t(j) t(j) t=1 t(i, j) t=1 P N j=1 t(i, j) t(j) = t(j) t (j) P (O ) t (i, j) = t(i)a ij b j (o t+1 ) t+1 (j) P (O )
8 MapReduce Implementation: Reducer 1: class Combiner 2: method Combine(string t, stripes [C 1,C 2,...]) 3: C f new AssociativeArray 4: for all stripe C 2 stripes [C 1,C 2,...] do 5: Sum(C f,c) 6: Emit(string t, stripe C f ) 1: class Reducer 2: method Reduce(string t, stripes [C 1,C 2,...]) 3: C f new AssociativeArray 4: for all stripe C 2 stripes [C 1,C 2,...] do 5: Sum(C f,c) 6: z 0 7: for all hk, vi 2C f do 8: z z + v 9: P f new AssociativeArray. Final parameters vector 10: for all hk, vi 2C f do 11: P f {k} v/z 12: Emit(string t, stripe P f ) ˆbj (v k )= â ij = P T i=1\o t =v k P T i=1 t(j) t(j) P T 1 t=1 t(i, j) P T 1 t=1 P N j=1 t(i, j) t(j) = t(j) t (j) P (O ) t (i, j) = t(i)a ij b j (o t+1 ) t+1 (j) P (O )
9 Finite State Machines Q: a finite set of N states l Q = {q 0, q 1, q 2, q 3, } l The start state: q 0 l The set of final states: q F Σ: a finite input alphabet of symbols δ(q,i): transition function l Given state q and input symbol i, transition to new state q'
10 Finite number of states
11 Transitions
12 Input alphabet
13 Start state
14 Final state(s)
15 What can we do with FSMs? Generate valid sequences Accept valid sequences
16 Weighted FSMs FSMs treat all transitions as equally likely What if we know more about state transitions? l a is twice as likely to be seen in state 1 as b or c l c is three times as likely to be seen in state 2 as a What do we get out of it? l score( ab ) = 2 l score( bc ) = 3
17 Probabilistic FSMs = Markov Chains Let s replace weights with probabilities What if we know more about state transitions? l a is twice as likely to be seen in state 1 as b or c l c is three times as likely to be seen in state 2 as a What do we get out of it? l P( ab ) = 0.5 l P( bc ) =
18 Specifying Markov Chains Q: a finite set of N states l Q = {q 0, q 1, q 2, q 3, } The start state l An explicit start state: q 0 l Alternatively, a probability distribution over start states: {π 1, π 2, π 3, }, Σ π i = 1 The set of final states: q F N N Transition probability matrix A = [a ij ] l a ij = P(q j q i ), Σ a ij = 1 i
19 Let s model the stock market 0.2 Each state corresponds to a physical state in the world What s missing? Add priors What s special about this FSM? l Present state only depends on the previous state! The (1st order) Markov assumption P (q i q 1...q i 1 )=P (q i q i 1 )
20 Are states always observable? Day: Bull Bear S Bear Not observable! S Bull Here s what you actually observe: Bull: Bull Market Bear: Bear Market S: Static Market : Market is up : Market is down : Market hasn t changed
21 Hidden Markov Models Markov chains aren t enough! l What if you can t directly observe the states? l We need to model problems where observations don t directly correspond to states Solution: Hidden Markov Model (HMM) l Assume two probabilistic processes l Underlying process (state transition) is hidden l Second process generates sequence of observed events
22 Specifying HMMs An HMM =(A, B, ) is characterized by: l N states: Q = {q 1,q 2,...q N } l N x N Transition probability matrix A =[a ij ] X a ij = p(q j q i ) a ij =1 8i l V observation symbols: O = {o 1,o 2,...o V } l N x V Emission probability matrix B =[b iv ] j b iv = b i (o v )=p(o v q i ) l Prior probabilities vector NX i =1 i=1 =[ i, 2,... N ]
23 Stock Market HMM States? Transitions? Vocabulary? Emissions? Priors?
24 Stock Market HMM States? Transitions? Vocabulary? Emissions? Priors?
25 Stock Market HMM States? Transitions? Vocabulary? Emissions? Priors?
26 Stock Market HMM States? Transitions? Vocabulary? Emissions? Priors?
27 Stock Market HMM π 1 =0.5 π 2 =0.2 π 3 =0.3 States? Transitions? Vocabulary? Emissions? Priors?
28 Properties of HMMs Markov assumption: P (q i q 1...q i 1 )=P (q i q i 1 ) Output independence: P (o i q 1...q i...q T,o 1...o i...o T )=P (o i q i ) Remember, these are distinct: l Number of states (N) l The number of distinct observation symbols (V) l The length of the sequence (T)
29 Running an HMM 1. Set t = 1, select initial state based on 2. Select an observation to emit based on 3. If t = T, then done =[ i, 2,... N ] B =[b iv ] 4. Select transition into a new state based on A =[a ij ] 5. Set t = t Goto step 2
30 HMMs: Three Problems Likelihood: Given an HMM λ and a sequence of observed events O, find the likelihood of observing the sequence Decoding: Given an HMM λ and an observation sequence O, find the most likely (hidden) state sequence Learning: Given a set of observation sequences, learn the parameters A and B for λ Okay, but where did the structure of the HMM come from?
31 HMM Problem #1: Likelihood
32 Computing Likelihood π 1 =0.5 π 2 =0.2 π 3 =0.3 t O Given this model of the stock market, how likely are we to observe the sequence of outputs?
33 Computing Likelihood Easy, right? l Sum over all possible ways in which we could generate O from λ l What s the problem? Right idea, wrong algorithm! Takes O(N T ) time to compute!
34 Computing Likelihood What are we doing wrong? l State sequences may have a lot of overlap l We re recomputing the shared subsequences every time l Let s store intermediate results and reuse them Sounds like a job for dynamic programming!
35 Forward Algorithm Forward probability l Probability of being in state j after t observations t (j) =P (o 1,o 2...o t,q t = j ) Build an N T trellis l Intuition: forward probability only depends on the previous state and observation
36 Forward Algorithm t (j) =P (o 1,o 2...o t,q t = j ) Initialization 1 (j) = j b j (o i ) 1 apple j apple N Recursion t (j) = Termination P (O )= NX t 1 (i)a ij b j (o t ) 1 apple j apple N,2 apple t apple T i=1 NX T (i) i=1 q 1 a 1j q 2 a 2j q 3 a 3j q j.... q N t 1 (i) a Nj t (j)
37 Forward Algorithm O = find P (O )
38 Forward Algorithm Static states Bear Bull t=1 t=2 t=3 time
39 Forward Algorithm: Initialization 1 (j) = j b j (o i ) 1 apple j apple N Static α 1 (Static) =0.09 states Bear α 1 (Bear) =0.05 Bull α 1 (Bull) =0.14 t=1 t=2 t=3 time
40 Forward Algorithm: Recursion t (j) = NX t 1 (i)a ij b j (o t ) 1 apple j apple N,2 apple t apple T i=1 Static =0.09 states Bear =0.05 X... and so on Bull = = α 1 (Bull) a BullBull b Bull ( ) t=1 t=2 t=3 time
41 Forward Algorithm: Recursion Static = states Bear = Bull = t=1 t=2 t=3 time
42 Forward Algorithm: Termination P (O )= NX T (i) i=1 Static = states Bear = X Bull = t=1 t=2 t=3 time P(O) =
43 HMM Problem #2: Decoding
44 Decoding π 1 =0.5 π 2 =0.2 π 3 =0.3 t O Given this model of the stock market, what are the most likely states the market went through to produce O?
45 Decoding Decoding because states are hidden First try: l Compute P(O) for all possible state sequences, then choose sequence with highest probability l What s the problem here? Second try: l For each possible hidden state sequence, compute P(O) using the forward algorithm l What s the problem here?
46 Viterbi Algorithm Decoding = computing most likely state sequence l Another dynamic programming algorithm l Efficient: polynomial vs. exponential Same idea as the forward algorithm l Store intermediate computation results in a trellis l Build new cells from existing cells
47 Viterbi Algorithm Viterbi probability l Probability of being in state j after seeing t observations and passing through the most likely state sequence so far v t (j) = Build an N T trellis max P (q 0,q 1...q t 1,o 1,o 2...o t,q t = j ) q 0,q 1,...q t 1 l Intuition: forward probability only depends on the previous state and observation
48 Viterbi vs. Forward Maximization instead of summation over previous paths This algorithm is still missing something! l In forward algorithm, we only care about the probabilities l What s different here? We need to store the most likely path (transition): l Use backpointers to keep track of most likely transition l At the end, follow the chain of backpointers to recover the most likely state sequence
49 Viterbi Algorithm: Formal Definition Initialization v 1 (j) = j b j (o 1 ) Bt 1 (j) =; 1 apple j apple N 1 apple j apple N Recursion v t (j) = Bt t (j) = arg Termination P = q T = arg N max i=1 [v t 1(i)a ij ]b j (o t ) 1 apple j apple N,2 apple t apple T N max j=1 v T (j) N max i=1 [v t 1(i)a ij ] 1 apple j apple N,2 apple t apple T N max j=1 v T (j) Why no b()?
50 Viterbi Algorithm O = find most likely state sequence
51 Viterbi Algorithm Static states Bear Bull t=1 t=2 t=3 time
52 Viterbi Algorithm: Initialization v 1 (j) = j b j (o 1 ) 1 apple j apple N Bt 1 (j) =; 1 apple j apple N Static v 1 (Static) =0.09 states Bear v 1 (Bear) =0.05 Bull v 1 (Bull) =0.14 t=1 t=2 t=3 time
53 Viterbi Algorithm: Recursion v t (j) = Bt t (j) = arg N max i=1 [v t 1(i)a ij ]b j (o t ) 1 apple j apple N,2 apple t apple T N max i=1 [v t 1(i)a ij ] 1 apple j apple N,2 apple t apple T Static =0.09 states Bear =0.05 Max Bull = = v 1 (Bull) a BullBull b Bull ( ) t=1 t=2 t=3 time
54 Viterbi Algorithm: Recursion v t (j) = Bt t (j) = arg N max i=1 [v t 1(i)a ij ]b j (o t ) 1 apple j apple N,2 apple t apple T N max i=1 [v t 1(i)a ij ] 1 apple j apple N,2 apple t apple T Static =0.09 states Bear =0.05 store backpointer... and so on Bull = t=1 t=2 t=3 time
55 Viterbi Algorithm: Recursion Static = states Bear = Bull = t=1 t=2 t=3 time
56 Viterbi Algorithm: Termination P = q T = arg N max j=1 v T (j) N max j=1 v T (j) Static = states Bear = Bull = t=1 t=2 t=3 time
57 Viterbi Algorithm: Termination Static = Most likely state sequence: [ Bull, Bear, Bull ], P = states Bear = Bull = t=1 t=2 t=3 time
58 HMM Problem #3: Learning
59 The Problem Given training data, learn parameters for the HMM =(A, B, ) l A: transition probabilities l B: emission probabilities Two cases: l Supervised training: sequences where observations are paired with states l Unsupervised training: sequences with observations only
60 Supervised Training Easy! Just like relative frequency counting Compute maximum likelihood estimates directly from data Transition probabilities: E[a ij ]= C(i! j) P j 0 C(i! j 0 ) Emission probabilities: E[b j (v)] = C(j " v) P v 0 C(j " v 0 )
61 Supervised Training Easy! Just like relative frequency counting Remember the usual MapReduce tricks: l Pairs vs. stripes for keep track of joint counts l Combiners and in-mapper combining apply
62 Unsupervised Training Hard! Actually, it s not that bad l Pseudo-counts instead of counts l More complex bookkeeping
63 Unsupervised Training What s the fundamental problem? Chick-and-egg problem: l If we knew what the hidden variables were, then computing the model parameters would be easy l If we knew the model parameters, we d be able to compute the hidden variables (but of course, that s the whole point) Where have we seen this before?
64 EM to the Rescue! Start with initial parameters Iterate until convergence: l E-step: Compute posterior distribution over latent (hidden) variables given the model parameters l M-step: Update model parameters using posterior distribution computed in the E-step How does this work for HMMs? First, we need one more definition
65 Backward Algorithm Backward probability l Probability of seeing observations from time t+1 to T given that we re in state j at time t t(j) =P (o t+1,o t+2...o T q t = i, ) Guess what? Build an N T trellis
66 Backward Algorithm t(j) =P (o t+1,o t+2...o T q t = j, ) Initialization T (j) =1 1apple j apple N Recursion t(j) = Termination P (O )= NX a ji b i (o t+1 ) t+1 (i) i=1 NX j b j (o 1 ) 1 (j) j=1 1 apple j apple N,1 apple t<t a j1 a j2 a j3 q j q 1 q 2 q 3 a jn.... q N t(j) t+1(i)
67 Backward Algorithm T (j) =1 1apple j apple N Static states Bear Bull t=1 t=2 t=3 time
68 Backward Algorithm: Initialization Static 1.0 states Bear 1.0 Bull 1.0 t=1 t=2 t=3 time
69 Backward Algorithm: Recursion t(j) = NX a ji b i (o t+1 ) t+1 (i) i=1 1 apple j apple N,1 apple t<t Static states Bear... and so on 1.0 Bull 1.0 t=1 t=2 t=3 time
70 Backward Algorithm: Recursion Static states Bear Bull t=1 t=2 t=3 time
71 Forward-Backward Forward probability l Probability of being in state j after t observations t (j) =P (o 1,o 2...o t,q t = j ) Backward probability l Probability of seeing observations from time t+1 to T given that we re in state j at time t t(j) =P (o t+1,o t+2...o T q t = i, ) Neat Observation: P (O )= NX t (j) t (j) j=1
72 Forward-Backward P (O )= NX t (j) t (j) j=1 Static states Bear Bull P (O )= t=1 t=2 t=3 NX j b j (o 1 ) 1 (j) j=1 time
73 Forward-Backward t (j) =P (o 1,o 2...o t,q t = j ) t(j) =P (o t+1,o t+2...o T q t = i, ).... q j.... t (j) t(j) o t 1 o t o t+1
74 Estimating Emissions Probabilities Basic idea: b j (v k ) = expected number of times in state j and observing symbol v k expected number of times in state j Let s define: Thus: t(j) = P (q t = j, O ) P (O ) ˆbj (v k )= P T i=1\o t =v k P T i=1 t(j) = t(j) t (j) P (O ) t(j)
75 Forward-Backward a ij b j (o t+1 ).... q i q j.... t (i) t+1(j) o t 1 o t o t+1 o t+2
76 Estimating Transition Probabilities Basic idea: a ij = expected number of transitions from state i to state j expected number of transitions from state i Let s define: Thus: t (i, j) = t(i)a ij b j (o t+1 ) t+1 (j) P (O ) â ij = P T 1 t=1 t(i, j) P T 1 t=1 P N j=1 t(i, j)
77 MapReduce Implementation: Mapper 1: class Mapper 2: method Initialize(integer iteration) P T 3: hs, Oi ReadModel i=1\o 4: ha, B, i ReadModelParams(iteration) ˆbj (v k )= t =v k P T 5: method Map(sample id, sequence x) i=1 6: Forward(x, ). cf. Section P6.2.2 T 1 7: Backward(x, ). âcf. ij Section = P : I new AssociativeArray. Initial state expectations T 1 9: for all q 2S do. Loop over states 10: I{q} 1 (q) 1(q) 11: O new AssociativeArray of AssociativeArray. Emissions 12: for t =1to x do. Loop over observations 13: for all q 2S do. Loop over states 14: O{q}{x t } O{q}{x t } + t (q) t(q) 15: t t +1 16: T new AssociativeArray of AssociativeArray. Transitions 17: for t =1to x 1 do. Loop over observations 18: for all q 2S do. Loop over states 19: for all r 2S do. Loop over states 20: T {q}{r} T {q}{r} + t (q) A q (r) B r (x t+1 ) t+1(r) 21: t t +1 22: Emit(string initial, stripe I) 23: for all q 2S do. Loop over states 24: Emit(string emit from + q, stripe O{q}) 25: Emit(string transit from + q, stripe T {q}) t(j) t(j) t=1 t(i, j) t=1 P N j=1 t(i, j) t(j) = t(j) t (j) P (O ) t (i, j) = t(i)a ij b j (o t+1 ) t+1 (j) P (O )
78 MapReduce Implementation: Reducer 1: class Combiner 2: method Combine(string t, stripes [C 1,C 2,...]) 3: C f new AssociativeArray 4: for all stripe C 2 stripes [C 1,C 2,...] do 5: Sum(C f,c) 6: Emit(string t, stripe C f ) 1: class Reducer 2: method Reduce(string t, stripes [C 1,C 2,...]) 3: C f new AssociativeArray 4: for all stripe C 2 stripes [C 1,C 2,...] do 5: Sum(C f,c) 6: z 0 7: for all hk, vi 2C f do 8: z z + v 9: P f new AssociativeArray. Final parameters vector 10: for all hk, vi 2C f do 11: P f {k} v/z 12: Emit(string t, stripe P f ) ˆbj (v k )= â ij = P T i=1\o t =v k P T i=1 t(j) t(j) P T 1 t=1 t(i, j) P T 1 t=1 P N j=1 t(i, j) t(j) = t(j) t (j) P (O ) t (i, j) = t(i)a ij b j (o t+1 ) t+1 (j) P (O )
79 Implementation Notes Standard setup of iterative MapReduce algorithms l Driver program sets up MapReduce job l Waits for completion l Checks for convergence l Repeats if necessary Additional details: l Must load and serialize model parameters at each iteration l Reducer receives 2N + 1 keys, so limits to reducer parallelization l Iteration overhead less than other iterative algorithms
80 Questions? Source: Wikipedia (Japanese rock garden)
81 Midterm
82 Final Projects Anything in the big data space Teams of 2-3 people Available data resources Available cluster resources Project Ideas?
CMSC 723: Computational Linguistics I Session #5 Hidden Markov Models. The ischool University of Maryland. Wednesday, September 30, 2009
CMSC 723: Computational Linguistics I Session #5 Hidden Markov Models Jimmy Lin The ischool University of Maryland Wednesday, September 30, 2009 Today s Agenda The great leap forward in NLP Hidden Markov
More informationSequence Labeling: HMMs & Structured Perceptron
Sequence Labeling: HMMs & Structured Perceptron CMSC 723 / LING 723 / INST 725 MARINE CARPUAT marine@cs.umd.edu HMM: Formal Specification Q: a finite set of N states Q = {q 0, q 1, q 2, q 3, } N N Transition
More informationToday s Agenda. Need to cover lots of background material. Now on to the Map Reduce stuff. Rough conceptual sketch of unsupervised training using EM
Today s Agenda Need to cover lots of background material l Introduction to Statistical Models l Hidden Markov Models l Part of Speech Tagging l Applying HMMs to POS tagging l Expectation-Maximization (EM)
More informationHidden Markov Models The three basic HMM problems (note: change in notation) Mitch Marcus CSE 391
Hidden Markov Models The three basic HMM problems (note: change in notation) Mitch Marcus CSE 391 Parameters of an HMM States: A set of states S=s 1, s n Transition probabilities: A= a 1,1, a 1,2,, a n,n
More informationMachine Learning for natural language processing
Machine Learning for natural language processing Hidden Markov Models Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Summer 2016 1 / 33 Introduction So far, we have classified texts/observations
More informationBasic Text Analysis. Hidden Markov Models. Joakim Nivre. Uppsala University Department of Linguistics and Philology
Basic Text Analysis Hidden Markov Models Joakim Nivre Uppsala University Department of Linguistics and Philology joakimnivre@lingfiluuse Basic Text Analysis 1(33) Hidden Markov Models Markov models are
More informationMachine Learning & Data Mining Caltech CS/CNS/EE 155 Hidden Markov Models Last Updated: Feb 7th, 2017
1 Introduction Let x = (x 1,..., x M ) denote a sequence (e.g. a sequence of words), and let y = (y 1,..., y M ) denote a corresponding hidden sequence that we believe explains or influences x somehow
More informationComputational Genomics and Molecular Biology, Fall
Computational Genomics and Molecular Biology, Fall 2011 1 HMM Lecture Notes Dannie Durand and Rose Hoberman October 11th 1 Hidden Markov Models In the last few lectures, we have focussed on three problems
More informationBasic math for biology
Basic math for biology Lei Li Florida State University, Feb 6, 2002 The EM algorithm: setup Parametric models: {P θ }. Data: full data (Y, X); partial data Y. Missing data: X. Likelihood and maximum likelihood
More informationSTA 414/2104: Machine Learning
STA 414/2104: Machine Learning Russ Salakhutdinov Department of Computer Science! Department of Statistics! rsalakhu@cs.toronto.edu! http://www.cs.toronto.edu/~rsalakhu/ Lecture 9 Sequential Data So far
More informationHidden Markov Models and Gaussian Mixture Models
Hidden Markov Models and Gaussian Mixture Models Hiroshi Shimodaira and Steve Renals Automatic Speech Recognition ASR Lectures 4&5 23&27 January 2014 ASR Lectures 4&5 Hidden Markov Models and Gaussian
More information10. Hidden Markov Models (HMM) for Speech Processing. (some slides taken from Glass and Zue course)
10. Hidden Markov Models (HMM) for Speech Processing (some slides taken from Glass and Zue course) Definition of an HMM The HMM are powerful statistical methods to characterize the observed samples of
More informationLecture 12: Algorithms for HMMs
Lecture 12: Algorithms for HMMs Nathan Schneider (some slides from Sharon Goldwater; thanks to Jonathan May for bug fixes) ENLP 17 October 2016 updated 9 September 2017 Recap: tagging POS tagging is a
More informationHidden Markov Models
Hidden Markov Models Slides mostly from Mitch Marcus and Eric Fosler (with lots of modifications). Have you seen HMMs? Have you seen Kalman filters? Have you seen dynamic programming? HMMs are dynamic
More informationLecture 12: Algorithms for HMMs
Lecture 12: Algorithms for HMMs Nathan Schneider (some slides from Sharon Goldwater; thanks to Jonathan May for bug fixes) ENLP 26 February 2018 Recap: tagging POS tagging is a sequence labelling task.
More informationPart of Speech Tagging: Viterbi, Forward, Backward, Forward- Backward, Baum-Welch. COMP-599 Oct 1, 2015
Part of Speech Tagging: Viterbi, Forward, Backward, Forward- Backward, Baum-Welch COMP-599 Oct 1, 2015 Announcements Research skills workshop today 3pm-4:30pm Schulich Library room 313 Start thinking about
More informationHidden Markov Models Hamid R. Rabiee
Hidden Markov Models Hamid R. Rabiee 1 Hidden Markov Models (HMMs) In the previous slides, we have seen that in many cases the underlying behavior of nature could be modeled as a Markov process. However
More informationSTA 4273H: Statistical Machine Learning
STA 4273H: Statistical Machine Learning Russ Salakhutdinov Department of Statistics! rsalakhu@utstat.toronto.edu! http://www.utstat.utoronto.ca/~rsalakhu/ Sidney Smith Hall, Room 6002 Lecture 11 Project
More informationStatistical NLP: Hidden Markov Models. Updated 12/15
Statistical NLP: Hidden Markov Models Updated 12/15 Markov Models Markov models are statistical tools that are useful for NLP because they can be used for part-of-speech-tagging applications Their first
More informationHidden Markov Models. Aarti Singh Slides courtesy: Eric Xing. Machine Learning / Nov 8, 2010
Hidden Markov Models Aarti Singh Slides courtesy: Eric Xing Machine Learning 10-701/15-781 Nov 8, 2010 i.i.d to sequential data So far we assumed independent, identically distributed data Sequential data
More informationCISC 889 Bioinformatics (Spring 2004) Hidden Markov Models (II)
CISC 889 Bioinformatics (Spring 24) Hidden Markov Models (II) a. Likelihood: forward algorithm b. Decoding: Viterbi algorithm c. Model building: Baum-Welch algorithm Viterbi training Hidden Markov models
More informationCSC401/2511 Spring CSC401/2511 Natural Language Computing Spring 2019 Lecture 5 Frank Rudzicz and Chloé Pou-Prom University of Toronto
CSC401/2511 Natural Language Computing Spring 2019 Lecture 5 Frank Rudzicz and Chloé Pou-Prom University of Toronto Revisiting PoS tagging Will/MD the/dt chair/nn chair/?? the/dt meeting/nn from/in that/dt
More informationRecap: HMM. ANLP Lecture 9: Algorithms for HMMs. More general notation. Recap: HMM. Elements of HMM: Sharon Goldwater 4 Oct 2018.
Recap: HMM ANLP Lecture 9: Algorithms for HMMs Sharon Goldwater 4 Oct 2018 Elements of HMM: Set of states (tags) Output alphabet (word types) Start state (beginning of sentence) State transition probabilities
More informationHidden Markov Model. Ying Wu. Electrical Engineering and Computer Science Northwestern University Evanston, IL 60208
Hidden Markov Model Ying Wu Electrical Engineering and Computer Science Northwestern University Evanston, IL 60208 http://www.eecs.northwestern.edu/~yingwu 1/19 Outline Example: Hidden Coin Tossing Hidden
More informationStatistical Methods for NLP
Statistical Methods for NLP Information Extraction, Hidden Markov Models Sameer Maskey Week 5, Oct 3, 2012 *many slides provided by Bhuvana Ramabhadran, Stanley Chen, Michael Picheny Speech Recognition
More informationCOMP90051 Statistical Machine Learning
COMP90051 Statistical Machine Learning Semester 2, 2017 Lecturer: Trevor Cohn 24. Hidden Markov Models & message passing Looking back Representation of joint distributions Conditional/marginal independence
More informationHidden Markov Models. By Parisa Abedi. Slides courtesy: Eric Xing
Hidden Markov Models By Parisa Abedi Slides courtesy: Eric Xing i.i.d to sequential data So far we assumed independent, identically distributed data Sequential (non i.i.d.) data Time-series data E.g. Speech
More informationIntroduction to Machine Learning CMU-10701
Introduction to Machine Learning CMU-10701 Hidden Markov Models Barnabás Póczos & Aarti Singh Slides courtesy: Eric Xing i.i.d to sequential data So far we assumed independent, identically distributed
More informationDynamic Programming: Hidden Markov Models
University of Oslo : Department of Informatics Dynamic Programming: Hidden Markov Models Rebecca Dridan 16 October 2013 INF4820: Algorithms for AI and NLP Topics Recap n-grams Parts-of-speech Hidden Markov
More informationNatural Language Processing Prof. Pushpak Bhattacharyya Department of Computer Science & Engineering, Indian Institute of Technology, Bombay
Natural Language Processing Prof. Pushpak Bhattacharyya Department of Computer Science & Engineering, Indian Institute of Technology, Bombay Lecture - 21 HMM, Forward and Backward Algorithms, Baum Welch
More informationParametric Models Part III: Hidden Markov Models
Parametric Models Part III: Hidden Markov Models Selim Aksoy Department of Computer Engineering Bilkent University saksoy@cs.bilkent.edu.tr CS 551, Spring 2014 CS 551, Spring 2014 c 2014, Selim Aksoy (Bilkent
More informationLecture 11: Hidden Markov Models
Lecture 11: Hidden Markov Models Cognitive Systems - Machine Learning Cognitive Systems, Applied Computer Science, Bamberg University slides by Dr. Philip Jackson Centre for Vision, Speech & Signal Processing
More informationStatistical Machine Learning from Data
Samy Bengio Statistical Machine Learning from Data Statistical Machine Learning from Data Samy Bengio IDIAP Research Institute, Martigny, Switzerland, and Ecole Polytechnique Fédérale de Lausanne (EPFL),
More informationStatistical Pattern Recognition
Statistical Pattern Recognition Expectation Maximization (EM) and Mixture Models Hamid R. Rabiee Jafar Muhammadi, Mohammad J. Hosseini Spring 2014 http://ce.sharif.edu/courses/92-93/2/ce725-2 Agenda Expectation-maximization
More informationorder is number of previous outputs
Markov Models Lecture : Markov and Hidden Markov Models PSfrag Use past replacements as state. Next output depends on previous output(s): y t = f[y t, y t,...] order is number of previous outputs y t y
More informationLecture 3: ASR: HMMs, Forward, Viterbi
Original slides by Dan Jurafsky CS 224S / LINGUIST 285 Spoken Language Processing Andrew Maas Stanford University Spring 2017 Lecture 3: ASR: HMMs, Forward, Viterbi Fun informative read on phonetics The
More informationHidden Markov Models. Terminology, Representation and Basic Problems
Hidden Markov Models Terminology, Representation and Basic Problems Data analysis? Machine learning? In bioinformatics, we analyze a lot of (sequential) data (biological sequences) to learn unknown parameters
More informationMath 350: An exploration of HMMs through doodles.
Math 350: An exploration of HMMs through doodles. Joshua Little (407673) 19 December 2012 1 Background 1.1 Hidden Markov models. Markov chains (MCs) work well for modelling discrete-time processes, or
More informationHidden Markov Modelling
Hidden Markov Modelling Introduction Problem formulation Forward-Backward algorithm Viterbi search Baum-Welch parameter estimation Other considerations Multiple observation sequences Phone-based models
More information8: Hidden Markov Models
8: Hidden Markov Models Machine Learning and Real-world Data Helen Yannakoudakis 1 Computer Laboratory University of Cambridge Lent 2018 1 Based on slides created by Simone Teufel So far we ve looked at
More informationDynamic Approaches: The Hidden Markov Model
Dynamic Approaches: The Hidden Markov Model Davide Bacciu Dipartimento di Informatica Università di Pisa bacciu@di.unipi.it Machine Learning: Neural Networks and Advanced Models (AA2) Inference as Message
More informationHidden Markov Models. Terminology and Basic Algorithms
Hidden Markov Models Terminology and Basic Algorithms What is machine learning? From http://en.wikipedia.org/wiki/machine_learning Machine learning, a branch of artificial intelligence, is about the construction
More informationp(d θ ) l(θ ) 1.2 x x x
p(d θ ).2 x 0-7 0.8 x 0-7 0.4 x 0-7 l(θ ) -20-40 -60-80 -00 2 3 4 5 6 7 θ ˆ 2 3 4 5 6 7 θ ˆ 2 3 4 5 6 7 θ θ x FIGURE 3.. The top graph shows several training points in one dimension, known or assumed to
More informationLecture 7 Sequence analysis. Hidden Markov Models
Lecture 7 Sequence analysis. Hidden Markov Models Nicolas Lartillot may 2012 Nicolas Lartillot (Universite de Montréal) BIN6009 may 2012 1 / 60 1 Motivation 2 Examples of Hidden Markov models 3 Hidden
More informationHidden Markov Models. Terminology and Basic Algorithms
Hidden Markov Models Terminology and Basic Algorithms The next two weeks Hidden Markov models (HMMs): Wed 9/11: Terminology and basic algorithms Mon 14/11: Implementing the basic algorithms Wed 16/11:
More informationA Higher-Order Interactive Hidden Markov Model and Its Applications Wai-Ki Ching Department of Mathematics The University of Hong Kong
A Higher-Order Interactive Hidden Markov Model and Its Applications Wai-Ki Ching Department of Mathematics The University of Hong Kong Abstract: In this talk, a higher-order Interactive Hidden Markov Model
More informationAutomatic Speech Recognition (CS753)
Automatic Speech Recognition (S753) Lecture 5: idden Markov Models (Part I) Instructor: Preethi Jyothi Lecture 5 OpenFst heat Sheet Quick Intro to OpenFst (www.openfst.org) a 0 label is 0 an 1 2 reserved
More informationPage 1. References. Hidden Markov models and multiple sequence alignment. Markov chains. Probability review. Example. Markovian sequence
Page Hidden Markov models and multiple sequence alignment Russ B Altman BMI 4 CS 74 Some slides borrowed from Scott C Schmidler (BMI graduate student) References Bioinformatics Classic: Krogh et al (994)
More informationLecture 12: EM Algorithm
Lecture 12: EM Algorithm Kai-Wei hang S @ University of Virginia kw@kwchang.net ouse webpage: http://kwchang.net/teaching/nlp16 S6501 Natural Language Processing 1 Three basic problems for MMs v Likelihood
More informationHidden Markov Models NIKOLAY YAKOVETS
Hidden Markov Models NIKOLAY YAKOVETS A Markov System N states s 1,..,s N S 2 S 1 S 3 A Markov System N states s 1,..,s N S 2 S 1 S 3 modeling weather A Markov System state changes over time.. S 1 S 2
More informationP(t w) = arg maxp(t, w) (5.1) P(t,w) = P(t)P(w t). (5.2) The first term, P(t), can be described using a language model, for example, a bigram model:
Chapter 5 Text Input 5.1 Problem In the last two chapters we looked at language models, and in your first homework you are building language models for English and Chinese to enable the computer to guess
More informationSequence Modelling with Features: Linear-Chain Conditional Random Fields. COMP-599 Oct 6, 2015
Sequence Modelling with Features: Linear-Chain Conditional Random Fields COMP-599 Oct 6, 2015 Announcement A2 is out. Due Oct 20 at 1pm. 2 Outline Hidden Markov models: shortcomings Generative vs. discriminative
More informationCS 136a Lecture 7 Speech Recognition Architecture: Training models with the Forward backward algorithm
+ September13, 2016 Professor Meteer CS 136a Lecture 7 Speech Recognition Architecture: Training models with the Forward backward algorithm Thanks to Dan Jurafsky for these slides + ASR components n Feature
More informationLinear Dynamical Systems
Linear Dynamical Systems Sargur N. srihari@cedar.buffalo.edu Machine Learning Course: http://www.cedar.buffalo.edu/~srihari/cse574/index.html Two Models Described by Same Graph Latent variables Observations
More informationLecture 4: Hidden Markov Models: An Introduction to Dynamic Decision Making. November 11, 2010
Hidden Lecture 4: Hidden : An Introduction to Dynamic Decision Making November 11, 2010 Special Meeting 1/26 Markov Model Hidden When a dynamical system is probabilistic it may be determined by the transition
More informationStatistical Methods for NLP
Statistical Methods for NLP Sequence Models Joakim Nivre Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se Statistical Methods for NLP 1(21) Introduction Structured
More informationStatistical Pattern Recognition
Statistical Pattern Recognition Expectation Maximization (EM) and Mixture Models Hamid R. Rabiee Jafar Muhammadi, Mohammad J. Hosseini Spring 203 http://ce.sharif.edu/courses/9-92/2/ce725-/ Agenda Expectation-maximization
More informationStatistical Sequence Recognition and Training: An Introduction to HMMs
Statistical Sequence Recognition and Training: An Introduction to HMMs EECS 225D Nikki Mirghafori nikki@icsi.berkeley.edu March 7, 2005 Credit: many of the HMM slides have been borrowed and adapted, with
More informationWhat s an HMM? Extraction with Finite State Machines e.g. Hidden Markov Models (HMMs) Hidden Markov Models (HMMs) for Information Extraction
Hidden Markov Models (HMMs) for Information Extraction Daniel S. Weld CSE 454 Extraction with Finite State Machines e.g. Hidden Markov Models (HMMs) standard sequence model in genomics, speech, NLP, What
More information6.864: Lecture 5 (September 22nd, 2005) The EM Algorithm
6.864: Lecture 5 (September 22nd, 2005) The EM Algorithm Overview The EM algorithm in general form The EM algorithm for hidden markov models (brute force) The EM algorithm for hidden markov models (dynamic
More informationO 3 O 4 O 5. q 3. q 4. Transition
Hidden Markov Models Hidden Markov models (HMM) were developed in the early part of the 1970 s and at that time mostly applied in the area of computerized speech recognition. They are first described in
More informationHidden Markov Models and Gaussian Mixture Models
Hidden Markov Models and Gaussian Mixture Models Hiroshi Shimodaira and Steve Renals Automatic Speech Recognition ASR Lectures 4&5 25&29 January 2018 ASR Lectures 4&5 Hidden Markov Models and Gaussian
More informationHidden Markov Models
Andrea Passerini passerini@disi.unitn.it Statistical relational learning The aim Modeling temporal sequences Model signals which vary over time (e.g. speech) Two alternatives: deterministic models directly
More information6.047/6.878/HST.507 Computational Biology: Genomes, Networks, Evolution. Lecture 05. Hidden Markov Models Part II
6.047/6.878/HST.507 Computational Biology: Genomes, Networks, Evolution Lecture 05 Hidden Markov Models Part II 1 2 Module 1: Aligning and modeling genomes Module 1: Computational foundations Dynamic programming:
More informationSequence labeling. Taking collective a set of interrelated instances x 1,, x T and jointly labeling them
HMM, MEMM and CRF 40-957 Special opics in Artificial Intelligence: Probabilistic Graphical Models Sharif University of echnology Soleymani Spring 2014 Sequence labeling aking collective a set of interrelated
More informationSTATS 306B: Unsupervised Learning Spring Lecture 5 April 14
STATS 306B: Unsupervised Learning Spring 2014 Lecture 5 April 14 Lecturer: Lester Mackey Scribe: Brian Do and Robin Jia 5.1 Discrete Hidden Markov Models 5.1.1 Recap In the last lecture, we introduced
More informationWe Live in Exciting Times. CSCI-567: Machine Learning (Spring 2019) Outline. Outline. ACM (an international computing research society) has named
We Live in Exciting Times ACM (an international computing research society) has named CSCI-567: Machine Learning (Spring 2019) Prof. Victor Adamchik U of Southern California Apr. 2, 2019 Yoshua Bengio,
More informationClustering. Professor Ameet Talwalkar. Professor Ameet Talwalkar CS260 Machine Learning Algorithms March 8, / 26
Clustering Professor Ameet Talwalkar Professor Ameet Talwalkar CS26 Machine Learning Algorithms March 8, 217 1 / 26 Outline 1 Administration 2 Review of last lecture 3 Clustering Professor Ameet Talwalkar
More informationHidden Markov Models: All the Glorious Gory Details
Hidden Markov Models: All the Glorious Gory Details Noah A. Smith Department of Computer Science Johns Hopkins University nasmith@cs.jhu.edu 18 October 2004 1 Introduction Hidden Markov models (HMMs, hereafter)
More informationProbabilistic Graphical Models Homework 2: Due February 24, 2014 at 4 pm
Probabilistic Graphical Models 10-708 Homework 2: Due February 24, 2014 at 4 pm Directions. This homework assignment covers the material presented in Lectures 4-8. You must complete all four problems to
More informationDept. of Linguistics, Indiana University Fall 2009
1 / 14 Markov L645 Dept. of Linguistics, Indiana University Fall 2009 2 / 14 Markov (1) (review) Markov A Markov Model consists of: a finite set of statesω={s 1,...,s n }; an signal alphabetσ={σ 1,...,σ
More informationAn Introduction to Bioinformatics Algorithms Hidden Markov Models
Hidden Markov Models Outline 1. CG-Islands 2. The Fair Bet Casino 3. Hidden Markov Model 4. Decoding Algorithm 5. Forward-Backward Algorithm 6. Profile HMMs 7. HMM Parameter Estimation 8. Viterbi Training
More informationCS 7180: Behavioral Modeling and Decision- making in AI
CS 7180: Behavioral Modeling and Decision- making in AI Hidden Markov Models Prof. Amy Sliva October 26, 2012 Par?ally observable temporal domains POMDPs represented uncertainty about the state Belief
More informationHidden Markov Models in Language Processing
Hidden Markov Models in Language Processing Dustin Hillard Lecture notes courtesy of Prof. Mari Ostendorf Outline Review of Markov models What is an HMM? Examples General idea of hidden variables: implications
More informationLog-Linear Models, MEMMs, and CRFs
Log-Linear Models, MEMMs, and CRFs Michael Collins 1 Notation Throughout this note I ll use underline to denote vectors. For example, w R d will be a vector with components w 1, w 2,... w d. We use expx
More informationData Mining in Bioinformatics HMM
Data Mining in Bioinformatics HMM Microarray Problem: Major Objective n Major Objective: Discover a comprehensive theory of life s organization at the molecular level 2 1 Data Mining in Bioinformatics
More informationDesign and Implementation of Speech Recognition Systems
Design and Implementation of Speech Recognition Systems Spring 2013 Class 7: Templates to HMMs 13 Feb 2013 1 Recap Thus far, we have looked at dynamic programming for string matching, And derived DTW from
More informationLab 3: Practical Hidden Markov Models (HMM)
Advanced Topics in Bioinformatics Lab 3: Practical Hidden Markov Models () Maoying, Wu Department of Bioinformatics & Biostatistics Shanghai Jiao Tong University November 27, 2014 Hidden Markov Models
More information1. Markov models. 1.1 Markov-chain
1. Markov models 1.1 Markov-chain Let X be a random variable X = (X 1,..., X t ) taking values in some set S = {s 1,..., s N }. The sequence is Markov chain if it has the following properties: 1. Limited
More informationMACHINE LEARNING 2 UGM,HMMS Lecture 7
LOREM I P S U M Royal Institute of Technology MACHINE LEARNING 2 UGM,HMMS Lecture 7 THIS LECTURE DGM semantics UGM De-noising HMMs Applications (interesting probabilities) DP for generation probability
More informationCSCI 5832 Natural Language Processing. Today 2/19. Statistical Sequence Classification. Lecture 9
CSCI 5832 Natural Language Processing Jim Martin Lecture 9 1 Today 2/19 Review HMMs for POS tagging Entropy intuition Statistical Sequence classifiers HMMs MaxEnt MEMMs 2 Statistical Sequence Classification
More informationCSCE 478/878 Lecture 9: Hidden. Markov. Models. Stephen Scott. Introduction. Outline. Markov. Chains. Hidden Markov Models. CSCE 478/878 Lecture 9:
Useful for modeling/making predictions on sequential data E.g., biological sequences, text, series of sounds/spoken words Will return to graphical models that are generative sscott@cse.unl.edu 1 / 27 2
More informationStephen Scott.
1 / 27 sscott@cse.unl.edu 2 / 27 Useful for modeling/making predictions on sequential data E.g., biological sequences, text, series of sounds/spoken words Will return to graphical models that are generative
More informationHidden Markov Models. x 1 x 2 x 3 x K
Hidden Markov Models 1 1 1 1 2 2 2 2 K K K K x 1 x 2 x 3 x K Viterbi, Forward, Backward VITERBI FORWARD BACKWARD Initialization: V 0 (0) = 1 V k (0) = 0, for all k > 0 Initialization: f 0 (0) = 1 f k (0)
More informationHidden Markov Models
Hidden Markov Models Slides revised and adapted to Bioinformática 55 Engª Biomédica/IST 2005 Ana Teresa Freitas Forward Algorithm For Markov chains we calculate the probability of a sequence, P(x) How
More informationLecture 9. Intro to Hidden Markov Models (finish up)
Lecture 9 Intro to Hidden Markov Models (finish up) Review Structure Number of states Q 1.. Q N M output symbols Parameters: Transition probability matrix a ij Emission probabilities b i (a), which is
More informationSpeech Recognition HMM
Speech Recognition HMM Jan Černocký, Valentina Hubeika {cernocky ihubeika}@fit.vutbr.cz FIT BUT Brno Speech Recognition HMM Jan Černocký, Valentina Hubeika, DCGM FIT BUT Brno 1/38 Agenda Recap variability
More informationHidden Markov Models
Hidden Markov Models CI/CI(CS) UE, SS 2015 Christian Knoll Signal Processing and Speech Communication Laboratory Graz University of Technology June 23, 2015 CI/CI(CS) SS 2015 June 23, 2015 Slide 1/26 Content
More informationToday s Lecture: HMMs
Today s Lecture: HMMs Definitions Examples Probability calculations WDAG Dynamic programming algorithms: Forward Viterbi Parameter estimation Viterbi training 1 Hidden Markov Models Probability models
More informationHidden Markov Models. x 1 x 2 x 3 x N
Hidden Markov Models 1 1 1 1 K K K K x 1 x x 3 x N Example: The dishonest casino A casino has two dice: Fair die P(1) = P() = P(3) = P(4) = P(5) = P(6) = 1/6 Loaded die P(1) = P() = P(3) = P(4) = P(5)
More informationHidden Markov Models,99,100! Markov, here I come!
Hidden Markov Models,99,100! Markov, here I come! 16.410/413 Principles of Autonomy and Decision-Making Pedro Santana (psantana@mit.edu) October 7 th, 2015. Based on material by Brian Williams and Emilio
More information8: Hidden Markov Models
8: Hidden Markov Models Machine Learning and Real-world Data Simone Teufel and Ann Copestake Computer Laboratory University of Cambridge Lent 2017 Last session: catchup 1 Research ideas from sentiment
More informationMultiscale Systems Engineering Research Group
Hidden Markov Model Prof. Yan Wang Woodruff School of Mechanical Engineering Georgia Institute of echnology Atlanta, GA 30332, U.S.A. yan.wang@me.gatech.edu Learning Objectives o familiarize the hidden
More informationCSCE 471/871 Lecture 3: Markov Chains and
and and 1 / 26 sscott@cse.unl.edu 2 / 26 Outline and chains models (s) Formal definition Finding most probable state path (Viterbi algorithm) Forward and backward algorithms State sequence known State
More informationMachine Learning and Bayesian Inference. Unsupervised learning. Can we find regularity in data without the aid of labels?
Machine Learning and Bayesian Inference Dr Sean Holden Computer Laboratory, Room FC6 Telephone extension 6372 Email: sbh11@cl.cam.ac.uk www.cl.cam.ac.uk/ sbh11/ Unsupervised learning Can we find regularity
More informationTemporal Modeling and Basic Speech Recognition
UNIVERSITY ILLINOIS @ URBANA-CHAMPAIGN OF CS 498PS Audio Computing Lab Temporal Modeling and Basic Speech Recognition Paris Smaragdis paris@illinois.edu paris.cs.illinois.edu Today s lecture Recognizing
More informationComputational Genomics and Molecular Biology, Fall
Computational Genomics and Molecular Biology, Fall 2014 1 HMM Lecture Notes Dannie Durand and Rose Hoberman November 6th Introduction In the last few lectures, we have focused on three problems related
More informationClustering K-means. Clustering images. Machine Learning CSE546 Carlos Guestrin University of Washington. November 4, 2014.
Clustering K-means Machine Learning CSE546 Carlos Guestrin University of Washington November 4, 2014 1 Clustering images Set of Images [Goldberger et al.] 2 1 K-means Randomly initialize k centers µ (0)
More information10/17/04. Today s Main Points
Part-of-speech Tagging & Hidden Markov Model Intro Lecture #10 Introduction to Natural Language Processing CMPSCI 585, Fall 2004 University of Massachusetts Amherst Andrew McCallum Today s Main Points
More informationHidden Markov Models
Hidden Markov Models Outline 1. CG-Islands 2. The Fair Bet Casino 3. Hidden Markov Model 4. Decoding Algorithm 5. Forward-Backward Algorithm 6. Profile HMMs 7. HMM Parameter Estimation 8. Viterbi Training
More information