{"id":714,"date":"2017-11-04T19:42:10","date_gmt":"2017-11-04T19:42:10","guid":{"rendered":"https:\/\/test.warrensoft.co.uk\/wp-test\/home-hub\/?p=714"},"modified":"2018-12-08T07:29:27","modified_gmt":"2018-12-08T07:29:27","slug":"voice-interface-phrase-processor","status":"publish","type":"post","link":"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/11\/04\/voice-interface-phrase-processor\/","title":{"rendered":"Voice Interface &#8211; Phrase Processor"},"content":{"rendered":"<p>As the name suggests, the Phrase Processor processes a phrase and returns a response. If the phrase is a call to action, then the action is performed and a confirmation forms the response. Here is a block diagram.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-743\" src=\"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/10\/PhraseProcessorBlockDiagram-300x232.png\" alt=\"\" width=\"300\" height=\"232\" srcset=\"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/10\/PhraseProcessorBlockDiagram-300x232.png 300w, https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/10\/PhraseProcessorBlockDiagram-768x594.png 768w, https:\/\/test.warrensoft.co.uk\/wp-test\/wp-content\/uploads\/2017\/10\/PhraseProcessorBlockDiagram.png 825w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The real work is performed by the <em>Functions<\/em>, which talk to the hub to find out the current kitchen temperature, or to switch on the heating, etc.<\/p>\n<p>The <em>Input Substitution<\/em> converts everyday terms into terms the hub will understand e.g. rain &gt; precipitation, etc. \u00a0Similarly, the <em>Output Substitution<\/em>\u00a0can change words that are not pronounced well by the Text-To-Speech component e.g. Beaufort &gt; Bofort.<\/p>\n<p><em>Candidate Extraction<\/em> involves splitting a phrase into likely candidate terms. For example, we may have a zone called Bedroom 1, so if we were to utter the phrase &#8216;<em>what is the humidity in bedroom 1<\/em>&#8216;, our tokenizer might spot humidity as a measurand, but might not recognise bedroom 1 as a zone. By using a word count of 2, we can extract the following candidate terms: what, what is, is the, .. , bedroom 1 and we have a fighting chance our zone will be spotted.<\/p>\n<p>The <em>Tokenizer<\/em> takes candidate terms and looks them up in lists of terms. Term lists are read from the hub: sensor names, zone names, actuator names, measurands, etc. or derived from pre-configured command lists. It then generates a set of tokens which provides automatic de-duplication.<\/p>\n<p>The <em>Signature Builder<\/em> converts the set of tokens into an ordered function signature and marshals the parameters. \u00a0So taking our example from above, the tokenizer would have generated a humidity measurand token and bedroom-1 zone token. These would be converted into the measurand_zone( x, y ) function signature, and the function would be called. This approach allows us to utter the reverse phrase &#8216;bedroom 1 humidity&#8217; and still have it handled by the same function.<\/p>\n<p>Specific sensors can be configured to report\u00a0<em>supplementary<\/em> information for certain value ranges. For example, wind speed in mph can be supplemented with a familiar description e.g. 40 mph plus\u00a0<em>gale, 8 on the Beaufort\u00a0scale.<\/em><\/p>\n<p>This covers the structure of the Phrase Processor. In the next post we will address minor changes we need to make to the home-hub to be able to implement the REST interface.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As the name suggests, the Phrase Processor processes a phrase and returns a response. If the phrase is a call to action, then the action is performed and a confirmation forms the response. Here is a block diagram. The real work is performed by the Functions, which talk to the hub to find out the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/11\/04\/voice-interface-phrase-processor\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Voice Interface &#8211; Phrase Processor&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-714","post","type-post","status-publish","format-standard","hentry","category-design-concepts"],"_links":{"self":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/comments?post=714"}],"version-history":[{"count":7,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/714\/revisions"}],"predecessor-version":[{"id":772,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/714\/revisions\/772"}],"wp:attachment":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/media?parent=714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/categories?post=714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/tags?post=714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}