{"id":3281,"date":"2020-10-25T13:37:00","date_gmt":"2020-10-25T19:37:00","guid":{"rendered":"https:\/\/yyc.ninja\/?p=3281"},"modified":"2022-03-26T19:07:48","modified_gmt":"2022-03-27T01:07:48","slug":"chat-bot-with-wit-ai-and-facebook-messanger-in-under-10-minutes","status":"publish","type":"post","link":"https:\/\/yyc.ninja\/index.php\/2020\/10\/25\/chat-bot-with-wit-ai-and-facebook-messanger-in-under-10-minutes\/","title":{"rendered":"Chat bot with wit.ai and Facebook Messanger in under 10 minutes"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-25%20at%201.37.54%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/969eec2f1011b9de8c592faf0b9c05f42624f92abea3650546ac7f3f6a93446b\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32352532306174253230312e33372e3534253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>[Unedited]<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Licene : MIT open source<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#level-\"><\/a>Level :<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Beginner \/ intermediate<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#requirements-\"><\/a>Requirements :<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Does not require any chatbot developmenet expereince, does not require software development expereince<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ll only need :<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><a href=\"http:\/\/facebook.com\/\">Facebook.com<\/a>&nbsp;account<\/li><li><a href=\"http:\/\/wit.ai\/\">wit.ai<\/a>&nbsp;account.<\/li><li><a href=\"http:\/\/glitch.com\/\">glitch.com<\/a>&nbsp;account.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#goals-\"><\/a>Goals :<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Chatbots are considered one of the most successful customer service tools, it is also free using wit.ai free Natural Language Processing (NLP) frameork.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial we will create a chatbot in easy and simple steps using wit.ai The chatbot will automatically answer questions from the customers of a fictional bus operator which we will call Safety Travels. These questions will be posed by customers using Facebook Messenger.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#steps\"><\/a>Steps:<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#1-creating-an-app-on-witai\"><\/a>1. Creating an app on wit.ai<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#2-creating-a-facebook-page\"><\/a>2. Creating a Facebook page<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#3-creating-a-facebook-app-that-uses-messenger\"><\/a>3. Creating a Facebook App that uses Messenger<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#4-cloning-a-glitchcom-projeict-that-will-connect-witai-with-messanger-messenger-service\"><\/a>4. Cloning a glitch.com projeict that will connect wit.ai with messanger Messenger service<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#5-testing-our-bot-using-facebook-messenger\"><\/a>5. Testing our bot using Facebook messenger<\/h3>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#1-creating-an-app-on-witai-1\"><\/a>1. Creating an app on wit.ai<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Why we&#8217;re using wit.ai? It&#8217;s easy to create a bot that answers a single question like &#8220;\u064bwhat&#8217;s the distance between Chicago and Seattle?&#8221; But what if the users ask different variations of the question? Like for example &#8220;How many Miles between Chicago and Seattle?&#8221; our chatbot will fail if we don&#8217;t include all those variations, luckily we don&#8217;t have to go this route. We can simply use and train an NLP tool like wit.ai to respond to all variation of a questions&nbsp;<em><strong>Utterances<\/strong><\/em>&nbsp;by grouping them into ###&nbsp;<em><strong>Intents<\/strong><\/em>&nbsp;, for example one intent for questions related to time &#8220;What&#8217;s the time now in Boston?&#8221; or distance, tempreture, price etc. The intent output, will help us match the question asked with the relevant answers as we will see below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-22%20at%207.33.52%20AM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/3fc254594956ce09b015e358113a3ad0ed8f2d9ef4bae75f5e4ad803ef01cfe2\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32322532306174253230372e33332e3532253230414d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can also train the wit.ai app with more variations of the questions to increase it&#8217;s accuracy. wit.ai is free and open for all.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After you signup or login into wit.ai , create a &#8220;New App&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-20%20at%207.37.04%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/5357098dc20a0650848119dba8cea7f73cbba4d557c171dc7966047a05618828\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32302532306174253230372e33372e3034253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">and choose a unique name for your app<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-20%20at%209.05.30%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/9fef0e855c909bd062e3f0246bd474851c05409cd8cf2358dc8306b6644a0df7\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32302532306174253230392e30352e3330253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You will be greeted by &#8220;Train Your App&#8221; page<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here you&#8217;ll enter the questions that you expect the customers will ask &#8220;Utterances&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-20%20at%209.17.22%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/13e1da11e59f8e324af5f8e055a2dad6f6f4ead6779d61fa5109c232eccf7e54\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32302532306174253230392e31372e3232253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To understand what&#8217;s going on on this page, let&#8217;s reiterate again our goal here:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">we&#8217;re training our wit.ai app to understand what the customer has typed , or said. Is the customer asking for the time? or is the customer asking for a distance? The app also extracts the details &#8220;Entities&#8221; that help us find a more accurate answers.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/camo.githubusercontent.com\/7113d93f60d6d4dc2ba6799be5f225ae2d25b9579588aaf096f978df3681a27f\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32322532306174253230312e34372e3532253230504d2e706e67\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/7113d93f60d6d4dc2ba6799be5f225ae2d25b9579588aaf096f978df3681a27f\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32322532306174253230312e34372e3532253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#utterance\"><\/a><em><strong>Utterance<\/strong><\/em><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">These are examples of what the customer might ask from our bot.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#intent\"><\/a><em><strong>Intent<\/strong><\/em><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An intent is derived from the Utterance, so at this point we know the category of the questions, if it is about a time or a distance etc. But if it is a distance, we still don&#8217;t have enough information to find an answer, the bot stilll don&#8217;t know what distance the customer is asking about. This is why we have<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#entities\"><\/a><em><strong>Entities<\/strong><\/em><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Entities are the details that will help us answer the customer&#8217;s question, so if the customer is asking about the distance between Chicagk and Seattle, then Chicago is an Entity of type location, as well as Seattle.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s the same when the customer asks about the time, the Entity here is of type location.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-22%20at%201.47.19%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/344ac0aa611123346589031638f42a505cbcab2c2d83915ba30c19b5ff4810e5\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32322532306174253230312e34372e3139253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Obviously the more Utterances we enter to train the wit.ai app the more the chatbot is able to guess what the customer needs to know.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#witai-supports-more-than-130-languages\"><\/a>wit.ai supports more than 130 languages<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After the above, we should faceno problem in following the coming steps to enter Utterances and train our wit.ai app<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">we can enter some variations of questions asking for the distance between 2 locations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because we will handle each Intent differently we need to name each Intent a descriptive name, so Intents related to distance between 2 locations we will cal them&nbsp;<code>distanceBetween<\/code>&nbsp;it&#8217;s very important to get them correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We make sure that we highlight city names in our Utterance, these are our Entities, choose type location<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-20%20at%209.10.16%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/257c32b1468cf05ace0752f93fd8dc432465f0269fe5c0490136c9d5393f709e\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32302532306174253230392e31302e3136253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s also add Utterances\/Questions about local time in few cities<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s name this Intent&nbsp;<code>timeAtPlace<\/code>&nbsp;Highlight the city, the city is our Entitiy and we select type location, if not auto detected.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-20%20at%209.19.26%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/96ec8fe5d3c24d153f25453ccddbe496ebdf3fb8d35ca02cf1334de6101dfa9f\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32302532306174253230392e31392e3236253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After you click &#8220;Train Your App&#8221; training takes between seconds to minutes Wait until training is complete then explore your Intents and Entities from the left menu to make sure that that they&#8217;re all set correctly.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-20%20at%209.20.38%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/e9a692c2857153295c1fbc07b0d8d18d52997d720472a57074aaf82be1e793ef\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32302532306174253230392e32302e3338253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can also revise all the Utterances from the Utterances section on the left<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-20%20at%209.22.59%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/904a36d955cea0bcbb546e65fc6e54b31a7e00d5d80e0beff2a7fe140014a8fd\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32302532306174253230392e32322e3539253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">wit.ai also stores all the Utterances \/ Questions which your customers has asked, this is extremly useful in going in retraining and refining how your bot interperts the customers&#8217; questions.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-22%20at%202.24.37%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/4044d88a7c6922c8a2a5d90ef06bd3219d1db479455e16ef4680707b131bcd76\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32322532306174253230322e32342e3337253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">All we need at this point is to copy and save the &#8220;Server Access Token&#8221; for our app, from the settings section, we will need this Access Token soon.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-20%20at%209.23.21%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/efb0367e2adc90a5d4c0d79c24972321fb36e5b3671262fa8582a0a6837ea58a\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32302532306174253230392e32332e3231253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#2-creating-a-facebook-page-1\"><\/a>2. Creating a Facebook page<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Why?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will need to create a new Facebook page for our fictional company &#8220;Safet Travels&#8221;, We do this because we want when the customers send Messenger messages to be assoicated with this page. To create a facebook page, visit the following link<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.facebook.com\/pages\/creation\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If you are already a Facebook user all you&#8217;ll need to do is to choose a name for your new page, if you aren&#8217;t you&#8217;ll need to sign up to facebook first.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click on &#8220;+&#8221; and choose crate new &#8220;Page&#8221; , enter the name and description for your new page.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2011.33.18%20AM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/a91bd3d4fc8c92f15ac29f86d30953d61c1fd76ab33ea9c3e2eb3e55629f0749\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031312e33332e3138253230414d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#3-creating-a-facebook-app-that-uses-messenger-1\"><\/a>3. Creating a Facebook App that uses Messenger<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Why?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can connect our wit.ai app to web page on Safety Travels website, or its mobile app, but for this tutorial we&#8217;ve choosen to connect our wit.ai app to Facebook Messanger. So we don&#8217;t need to build and host a web page or create a mobile app from scratch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The other reason is Facebook has a huge user base, and many of Safety Travels clients would be Facebook users, and would likely have Facebook Messanger app on their mobile devices.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-22%20at%2012.29.38%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/904b26827df33257655a3cc8abea70b1693413a4bf331dcaa8691a26157b6052\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3232253230617425323031322e32392e3338253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To create your Facebook app head to<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/developers.facebook.com\/apps\/\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">click on &#8220;Create App&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then select &#8220;Manage Business Integrations&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2011.55.45%20AM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/571ffa9c4b7a5f5f8dd117c77325d91b28c753fe68e057dd431efe7f1951683d\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031312e35352e3435253230414d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Select a name for your Facebook app, because you&#8217;re creating this app to access your own data on Facebook, meaning your Page and the associated Messenger messeges, in the App Purpose field select &#8220;Yourself or your own business&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This relates to the (A) part in the Facebook&nbsp;<a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#3-creating-a-facebook-app-that-uses-messenger-1\">diagram<\/a>&nbsp;above.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2011.57.24%20AM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/1b30c09f52a67a4d0af552775444046a929b58c9534f7c46149eb13274d812bb\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031312e35372e3234253230414d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A new App ID and an App Secret will automatically be generated for your new app, we will need to copy and save the App Secret , because we will need it later on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can find it under Settings &gt; Basic<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.44.07%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/302043a69328a0535cf86eab8302d07382da44a782b8ebb7181d399f50a3b784\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e34342e3037253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Head back to the Dashboard and you&#8217;ll be offered many Facebook products to incorporate in your app, for our app we only want to select Messanger<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This relates to the (B) part in the Facebook&nbsp;<a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#3-creating-a-facebook-app-that-uses-messenger-1\">diagram<\/a>&nbsp;above.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2011.58.49%20AM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/902199bd92937fde969a2947d5d61c00914f9e2ee34bee39cf71fdd7a6aa0a41\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031312e35382e3439253230414d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Customers will reach out to Safety Travels through Facebook Messenger associated with Safety Travels Facebook page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is why we will need to connect our application to this Safety Travels Page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is illustrated in the (C) part in the Facebook&nbsp;<a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#3-creating-a-facebook-app-that-uses-messenger-1\">diagram<\/a>&nbsp;above.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.01.57%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/e053e382d5218b6ef47d9c99faf30d8d156e73428b4d992f86b56339b1362b5d\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e30312e3537253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.03.03%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/4128b4d1752373cf42714c977c104a9ca5070ad6b813a8ed4c187e71b6e8d710\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e30332e3033253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.04.37%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/d4da1a00b5769522fda945f9fa2fbad1447385d40e48e75f0d1e2ce884c27719\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e30342e3337253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.05.10%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/68064e2aba9945d910f6aa3332ed73f08e089582be6b04037824bbffb5226e47\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e30352e3130253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To be able to post messages back to our customers over Messenger, we need a token, we can get one by clicking on &#8220;Generate Token&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This relates to the (C) i) part in the Facebook&nbsp;<a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#3-creating-a-facebook-app-that-uses-messenger-1\">diagram<\/a>&nbsp;above.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.05.25%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/49189cbf40c2ea68162a4712dddcea82042034ab3c46ec4448e5ce820006610a\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e30352e3235253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.19.53%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/0de0d4f56d9cf5888b78ca69c2666d6d014be335da63787655fab42841e0c8db\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e31392e3533253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#4-cloning-a-glitchcom-projeict-that-will-connect-witai-with-messanger-messenger-service-1\"><\/a>4. Cloning a glitch.com projeict that will connect wit.ai with messanger Messenger service<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Why?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wit.ai is great in interperting what the customer would type, and translate the customers questions into Intents and Entities and produce them as output. But wit.ai cannot answer those questions on its own.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will still need to use this categorized output, that we got from step 1 above, to find matching answers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So for example when a customer asks about &#8220;The distance between Chicago and Seattle&#8221; then wit.ai will give us an output that reflects the customer has the intent to learn the distance between 2 locations, and the output will include the lattitudes and longitudes of these 2 cities.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-22%20at%207.33.52%20AM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/3fc254594956ce09b015e358113a3ad0ed8f2d9ef4bae75f5e4ad803ef01cfe2\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32322532306174253230372e33332e3532253230414d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Below is a sample for the output from wit.ai<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"text\": \"What's the distance between Beirut and Amman?\",\n    \"intents\": &#91;\n        {\n            \"id\": \"340263910599935\",\n            \"name\": \"distanceBetween\",\n            \"confidence\": 0.97\n        }\n    ],\n    \"entities\": {\n        \"wit$location:location\": &#91;\n            {\n                \"id\": \"3487207574650572\",\n                \"name\": \"wit$location\",\n                \"role\": \"location\",\n                \"start\": 28,\n                \"end\": 34,\n                \"body\": \"Beirut\",\n                \"confidence\": 0.9195,\n                \"entities\": &#91;],\n                \"resolved\": {\n                    \"values\": &#91;\n                        {\n                            \"name\": \"Beirut\",\n                            \"domain\": \"locality\",\n                            \"coords\": {\n                                \"lat\": 33.89331817627,\n                                \"long\": 35.501571655273\n                            },\n                            \"timezone\": \"Asia\/Beirut\",\n                            \"external\": {\n                                \"geonames\": \"276781\",\n                                \"wikidata\": \"Q3820\",\n                                \"wikipedia\": \"Beirut\"\n                            },\n                            \"attributes\": {}\n                        }\n                    ]\n                },\n                \"type\": \"resolved\"\n            },\n            {\n                \"id\": \"3487207574650572\",\n                \"name\": \"wit$location\",\n                \"role\": \"location\",\n                \"start\": 39,\n                \"end\": 44,\n                \"body\": \"Amman\",\n                \"confidence\": 0.9328,\n                \"entities\": &#91;],\n                \"resolved\": {\n                    \"values\": &#91;\n                        {\n                            \"name\": \"Amman\",\n                            \"domain\": \"locality\",\n                            \"coords\": {\n                                \"lat\": 31.955219268799,\n                                \"long\": 35.945030212402\n                            },\n                            \"timezone\": \"Asia\/Amman\",\n                            \"external\": {\n                                \"geonames\": \"250441\",\n                                \"wikidata\": \"Q3805\",\n                                \"wikipedia\": \"Amman\"\n                            },\n                            \"attributes\": {}\n                        },\n                        {\n                            \"name\": \"Amman Governorate\",\n                            \"domain\": \"region\",\n                            \"coords\": {\n                                \"lat\": 31.583690643311,\n                                \"long\": 36.333351135254\n                            },\n                            \"timezone\": \"Asia\/Amman\",\n                            \"external\": {\n                                \"geonames\": \"250439\",\n                                \"wikidata\": \"Q472788\",\n                                \"wikipedia\": \"Amman Governorate\"\n                            },\n                            \"attributes\": {}\n                        }\n                    ]\n                },\n                \"type\": \"resolved\"\n            }\n        ]\n    },\n    \"traits\": {}\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now it&#8217;s up to us to use the information above to calculate the distance between the 2 cities.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Luckily you don&#8217;t need to do any calculation, our gilitch.com project has all the code needed to calculate the distance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can clone and add the glitch.com project to your account with a single click of a button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;re using glitch because it makes it extremely easy to deploy an app that connects our app on wit.ai and the our Facebook app with Facebook Messenger, without the need for hosting or complicated setups.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our chatbot also make use of the output from questions about time, such as &#8220;What&#8217;s the time now in Toronto?&#8221; to get the local time for a city from the following API<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/worldtimeapi.org\/api\/\">worldtimeapi.org\/api<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below is a sample output for when the customer asks about the time in a certain city<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"text\": \"What's the time in Tunis?\",\n    \"intents\": &#91;\n        {\n            \"id\": \"3303593069738308\",\n            \"name\": \"timeAtPlace\",\n            \"confidence\": 0.9944\n        }\n    ],\n    \"entities\": {\n        \"wit$location:location\": &#91;\n            {\n                \"id\": \"3487207574650572\",\n                \"name\": \"wit$location\",\n                \"role\": \"location\",\n                \"start\": 19,\n                \"end\": 24,\n                \"body\": \"Tunis\",\n                \"confidence\": 0.9342,\n                \"entities\": &#91;],\n                \"resolved\": {\n                    \"values\": &#91;\n                        {\n                            \"name\": \"Tunis\",\n                            \"domain\": \"locality\",\n                            \"coords\": {\n                                \"lat\": 36.818969726562,\n                                \"long\": 10.165789604187\n                            },\n                            \"timezone\": \"Africa\/Tunis\",\n                            \"external\": {\n                                \"geonames\": \"2464470\",\n                                \"wikidata\": \"Q3572\",\n                                \"wikipedia\": \"Tunis\"\n                            },\n                            \"attributes\": {}\n                        }\n                    ]\n                },\n                \"type\": \"resolved\"\n            }\n        ]\n    },\n    \"traits\": {}\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To complete this step , just head to the glitch project at<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/glitch.com\/~aeolian-sponge-glade\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">in a nutshell, it&#8217;s a Node.JS end point that will glow our other components together<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To copy this project, click on the button below &#8220;Remix This&#8221; If you&#8217;re not logged into glitch.com you would want to login.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/glitch.com\/edit\/?utm_content=project_aeolian-sponge-glade&amp;utm_source=remix_this&amp;utm_medium=button&amp;utm_campaign=glitchButton#!\/remix\/aeolian-sponge-glade\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/fe8a51a3c56a2b1dbe23ec00a69532477619e4e41a072441f0a2daccdda078b8\/68747470733a2f2f63646e2e676c697463682e636f6d2f32626466623366382d303565662d343033352d613036652d32303433393632613361313325324672656d697825343032782e706e673f31353133303933393538373236\" alt=\"remix this\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Within few minutes glitch will automatically add the project to your account, clone and deploy the app for you witha new URL.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.24.59%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/67f0800d635836fa7825b92a3b36143806090c8e00936f4c70f1799a3b7010a1\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e32342e3539253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now you can open the project that you have cloned<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.34.15%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/78a0b1b779bd14bddb0069a1535a782512a1279fc3323a6a060d5d7334d8d1ae\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e33342e3135253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">On the left side of the screen click on &#8220;Share&#8221;, and click on the &#8220;Live App&#8221; tab<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.45.33%20PM%20copy.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/5674e6650b135d3d55788de816ba4557161f13eef4c1a12d3b0f4cf748e864b4\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e34352e3333253230504d253230636f70792e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This now is the URL that points to your app, click on copy because this URL will be the where the Facebook app will send in the questions from Messenger, so we can forward it to wit.ai and get the output that will help us in generating an answer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now we head to the Facebook app, and click on Messenger on the left menu, and Settings<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Find the Webhook section in the page and click on &#8220;Add Callback URL&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This relates to the (C) ii) part in the Facebook&nbsp;<a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#3-creating-a-facebook-app-that-uses-messenger-1\">diagram<\/a>&nbsp;above.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.46.07%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/c2ef1e56e1b67b71966df3a3ce61e27617355ce4277b75c420abf7861ed401cf\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e34362e3037253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.46.49%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/d27709393c1445da2cb1aa3541f4211bdcb685e48b7455c41f77800e643c976a\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e34362e3439253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-25%20at%209.35.20%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/e4d59128f4c77f205ca16030cc2e4c9658577b50ae757e449238d5fa5031f029\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32352532306174253230392e33352e3230253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the URL we&#8217;ve copied earlier from our glitch.com project and add the suffix&nbsp;<code>\/webhook<\/code>&nbsp;to the end of the URL, so the correct address is&nbsp;<code>https:\/\/YOUR_PROJECT_URL\/webhook<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that the address to your glitch.com project will be different than the one you see here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the field below, &#8220;Verify Token&#8221; enter&nbsp;<code>verifytoken<\/code>, we choose this randomly it could be any other word or sentence, but we need to be consistent with the one we will enter later in our glitch project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After entering the Webhook and Verify Token, now we need to choose when we need to be notified by the Facebook App, we need to be notified when there&#8217;s a message or action taken by the customer on the Messanger.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So we need the&nbsp;<code>pessages<\/code>&nbsp;and&nbsp;<code>pessaging_postbacks<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%2012.47.30%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/1caa4e469deb2f4c8bc5e4c660fd782ba81e67012c9eb3ec4c07390343a885fa\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d3231253230617425323031322e34372e3330253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Now our Facebook app knows where to forward the questions coming from the Messenger<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We return now to our glitch.com project to complete its configuration<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the left menu select the &#8220;.env&#8221; file, this is where we will enter our configuration<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Again it&#8217;s needless to say that most of the values below will be different than the ones you will enter in your configuration file, just follow along to know where you&#8217;ll get those values.<\/p>\n\n\n\n\n\n<p class=\"wp-block-paragraph\">To configure the glitch.com project and allow it to work with the other compnents of the chatbot, we will need to enter the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>FB_VERIFY_TOKEN<\/code>&nbsp;in a previous step we have decided that the Veirfy Token will be&nbsp;<code>verifytoken<\/code><\/li><li><code>WIT_TOKEN<\/code>&nbsp;this is the wit.ai Token that we copied in step one from wit.ai the Settings page<\/li><\/ul>\n\n\n\n\n\n<ul class=\"wp-block-list\"><li><code>FB_APP_SECRET<\/code>&nbsp;The Facbook App Secret that we copied in step 3<\/li><li><code>FB_PAGE_TOKEN<\/code>&nbsp;The Facebook Page Token that we have generated in step 3<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#5-testing-our-bot-using-facebook-messenger-1\"><\/a>5. Testing our bot using Facebook messenger<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">All the above hard work has paid off and it&#8217;s time to use Facebook Messenger and test the chatbot<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Head to the Facebook Page that we have created and click on &#8220;View As Visitor&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-25%20at%209.30.05%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/5361b39d60bf476678f430430fa4873539340b9572845f8cf399018e20be476a\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32352532306174253230392e33302e3035253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You will see the Messenger button, click on it<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%201.27.41%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/6893f6561d1eef430b7fbbab7143487618eed0c4dff03ae6e7da942f923b964b\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32312532306174253230312e32372e3431253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To test it, type for example : What&#8217;s the time in Boston?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or What&#8217;s the distance between Chicago and Seattle?<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/storage.googleapis.com\/assets2020\/Screen%20Shot%202020-10-21%20at%208.32.06%20PM.png\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/d1b70cca9dc995fb484180c372c58374a8d96d28f45f1e567059506e53308d67\/68747470733a2f2f73746f726167652e676f6f676c65617069732e636f6d2f617373657473323032302f53637265656e25323053686f74253230323032302d31302d32312532306174253230382e33322e3036253230504d2e706e67\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#-remember-that-the-number-of-cities-are-limited\"><\/a>&gt; Remember that the number of cities are limited<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">At this stage we can review the questions we&#8217;ve asked and wit.ai interpertations of those questions, we can fine tune and retrain the wit.ai app<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#-congratulations-youve-just-created-a-chatbot-and-connected-it-to-facebook-messanger\"><\/a>&gt; Congratulations, you&#8217;ve just created a chatbot and connected it to Facebook Messanger<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/demotuts\/witai-eng\/blob\/main\/README.md#for-those-who-want-to-go-further\"><\/a>For those who want to go further<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This chatbot can be used to connect with customers over Twitter , Telegram web or any other platform, and with the right modification it can respond to customers&#8217; voices<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">The glitch.com application above is inspired by a demo app by Arnold Scott, Partner Engineer at Facebook&nbsp;<a href=\"https:\/\/glitch.com\/~dapper-hungry-grapple\">https:\/\/glitch.com\/~dapper-hungry-grapple<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Unedited] Licene : MIT open source Level : Beginner \/ intermediate Requirements : Does not require any chatbot developmenet expereince, does not require software development expereince You&#8217;ll only need : Facebook.com&nbsp;account wit.ai&nbsp;account. glitch.com&nbsp;account. Goals : Chatbots are considered one of the most successful customer service tools, it is also free using wit.ai free Natural Language [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,19],"tags":[17,18],"class_list":["post-3281","post","type-post","status-publish","format-standard","hentry","category-how-to","category-tutorial","tag-how-to-ninja","tag-tutorial"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"featured_image_urls_v2":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","RoboGalleryMansoryImagesCenter":"","RoboGalleryPreload":"","1536x1536":"","2048x2048":""},"post_excerpt_stackable_v2":"<p>[Unedited] Licene : MIT open source Level : Beginner \/ intermediate Requirements : Does not require any chatbot developmenet expereince, does not require software development expereince You&#8217;ll only need : Facebook.com&nbsp;accountwit.ai&nbsp;account.glitch.com&nbsp;account. Goals : Chatbots are considered one of the most successful customer service tools, it is also free using wit.ai free Natural Language Processing (NLP) frameork. In this tutorial we will create a chatbot in easy and simple steps using wit.ai The chatbot will automatically answer questions from the customers of a fictional bus operator which we will call Safety Travels. These questions will be posed by customers using Facebook&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/yyc.ninja\/index.php\/category\/how-to\/\" rel=\"category tag\">How To Ninja<\/a>, <a href=\"https:\/\/yyc.ninja\/index.php\/category\/how-to\/tutorial\/\" rel=\"category tag\">Tutorial<\/a>","author_info_v2":{"name":"YYC Ninja","url":"https:\/\/yyc.ninja\/index.php\/author\/admin\/"},"comments_num_v2":"0 comments","_links":{"self":[{"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/posts\/3281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/comments?post=3281"}],"version-history":[{"count":3,"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/posts\/3281\/revisions"}],"predecessor-version":[{"id":3288,"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/posts\/3281\/revisions\/3288"}],"wp:attachment":[{"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/media?parent=3281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/categories?post=3281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yyc.ninja\/index.php\/wp-json\/wp\/v2\/tags?post=3281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}