Building a basic ChatBot Points (30 points) Exercise 1: Create a skill for your chatbot This lab is all about intents, but in order to work with them, we'll need to create a dialog skill which will...

1 answer below »
I added the CSV file for Exercise 4 if the link in the document doesn't work


Building a basic ChatBot Points (30 points) Exercise 1: Create a skill for your chatbot This lab is all about intents, but in order to work with them, we'll need to create a dialog skill which will contain said intents (along with entities and the dialog itself). Although it's possible to create elaborate chatbots that use multiple skills, it is common to have just one skill per chatbot. In other words, for now, you can simply think of your dialog skill as your chatbot. This lab is all about intents, but in order to work with them, we'll need to create a dialog skill which will contain said intents (along with entities and the dialog itself). 1. From the Skills page of your Watson Assistant instance, click on the Create new button. (If you didn't bookmark your instance in the previous lab, you can find it within your dashboard.) 2. Here you'll be able to add a Dialog Skill as shown in the image below. You'll be offered to enter a Name and an optional Description. Enter Flower Shop Skill or whatever you prefer for the name. For the description, feel free to add A skill for a flower shop chain. or something similar. You'll also notice that the UI offers you to create a sample customer service skill from the Use sample skill tab and even import skills from JSON files from the Import skill tab. You can ignore both for now. 3. We'll create the chatbot in English, but which other languages are also supported? Find out from this window. 4. Ensuring English (U.S.) is selected, click on the Create button to generate the empty skill for your chatbot. 5. Practice going back and forth between the Skills page and the skill you just created (e.g., Flower Shop Skill). NOTE: At any time, you can add new skills from the Skills tab of your Watson Assistant instance. Clicking on the three vertical dots within a skill will allow you to delete, rename, duplicate or export to the JSON file format a given skill, as shown in the image below. Exercise 2: Create, train, and test intents Upon creation of the skill, you'll find yourself on the Intents section of your skill or the Dialog skill that you can click & which takes you to the Intents section. Here you can add intents in several ways. In this exercise, we'll focus on the most common way. That is, manually adding intents. 1. From the Intents section of your dialog skill, click on the Add intent button. Here you'll be able to define an Intent name and a Description. What happens if you try to call the intent #greeting us with a space in the name? 2. Define a #greetings intent. You can leave the description blank and then click the Create intent button. 3. You'll be prompted to create some user examples to train Watson on the concept of greetings. Enter hello then click Add example. Repeat the process for other greeting examples such as hi, hey, good morning, good afternoon, and so on. Make sure you add one example at the time. You don't need to go crazy, especially on such a simple intent, but you should always include at least 5 examples. Ideally more, particularly for more complex intents. If you make a typo in one or two of your examples, don't worry. Keep the typos, as your users are likely to do the same mistakes, so this ends up training Watson on a more realistic input set. When you are done, you can click the back arrow icon at the top to go back to your list of intents. 4. Repeat the process to add the #thank_you and #goodbyes intents with at least 5 appropriate examples each. For #thank_you, you might use examples such as thank you, thanks, thx, cheers, and appreciate it. For #goodbyes, you might want to use good bye, bye, see you, c ya, and talk to you soon. At this point, you'll have the most basic chitchat intents a chatbot needs to have. The more the merrier, of course, but this will do for now. 5. To test our intents, click on the Try it button in the top right. A chat panel will appear where you can try user input and see how Watson analyses it and how our chatbot responds. We haven't provided responses yet (we'll do so in the module on Dialog) but we can still use it to test the classification of our intents. If you see a Watson is training message, please wait for Watson to finish training on your intent examples. 6. Go ahead and try some greetings, thank you, and goodbye messages in the panel. Feel free to try both examples you provided and expressions that you haven't provided as examples. For instance, try Hola and Aloha. Though specific to certain languages, they are common enough intentionally to be recognized as greetings by Watson. Now, try it with Kia Ora, a common greeting in New Zealand, but not a globally adopted one. Chances are Watson will categorize it as Irrelevant. If Watson miscategorized one example, as it arguably did in this example, feel free to click on the V symbol next to the detected intent to assign a different intent to it. This will add your utterance (e.g., Kia Ora) as an example for the intent you picked (e.g., #greetings), further training Watson. The image below shows the message we receive when we make an intent correction directly from the Try it out panel. The word model is used to refer to the fact that Watson will use our correction to further train its Machine Learning model. -------------------------------------------------------------------------------------------------------------- Exercise 3: Add intents from the Content Catalog IBM provides you with some ready-made intents that might be relevant to the scope of your chatbot. To see what's available, click on Content Catalog within your dialog skill. Select one category of your choice (e.g., Banking) and then click on the Add to skill button next to it. Switch back to the Intents section and you should see a series of new intents relevant to common queries customers may have for the category of your choice. This isn't quite a pre-made chatbot but it's a nice starting point, that you can edit and adapt as needed. Feel free to try them out in the Try it out panel. For example, if you added banking intents, try I lost my credit card in the Try it out panel. What intent is detected by Watson? We are not going to use them for our Flower Shop Chatbot so select the checkmarks next to them and press the Delete button to remove them. (Make sure you keep the chitchat intents we created.) You'll notice how you were also given the option to export them, which is quite useful when reusing intents across different chatbots. Go ahead, select our three chitchat intents and click on the Export button to download a CSV file containing our intents and examples. Open the file to see what it looks like. As you can see, it's very easy to create, modify, and delete intents, whether they were manually created or imported from the Content Catalog. --------------------------------------------------------------------------------------------------- Exercise 4: Import intents from a CSV file Just like we exported our intents to a CSV file, we can do the opposite and import intents from a CSV file. This format is particularly handy because it allows you to easily import intents (and their examples) from a spreadsheet. Let's see how this works in practice. 1. Download the CSV file I prepared for you: hours_and_location_intents.csv If clicking on it simply opened the file in a new tab in your browser instead of downloading it, with that tab selected, press CRTL+S on Windows or ⌘+S on Mac to download it. You'll notice that the structure of the file is very simple. Each line of the file has an example, comma separated by the intent we want to assign to it. In our Flower Shop Chatbot we want to allow people to inquire about hours of operation and addresses of our flower shop stores, so this file includes examples for both #hours_info and #location_info. Note that the # prefix is not included in the CSV file. It will be automatically added by Watson to the intent names when importing them. 2. From the Intents section of your skill, click on the Import intents icon next to the Add intent button. 3. Select Choose a file from the window that appears, and find the CSV file you just downloaded in the first step. https://d18ky98rnyall9.cloudfront.net/8CRA91A0EemFOA6Hm29iNA_35cd1124c08344a784902e84c7bcb560_hours_and_location_intents.csv?Expires=1571875200&Signature=UNRrJCIAsUusPySHz~ZDDiAKHCeHMmliDWBI3rHd4KrLhggCTZvu5XjW~HGfpE~x5737gKrw612H9CRW9AEKAQtOzA0q7llpb6VkJ304xEVPy9wHnuueoEmM9tBSDvhSLGHuMTTQF6QrU-ZgYoCHpsIjnJC4NwDenYaAdZKdVuY_&Key-Pair-Id=APKAJLTNE6QMUY6HBC5A 4. Click on the Import button. A report of what was imported will be shown as seen in the picture below. Click on Done to close the window. You now have successfully imported two new intents and their examples to train Watson. Take a moment to review the intents that were imported and the examples for each of them. Next, take them for a spin in the Try it out panel. Ask questions like you naturally would to inquire about store hours or address information. Does it recognize the intents we imported well enough? Train Watson further by adding your own examples directly from the Try it panel when it fails to interpret them correctly. At this point, our chatbot understands basic chitchat and it detects when a question is about hours of operation vs when it's about location. You can click on that intent name in the Intents section of your skill to verify that the example was indeed added automatically for you. If you test the same utterance again, Watson will correctly recognize the right intent this time. In the Try it out panel, what happens if you try a nonsensical input? Randomly smash on the keyboard if you have to. Personally, I produced the beautiful, cat-walking-on-the-keyboard string dljkasdlsa dasldj alskdkas ld
Answered 2 days AfterApr 20, 2021

Answer To: Building a basic ChatBot Points (30 points) Exercise 1: Create a skill for your chatbot This lab is...

Sandeep Kumar answered on Apr 22 2021
139 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here