{"id":214,"date":"2020-06-27T11:46:32","date_gmt":"2020-06-27T11:46:32","guid":{"rendered":"http:\/\/fadyanwar.com\/?p=214"},"modified":"2020-06-27T12:09:43","modified_gmt":"2020-06-27T12:09:43","slug":"building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud","status":"publish","type":"post","link":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/","title":{"rendered":"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud"},"content":{"rendered":"\n<p>As promised in my <a aria-label=\"undefined (opens in a new tab)\" href=\"http:\/\/fadyanwar.com\/index.php\/2020\/05\/17\/giving-aiot-a-voice-using-azure-ai\/\" target=\"_blank\" rel=\"noreferrer noopener\">previous howto articles<\/a>, we are going to build an interactive AI assistant based on what we had learnt so far. In this article we are going to learn how to build an AI assistant using Raspberry Pi and make it interactive using Watson Assistant while giving it a voice using Azure Speech.<\/p>\n\n\n\n<p>In order to follow through this article you will need to <a href=\"http:\/\/fadyanwar.com\/index.php\/2020\/05\/08\/an-aiot-example-using-raspberry-pi-and-azure-ai\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">set up your Raspberry Pi as described here.<\/a> You will also <a href=\"http:\/\/fadyanwar.com\/index.php\/2020\/05\/17\/giving-aiot-a-voice-using-azure-ai\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">need to configure Azure Speech as detailed on this article.<\/a><\/p>\n\n\n\n<p>We are going to use <a rel=\"noreferrer noopener\" href=\"https:\/\/www.ibm.com\/cloud\/watson-assistant\/\" target=\"_blank\">Watson Assistant from IBM Cloud.<\/a> Azure do have a <a rel=\"noreferrer noopener\" href=\"https:\/\/azure.microsoft.com\/en-us\/services\/bot-service\/\" target=\"_blank\">bot service<\/a>, however I found Watson more easier to learn not to mention it&#8217;s fun to use a Raspberry Pi in a multi cloud application. <\/p>\n\n\n\n<p>You will need to register for an IBM cloud, <a rel=\"noreferrer noopener\" href=\"https:\/\/www.ibm.com\/cloud\/free\" target=\"_blank\">which you can do for free with only your mail under 5 minutes from here<\/a>. After registering you will get some decent free credit so you can<a rel=\"noreferrer noopener\" href=\"https:\/\/cloud.ibm.com\/docs\/assistant?topic=assistant-getting-started#getting-started\" target=\"_blank\"> create a Watson Assistant as detailed on this documenation.<\/a> It&#8217;s really exciting the kind of free stuff you can get as a developer these days.<\/p>\n\n\n\n<p>After setting up Watson Assistant, make sure that you added the dialog skill then <a rel=\"noreferrer noopener\" href=\"https:\/\/cloud.ibm.com\/docs\/assistant?topic=assistant-intents\" target=\"_blank\">create an intent as detailed here<\/a>. In my example below I created a simple intent called abilities which would be triggered by asking the assistant what can it do.<\/p>\n\n\n\n<p>When Watson is ready then it&#8217;s time to test it. Copy your assistant id, api key and endpoint in place of the placeholders in the below nodejs script.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\nconst AssistantV2 = require('ibm-watson\/assistant\/v2');\nconst { IamAuthenticator } = require('ibm-watson\/auth');\nvar sessionid;\nvar assistantid = '&lt;id&gt;'\nconst assistant = new AssistantV2({\n  version: '2020-04-01',\n  authenticator: new IamAuthenticator({\n    apikey: '&lt;apikey&gt;', \/\/place your api key here\n  }),\n  url: '&lt;endpoint&gt;', \/\/place your endpoint url here\n});\n\n\/\/first create an assistant session to be used later\nassistant.createSession({\n    assistantId: assistantid\n  })\n    .then(res =&gt; {\n      console.log(JSON.stringify(res.result, null, 2));\n      sessionid = res.result&#x5B;&quot;session_id&quot;];\n      sendMessage(&quot;hello&quot;); \/\/when session is ready send a hello message\n      \n    })\n    .catch(err =&gt; {\n      console.log(err);\n    });\n\n\nfunction sendMessage(message)\n{\n    assistant.message({\n      assistantId: assistantid,\n      sessionId: sessionid,\n      input: {\n        'message_type': 'text',\n        'text': message\n        }\n      })\n      .then(res =&gt; {\n        return res.result.output.generic&#x5B;0]&#x5B;&quot;text&quot;];        \n      })\n      .catch(err =&gt; {\n        console.log(err);\n      });\n\n}\n<\/pre><\/div>\n\n\n<p>In order to run this script you will need first to install the required npm package as following<\/p>\n\n\n\n<p><code>npm install ibm-watson@^5.6.0<\/code><\/p>\n\n\n\n<p>Save the script to something like chat.js and then execute by typing the below command<\/p>\n\n\n\n<p><code>node chat.js<\/code><\/p>\n\n\n\n<p>You should get a json response with the session id and whatever response you had configured Watson to respond to a generic greeting. Which means Watson Assistant service is ready.<\/p>\n\n\n\n<p>Now it&#8217;s time put things together. You will now use Azure Speech to translate speech to text, send it over to Watson Assistant IBM cloud service, get the text response back then convert it to human like speech using Azure Speech again.<\/p>\n\n\n\n<p>In order to do so, use the below code snippet and replace the placeholders with Azure Speech and Watson Assistant details as per the comments in the below code.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n\/\/ Import required npm packages\nconst AudioRecorder = require('node-audiorecorder');\nconst fs = require('fs');\nvar sdk = require(&quot;microsoft-cognitiveservices-speech-sdk&quot;);\nvar player = require('play-sound')(opts = {})\n\n\nvar subscriptionKey = &quot;&lt;key&gt;&quot;; \/\/replace with your azure speech service key\nvar serviceRegion = &quot;northeurope&quot;; \/\/ e.g., &quot;westus&quot;\nvar filename = &quot;message.wav&quot;; \/\/ 16000 Hz, Mono\n\n\nconst AssistantV2 = require('ibm-watson\/assistant\/v2');\nconst { IamAuthenticator } = require('ibm-watson\/auth');\nvar sessionid;\nvar assistantid = '&lt;id&gt;'\/\/replace with assistant id\nconst assistant = new AssistantV2({\n  version: '2020-04-01',\n  authenticator: new IamAuthenticator({\n    apikey: '&lt;key&gt;', \/\/replace with watson api key\n  }),\n  url: '&lt;url&gt;', \/\/replace with watson endpoint url\n});\n\n\nassistant.createSession({\n    assistantId: assistantid\n  })\n    .then(res =&gt; {\n      console.log(JSON.stringify(res.result, null, 2));\n      sessionid = res.result&#x5B;&quot;session_id&quot;];\n      \n    })\n    .catch(err =&gt; {\n      console.log(err);\n    });\n\n\n\/\/ Create an instance.\nconst audioRecorder = new AudioRecorder({\n    program: process.platform = 'sox', \n  }, console);\n\n\/\/ Create write stream.\nconst fileStream = fs.createWriteStream(filename, { encoding: 'binary' });\n\/\/ Start and write to the file.\naudioRecorder.start().stream().pipe(fileStream);\nsetTimeout(recognize, 5000); \/\/wait for 5 seconds then call recognize function\n\nfunction recognize()\n{\n    audioRecorder.stop();\n    \n    \/\/ create the push stream we need for the speech sdk.\n    var pushStream = sdk.AudioInputStream.createPushStream();\n\n    \/\/ open the file and push it to the push stream.\n    fs.createReadStream(filename).on('data', function(arrayBuffer) {\n        pushStream.write(arrayBuffer.slice());\n    }).on('end', function() {\n        pushStream.close();\n    });\n\n    \/\/ we are done with the setup\n    console.log(&quot;Now recognizing from: &quot; + filename);\n\n    \/\/ now create the audio-config pointing to our stream and\n    \/\/ the speech config specifying the language.\n    var audioConfig = sdk.AudioConfig.fromStreamInput(pushStream);\n    var speechConfig = sdk.SpeechConfig.fromSubscription(subscriptionKey, serviceRegion);\n\n    \/\/ setting the recognition language to English.\n    speechConfig.speechRecognitionLanguage = &quot;en-US&quot;;\n\n    \/\/ create the speech recognizer.\n    var recognizer = new sdk.SpeechRecognizer(speechConfig, audioConfig);\n\n    \/\/ start the recognizer and wait for a result.\n    recognizer.recognizeOnceAsync(\n        function (result) {\n        console.log(result);\n\n        sendMessage(result&#x5B;&quot;privText&quot;]);\n        \n        recognizer.close();\n        recognizer = undefined;\n        },\n        function (err) {\n        console.trace(&quot;err - &quot; + err);\n\n        recognizer.close();\n        recognizer = undefined;\n        });\n\n}\n\n\nfunction sendMessage(message)\n{\n    assistant.message({\n      assistantId: assistantid,\n      sessionId: sessionid,\n      input: {\n        'message_type': 'text',\n        'text': message\n        }\n      })\n      .then(res =&gt; {\n        say(res.result.output.generic&#x5B;0]&#x5B;&quot;text&quot;]);        \n      })\n      .catch(err =&gt; {\n        console.log(err);\n      });\n\n}\n\nfunction say(text){\n\n\n  \/\/ create the pull stream we need for the speech sdk.\n  var pullStream = sdk.AudioOutputStream.createPullStream();\n\n\n  \/\/ now create the audio-config pointing to our stream and\n  \/\/ the speech config specifying the language.\n  var speechConfig = sdk.SpeechConfig.fromSubscription(subscriptionKey, serviceRegion);\n\n  \/\/ setting the recognition language to English.\n  speechConfig.speechRecognitionLanguage = &quot;en-US&quot;;\n\n  var audioConfig = sdk.AudioConfig.fromStreamOutput(pullStream);\n\n  \/\/ create the speech synthesizer.\n  var synthesizer = new sdk.SpeechSynthesizer(speechConfig, audioConfig);\n\n\n  synthesizer.speakTextAsync(\n    text,\n    function (result) {\n      console.log(result);\n\n      \/\/when the wav file is ready, play it\n      player.play(filename, function(err){\n          if (err) throw err\n        })\n          \n      synthesizer.close();\n      synthesizer = undefined;\n    },\n    function (err) {\n      console.trace(&quot;err - &quot; + err);\n\n      synthesizer.close();\n      synthesizer = undefined;\n    },\n    filename);\n}\n\n\n<\/pre><\/div>\n\n\n<p>When having both Azure Speech and Watson Assistant ready test first on your machine, you should get something similar as shown on the below video.<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Having fun with the multicloud, IBM Watson + Azure Speech (turn on your audio)\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/EareshRLFhY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>When everything is ready and tested, deploy the code to your Raspberry Pi using SFTP. You can use sftp shell command or something like <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/filezilla-project.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">FileZilla<\/a>.<\/p>\n\n\n\n<p>Deploy the nodejs script to your Raspberry Pi and name it something such as watson.js then test it by typing the below command.<\/p>\n\n\n\n<p><code>node watson.js <\/code><\/p>\n\n\n\n<p>Say hello to your new AI Assistant, you should hear it replying back to you confirming that you had successfully created your first multi cloud AIoT assistant.<\/p>\n\n\n\n<p>Try playing around with Watson Intents and experiment with its features to learn more about its capabilities. Hope you found this article helpful and stay tuned for my future articles by following me at <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/twitter.com\/FadyAnwar\" target=\"_blank\" rel=\"noreferrer noopener\">@fadyanwar<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>As promised in my previous howto articles, we are going to build an interactive AI assistant based on what we had learnt so far. In this article we are going to learn how to build an AI assistant using Raspberry Pi and make it interactive using Watson Assistant while giving it a voice using Azure [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":237,"comment_status":"open","ping_status":"open","sticky":false,"template":"templates\/template-full-width.php","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_vp_format_video_url":"","_vp_image_focal_point":[],"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[4,5,14,3,9,15],"class_list":["post-214","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-aiot","tag-azure","tag-ibm","tag-iot","tag-raspberrypi","tag-watson"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Building a Raspberry Pi AI Assistant using Azure and IBM Cloud - Fady Anwar<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud - Fady Anwar\" \/>\n<meta property=\"og:description\" content=\"As promised in my previous howto articles, we are going to build an interactive AI assistant based on what we had learnt so far. In this article we are going to learn how to build an AI assistant using Raspberry Pi and make it interactive using Watson Assistant while giving it a voice using Azure [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/\" \/>\n<meta property=\"og:site_name\" content=\"Fady Anwar\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-27T11:46:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-27T12:09:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i2.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/06\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"2048\" \/>\n\t<meta property=\"og:image:height\" content=\"1365\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fady Anwar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fadyanwar\" \/>\n<meta name=\"twitter:site\" content=\"@fadyanwar\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fady Anwar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/\"},\"author\":{\"name\":\"Fady Anwar\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"headline\":\"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud\",\"datePublished\":\"2020-06-27T11:46:32+00:00\",\"dateModified\":\"2020-06-27T12:09:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/\"},\"wordCount\":547,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"image\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1\",\"keywords\":[\"AIoT\",\"Azure\",\"IBM\",\"IoT\",\"raspberrypi\",\"Watson\"],\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/\",\"url\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/\",\"name\":\"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud - Fady Anwar\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1\",\"datePublished\":\"2020-06-27T11:46:32+00:00\",\"dateModified\":\"2020-06-27T12:09:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/fadyanwar.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1\",\"width\":2048,\"height\":1365},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/index.php\\\/2020\\\/06\\\/27\\\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fadyanwar.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#website\",\"url\":\"https:\\\/\\\/fadyanwar.com\\\/\",\"name\":\"Fady Anwar\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fadyanwar.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/fadyanwar.com\\\/#\\\/schema\\\/person\\\/b66e3277ceba346f7053a83464e90b03\",\"name\":\"Fady Anwar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\",\"caption\":\"Fady Anwar\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud - Fady Anwar","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/","og_locale":"en_US","og_type":"article","og_title":"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud - Fady Anwar","og_description":"As promised in my previous howto articles, we are going to build an interactive AI assistant based on what we had learnt so far. In this article we are going to learn how to build an AI assistant using Raspberry Pi and make it interactive using Watson Assistant while giving it a voice using Azure [&hellip;]","og_url":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/","og_site_name":"Fady Anwar","article_published_time":"2020-06-27T11:46:32+00:00","article_modified_time":"2020-06-27T12:09:43+00:00","og_image":[{"width":2048,"height":1365,"url":"https:\/\/i2.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/06\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1","type":"image\/jpeg"}],"author":"Fady Anwar","twitter_card":"summary_large_image","twitter_creator":"@fadyanwar","twitter_site":"@fadyanwar","twitter_misc":{"Written by":"Fady Anwar","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/#article","isPartOf":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/"},"author":{"name":"Fady Anwar","@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"headline":"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud","datePublished":"2020-06-27T11:46:32+00:00","dateModified":"2020-06-27T12:09:43+00:00","mainEntityOfPage":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/"},"wordCount":547,"commentCount":0,"publisher":{"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"image":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/06\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1","keywords":["AIoT","Azure","IBM","IoT","raspberrypi","Watson"],"articleSection":["Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/","url":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/","name":"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud - Fady Anwar","isPartOf":{"@id":"https:\/\/fadyanwar.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/#primaryimage"},"image":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/06\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1","datePublished":"2020-06-27T11:46:32+00:00","dateModified":"2020-06-27T12:09:43+00:00","breadcrumb":{"@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/#primaryimage","url":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/06\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1","contentUrl":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/06\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1","width":2048,"height":1365},{"@type":"BreadcrumbList","@id":"https:\/\/fadyanwar.com\/index.php\/2020\/06\/27\/building-a-raspberry-pi-ai-assistant-using-azure-and-ibm-cloud\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fadyanwar.com\/"},{"@type":"ListItem","position":2,"name":"Building a Raspberry Pi AI Assistant using Azure and IBM Cloud"}]},{"@type":"WebSite","@id":"https:\/\/fadyanwar.com\/#website","url":"https:\/\/fadyanwar.com\/","name":"Fady Anwar","description":"","publisher":{"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fadyanwar.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/fadyanwar.com\/#\/schema\/person\/b66e3277ceba346f7053a83464e90b03","name":"Fady Anwar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g","caption":"Fady Anwar"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/a9172040bbc3bbe24fb49d59dac20da030af1f5ff628126c979a1d4b71eaed41?s=96&d=mm&r=g"}}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/fadyanwar.com\/wp-content\/uploads\/2020\/06\/IBM-Watson.jpg?fit=2048%2C1365&ssl=1","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/comments?post=214"}],"version-history":[{"count":19,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/214\/revisions"}],"predecessor-version":[{"id":240,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/posts\/214\/revisions\/240"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/media\/237"}],"wp:attachment":[{"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/media?parent=214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/categories?post=214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fadyanwar.com\/index.php\/wp-json\/wp\/v2\/tags?post=214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}