Tagging with Hidden Markov Models CMPT 882 Final Project Chris Demwell Simon Fraser University.

Slides:



Advertisements
Similar presentations
Three Basic Problems Compute the probability of a text: P m (W 1,N ) Compute maximum probability tag sequence: arg max T 1,N P m (T 1,N | W 1,N ) Compute.
Advertisements

Three Basic Problems 1.Compute the probability of a text (observation) language modeling – evaluate alternative texts and models P m (W 1,N ) 2.Compute.
Hidden Markov Models (HMM) Rabiner’s Paper
Yasuhiro Fujiwara (NTT Cyber Space Labs)
Learning HMM parameters
Expectation Maximization
The EM algorithm LING 572 Fei Xia Week 10: 03/09/2010.
Part of Speech Tagging The DT students NN went VB to P class NN Plays VB NN well ADV NN with P others NN DT Fruit NN flies NN VB NN VB like VB P VB a DT.
Hidden Markov Models. A Hidden Markov Model consists of 1.A sequence of states {X t |t  T } = {X 1, X 2,..., X T }, and 2.A sequence of observations.
Tutorial on Hidden Markov Models.
Hidden Markov Models Bonnie Dorr Christof Monz CMSC 723: Introduction to Computational Linguistics Lecture 5 October 6, 2004.
Hidden Markov Models Adapted from Dr Catherine Sweeney-Reed’s slides.
Ch 9. Markov Models 고려대학교 자연어처리연구실 한 경 수
Statistical NLP: Lecture 11
Hidden Markov Models Theory By Johan Walters (SR 2003)
Statistical NLP: Hidden Markov Models Updated 8/12/2005.
1 Hidden Markov Models (HMMs) Probabilistic Automata Ubiquitous in Speech/Speaker Recognition/Verification Suitable for modelling phenomena which are dynamic.
Hidden Markov Models Fundamentals and applications to bioinformatics.
Hidden Markov Models in NLP
Lecture 15 Hidden Markov Models Dr. Jianjun Hu mleg.cse.sc.edu/edu/csce833 CSCE833 Machine Learning University of South Carolina Department of Computer.
Tagging with Hidden Markov Models. Viterbi Algorithm. Forward-backward algorithm Reading: Chap 6, Jurafsky & Martin Instructor: Paul Tarau, based on Rada.
GS 540 week 6. HMM basics Given a sequence, and state parameters: – Each possible path through the states has a certain probability of emitting the sequence.
Hidden Markov Model 11/28/07. Bayes Rule The posterior distribution Select k with the largest posterior distribution. Minimizes the average misclassification.
Lecture 5: Learning models using EM
Hidden Markov Models K 1 … 2. Outline Hidden Markov Models – Formalism The Three Basic Problems of HMMs Solutions Applications of HMMs for Automatic Speech.
Tagging – more details Reading: D Jurafsky & J H Martin (2000) Speech and Language Processing, Ch 8 R Dale et al (2000) Handbook of Natural Language Processing,
Forward-backward algorithm LING 572 Fei Xia 02/23/06.
Efficient Estimation of Emission Probabilities in profile HMM By Virpi Ahola et al Reviewed By Alok Datar.
Fast Temporal State-Splitting for HMM Model Selection and Learning Sajid Siddiqi Geoffrey Gordon Andrew Moore.
Hidden Markov Models. Hidden Markov Model In some Markov processes, we may not be able to observe the states directly.
Learning HMM parameters Sushmita Roy BMI/CS 576 Oct 21 st, 2014.
Hidden Markov Models CMSC 723: Computational Linguistics I ― Session #5 Jimmy Lin The iSchool University of Maryland Wednesday, September 30, 2009.
Visual Recognition Tutorial1 Markov models Hidden Markov models Forward/Backward algorithm Viterbi algorithm Baum-Welch estimation algorithm Hidden.
(Some issues in) Text Ranking. Recall General Framework Crawl – Use XML structure – Follow links to get new pages Retrieve relevant documents – Today.
EM algorithm LING 572 Fei Xia 03/02/06. Outline The EM algorithm EM for PM models Three special cases –Inside-outside algorithm –Forward-backward algorithm.
Hidden Markov Models CMSC 723: Computational Linguistics I ― Session #5 Jimmy Lin The iSchool University of Maryland Wednesday, September 30, 2009.
Cognitive Computer Vision 3R400 Kingsley Sage Room 5C16, Pevensey III
Albert Gatt Corpora and Statistical Methods Lecture 9.
Part II. Statistical NLP Advanced Artificial Intelligence Applications of HMMs and PCFGs in NLP Wolfram Burgard, Luc De Raedt, Bernhard Nebel, Lars Schmidt-Thieme.
Gaussian Mixture Model and the EM algorithm in Speech Recognition
7-Speech Recognition Speech Recognition Concepts
Segmental Hidden Markov Models with Random Effects for Waveform Modeling Author: Seyoung Kim & Padhraic Smyth Presentor: Lu Ren.
Fundamentals of Hidden Markov Model Mehmet Yunus Dönmez.
1 HMM - Part 2 Review of the last lecture The EM algorithm Continuous density HMM.
Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Part-of-Speech Tagging for Bengali with Hidden Markov Model Sandipan Dandapat,
Sequence Models With slides by me, Joshua Goodman, Fei Xia.
Hidden Markov Models CBB 231 / COMPSCI 261 part 2.
ECE 8443 – Pattern Recognition ECE 8423 – Adaptive Signal Processing Objectives: ML and Simple Regression Bias of the ML Estimate Variance of the ML Estimate.
S. Salzberg CMSC 828N 1 Three classic HMM problems 2.Decoding: given a model and an output sequence, what is the most likely state sequence through the.
NLP. Introduction to NLP Sequence of random variables that aren’t independent Examples –weather reports –text.
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Reestimation Equations Continuous Distributions.
PGM 2003/04 Tirgul 2 Hidden Markov Models. Introduction Hidden Markov Models (HMM) are one of the most common form of probabilistic graphical models,
Hidden Markov Models 1 2 K … 1 2 K … 1 2 K … … … … 1 2 K … x1x1 x2x2 x3x3 xKxK 2 1 K 2.
HMM - Part 2 The EM algorithm Continuous density HMM.
1 CSE 552/652 Hidden Markov Models for Speech Recognition Spring, 2005 Oregon Health & Science University OGI School of Science & Engineering John-Paul.
1 CS 552/652 Speech Recognition with Hidden Markov Models Winter 2011 Oregon Health & Science University Center for Spoken Language Understanding John-Paul.
1 CSE 552/652 Hidden Markov Models for Speech Recognition Spring, 2006 Oregon Health & Science University OGI School of Science & Engineering John-Paul.
1 Hidden Markov Models Hsin-min Wang References: 1.L. R. Rabiner and B. H. Juang, (1993) Fundamentals of Speech Recognition, Chapter.
Part of Speech Tagging in Context month day, year Alex Cheng Ling 575 Winter 08 Michele Banko, Robert Moore.
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Reestimation Equations Continuous Distributions.
Hidden Markov Model Parameter Estimation BMI/CS 576 Colin Dewey Fall 2015.
Hidden Markov Models. A Hidden Markov Model consists of 1.A sequence of states {X t |t  T } = {X 1, X 2,..., X T }, and 2.A sequence of observations.
Data-Intensive Computing with MapReduce Jimmy Lin University of Maryland Thursday, March 14, 2013 Session 8: Sequence Labeling This work is licensed under.
Other Models for Time Series. The Hidden Markov Model (HMM)
Visual Recognition Tutorial1 Markov models Hidden Markov models Forward/Backward algorithm Viterbi algorithm Baum-Welch estimation algorithm Hidden.
Dan Roth University of Illinois, Urbana-Champaign 7 Sequential Models Tutorial on Machine Learning in Natural.
Hidden Markov Models BMI/CS 576
LECTURE 15: REESTIMATION, EM AND MIXTURES
A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models Jeff A. Bilmes International.
A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models Jeff A. Bilmes International.
Presentation transcript:

