{"id":20011,"date":"2016-08-02T19:34:40","date_gmt":"2016-08-02T16:34:40","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=20011"},"modified":"2019-05-07T17:41:29","modified_gmt":"2019-05-07T14:41:29","slug":"using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/","title":{"rendered":"Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/chatbots-with-ibm-watson-dialog.png\" alt=\"chatbots-with-ibm-watson-dialog\" width=\"110\" style=\"margin: 0px 0px 20px 20px;\" class=\"alignright size-full wp-image-20064\" \/><\/p>\n<p><a href=\"https:\/\/www.ibm.com\/watson\/developercloud\/dialog.html\" target=\"_blank\" rel=\"noopener noreferrer\">Dialog<\/a> is an IBM Watson service that enables you to automate branching conversations. Below, we show how to create dialogs for virtual agent applications with this service. As an example, we design a sample chatbot for solving the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fox,_goose_and_bag_of_beans_puzzle\" target=\"_blank\" rel=\"noopener noreferrer\">Fox, goose, and bag of beans<\/a> puzzle.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#How_it_works\" >How it works<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#Designing_a_dialog\" >Designing a dialog<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#Trying_it_yourself\" >Trying it yourself<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#Further_reading\" >Further reading<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To get started, you need:<\/p>\n<ul>\n<li>An IBM Bluemix account<\/li>\n<li>The Cloud Foundry CLI<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_it_works\"><\/span>How it works<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>IBM Watson Dialog manages conversations\u2014dialogs\u2014between virtual agents and users through an application programming interface (API). In addition to the automation of branching conversations between a user and your application, the service can also track and store user profile information.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Designing_a_dialog\"><\/span>Designing a dialog<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In our example, we will create a dialog to solve a classic <a href=\"https:\/\/en.wikipedia.org\/wiki\/River_crossing_puzzle\" target=\"_blank\" rel=\"noopener noreferrer\">river crossing puzzle<\/a>\u2014a fox, a goose, and a bag of beans:<\/p>\n<blockquote>\n<p><em>Once upon a time, a farmer went to a market and purchased a fox, a goose, and a bag of beans. On his way home, the farmer came to the bank of a river and rented a boat. But in crossing the river by boat, the farmer could carry only himself and a single one of his purchases\u2014the fox, the goose, or the bag of beans.<\/em><\/p>\n<p><em>If left together, the fox would eat the goose, or the goose would eat the beans.<\/em><\/p>\n<p><em>The farmer&#8217;s challenge was to carry himself and his purchases to the far bank of the river, leaving each purchase intact.<\/em><\/p>\n<\/blockquote>\n<p>The current <em>state<\/em> can be viewed as the positions of the players. For example, the puzzle begins in the state when all players are on the same side of the river (let&#8217;s say on the left side). So, the initial state can be represented by (mFGB|), where <em>m<\/em> is the man, <em>F<\/em> is the fox, <em>G<\/em> is the goose, and <em>B<\/em> is the bag of beans. If the man crosses with the fox, then the state becomes (GB|mF) with the goose eating the beans on the left bank and the man and fox on the right bank.<\/p>\n<p>Since we have four players, each with two possible states, there are 16 possible states in total:<\/p>\n<table class=\"fm-table\" width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">\n<tr>\n<td style=\"font-size: 13px;\" \" width=\"220\" valign=\"top\">(mFGB|)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\"><font style=\"color:red\">(FGB|m)<\/font><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mFG|B)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\"><font style=\"color:red\">(FG|mB)<\/font><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mFB|G)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(FB|mG)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\"><font style=\"color:blue\">(mF|GB)<\/font><\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(F|mGB)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mGB|F)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\"><font style=\"color:blue\">(GB|mF)<\/font><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mG|FB)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(G|mFB)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\"><font style=\"color:red\">(mB|FG)<\/font><\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(B|mFG)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\"><font style=\"color:red\">(m|FGB)<\/font><\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(|mFGB)<\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<p><em><font style=\"color:blue\">Blue<\/font><\/em> means the goose ate the beans, and <em><font style=\"color:red\">Red<\/font><\/em> means the fox ate the goose. We can consolidate these states to make a total of 12 states:<\/p>\n<table class=\"fm-table\" width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mFGB|)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(F|mGB)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mFG|B)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(G|mFB)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mFB|G)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(B|mFG)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mGB|F)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(|mFGB)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(mG|FB)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(Fox eats Goose)<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 13px;\" width=\"220\" valign=\"top\">(FB|mG)<\/td>\n<td style=\"font-size: 13px;\" valign=\"top\">(Goose eats Grain)<\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<p>In the given state space, there is a distinct process that changes from one state to another: crossing the river on the boat. Either it is the man alone or with one other item. Knowing this, we can arrange the states into something called a state diagram showing the possible transitions:<\/p>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/creating-bots-state-diagram.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/creating-bots-state-diagram.png\" alt=\"creating-bots-state-diagram\" width=\"640\" class=\"aligncenter size-full wp-image-20065\" \/><\/a><\/p>\n<p>To represent a state in our dialog file, we will use the <a href=\"https:\/\/www.ibm.com\/watson#reference_output\" target=\"_blank\" rel=\"noopener noreferrer\"><code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">output<\/code><\/a> element in conjunction with the <a href=\"https:\/\/www.ibm.com\/watson#reference_folder\" target=\"_blank\" rel=\"noopener noreferrer\"><code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">folder<\/code><\/a> element to group valid inputs and the <a href=\"https:\/\/www.ibm.com\/watson#reference_goto\" target=\"_blank\" rel=\"noopener noreferrer\"><code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">goto<\/code><\/a> element for state transition. To store the count of crossings, we will also use <a href=\"https:\/\/www.ibm.com\/watson#reference_variables\" target=\"_blank\" rel=\"noopener noreferrer\">variables<\/a> and <a href=\"https:\/\/www.ibm.com\/watson#reference_action\" target=\"_blank\" rel=\"noopener noreferrer\">actions<\/a>. Each state looks like this:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\"> &lt;output id=&quot;FB_MG_OUTPUT&quot;&gt;\n    &lt;prompt selectionType=&quot;SEQUENTIAL&quot;&gt;\n        &lt;item&gt;Fox and bag of beans on left bank, you and goose right.&lt;\/item&gt;\n    &lt;\/prompt&gt;\n    &lt;getUserInput id=&quot;FB_MG_INPUT&quot;&gt;\n        &lt;search ref=&quot;FB_MG&quot;\/&gt;\n        &lt;default&gt;\n            &lt;output&gt;\n                &lt;prompt selectionType=&quot;RANDOM&quot;&gt;\n                    &lt;item&gt;I did not quite get that.&lt;\/item&gt;\n                    &lt;item&gt;I didnt grasp what you said.&lt;\/item&gt;\n                    &lt;item&gt;I'm not following you at the moment.&lt;\/item&gt;\n                &lt;\/prompt&gt;\n            &lt;\/output&gt;\n        &lt;\/default&gt;\n    &lt;\/getUserInput&gt;\n&lt;\/output&gt;\n\n....\n&lt;folder id=&quot;FB_MG&quot;&gt;\n  &lt;input&gt;\n    &lt;grammar&gt;\n      &lt;item&gt;Return&lt;\/item&gt;\n      &lt;item&gt;return&lt;\/item&gt;\n    &lt;\/grammar&gt;\n    &lt;action varName=&quot;Moves&quot; operator=&quot;INCREMENT_BY&quot;&gt;1&lt;\/action&gt;\n    &lt;goto ref=&quot;MFB_G_OUTPUT&quot; \/&gt;\n  &lt;\/input&gt;\n  &lt;input&gt;\n    &lt;grammar&gt;\n      &lt;item&gt;Return with goose&lt;\/item&gt;\n      &lt;item&gt;return with goose&lt;\/item&gt;\n    &lt;\/grammar&gt;\n    &lt;goto ref=&quot;begin&quot; \/&gt;\n  &lt;\/input&gt;\n&lt;\/folder&gt;<\/pre>\n<p>For more details, see the <a href=\"https:\/\/www.ibm.com\/watson\" target=\"_blank\" rel=\"noopener noreferrer\">element reference documentation<\/a>.<\/p>\n<p>The rest of our example is trivial: a simple web application gets user inputs, passes it to a dialog service, and shows responses from the services. Here is how the bot works:\n<\/p>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/ibm-watson-dialog-bots.gif\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/ibm-watson-dialog-bots.gif\" alt=\"ibm-watson-dialog-bots\" width=\"640\" class=\"aligncenter size-full wp-image-20070\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Trying_it_yourself\"><\/span>Trying it yourself<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The source code for the article is available in <a href=\"https:\/\/github.com\/Altoros\/watson-dialog-demo\" target=\"_blank\" rel=\"noopener noreferrer\">our GitHub repository<\/a>. You can use <a href=\"https:\/\/console.bluemix.net\/devops\/setup\/deploy?repository=https:\/\/github.com\/Altoros\/watson-dialog-demo\" target=\"_blank\" rel=\"noopener noreferrer\">this link<\/a> to deploy a demo application to your Bluemix account or follow the steps below to deploy it manually:<\/p>\n<ol>\n<li>\n<p>Clone the repository: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">git clone https:\/\/github.com\/Altoros\/watson-dialog-demo<\/code><\/p>\n<\/li>\n<p><\/p>\n<li>\n<p>Go to the repository directory: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cd watson-dialog-demo<\/code><\/p>\n<\/li>\n<p><\/p>\n<li>\n<p>Create an application: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cf push APP_NAME<\/code><\/p>\n<\/li>\n<p><\/p>\n<li>\n<p>Create a Personality Insight service instance: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cf create-service dialog  standard dialog_svc<\/code><\/p>\n<\/li>\n<p><\/p>\n<li>\n<p>Bind the service instance to your application: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cf bind-service YOUR_APP_NAME dialog_svc<\/code><\/p>\n<\/li>\n<p><\/p>\n<li>\n<p>Restage your application: <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cf restage APP_NAME<\/code><\/p>\n<\/li>\n<p><\/ol>\n<p>Alternatively, you can create and bind the service instance using the Bluemix dashboard UI.<\/p>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/ibm-watson-dialog-bluemix-catalog.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/ibm-watson-dialog-bluemix-catalog.png\" alt=\"ibm-watson-dialog-bluemix-catalog\" width=\"594\" class=\"aligncenter size-full wp-image-20069\" \/><\/a><\/p>\n<p>The binding process is simple.<\/p>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/ibm-bluemix-ui.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2017\/01\/ibm-bluemix-ui.png\" alt=\"ibm-bluemix-ui\" width=\"576\" class=\"aligncenter size-full wp-image-20067\" \/><\/a><\/p>\n<p>As you can see, with the Dialog service, it is really easy to automate branching conversations between a user and your application.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Further_reading\"><\/span>Further reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/analyzing-text-with-the-alchemylanguage-service-in-ibm-watson\/\">Analyzing Text with the AlchemyLanguage Service in IBM Watson<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/using-the-personality-insights-service-in-ibm-watson\/\">Using the Personality Insights Service in IBM Watson<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/iot-platform-on-bluemix-experimenting-with-ibm-watson-and-gobot\/\">IoT Platform on Bluemix: Experimenting with IBM Watson and Gobot<\/a><\/li>\n<\/ul>\n<hr \/>\n<p><center><small>This post was written by Stas Turlo with assistance from <a href=\"https:\/\/www.altoros.com\/blog\/author\/viktoryia-fedzkovich\/\">Victoria Fedzkovich<\/a> and <a href=\"https:\/\/www.altoros.com\/blog\/author\/alex\/\">Alex Khizhniak<\/a>.<\/small><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<\/p>\n<p>Dialog is an IBM Watson service that enables you to automate branching conversations. Below, we show how to create dialogs for virtual agent applications with this service. As an example, we design a sample chatbot for solving the Fox, goose, and bag of beans puzzle.<\/p>\n<p>&nbsp;<\/p>\n<p>Prerequisites<\/p>\n<p>To get started, you need:<\/p>\n<p>An IBM [&#8230;]<\/p>\n","protected":false},"author":90,"featured_media":31575,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[214],"tags":[873,187,810,748],"class_list":["post-20011","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-cloud-native","tag-ibm-bluemix","tag-ibm-watson","tag-machine-learning"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot | Altoros<\/title>\n<meta name=\"description\" content=\"In this blog post, we demonstrate how to create a sample chatbot on the Watson platform to solve a classic river crossing puzzle.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot | Altoros\" \/>\n<meta property=\"og:description\" content=\"Dialog is an IBM Watson service that enables you to automate branching conversations. Below, we show how to create dialogs for virtual agent applications with this service. As an example, we design a sample chatbot for solving the Fox, goose, and bag of beans puzzle. &nbsp; Prerequisites To get started, you need: An IBM [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-02T16:34:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-07T14:41:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/ibm-watson-dialog-bots-v11.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"541\" \/>\n\t<meta property=\"og:image:height\" content=\"480\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Stas Turlo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stas Turlo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/\",\"name\":\"Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot | Altoros\",\"isPartOf\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/ibm-watson-dialog-bots-v11.gif\",\"datePublished\":\"2016-08-02T16:34:40+00:00\",\"dateModified\":\"2019-05-07T14:41:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/11d47ed3fb77ea65d2dd1af0af17f1f1\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#primaryimage\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/ibm-watson-dialog-bots-v11.gif\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/ibm-watson-dialog-bots-v11.gif\",\"width\":541,\"height\":480},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.altoros.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\",\"url\":\"https:\/\/www.altoros.com\/blog\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.altoros.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/11d47ed3fb77ea65d2dd1af0af17f1f1\",\"name\":\"Stas Turlo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Turlo_Stanislav.png\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Turlo_Stanislav.png\",\"caption\":\"Stas Turlo\"},\"description\":\"Stas Turlo is a software engineer at Altoros. He has 10+ years of experience in reverse engineering, object-oriented programming, cloud computing, and data analysis. His expertise includes reconstructing algorithms, file formats, and structures of binary data. Using Golang and Ruby as his primary tools, Stas is also proficient in Python, C \/ C++, and C#. You can find Stas on GitHub.\",\"url\":\"https:\/\/www.altoros.com\/blog\/author\/s-turlo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot | Altoros","description":"In this blog post, we demonstrate how to create a sample chatbot on the Watson platform to solve a classic river crossing puzzle.","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:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/","og_locale":"en_US","og_type":"article","og_title":"Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot | Altoros","og_description":"Dialog is an IBM Watson service that enables you to automate branching conversations. Below, we show how to create dialogs for virtual agent applications with this service. As an example, we design a sample chatbot for solving the Fox, goose, and bag of beans puzzle. &nbsp; Prerequisites To get started, you need: An IBM [...]","og_url":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/","og_site_name":"Altoros","article_published_time":"2016-08-02T16:34:40+00:00","article_modified_time":"2019-05-07T14:41:29+00:00","og_image":[{"width":541,"height":480,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/ibm-watson-dialog-bots-v11.gif","type":"image\/gif"}],"author":"Stas Turlo","twitter_misc":{"Written by":"Stas Turlo","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/","url":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/","name":"Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/ibm-watson-dialog-bots-v11.gif","datePublished":"2016-08-02T16:34:40+00:00","dateModified":"2019-05-07T14:41:29+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/11d47ed3fb77ea65d2dd1af0af17f1f1"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/ibm-watson-dialog-bots-v11.gif","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/08\/ibm-watson-dialog-bots-v11.gif","width":541,"height":480},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/using-the-dialog-service-in-ibm-watson-the-fox-goose-and-bag-of-beans-chatbot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using the Dialog Service in IBM Watson\u2014the Fox, Goose, and Bag of Beans Chatbot"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/11d47ed3fb77ea65d2dd1af0af17f1f1","name":"Stas Turlo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Turlo_Stanislav.png","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/12\/Turlo_Stanislav.png","caption":"Stas Turlo"},"description":"Stas Turlo is a software engineer at Altoros. He has 10+ years of experience in reverse engineering, object-oriented programming, cloud computing, and data analysis. His expertise includes reconstructing algorithms, file formats, and structures of binary data. Using Golang and Ruby as his primary tools, Stas is also proficient in Python, C \/ C++, and C#. You can find Stas on GitHub.","url":"https:\/\/www.altoros.com\/blog\/author\/s-turlo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/20011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/90"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=20011"}],"version-history":[{"count":36,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/20011\/revisions"}],"predecessor-version":[{"id":42885,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/20011\/revisions\/42885"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/31575"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=20011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=20011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=20011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}