{"id":1578,"date":"2018-10-27T10:12:23","date_gmt":"2018-10-27T15:12:23","guid":{"rendered":"http:\/\/haleyai.com\/wordpress\/?p=1578"},"modified":"2018-10-29T08:49:04","modified_gmt":"2018-10-29T13:49:04","slug":"simon-says","status":"publish","type":"post","link":"http:\/\/haleyai.com\/wordpress\/2018\/10\/27\/simon-says\/","title":{"rendered":"Simon Says"},"content":{"rendered":"<p>Some folks use the term &#8220;automatic speech recognition&#8221;, ASR.\u00a0 I don&#8217;t like the separation between recognition and understanding, but that&#8217;s where the technology stands.<\/p>\n<p>The term ASR encourages thinking about spoken language at a technical level in which purely inductive techniques are used to generate text from an audio signal (which is hopefully some recorded speech!).<\/p>\n<p>As you may know, I am very interested in what many in ASR consider &#8220;downstream&#8221; natural language tasks.\u00a0 Nonetheless, I&#8217;ve been involved with speech since Carnegie Mellon in the eighties.\u00a0 During Haley Systems, I hired one of the Sphinx fellows who integrated Microsoft and IBM speech products with our natural language understanding software.\u00a0 Now I&#8217;m working on spoken-language understanding again&#8230;<\/p>\n<p>Most common approaches to ASR these days involve deep learning, such as Baidu&#8217;s <a href=\"https:\/\/github.com\/mozilla\/DeepSpeech\" target=\"_blank\" rel=\"noopener\">DeepSpeech<\/a>.\u00a0 If your notion of deep learning means lots of matrix algebra more than necessarily neural networks, then <a href=\"http:\/\/kaldi-asr.org\/doc\/about.html\" target=\"_blank\" rel=\"noopener\">KALDI<\/a> is also in the running, but it dates to 2011.\u00a0 KALDI is an evolution from the hidden Markov model toolkit, <a href=\"http:\/\/htk.eng.cam.ac.uk\/\" target=\"_blank\" rel=\"noopener\">HTK<\/a> (once owned by Microsoft).\u00a0 Hidden Markov models (HMM) were the basis of most speech recognition systems dating back to the eighties or so, including <a href=\"https:\/\/cmusphinx.github.io\/\" target=\"_blank\" rel=\"noopener\">Sphinx<\/a>.\u00a0 All of these are open source and freely licensed.<\/p>\n<p>As everyone knows, ASR performance has improved dramatically in the last 10 years. The primary metric for ASR performance is &#8220;word error rate&#8221; (WER).\u00a0 Most folks think of WER as the percentage of words incorrectly recognized, although it&#8217;s not that simple.\u00a0 WER can be more than 1 (e.g., if you come up with a sentence given only noise!).\u00a0 Here is a comparison published in 2011.<\/p>\n<p><a href=\"https:\/\/www.researchgate.net\/publication\/314938892_Comparing_Speech_Recognition_Systems_Microsoft_API_Google_API_And_CMU_Sphinx\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1579\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/SphinxBingGoogle.png\" alt=\"\" width=\"480\" height=\"265\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/SphinxBingGoogle.png 895w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/SphinxBingGoogle-300x166.png 300w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/SphinxBingGoogle-768x425.png 768w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/a><\/p>\n<p>Today, Google, Amazon, Microsoft and others have WER under 10% in many cases. To get there, it takes some talent and thousands of hours of training data.\u00a0 Google is best, Alexa is close, and Microsoft lags a bit in 3rd place.\u00a0 (Click the graphic for the article summarizing Vocalize.io results.)<\/p>\n<p><a href=\"https:\/\/voicebot.ai\/2018\/05\/14\/google-home-beats-amazon-echo-in-two-audio-recognition-performance-tests-but-alexa-delivers-highest-composite-score\/\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1580\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/VocalizeSummary.png\" alt=\"\" width=\"410\" height=\"95\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/VocalizeSummary.png 410w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/VocalizeSummary-300x70.png 300w\" sizes=\"auto, (max-width: 410px) 100vw, 410px\" \/><\/a><\/p>\n<p><!--more-->Even more impressive is that Google and Amazon are doing this with far-field microphones.\u00a0 Recognizing far-field speech is much harder than the clean speech that a near-field microphone, such as a high-quality headset microphone used in prior speech recognition benchmarking.<\/p>\n<p>These numbers are better than Google and Amazon perform in regular usage tests, however.\u00a0 For example, using Alexa, you can say &#8220;Simon Says&#8221;, and it will read back what it thinks it heard.\u00a0 Try a couple 10 word sentences and you&#8217;ll probably conclude that Alexa has a WER of 10% or so (again, WER is not a percentage, but everyone treats it that way).\u00a0\u00a0 Google messes up roughly as much in my experience.\u00a0 I use Cortana (actually, Microsoft Cognitive Services, formerly known as Bing Speech) more and find it generally acceptable, although, as shown above, lagging behind Amazon and Google.\u00a0 I simply don&#8217;t know about Siri since I talk to array microphones of various sorts and at various distances, not into an iPhone mic or headset.<\/p>\n<p>I suspect that the numbers above are unrealistically good from Amazon and Google because of the test cases.\u00a0 An utterance like &#8220;what time is it&#8221;, is pretty short and easy to model with a statistical language model.\u00a0\u00a0 It also helps that you prime the system by saying, &#8220;Alexa&#8221; or &#8220;Hey, whats-your-name&#8221;.\u00a0 More natural dialog without such &#8220;keyword spotting&#8221; is more challenging.\u00a0\u00a0\u00a0 You&#8217;re more like to say &#8220;uh&#8221; in a natural dialog than after you say, &#8220;Hey Google&#8221;.\u00a0 And, as you get into more natural utterances, they get longer and statistical language modelling does not help as much.<\/p>\n<p style=\"padding-left: 30px;\">Indeed, statistical language modeling can increase errors.\u00a0 Language models are used in &#8220;decoding&#8221; the time-series of parameters estimated by an acoustic model which encodes the speech signal.\u00a0\u00a0\u00a0 Most ASRs decode using n-gram language models.\u00a0 Roughly speaking, if you have a language model that counts how many times each sequence of 4words is encountered in a corpus you can use it to guide or bias a best-first or beam-search towards a decoding that is &#8220;most consistent&#8221; with the corpus.\u00a0 If 4 words uttered do not occur in the corpus, decoding needs to estimate that 4-gram&#8217;s consistency with the corpus.\u00a0 The most common approach to doing so is by &#8220;backing off&#8221; to the consistency of 3 words and interpolating with respect to the 4th word.\u00a0 There&#8217;s been a lot of work in this area over several decades, but it&#8217;s been pretty stable since <a href=\"https:\/\/github.com\/kpu\/kenlm\" target=\"_blank\" rel=\"noopener\">KenLM<\/a>, which is used in many state of are deep learning systems.\u00a0 The references of that paper lead to improved Knesser-Ney smoothing for the estimation problem.\u00a0 It is clear to me that Google does better.\u00a0 DeepSpeech uses KenLM and I observe the limitations of Knesser-Ney backoff leading to higher WER.\u00a0 As this has become quite technical, I will spare you the details!<\/p>\n<p>It takes a lot of data to get anywhere near the far-field performance of Google and Amazon (or the near-field performance of Google and Apple), as shown by DeepSpeech numbers (again, click on the image for the PDF).<\/p>\n<p><a href=\"https:\/\/arxiv.org\/abs\/1512.02595v1\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1583\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/DeepSpeech2TrainingData.png\" alt=\"\" width=\"424\" height=\"142\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/DeepSpeech2TrainingData.png 424w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/DeepSpeech2TrainingData-300x100.png 300w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/a><\/p>\n<p>Google has a large edge over Amazon on data, thanks to its Android market penetration and tenure.\u00a0 Amazon had the lead with Echo, but Google has closed that gap this year.<\/p>\n<p>All the rest of us working on ASR have data envy.\u00a0 In\u00a0 the table above, 80% of the data is Baidu&#8217;s!\u00a0 It&#8217;s hard for anyone to compete with these big players in WER metrics without many times the data that&#8217;s publicly available.\u00a0 Fortunately, we have the models made available by Baidu.\u00a0 Unfortunately, anyone who leverages their model is also stuck with it!<\/p>\n<p>Fortunately, there a folks like Daniel Povey.\u00a0 He is behind KALDI (and an open spoken-language resources <a href=\"http:\/\/www.openslr.org\" target=\"_blank\" rel=\"noopener\">web site<\/a>).\u00a0 As you can see on &#8220;<a href=\"https:\/\/github.com\/syhw\/wer_are_we\" target=\"_blank\" rel=\"noopener\">WER: where are we<\/a>&#8220;, his <a href=\"http:\/\/www.danielpovey.com\/files\/2018_interspeech_tdnnf.pdf\" target=\"_blank\" rel=\"noopener\">2018 paper combining time-delay neural networks (TDNN) with KALDI<\/a> performs much better than DeepSpeech on the LibriSpeech test.\u00a0 This was accomplished with publicly available data (roughly the same first 20% shown above as used by Baidu).\u00a0 There are some caveats, however. As suggested above, its not just the acoustic model, but the language model impacts word error rate.\u00a0 This paper uses a language model that raises some questions&#8230;<\/p>\n<p>Still, there is hope for more open ASR rivaling the leaders in terms of WER.\u00a0 The rest of the question is how well we&#8217;ll do at spoken language <span style=\"text-decoration: underline;\">understanding<\/span>, which is enabled by low WER, just as natural language understanding (NLU) is enabled by better natural language <span style=\"text-decoration: underline;\">processing<\/span> (NLP).\u00a0 It&#8217;s great fun to be closing the gap between ever-improving machine learning and more intelligent understanding.\u00a0\u00a0 Hopefully, this will lead to more valuable intelligent agents than the chatbots that are most likely to claim the Alexa Prize (where by chatbot I mean an agent whose primary goal is merely to converse).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some folks use the term &#8220;automatic speech recognition&#8221;, ASR.\u00a0 I don&#8217;t like the separation between recognition and understanding, but that&#8217;s where the technology stands. The term ASR encourages thinking about spoken language at a technical level in which purely inductive techniques are used to generate text from an audio signal (which is hopefully some recorded &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/haleyai.com\/wordpress\/2018\/10\/27\/simon-says\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Simon Says&#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":[901],"tags":[919,927,907,909,917,902,914,918,865,908,925,915,920,916,906,905,911,717,910,866,913,921,922,851,904,528,903,912,926,923,924],"class_list":["post-1578","post","type-post","status-publish","format-standard","hentry","category-speech-recgonition","tag-aec","tag-alexa-prize","tag-amazon-alexa","tag-apple-homepod","tag-array-microphone","tag-asr","tag-baidu","tag-beam-forming","tag-chatbot","tag-cortana","tag-daniel-povey","tag-deepspeech","tag-echo-cancellation","tag-far-field","tag-google-assistant","tag-google-home","tag-hidden-markov-model","tag-hmm","tag-htk","tag-intelligent-agent","tag-kaldi","tag-kenlm","tag-language-model","tag-microsoft-bing","tag-natural-langauge","tag-nlu","tag-speech-recognition","tag-sphinx","tag-tdnn","tag-wer","tag-word-error-rate"],"_links":{"self":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1578","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=1578"}],"version-history":[{"count":14,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1578\/revisions"}],"predecessor-version":[{"id":1596,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1578\/revisions\/1596"}],"wp:attachment":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1578"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}