1 00:00:00,380 --> 00:00:03,830 So at this point, Armin, I could imagine that these dialogs can get pretty complex, 2 00:00:03,830 --> 00:00:04,370 pretty quickly. 3 00:00:05,590 --> 00:00:08,980 >> Yes, they can, as complex as you need them to. 4 00:00:08,980 --> 00:00:12,760 You can build lots of intents, recognize lots of entities, and 5 00:00:12,760 --> 00:00:16,526 control the dialog with lots of nodes and conditions. 6 00:00:16,526 --> 00:00:17,400 >> In this car chatbot, 7 00:00:17,400 --> 00:00:20,720 we have a lot more of those things built out in a more detailed example. 8 00:00:20,720 --> 00:00:24,050 Let's take a look to see how a more complex bot looks, and 9 00:00:24,050 --> 00:00:26,060 how we can copy some of it for our own bot. 10 00:00:27,640 --> 00:00:30,800 So first you'll need to switch back to your Workspaces page. 11 00:00:30,800 --> 00:00:34,960 We can expand this menu on the left, and click Back to workspaces. 12 00:00:34,960 --> 00:00:37,910 And then this is the Car Dashboard sample that was created for 13 00:00:37,910 --> 00:00:40,070 us when we created this workspace. 14 00:00:40,070 --> 00:00:45,560 So if we click on this, we get a little note that it's being freshened up for us. 15 00:00:45,560 --> 00:00:48,750 And here we can see lots of different intents. 16 00:00:48,750 --> 00:00:55,018 And you can see on the right that these have lots of different samples built in. 17 00:00:55,018 --> 00:00:58,637 So this #capabilities one has over a hundred different samples 18 00:00:58,637 --> 00:01:01,860 about asking what kind of capabilities the chatbot has. 19 00:01:03,010 --> 00:01:05,230 Same thing if we switch to the entities. 20 00:01:05,230 --> 00:01:08,940 We can see there are a number of different entities with lots of values and 21 00:01:08,940 --> 00:01:12,120 synonyms, and a more complex dialog. 22 00:01:12,120 --> 00:01:17,460 So here we have an initializer, much like the welcome node that we saw in our own. 23 00:01:17,460 --> 00:01:22,570 And then there's #turn_off, there's a #turn_up command here, and 24 00:01:22,570 --> 00:01:26,600 different nodes that respond to different intents in this chatbot. 25 00:01:28,350 --> 00:01:30,610 Just like our own, we can test this sample out. 26 00:01:30,610 --> 00:01:36,246 We can say things like hi, what can you do? 27 00:01:36,246 --> 00:01:39,010 And the bot tells us that it's trained to turn things on or 28 00:01:39,010 --> 00:01:40,640 off in the car dashboard, cool. 29 00:01:40,640 --> 00:01:44,350 So we can say yeah, find a nearby gas 30 00:01:44,350 --> 00:01:49,310 station, and it says there's some gas stations nearby. 31 00:01:49,310 --> 00:01:52,860 This is very similar to the sample that Arman walked us through earlier. 32 00:01:53,990 --> 00:01:56,860 So one very cool thing that we can do is export these intents and 33 00:01:56,860 --> 00:02:00,100 entities from this workspace into another. 34 00:02:00,100 --> 00:02:02,170 Let's try it with the capabilities. 35 00:02:02,170 --> 00:02:07,910 So I'm going to switch back to Intents, and I want to click on Export right here. 36 00:02:07,910 --> 00:02:11,200 Then I can select everything that I want to export, 37 00:02:11,200 --> 00:02:14,520 I'll just do #capabilities, give it a check box. 38 00:02:14,520 --> 00:02:17,530 I'm gonna close the tester over here, and click Export. 39 00:02:18,940 --> 00:02:22,320 And it looks like that was exported in comma separated values. 40 00:02:22,320 --> 00:02:23,885 Let's take a look at how that looks. 41 00:02:23,885 --> 00:02:27,980 And yeah, it's just a huge list of different 42 00:02:27,980 --> 00:02:33,045 sample things that people might say to understand capabilities, interesting. 43 00:02:33,045 --> 00:02:34,890 Right, I'm gonna close this. 44 00:02:34,890 --> 00:02:38,950 And now we also want to export the corresponding entities. 45 00:02:38,950 --> 00:02:45,520 So we have @capabilities_subject, I guess let's take that one. 46 00:02:45,520 --> 00:02:50,798 Export @capabilities_subject, we'll get another CSV. 47 00:02:50,798 --> 00:02:53,300 And now we can switch back to our own app. 48 00:02:53,300 --> 00:02:58,430 So I'm gonna go back to Workspaces, click on the Treehouse Car Chatbot, and 49 00:02:58,430 --> 00:02:59,390 we can just import the data. 50 00:02:59,390 --> 00:03:03,300 Again, this is just a way to show how you might wanna do data entry 51 00:03:03,300 --> 00:03:04,360 in a different format. 52 00:03:04,360 --> 00:03:08,750 You could have somebody type a bunch of samples in a comma separated value, 53 00:03:08,750 --> 00:03:12,500 some kind of text document, and then import them just like this. 54 00:03:12,500 --> 00:03:14,600 So if I click Import, I can choose a file. 55 00:03:15,970 --> 00:03:19,240 And I'll go to Downloads and I'll get the most recent file. 56 00:03:20,800 --> 00:03:24,691 And you can see I've got multiple copies because I tried this before, but 57 00:03:24,691 --> 00:03:26,260 I want the intent first. 58 00:03:26,260 --> 00:03:31,660 So I'm gonna grab the intents file, click Open and Import. 59 00:03:31,660 --> 00:03:34,750 After a moment we get a successful window here, 60 00:03:34,750 --> 00:03:37,320 one new intent with 120 examples added. 61 00:03:37,320 --> 00:03:39,160 And if I click on Done, 62 00:03:39,160 --> 00:03:43,270 you can see all the different capabilities similar to what we saw in the sample. 63 00:03:44,410 --> 00:03:47,300 And for completeness, let's do the same thing for entities. 64 00:03:47,300 --> 00:03:51,720 We will Import, Choose a file, grab those entities, 65 00:03:51,720 --> 00:03:53,880 which you can see in the file name here. 66 00:03:53,880 --> 00:03:57,666 Click on Open, Import, get the success message, and 67 00:03:57,666 --> 00:04:00,558 we get those @capabilities_subject. 68 00:04:00,558 --> 00:04:03,850 Now, if we wanted to do dialog as well, then it's a bit further. 69 00:04:03,850 --> 00:04:07,110 We need to export and import the whole workspace, right Armin? 70 00:04:07,110 --> 00:04:13,280 >> Very true, at that point, we import a JSON file that would contain, 71 00:04:13,280 --> 00:04:18,100 most likely, intent entities and a dialog format. 72 00:04:18,100 --> 00:04:22,010 And that's a good point, we can do it for the whole workspace. 73 00:04:22,010 --> 00:04:25,490 We could also create a node, I'm just gonna do this for a sample here. 74 00:04:25,490 --> 00:04:29,449 And here in the response, we haven't looked at this yet, but 75 00:04:29,449 --> 00:04:32,203 we can switch over to the JSON editor view. 76 00:04:32,203 --> 00:04:36,112 And we could pick and choose Individual snippets of JSON, if we wanted to, for 77 00:04:36,112 --> 00:04:38,320 a specific node, is that correct? 78 00:04:38,320 --> 00:04:39,390 >> Very true, very true. 79 00:04:39,390 --> 00:04:43,843 In fact, we use Span language in this JSON format to 80 00:04:43,843 --> 00:04:47,860 build rather complex dialog structures. 81 00:04:47,860 --> 00:04:48,470 >> Cool, very cool. 82 00:04:50,450 --> 00:04:54,614 Okay, so I'm going to get rid of this node, because it's not doing anything, 83 00:04:54,614 --> 00:04:55,370 Delete here. 84 00:04:55,370 --> 00:04:58,400 [LAUGH] It gives me a nice warning, yes, I do wanna delete it. 85 00:04:58,400 --> 00:05:00,570 And I'm gonna do the same double test as before. 86 00:05:00,570 --> 00:05:05,040 First, I'm gonna open up and Watson looks like it's done training. 87 00:05:05,040 --> 00:05:08,492 So I can ask this bot, what can you do? 88 00:05:08,492 --> 00:05:09,840 And I should get a response. 89 00:05:11,180 --> 00:05:14,122 This is because I didn't setup an actual dialog for it. 90 00:05:14,122 --> 00:05:15,348 >> Very true. >> I would need to go ahead and 91 00:05:15,348 --> 00:05:16,590 manually do it. 92 00:05:16,590 --> 00:05:21,820 So let's do that real quick, actually, just to make this example complete. 93 00:05:21,820 --> 00:05:26,880 We'll name this #capabilities, just like we did before to match the intent. 94 00:05:28,150 --> 00:05:32,880 If the bot matches the new #capabilities intent, there it is in auto complete, 95 00:05:32,880 --> 00:05:39,516 we'll enter a response like, I can turn on things like the radio, 96 00:05:39,516 --> 00:05:45,190 heater, AC, and lights. 97 00:05:45,190 --> 00:05:47,150 Okay, now I'm gonna close this. 98 00:05:49,050 --> 00:05:52,010 And let's see, does Watson need to train itself on this one or 99 00:05:52,010 --> 00:05:53,190 is that a pretty quick change? 100 00:05:53,190 --> 00:05:56,080 Looks like it was a pretty quick change, so let's try it again. 101 00:05:57,250 --> 00:06:01,367 What can you do? 102 00:06:01,367 --> 00:06:03,583 And now, sure enough, it tells us it can turn things on and 103 00:06:03,583 --> 00:06:05,480 off like the radio, etc. 104 00:06:05,480 --> 00:06:07,460 >> Interesting to note, Ben, 105 00:06:07,460 --> 00:06:12,955 the Watson training actually takes place when we build intent and entities. 106 00:06:12,955 --> 00:06:16,170 >> Okay. >> Those are the two constructs that tap 107 00:06:16,170 --> 00:06:18,230 into machine learning technologies. 108 00:06:18,230 --> 00:06:21,249 The dialog really is a Boolean structure, a yes or 109 00:06:21,249 --> 00:06:25,480 no that we can navigate through the tree. 110 00:06:25,480 --> 00:06:26,080 >> Okay, that's nice. 111 00:06:26,080 --> 00:06:28,910 So then when we were importing, it triggered some training, 112 00:06:28,910 --> 00:06:30,100 which happened behind the scenes. 113 00:06:30,100 --> 00:06:32,880 And it was already done before we even cared about it, which is great. 114 00:06:32,880 --> 00:06:34,350 >> Indeed. 115 00:06:34,350 --> 00:06:37,606 >> This is fantastic, Armin, thank you for walking us through the setup. 116 00:06:37,606 --> 00:06:40,742 What do you say we take a little break, and then we make this chatbot even more 117 00:06:40,742 --> 00:06:44,060 useful by adding in another Watson service called Discovery? 118 00:06:44,060 --> 00:06:45,150 >> Sounds great. 119 00:06:45,150 --> 00:06:48,695 There are so many meaningful ways to use these services together. 120 00:06:48,695 --> 00:06:51,488 But discovery is particularly useful, 121 00:06:51,488 --> 00:06:57,210 because it allows our bot to discover new answers that we don't program. 122 00:06:57,210 --> 00:07:02,110 In fact, I often like to think of the discovery service as a area where 123 00:07:02,110 --> 00:07:06,540 you find out things that you don't know that you don't know. 124 00:07:06,540 --> 00:07:10,610 And I can trust that with a conversation service, that is where 125 00:07:10,610 --> 00:07:14,890 at least you know what it is that you don't know, and then you may ask it. 126 00:07:14,890 --> 00:07:18,530 We shall see more as the course progresses. 127 00:07:18,530 --> 00:07:19,220 >> Sounds great. 128 00:07:19,220 --> 00:07:20,210 All right, see you shortly.