{"id":931,"date":"2017-11-27T15:00:50","date_gmt":"2017-11-27T20:00:50","guid":{"rendered":"http:\/\/haleyai.com\/wordpress\/?p=931"},"modified":"2018-07-15T08:03:20","modified_gmt":"2018-07-15T13:03:20","slug":"of-kahlman-filters-and-hidden-markov-models","status":"publish","type":"post","link":"http:\/\/haleyai.com\/wordpress\/2017\/11\/27\/of-kahlman-filters-and-hidden-markov-models\/","title":{"rendered":"Of Kalman Filters and Hidden Markov Models"},"content":{"rendered":"<p>This provides some background relating to some work we did on part of speech tagging for a modest, domain-specific corpus.\u00a0 The path is from <a href=\"http:\/\/www.cs.mcgill.ca\/~colt2009\/papers\/011.pdf\">Hsu et al 2012<\/a>, which discusses spectral methods based on singular value decomposition (SVD) as a better method for learning hidden Markov models (HMM) and the use of word vectors instead of clustering to improve aspects of NLP, such as part of speech tagging.<\/p>\n<p>The use of vector representations of words for machine learning in natural language is not all that new.\u00a0 A quarter century ago, <a href=\"http:\/\/www.cs.cmu.edu\/~roni\/11761\/PreviousYearsHandouts\/classlm.pdf\">Brown et al 1992<\/a> introduced hierarchical agglomerative clustering of words based on mutual information and the use of those clusters within hidden Markov language models.\u00a0 One notable difference versus today\u2019s word vectors is that paths through the hierarchy of clusters to words at the leaves correspond to vectors of bits (i.e., Boolean features) rather than real-valued features.<\/p>\n<p><a href=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/Miller-et-al-POS-tagging-using-Brown-clusters-and-active-learning.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-932\" title=\"Miller et al POS tagging using Brown clusters and active learning\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/Miller-et-al-POS-tagging-using-Brown-clusters-and-active-learning.png\" alt=\"\" width=\"837\" height=\"577\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/Miller-et-al-POS-tagging-using-Brown-clusters-and-active-learning.png 837w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/Miller-et-al-POS-tagging-using-Brown-clusters-and-active-learning-300x206.png 300w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/citeseerx.ist.psu.edu\/viewdoc\/download?doi=10.1.1.105.9395&amp;rep=rep1&amp;type=pdf\"><!--more-->Miller et al 2004<\/a> used Brown\u2019s approach with active learning to address needs similar to those of our client, as indicated by the following from their paper:<\/p>\n<p style=\"padding-left: 30px;\">At a recent meeting, we presented name-tagging technology to a potential user. The technology had performed well in formal evaluations, had been applied successfully by several research groups, and required only annotated training examples to configure for new name classes. Nevertheless, it did not meet the user&#8217;s needs.<\/p>\n<p style=\"padding-left: 30px;\">To achieve reasonable performance, the HMM-based technology we presented required roughly 150,000 words of annotated examples, and over a million words to achieve peak accuracy. Given a typical annotation rate of 5,000 words per hour, we estimated that setting up a name finder for a new problem would take four person-days of annotation work \u2013 a period we considered reasonable. However, this user&#8217;s problems were too dynamic for that much setup time. To be useful, the system would have to be trainable in minutes or hours, not days or weeks.<\/p>\n<p>The paper demonstrates a remarkable improvement even though the approaches were limited to pairs of adjacent words (i.e., bigrams).\u00a0 Generally, the longer the n-grams used, the better HMM approaches perform.\u00a0 For example, the trigrams (i.e., sequences of 3 words) that occur in text subsume the bigrams in the text but not vice-versa, so trigrams provide more information from which to learn.<\/p>\n<p>There is a lot of literature on distributed representation of words.\u00a0 Typically, such representations are points in a high-dimensional space in which \u201csimilar\u201d words are \u201cclose\u201d.\u00a0 Such representations include <a href=\"https:\/\/www.tensorflow.org\/tutorials\/word2vec\">Word2Vec<\/a> and <a href=\"https:\/\/nlp.stanford.edu\/projects\/glove\/\">GloVe<\/a>.\u00a0 The former vectors were obtained using neural networks while the latter were derived from co-occurrence matrices.<a href=\"#_ftn1\">[1]<\/a><\/p>\n<p><a href=\"http:\/\/www.cs.columbia.edu\/~mcollins\/papers\/uai2014.pdf\">Stratos et al 2014<\/a> demonstrated a more efficient approach (than Brown clustering) which yields similar results using hierarchical agglomerative clustering of real-valued vectors produced by canonical correlation analysis (CCA).<\/p>\n<p>More recently, <a href=\"http:\/\/www.anthology.aclweb.org\/W\/W15\/W15-1511.pdf\">Stratos &amp; Collins 2015<\/a> dropped the clustering and used the \u201ceigenvectors\u201d produced by CCA to achieve excellent results.\u00a0 In that work, they also employed active learning, as in Miller et al.\u00a0 The reduction in tagging effort required to achieve excellent performance is stunning.<\/p>\n<p>Having recently implemented a vision system for 3D body tracking, I enjoyed contemplating the following statement from <a href=\"http:\/\/www.cs.mcgill.ca\/~colt2009\/papers\/011.pdf\">Hsu et al 2012<\/a>, in particular:<\/p>\n<p style=\"padding-left: 30px;\">The subspace identification methods, used in control theory, use spectral approaches to discover the relationship between hidden states and the observations.\u00a0 In this literature, the relationship is discovered for linear dynamical systems such as Kalman filters.\u00a0 The basic idea is that the relationship between observations and hidden states can often be discovered by spectral\/SVD methods correlating the past and future observations (in particular, such methods often do a CCA between the past and future observations).<\/p>\n<p>The analogy between <a href=\"https:\/\/en.wikipedia.org\/wiki\/Kalman_filter\">Kalman filtering<\/a> and HMMs is a nice one!<\/p>\n<hr size=\"1\" \/><a href=\"#_ftnref1\">[1]<\/a> from which GloVe derives the co-occurrence probabilities which are the basis for the algorithm<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This provides some background relating to some work we did on part of speech tagging for a modest, domain-specific corpus.\u00a0 The path is from Hsu et al 2012, which discusses spectral methods based on singular value decomposition (SVD) as a better method for learning hidden Markov models (HMM) and the use of word vectors instead &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/haleyai.com\/wordpress\/2017\/11\/27\/of-kahlman-filters-and-hidden-markov-models\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Of Kalman Filters and Hidden Markov Models&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[195,16],"tags":[720,727,725,726,732,733,724,736,722,728,717,730,737,718,729,734,731,735,723,721],"class_list":["post-931","post","type-post","status-publish","format-standard","hentry","category-machine-learning","category-natural-language","tag-active-learning","tag-brown-clusters","tag-canonical-correlation-analysis","tag-cca","tag-collins","tag-dhillon","tag-distributed-representation-of-words","tag-eigen","tag-glove","tag-hierarchical-agglomerative-clustering","tag-hmm","tag-hsu","tag-kalman-filter","tag-markov","tag-part-of-speech-tagging","tag-singular-value-decomposition","tag-stratos","tag-svd","tag-word-embeddings","tag-word2vec"],"_links":{"self":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/comments?post=931"}],"version-history":[{"count":10,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/931\/revisions"}],"predecessor-version":[{"id":937,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/931\/revisions\/937"}],"wp:attachment":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/media?parent=931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/categories?post=931"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/tags?post=931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}