Tagging with Hidden Markov Models CMPT 882 Final Project Chris Demwell Simon Fraser University

The Tagging Task Identification of the part of speech of each word of a corpus Supervised: Training corpus provided consisting of correctly tagged text Unsupervised: Uses only plain text

Hidden Markov Models 1 Observable states (corpus text) generated by hidden states (tags) Generative model

Hidden Markov Models 2 Model: λ = {A, B, π} A: State transition probability matrix –a i,j = probability of changing from state i to state j B: Emission probability matrix –b j,k = probability that word at location k is associated with tag j π: Intial state probability –π i = probability of starting in state i

Hidden Markov Models 3 Terms in this presentation –N: Number of hidden states in each column (distinct tags) –T: Number of columns in trellis (time ticks) –M: Number of symbols (distinct words) –O: The observation (the untagged text) –b j (t): The probability of emitting the symbol found at tick t, given state j –α t,j and β t,j : The probability of arriving at state i in time tick t, given the observation before and after tick t (respectively)

Hidden Markov Models 4 A is a NxN matrix B is a NxT matrix π is a vector of size N π1π1 π2π2 a 1,1 a 1,2 b 1,1 b 1,2

Forward Algorithm Used for calculating Likelihood quickly α t,i : The probability of arriving at trellis node (t,j) given the observation seen “so far”. Initialization –α 1,i = π i Induction α 2,2 α 1,1 α 1,2 α 1,3

Backward Algorithm Symmetrical to Forward Algorithm Initialization – β T,i =1 for all I Induction: β 1,2 β 2,1 β 2,2 β 2,3

