<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ricardo Moutinho on Medium]]></title>
        <description><![CDATA[Stories by Ricardo Moutinho on Medium]]></description>
        <link>https://medium.com/@rjam?source=rss-1f7730fc3276------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*bnRX12XeSnO0a6tTtWbjVA.jpeg</url>
            <title>Stories by Ricardo Moutinho on Medium</title>
            <link>https://medium.com/@rjam?source=rss-1f7730fc3276------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:32:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rjam/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Chatbots: What, Why and How (part III)]]></title>
            <link>https://medium.com/glazed-dev/chatbots-what-why-and-how-part-iii-28aa0de83133?source=rss-1f7730fc3276------2</link>
            <guid isPermaLink="false">https://medium.com/p/28aa0de83133</guid>
            <category><![CDATA[alexa-skills]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[google-actions]]></category>
            <category><![CDATA[dialogue]]></category>
            <category><![CDATA[watson-assistant]]></category>
            <dc:creator><![CDATA[Ricardo Moutinho]]></dc:creator>
            <pubDate>Tue, 02 Jun 2020 15:03:58 GMT</pubDate>
            <atom:updated>2020-06-02T15:03:58.093Z</atom:updated>
            <content:encoded><![CDATA[<h4>Adding dialog and action processing capabilities to your chatbot</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWazNLTkBy444KscvXPSwg.jpeg" /></figure><p>Welcome back to the third and final part of our chatbot mini-series. If you missed our previous articles and want to know more about the chatbot landscape and their relevance in today’s markets, you can find <a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-i-a6fc4655430d"><strong>Part I here</strong></a>. If you’re more interested in understanding how they work or just building your own, this article is for you! Be sure to take a look at <a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-ii-a5399f2ce274"><strong>Part II</strong></a> first though, where we started doing just that, focusing on the Natural Language Understanding (NLU) component.</p><p>In this article, we’ll build upon that work as we continue using <a href="https://cloud.ibm.com/catalog/services/watson-assistant">IBM’s Watson Assistant</a> to show you how you can have your chatbot reply and perform actions based on the user’s requests, by specifying a dialog tree.</p><p><strong>Step 3: Dialog</strong></p><p>In <a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-ii-a5399f2ce274">Part II</a> we covered the first two steps of a chatbot’s request handling process. Now that we have a standard representation of the user’s request, we can assess how to best handle it. That is the dialog’s job: to take a standardised request and based on the information available and context of the conversation, decide what is the best next path to take, act upon it, and draw up which should be the chatbot’s response.</p><p>If you’ve been following along on our previous article and reproduced our examples on <a href="https://cloud.ibm.com/catalog/services/watson-assistant">IBM’s Watson Assistant</a>, you’ll have noticed that regardless of the intent being correctly understood or not, the bot would always respond with something like “<em>Can you reword your statement? I’m not understanding.</em>”</p><p>That’s because even though we’ve taught the NLU model how to recognise the user’s intentions, we haven’t specified how it should react to them, so we’re constantly falling into Watson’s default fallback response.</p><p>Let’s jump back to our test skill, and take a look at the <strong>Dialog tab</strong> in Watson:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JjsPVDgCrza8Gm0H" /></figure><p>Dialog works by allowing you to add multiple response nodes to the dialog tree, each with their specific conditions, and based on those and the tree’s structure, Watson will decide the best node to go into for each user input.</p><p>Currently, there are only the two default <em>response nodes </em>in there:</p><ul><li><em>Welcome</em>: to greet the user when a conversation starts</li><li><em>Anything else</em>: the default fallback response that’s been generating the replies we’ve been seeing</li></ul><p>For starters, we want our chatbot to respond properly to requests to turn things off, so let’s add a response node for that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZWco-pLf7IzQgEI7" /></figure><p>And let’s tell the service that we want this node’s logic to be triggered when we have a match for the #turn_off intent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dMDRuLqQ0ftZxin1" /><figcaption>We set the node’s condition to trigger if the assistant recognizes #turn_off</figcaption></figure><p>What we’re saying here, is that whenever the NLU’s best match is this intent, we want this node to be selected. Next, we specify what we want to reply to the user in this situation. For now, let’s just acknowledge the request back:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a24Lg4901kV7Gi1l" /><figcaption>We update the node’s response by providing a text on the “Assistant responds” section</figcaption></figure><p>Let’s give that a go:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*bfaC3kk2Lh3iHWdR" /><figcaption><strong>Tip</strong>: try this for yourself using IBM’s “<a href="https://cloud.ibm.com/docs/assistant?topic=assistant-getting-started#testing-the-start-node">Try it</a>” option</figcaption></figure><p>🎉 Cool, we’ve just taught our chatbot to answer these types of questions!</p><blockquote>But where do the <strong><em>$location</em></strong> and <strong><em>$subject</em></strong> variables come from? What if they don’t exist?</blockquote><p>We start by telling Watson that we want it to check for a <strong>subject </strong>and <strong>location </strong>in this request. To do this, we can take advantage of a feature of Watson called <a href="https://www.youtube.com/watch?v=ES4GHcDsSCI">slots</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g4djNK7jQTiD_Spg" /><figcaption><strong><em>Note:</em></strong><em> To use slots in a dialog node in Watson, first go to the node’s “Customize” settings and enable them</em></figcaption></figure><p>Slots are like saying “before I can complete what I want to do in this response, I want to check if certain properties are available already and if not, optionally ask for them”. In this example, we made the location optional because we can assume a default for that (e.g. the current room or all locations), but we made the subject<strong> </strong>mandatory because we need to know <em>what</em> to turn off. In Watson, you can do this by providing the response to be sent if the user doesn’t mention your required parameter. Here we come back with: “<em>What do you want to turn off?</em>” if subject is missing. Let’s see how that might go:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*6pyMDi6tpwlFNpwo" /></figure><p>Since the user didn’t include information about what to turn off in the original sentence the chatbot enquired about it before proceeding. Once the user replies with the required information, the dialog is allowed to carry on and generate the expected response. It didn’t ask for a location, because that’s an optional field, but if it weren’t, Watson would have moved on to the next missing parameters one by one. Even though we only ask what the user wants to turn off looking for a subject, if the user had included a location<strong> </strong>in its response, it’d still be taken into account. That makes slots an excellent tool when dealing with missing parameters, as they’ll handle both the situations where users just ask for everything all at once <strong>(more common when using voice)</strong> as well as those situations where they just answer questions with a sharp direct response <strong>(more common when typing, particularly mobile).</strong></p><p>One final thing we have to do is to clear the values of subject<strong> </strong>and location now that we’ve dealt with this request. Otherwise, the next time the user doesn’t include them, Watson will just reuse these same values. To do this, we create a “Clear State” node, whose only purpose is to erase these variables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wgXfJQ3kYpysBekB" /><figcaption>The new “Clear State” response node</figcaption></figure><p>Notice that since we never want this to happen in direct response to a user’s input, we don’t set any condition for this node. Instead, we make sure our #turn_off<strong> </strong>node jumps to this node after handling the reply:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kvSiMSmEpSKA90u7" /><figcaption>Back on the “Turn off” response node</figcaption></figure><p>Now that we’re done for #turn_off, we just have to follow the same steps for the #turn_on<strong> </strong>intent and we’ll end up with a dialog tree like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P8gNnlITLMwQZgOu" /></figure><p>And there you have it. You got yourself a chatbot that can understand and respond to your commands to turn your smart lights on and off around the house 🤖</p><p>💡 <strong>Just one more thing…</strong></p><p>There is one thing left though: how do you make the connection to an external service and make those actions happen for real?</p><p>To achieve this, the pseudo-code for our response should be something along these lines:</p><ol><li>Assess which are the <em>lights</em> located in the <em>living room</em></li><li>Dispatch a command to those devices to turn them off/on</li><li>Based on the outcome (success/failure) decide the response to be sent back to the user</li></ol><p>This means we need to be able to run a bit of custom logic and unfortunately we’ll need to do this outside of Watson Assistant. We need to implement the above logic in our server (or cloud function) and expose an endpoint for Watson to call whenever there’s work to be done.</p><p>First steps involve telling Watson that this chatbot needs to call an external endpoint, and what that endpoint is. We can do both from the node’s “Customization” settings when enabling <a href="https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-webhooks"><strong>Webhooks</strong></a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7k0pcJA2SEsw9FmJ" /></figure><p><strong><em>Tip</em></strong><em>: if you just want to test your chatbot quickly you can use a webhook testing tool like </em><a href="https://webhook.site/"><em>https://webhook.site/</em></a> <em>to generate a unique endpoint and quickly set up a response</em></p><p>Once we enable webhooks on a response node, Watson automatically adds a Webhooks section to our node including the <strong>Parameters </strong>we want to send over to our endpoint, and the <strong>Return Variable</strong> to store its result. So let’s use those to pass the <em>action</em>, <em>subject</em> and <em>location</em> we need, and assign the result to the <em>webhook_result_1 </em>variable (note that this variable name should be unique):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*znOWcfP3YcuzCnDc" /><figcaption>Pass the required information to the webhook to perform this action and save the result</figcaption></figure><p>With this we have all we need to implement the above pseudo-code, so let’s assume our API’s return contract to be:</p><ul><li><em>{ success: true } </em>when the action is successful</li><li><em>{ error: “reason” } </em>when the action fails</li></ul><p>Our dialog only needs to know if the request was successful, so we set our conditional responses according to whether the <em>success </em>field is present on the response or not. This way, even if the request times out or fails for another reason, we’ll still send out the error response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PeqFKbgQZf1G3Mhh" /><figcaption>Set our node’s response to be dynamic depending on the webhook’s result</figcaption></figure><p>With this change, if the action succeeds, we just acknowledge the action to the user as before, but if it fails, we now let the user know it by responding with “<em>I’m afraid I couldn’t do that at the moment</em>”.</p><p>And we’re done! All that’s left is replicating the above for the #turn_on<strong> </strong>intent and<strong> </strong>you have a chatbot that not only understands requests to turn things on and off, but would also able to perform those actions and respond accordingly! 🙌</p><p><strong>Step 4: Respond to the user</strong></p><p>Once we have actioned and decided our response, the final step is just sending that response back to the user through the original channel, thus completing a round of conversation. As for Step 1, we won’t focus too much on this as each platform has its detailed instructions on how to do this, but as an example, on Facebook, you’d use the messenger’s <a href="https://developers.facebook.com/docs/messenger-platform/reference/send-api/">Send API</a> to achieve this.</p><p>That’s it for Part III and our chatbot mini-series. We’ve covered everything from the chatbot landscape to the practical implementation of NLU and Dialog. In the process we created a Watson Assistant skill capable of <strong>understanding</strong>, <strong>acting</strong> and <strong>responding</strong> to requests to turn things on and off. You should now be able to take this example and explore your ideas for a chatbot.</p><p>As this is the last article of this series, we’ve included not only insights &amp; tips related to this article but also chatbot development in general:</p><p>💡 It’s important to understand the limitations of chatbots before envisioning, designing and specifying the scope of one. <strong>NLU got a big push in recent years with the advances of machine learning but, at its core, dialog building still follows the same basic principles it would have 20 years ago</strong>. At <a href="http://www.glazedsolutions.com/">Glazed</a> we iterated through multiple alternatives to build chatbot dialogues but ended up developing our own Dialog Engine to give us the flexibility we needed.</p><p>💡 When designing your conversation, <strong>design the error/misunderstanding path from the start</strong>. This might seem trivial, but as you start building more complex dialog trees it will be key to have a solid fallback. <strong>No matter how well you design your chatbot, this fallback path will always be a possibility.</strong></p><p>💡 You’ll find many services online offering all-in-one solutions for chatbot development (NLU + dialog + copy + conversation context). These are fine to get you started and smaller projects, but they might fall short for long term commitments.<strong> </strong>Over time you might want to add additional languages, deploy to additional channels, include new dialog, tweak &amp; improve NLU sets, etc. If so make sure these things are all possible and relatively simple.</p><p>💡 If you’re a developer this goes without saying, but <strong>you’ll want to make sure your workflow enables proper version control, PRs, reviews, releases, etc… </strong>I dare you to achieve that through these service’s web tools 😬🤯</p><p>💡 Depending on the chatbot, <strong>personal information might be shared during conversations. </strong>This might be particularly hard to narrow down to specific locations in chatbots using natural language, <strong>so consider enforcing global privacy-aware logging policies </strong>(e.g. limited log access, short life span, automatic data maskers, …).</p><p><em>Thanks for reading, if you enjoyed our content you can find more over at our </em><a href="https://twitter.com/glazedSolutions"><em>Twitter</em></a><em>, </em><a href="https://www.facebook.com/glazedEliteDevelopers"><em>Facebook</em></a><em> and </em><a href="https://www.linkedin.com/company/glazed-solutions/"><em>LinkedIn</em></a><em> 👋</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28aa0de83133" width="1" height="1" alt=""><hr><p><a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-iii-28aa0de83133">Chatbots: What, Why and How (part III)</a> was originally published in <a href="https://medium.com/glazed-dev">Glazed Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chatbots: What, Why and How (part II)]]></title>
            <link>https://medium.com/glazed-dev/chatbots-what-why-and-how-part-ii-a5399f2ce274?source=rss-1f7730fc3276------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5399f2ce274</guid>
            <category><![CDATA[ibm-watson-assistant]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[nlu]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Ricardo Moutinho]]></dc:creator>
            <pubDate>Wed, 13 May 2020 11:01:31 GMT</pubDate>
            <atom:updated>2020-05-13T11:01:31.540Z</atom:updated>
            <content:encoded><![CDATA[<p>How do chatbots work? A beginner’s guide to building yours focusing on NLU</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6NfhieH_3iSaYrDhv0Y5Q.png" /></figure><p>Welcome back to the second part of our chatbot mini-series. If you missed our first article, and want to know more about the chatbot landscape and their relevance in today’s markets, you can find <a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-i-a6fc4655430d"><strong>Part I here</strong></a>.</p><p>In this article we’ll be diving into the inner workings of a chatbot, focusing on the Natural Language Understanding (NLU) component. For those unfamiliar with it, NLU is a subfield of Natural Language Processing (NLP) where Artificial Intelligence (AI) is used to attempt to comprehend the meaning of written sentences or speech, and its developments have allowed chatbots to become better at understanding us. We’ll be taking a step-by-step approach on how to get started with NLU using <a href="https://cloud.ibm.com/catalog/services/watson-assistant">IBM’s Watson Assistant</a> to illustrate a practical example below. If you’re up for it, give it a try and tag along, there’s a free tier 😉</p><p>As before, at the end of this article, there’ll also be a few insights &amp; tips about the subjects covered…but enough of this, let’s get started! 💪</p><h3>What makes chatbots tick?</h3><p>A chatbot sees a conversation as single rounds of back and forth requests &amp; responses happening over and over. In each of these rounds, the state and context of the conversation are changing, but we can break down each round into a few main steps:</p><ol><li>Receive the user’s input</li><li>Transform it into a standard data structure our chatbot can process (NLU)</li><li>Decide the path and actions to take based on the conversation state, context and request (Dialog)</li><li>Get the response back to the user</li></ol><p>In this article, we’ll take a closer look at the first two steps and we’ll cover the remaining steps on Part III.</p><h4>Step 1: Receive the user’s input</h4><p>The first thing you need to be able to do is to receive messages from your users. Depending on which channel you’re going for <em>(Facebook Messenger, Google Actions, etc.),</em> this might involve implementing an SDK or, in most channels, just registering a webhook to receive new message events from conversations with your chatbot. We won’t focus too much on this step as each platform has its detailed instructions on how you can set this step up, but an example of what you might get on each event originating from Facebook chat can be seen <a href="https://developers.facebook.com/docs/messenger-platform/reference/webhook-events/messages">here</a>.</p><h4>Step 2: NLU</h4><p>Once you have access to the user’s request, you need to transform its input into something that your chatbot will understand. This is where NLU comes into play. You can use it to take the incoming message and transform it into a standard data structure that you can build a dialog tree around.</p><p>The typical outcome of NLU processing is a set of <strong>Intents </strong>and <strong>Entities</strong>. Here’s an example:</p><p><strong>User input</strong>: <em>“Turn off my living room lights”</em></p><p>NLU processing outcome:</p><p><strong>Intents:</strong></p><ul><li>turn_off</li></ul><p><strong>Entities</strong>:</p><ul><li>location: living room</li><li>subject: lights</li></ul><p><strong>Intents</strong> <strong>attempt to categorise the action</strong> associated with the input, while <strong>entities allow you to get additional contextual information</strong> from the sentence. You can think of them as the whats, the hows, the whens, and so forth.</p><p>Note that by default, a blank NLU model won’t be able to understand these things for any inputs, although NLU services will usually allow you to add recognition for some things by default, including common intents (greetings, goodbyes, …) and entities (dates, times, locations, numbers, …). Still, once you start building your chatbot, you’ll need to decide what you want it to be able to understand and train your NLU model to recognise it.</p><p>Let’s see how you can do that by creating an NLU model capable of understanding requests to turn things off, replicating the example above. To get started, let’s create a blank dialog skill in <a href="https://cloud.ibm.com/docs/assistant?topic=assistant-getting-started">Watson Assistant</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*af8qF_k4RteA6itw" /><figcaption>If you need additional assistance on setting up your first skill take a look <a href="https://cloud.ibm.com/docs/assistant?topic=assistant-skill-add">here</a></figcaption></figure><p>To teach it how to understand an intent, we need to provide it with different examples of what people might typically say to achieve that goal. In this case, let’s create the <strong><em>turn_off</em></strong> intent — <em>a way of users asking to turn something off</em> — with the following examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8o4ELHqjgtOWpdOl" /><figcaption><a href="https://cloud.ibm.com/docs/assistant?topic=assistant-intents">Additional information on adding intents to your skill</a></figcaption></figure><p>For a production rollout we could certainly add more but for the purpose of this example, these will be enough. With the intent out of the way, we also have to teach it about the two entities we want it to look for: <strong>locations</strong> and <strong>subjects</strong>. These are the things we want to look out for in requests to “turn something off”. We want to know <em>what </em>to turn off, and potentially, from <em>which location</em>. To do this, let’s create both entities and specify the values they could take:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ECDSm_gE8ls0Uxbl" /><figcaption><a href="https://cloud.ibm.com/docs/assistant?topic=assistant-entities">Additional information on adding entities to your skill</a></figcaption></figure><p>Note that these could take more values, but for now, we’ll assume our chatbot’s goal is just to be able to understand requests related to <em>lights </em>in our <em>kitchen</em> and our <em>living room</em>. To improve their recognition, we also add a few synonyms for each value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3WuYT-DctNdkFOBi" /></figure><p>When specifying your entities, always take a few moments to think of synonyms that people might use to refer to them, as they represent a quick and easy improvement to your chatbot’s capability to understand natural requests. In this example, we’ve added <em>lamp, bulb </em>and <em>chandelier </em>as synonyms that people might use to refer to when asking to turn off the lights. Note that in Watson, entities will <a href="https://en.wikipedia.org/wiki/Approximate_string_matching">fuzzy match</a> values by default, so we don’t need to add plurals or typos for these.</p><p>Ok! We’ve created the <strong><em>turn_off</em></strong> intent and the two entities we needed so our NLU model should now be able to:</p><ul><li>Understand when a user asks to <em>turn something off</em></li><li>Be able to identify any <em>subject </em>and <em>location</em> included in those requests</li></ul><p>Let’s give it a go! 🤞🏻</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/0*zDXdPP2TOzwV-cfD" /><figcaption>Tip: try this for yourself using IBM’s “<a href="https://cloud.ibm.com/docs/assistant?topic=assistant-getting-started#testing-the-start-node">Try it</a>” option and check your model as you go</figcaption></figure><p>Success 🎉</p><p>Still, you might be thinking…</p><blockquote>“What’s so special about that? That looks just like regular string matching”</blockquote><p>The magic of NLU is that through machine learning, even if the user goes for a different utterance we can still get the same intent and entities returned to us, without ever explicitly teaching the model that sentence. Let’s try something slightly different:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/0*BMBw_Q0ou2tpKqj9" /></figure><p>We still got the same results! This means that <strong>from a</strong> <strong>relatively small number of examples, you can start building a chatbot that understands many of the variations </strong>we see between how each person asks for something.</p><p>Try playing around with it for a while using different sentences users might use to ask to turn lights off. If you find one that the chatbot doesn’t understand, teach it by adding it as an example to the <em>turn_off</em> intent and try again. The more iterations you go through, the more robust your chatbot will become 🦾</p><p>What happens if we ask our model about anything else though? Since we started with a blank model, most things just won’t be understood at all, but even worse, let’s see what happens if we ask it to turn the lights back on:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/0*ZiEgwSNXDcdF6fH0" /></figure><p>That doesn’t look right 🤔</p><p>It still thinks we’re trying to turn the lights <strong>off</strong>, even though we’re trying to turn them <strong>on. </strong>Why is that? Our current model only knows about turning things off so to it, this request looks pretty similar to that. Let’s add a <strong><em>turn_on</em></strong> intent as well and see if that makes a difference:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wvwDAEbnaRXzK1CL" /></figure><p>Again, we only add a few examples, similar to the ones we used for the <em>turn_off</em> intent. Let’s see what happens now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/0*Kh_iE1eO2NYEqoj3" /></figure><p>🎉 Now that our model knows about turning things on as well, it can easily distinguish between both intents. Notice how the entities we specified are still correctly identified in these requests as well. That’s because entities aren’t really tied to intents, they will always be recognised whenever they appear in a sentence.</p><p>That’s it for Part II. We’ve covered the basics of NLU and created a Watson Assistant skill capable of understanding requests to turn things on and off. In the next and final article of this mini-series, we’ll cover the remaining two steps and show you how you to create a dialog, having your chatbot reply and perform actions based on the user’s requests. If that sounds interesting, stay tuned!</p><p>As promised, before we go, here are a few insights &amp; tips related to NLU:</p><p><strong>💡 It’s important to understand what scope you want your chatbot to cover before deciding what you’re going to map as an intent or an entity.</strong> As we’ve just seen, this can easily make a difference in your dataset’s performance, and it will also impact its capability to evolve.</p><p><strong>💡 The more you focus your efforts on the scope you want your chatbot to excel at, the more its users will be pleased with the experience. </strong>Just because AI is powering your chatbot’s understanding it doesn’t mean it will be able to understand and chat about everything…and that’s probably not what you want anyway!</p><p><strong>💡 Optimising your NLU model might depend on the channel you’re aiming for</strong>. For example, voice platforms (e.g. Alexa, Google Assistant) using Speech-to-Text to generate the user’s input, will commonly include wrong words amid sentences that <strong>sound alike </strong>to the desired word, while text first platforms (e.g. webchat, FB messenger, WhatsApp) will commonly include <strong>typos or abbreviations</strong>.</p><p><strong>💡 Before going live make sure you can track these and have a process in place for improving your intent categorisation. </strong>Chatbots improve over time as you train them with more examples from real conversations.</p><p><em>Thanks for reading, if you enjoyed our content you can find more over at our </em><a href="https://twitter.com/glazedSolutions"><em>Twitter</em></a><em>, </em><a href="https://www.facebook.com/glazedEliteDevelopers"><em>Facebook</em></a><em> and </em><a href="https://www.linkedin.com/company/glazed-solutions/"><em>LinkedIn</em></a><em> 👋</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5399f2ce274" width="1" height="1" alt=""><hr><p><a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-ii-a5399f2ce274">Chatbots: What, Why and How (part II)</a> was originally published in <a href="https://medium.com/glazed-dev">Glazed Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chatbots: What, Why and How (part I)]]></title>
            <link>https://medium.com/glazed-dev/chatbots-what-why-and-how-part-i-a6fc4655430d?source=rss-1f7730fc3276------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6fc4655430d</guid>
            <category><![CDATA[chatbots-for-business]]></category>
            <category><![CDATA[google-actions]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[alexa-skills]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Ricardo Moutinho]]></dc:creator>
            <pubDate>Wed, 29 Apr 2020 09:21:09 GMT</pubDate>
            <atom:updated>2020-05-26T10:37:49.534Z</atom:updated>
            <content:encoded><![CDATA[<p>Learn about what they are, how they work and how you can build your own</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BveXj87e_lw-HemBbuoP3w.jpeg" /></figure><p>Here at <a href="https://medium.com/glazed-dev">Glazed</a> we started working with Chatbots and NLU (Natural Language Understanding) back in 2016. Since then we’ve delivered chatbots for Alexa, Facebook Messenger, Google Assistant, Web pages, Salesforce, WhatsApp, and even Slack, so we thought we’d talk a bit about them and share a few of the things we learned along the way.</p><p>This is the first of three articles, where we cover:</p><ul><li><strong>Part I</strong>: An introduction to chatbots, what they are and why are they relevant in today’s market.</li><li><a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-ii-a5399f2ce274"><strong>Part II</strong></a>: How do they work? We start taking a practical look into the steps needed to build a chatbot, focusing on the NLU model generation.</li><li><strong>Part III</strong>: In the final article, we build upon our work from part II and by focusing on the addition of Dialog, we’ll have covered the main steps involved in the creation of a basic chatbot.</li></ul><p>At the end of each article, there’ll also be a few insights &amp; tips about the subjects covered…but enough of this, let’s get started! 💪</p><h3><strong>What are chatbots and why should I care?</strong></h3><p>We’ve all probably already had an experience with some sort of chatbot by now. For a few good years, they’ve been making their way into more and more business pages, social platform presences and customer service chains. Propelled by the Artificial Intelligence (AI) push cycle we’ve been experiencing through the last half of the decade, as businesses look for ways to take AI on board, chatbots are frequently one of the first items on their list.</p><h4>Why is that?</h4><p>It comes down as the result of a few key points:</p><ul><li><strong>Chatbots are an understandable concept</strong>, with several businesses already deploying some level of client-facing automation through their customer service chains.</li><li>Being able to take on the ever-growing<strong> instant messaging market has great appeal to businesses</strong>, as does being able to provide some level of <strong>customer reach through multiple social channels easily.</strong></li><li><strong>Virtual assistants </strong>like Alexa, Google Assistant and Siri are now widely used products, present in millions of homes and personal devices, <strong>familiarising and building the trust of mainstream audiences in the concept of automation through natural language. </strong>One might even find them… on their next <a href="https://youtu.be/xYsy9Yd5grs">toilet</a>? 😮</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FxYsy9Yd5grs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxYsy9Yd5grs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FxYsy9Yd5grs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/69d32f8a631de36729ecb7577d40135a/href">https://medium.com/media/69d32f8a631de36729ecb7577d40135a/href</a></iframe><h4>What’s so great about them?</h4><p>Most chatbots’ purpose is to automate specific tasks either for scalability, efficiency or plain convenience, but that’s not all there is to it.</p><p>Some of their key advantages include:</p><ul><li><strong>Platform support: </strong>Chatbot support has been steadily increasing through social, instant messaging and virtual assistant platforms, allowing businesses to expand their offers and reach more customers through their preferred channel.</li><li><strong>24/7 availability: </strong>Chatbots are always available.<strong> </strong>Take the customer service scenario, human agents are a limited resource and work during specific hours. Chatbots help fill in the gap, answering requests out of business hours and saving the agents’ capacity for the situations that really require it during the day.</li><li><strong>Instant replies: </strong>Not only are chatbots always available but they can also respond almost instantly to questions.</li><li><strong>Scalability: </strong>Chatbots are built to scale, so they can go from servicing a few users to handling hundreds of conversations simultaneously over time.</li><li><strong>Cost-effectiveness: </strong>All of the above combined, make chatbots a cost-efficient solution. Their availability and response rate keep users happy, while their cost-effective scalability helps businesses cope with customer demands as they grow.</li></ul><h4>Are all chatbots the same?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MlghQxqit7894N3rNAbvlg.jpeg" /></figure><p>Chatbots might be encountered in all sorts of devices, but when it comes to their interaction design, there are mostly two main paths to take:</p><ul><li><strong>Natural language-based</strong>: taking advantage of <strong>NLU </strong>and <strong>machine learning</strong>, these chatbots <strong>try to understand natural commands </strong>like <em>“Turn off the lights in the living room”</em> based on models trained through hundreds or thousands of examples. They will also reply in the same manner, <strong>leading to more natural conversations</strong> taking place without strict paths to follow.</li><li><strong>Functional based</strong>: these bots don’t worry as much about “sounding human”, instead <strong>focusing on enabling their tasks to be performed as efficiently and quickly as possible</strong>. An example would be a triage chatbot that simply collects your information through a <strong>series of closed response predetermined questions</strong>.</li></ul><p>Both have their ups and downs and selecting which to go for should be done based on the specific problem at hand. However, even a functionality focused chatbot can be quickly trained to take some advantage of NLU<strong> </strong>to improve its User Experience (UX). If your chatbot is targeted at a general audience, a natural language-based experience is likely the way to go.</p><h4>How are they being used?</h4><p>There are many use-cases typically associated with chatbots, but here are some of the best ones we’ve worked on for businesses:</p><ul><li><strong>Customer services</strong>: One of the most valuable and best-suited use-cases for chatbots is having them answer common customer questions 24/7 while escalating more complex issues to human support agents.</li><li><strong>Booking scenarios: </strong>From dinner reservations or barber appointments to booking flights or buying event tickets, chatbots are a good fit for enabling these journeys on the go.</li><li><strong>Tracking scenarios: </strong>As for bookings, keeping track of the status of <em>something</em> is another good use-case for chatbots. Be it your latest delivery, a payment confirmation, your flight’s status or your favorite stocks, being able to ask a virtual assistant about it makes people feel like they’re living in the future 🤖</li><li><strong>Automation of repetitive work:</strong> By taking repetitive and error-prone chores away from humans, chatbots can increase both businesses and personal productivity.</li></ul><p>That’s it for today’s introduction but before we wrap up, a few insights &amp; tips:</p><ul><li>A chatbot <strong>isn’t the right answer for all problems, but it can be a very efficient one when used correctly.</strong></li><li><strong>As a conversation designer, consider an escalation path for the user to still achieve its goal if the chatbot fails. </strong>For example, if your chatbot is replacing a customer service team during out of hours and it fails to handle a client’s request, consider having a process to arrange a callback, leaving all the information ready for human agents to pick up when they get back to work the next morning.</li><li><strong>If your chatbot sits in front of a human, remember that some people will prefer to speak to the human directly</strong> and you should respect and facilitate that path as well.</li></ul><p>With the intros out of the way, we can now get to the nitty-gritty of chatbots. In the next articles, we’ll take a practical look into how a chatbot is built, as we provide instructions on how you can get started building your own NLU and Dialog using <a href="https://www.ibm.com/cloud/watson-assistant/">IBM Watson Assistant</a>. If that sounds interesting, stay tuned!</p><p><em>Update</em>: Part II is now available <a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-ii-a5399f2ce274">here</a>.</p><p><em>Thanks for reading, if you enjoyed our content you can find more over at our </em><a href="https://twitter.com/glazedSolutions"><em>Twitter</em></a><em>, </em><a href="https://www.facebook.com/glazedEliteDevelopers"><em>Facebook</em></a><em> and </em><a href="https://www.linkedin.com/company/glazed-solutions/"><em>LinkedIn</em></a><em> 👋</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6fc4655430d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/glazed-dev/chatbots-what-why-and-how-part-i-a6fc4655430d">Chatbots: What, Why and How (part I)</a> was originally published in <a href="https://medium.com/glazed-dev">Glazed Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>