{"id":691,"date":"2013-02-17T00:35:04","date_gmt":"2013-02-16T23:35:04","guid":{"rendered":"http:\/\/quantum-bits.org\/?p=691"},"modified":"2022-08-12T17:34:34","modified_gmt":"2022-08-12T16:34:34","slug":"project-jarvis-step-three-the-brain","status":"publish","type":"post","link":"https:\/\/www.quantum-bits.org\/?p=691","title":{"rendered":"Project \u201cJarvis\u201d: step three (the brain)"},"content":{"rendered":"<table width=\"100%\">\n<tbody>\n<tr>\n<td>During the last steps, voice recording, speech-to-text and text-to-speech feasibility was studied. Now enters another difficicult part: the brain !<\/td>\n<td><img decoding=\"async\" src=\"http:\/\/quantum-bits.org\/wp-content\/uploads\/2013\/02\/raspberrypi-logo.png\" alt=\"\" align=\"top\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The last steps implied the use of external services for voice-recognition and text-to-speech capabilities.<\/p>\n<p>When it comes to Jarvis&#8217; brain, the idea is twofold:<\/p>\n<ul>\n<li style=\"list-style: square inside; color: #aaaaaa;\"><span style=\"color: #666666;\"><strong>Onboard answer engine<\/strong>: part of the analysis will be done onboard with simple regular expressions (as it was seen on the &#8220;proof of concept&#8221; step).<\/span><\/li>\n<li style=\"list-style: square inside; color: #aaaaaa;\"><span style=\"color: #666666;\"><strong>External answer engine<\/strong>: the other part of the analysis is triggered whenever the first one fails. More than a fallback engine, this service should enrich the answer as much as possible.<\/span><\/li>\n<\/ul>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Wolfram_Alpha\" title=\"Wolfram Alpha\" target=\"_blank\" rel=\"noopener\">Wolfram|Alpha<\/a> is a computational knowledge engine. It&#8217;s an online service that answers factual queries directly by computing the answer in terms of structured data, rather than providing a list of documents or web pages that might contain the answer as a search engine would do. It&#8217;s a pretty good candidate for Jarvis.<\/p>\n<p><strong>Jarvis&#8217; Workflow<\/strong><\/p>\n<p>This simplified illustration describes Jarvis&#8217; workflow, including voice acquisition, external speech-to-text, parsing &amp; analyzing (including Wolfram|Alpha service), external text-to-speech and actions:<\/p>\n<p><center><img decoding=\"async\" src=\"http:\/\/quantum-bits.org\/wp-content\/uploads\/2013\/02\/jarvis-workflow.png\" alt=\"\"><\/center><\/p>\n<p><strong>Wolfram|Alpha<\/strong><\/p>\n<p>The Wolfram|Alpha API provides a web-based API which allows clients to submit free-form queries. The API is implemented in a standard REST protocol using HTTP GET requests. Each result is returned as a descriptive XML structure wrapping the requested content format.<\/p>\n<p>Roughtly speaking, these results are divided into sections: <strong>assumptions<\/strong> and <strong>pods<\/strong>.<\/p>\n<p>The <strong><assumption><\/assumption><\/strong> sections tell you what assumptions Wolfram|Alpha made about certain parts of the input, and what the alternative values are for each assumption.<\/p>\n<p>The <strong><pod><\/pod><\/strong> sections correspond to one category of result. Each pod has a title (\u201cInput interpretation\u201d is the title of the first pod) and a content (a GIF image). Pods may also have additional features such as a plaintext representation that appears in a popup when you mouse over the image, and JavaScript buttons that replace the pod with different information in an AJAX-style operation.<\/p>\n<p>The web-service API can be accessed from any language that supports web requests and XML. Furthermore, the Wolfram|Alpha community provides a set of bindings for Ruby, Perl, Python, PHP, .Net (juk!) Java (and <a href=\"http:\/\/www.wolfram.com\/mathematica\/\" title=\"Mathematica\" target=\"_blank\" rel=\"noopener\">Mathematica<\/a>, of course). \ud83d\ude0e<\/p>\n<p>I created an account on Wolfram|Alpha and applied for an AppID (which I received right away). I free account allows up to 2000 queries a month, which should plenty.<\/p>\n<p>I downloaded the PHP binding to my Raspberry Pi, read the documentation (no, I didn&#8217;t, I&#8217;m kidding. Who reads manuals ???), and in less than 100 lines of code I got this running:<\/p>\n<p><center><img decoding=\"async\" src=\"http:\/\/quantum-bits.org\/wp-content\/uploads\/2013\/02\/jarvis-wolfram-alpha-first-try.png\" alt=\"\"><\/center><\/p>\n<p>It&#8217;s a first try, but it looks promising. Jarvis may have soon a brain.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>During the last steps, voice recording, speech-to-text and text-to-speech feasibility was studied. Now enters another difficicult part: the brain ! The last steps implied the use of external services for &#8230;<\/p>\n","protected":false},"author":1,"featured_media":3853,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[5,21],"tags":[],"_links":{"self":[{"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/posts\/691"}],"collection":[{"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=691"}],"version-history":[{"count":0,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/posts\/691\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/media\/3853"}],"wp:attachment":[{"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}