Baum-Welch Re-estimation Calculate two new matrices of intermediate probabilities δ,γ Calculate new A, B, π given these probabilities Recalculate α and β, p(O | λ) Repeat until p(O | λ) doesn’t change much

HMM Tagging 1 Training Method –Supervised Relative Frequency Relative Frequency with further Maximum Likelihood training –Unsupervised Maximum Likelihood training with random start

HMM Tagging 2 1.Read corpus, take counts and make translation tables 2.Train HMM using BW or compute HMM using RF 3.Compute most likely hidden state sequence 4.Determine POS role that each state most likely plays

HMM Tagging: Pitfalls 1 Monolithic HMM –Relatively opaque to debugging strategies –Difficult to modularize –Significant time/space efficiency concerns –Varied techniques for prior implementations Numerical Stability –Very small probabilities likely to underflow –Log likelihood Text Chunking –Sentences? Fixed? Stream?

HMM Tagging: Pitfalls 2 State role identification –Lexicon giving p(tag | word) from supervised corpus –Unseen words –Equally likely tags for multiple states Local maxima –HMM not guaranteed to converge on correct model Initial conditions –Random –Trained –Degenerate

HMM Tagging: Prior Work 1 Cutting et al. –Elaborate reduction of complexity (ambiguity classes) –Integration of bias for tuning (lexicon choice, initial FB values) –Fixed-size text chunks, model averaging between chunks for final model –500,000 words of Brown corpus: 96% accurate after eight iterations

HMM Tagging: Prior Work 2 Merialdo –Contrasted computed (Relative Frequency) vs trained (BWRE) models –Constrained training Keep p(tag | word) constant from bootstrap corpus’ RF Keep p(tag) constant from bootstrap corpus’ RF –Constraints allow degradation, but more slowly –Constraints required extensive calculation

Constraints and HMM Tagging 1 Elworthy: Accuracy of classic trained HMM always decreases after some point From Elworthy, “Does Baum-Welch Re-Estimation Help Taggers?”

Constraints and HMM Tagging 2 Tagging: An excellent candidate for a CSP –Many degrees of freedom in naïve case –Linguistically, only some few tagging solutions are possible –HMM, like modern CSP techniques, does not make final choices in order Merialdo’s t and t-w constraints –Expensive, but helpful

Constraints and HMM Tagging 3 Obvious places to incorporate constraints –Updates to λ A, B, π Deny an update to A if tag at (t+1) should not follow tag at (t) Deny an update to B if we are confident that word at (t) should not be associated with tag at (t) Merialdo’s t and t-w constraints

Constraints and HMM Tagging 4 Obvious places to incorporate constraints –Forward-Backward calculations Some tags are linguistically impossible sequentially Deny transition probability

Constraints and HMM Tagging 5 Where to get constraints? –Grammar databases (WordNet) –Bootstrap corpus Use relative frequencies of tags to guess rules Use frequencies of words to estimate confidence Allow violations?

reMarker: Motivation reMarker, an implementation in Java of HMM tagging Support for multiple models Modular updates for constraint implementation

reMarker: The Reality HMM component too time-consuming to debug Preliminary rule implementations based on corpus RF Using Tapas Kanugo’s HMM implementation in C, externally

reMarker: Method Penn-Treebank Wall Street Journal part- of-speech tagged data Corpus handled as stream of words –Restriciton of Kanugo’s HMM implementation –Results in enormous resource requirements –Results in degradation of accuracy with increase in training data size

reMarker: Experiment Two corpora –200 words of PT WSJ Section 00 –5000 words of PT WSJ Section 00 Three training methods –Relative Frequency, computed –Supervised, but with BWRE –Unsupervised BWRE

reMarker: Results 200 word corpus 5000 word corpus Relative Frequency100%98.0% Supervised, BW estimated 80.09%50.04% Unsupervised, BW estimated 43.69%22.96%

Future Work Fix the reMarker HMM –Allow corpus chunking –Allow more complicated constraints Incorporate tighter constraints –Merialdo’s t and t-w –Possible POS for each word: WordNet Machine-learned rules

References 1.A Tutorial on Hidden Markov Models. Rakesh Dugad and U. B. Desai. Technical Report, Signal Processing and Artificial Neural Networks Laboratory, Indian Institute of Technology, SPANN Does Baum-Welch Re-estimation help taggers? (1994). David Elworthy. Proceedings of 4th ACL Conf on ANLP, Stuttgart. pp A Practical Part-of-Speech Tagger (1992). Doug Cutting, Julian Kupiec, Jan Pedersen and Penelope Sibun. In Proceedings of ANLP Tagging text with a probabilistic model (1994). Bernard Merialdo. Computational Linguistics 20(2): A Gentle Tutorial on the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models (1997). Jeff A. Bilmes, Technical Report, University of Berkeley, ICSI-TR