Subtitles section Play video Print subtitles [MUSIC PLAYING] DAN AHARON: Hi, everyone. I'm pleased to be here with you. I hope you're having an awesome Google Cloud Next. I'm here to talk to you about something that I'm personally very excited about, and we at Google are very excited about, which is conversational applications, which includes Bots, and I hope you're as excited as me at the beginning of the session, or if not, by the end of it. Here we're going to introduce API.AI to you guys, which is a tool probably many of you are familiar with. It's our Bot application development platform that we acquired last year. And we're also going to go beyond the basics and show you guys a little bit more tips and tricks. So you're going to hear from a couple people, Cornelius and Petr, that have been using API.AI, and they're going to share some of the lessons that they've learned while building conversational Bots. So, this is one of three different sessions we have on this topic of conversational applications. We had one yesterday which focused on cloud functions and surveillance and architecture to serve conversational applications. We're now doing the middle session that you see on the slide. And then, following after me, Brad and Guilliame are going to show you how to extend Google assistant with actions on Google. So, what is a conversational agent platform? We'll just go through this quickly, probably a lot of you already know, but, basically what it does is it takes natural language and it turns it into structured data that you can then use in your applications. So, for example, if a user orders a pizza and says what ingredients it has, the software will turn that into structured data which says what's exactly inside the pizza, what type it is, and then you can actually act on it. What it doesn't do is, it doesn't really understand your domain and your vertical until you actually teach it and train it. You can give training examples that explain exactly what to do. And, it also doesn't do any fulfillment. It's not actually going to bake a pizza and deliver it for you, unfortunately. That would be nice. But, the good thing is you're here at Google Cloud Next, you've probably been to a bunch of sessions. Most of this conference is about how to fulfill the back-end of your application, and we think Google Cloud Platform is a great way to do that. So, it's a very good complement to API.AI And then, specifically, we're very proud of API.AI, we think it's pretty distinctive in the space. A few of the important benefits that API.AI has that it is an end-to-end suite, it really combines a bunch of different elements that you need for building compositional applications. It doesn't just do natural language understanding, or just one component. It can get pretty smart very quickly. You're going to see that later on. I'm going to attempt to do something that's probably very risky, and not very wise of me. I'm going to try and build in front of you, from scratch, a whole new conversational application, in less than 20 minutes, that handles an imaginary scenario. Hopefully, it will work, we'll see. But, you can see the power of API.AI with a very small data set, what it's able to do. It's multi-lingual, it already supports 40 languages, and we're investing in growing that. We want it to be as global as Google is. There was a lot of speculation last year when we bought API.AI that we will turn it into sort of a closed system that only works with Google software. The truth is, it's far from it. API.AI works with all of the different messaging platforms that are out there. And we're very proud of that. We're a very open company at Google, we actually want you to build the best conversational applications that work across all the platforms that you're interested in. And we want to keep making API.AI the best cross-platform tool. So we're going to continue to support all of the platforms that are out there. I'm just going to go through this very quickly, but this is just an example architecture of how you can build a conversational application. So, on the left-hand side, you can see all of the different channels where conversations can come in. So, it starts from owned and operated websites or web apps or mobile apps. And you could have Google Assistant properties like Pixel, Aloe, and Home, or you could have integrations with the different applications that I just showed you, all of the different messaging applications. The other thing is you could have voice calls come in and be transcribed with Cloud Speech API, and flown in. All of those can get processed by API.AI, which handles the conversational aspect, including context, natural language understanding, and figures out how to involve the back-end. And then, through web hook integration, you can connect it to Google Cloud Platform to handle all of your back-end needs, or any other platform that you want. You can connect to other external systems like ERP, like CRM, or whatever you need on the back-end. You can get there through cloud functions or any other Google top-form application cloud service. OK, so now to the demo. So what I'm going to do now, we're going to look at an imaginary Google hardware store. And we're going to try and create a conversational app that processes requests for that imaginary store, including service requests and commerce requests. So we're going to just quickly go through defining an entity, defining the intent, adding an ability to buy other items through a WebHook, and then we're going to connect it to a messaging platform. OK, so let's switch to the demo now. OK, can everyone see my screen? How's the font size? Is it OK? Yes. People are saying yes. OK, great. OK, so let's start by defining an entity. And we'll list all of the products that we want to sell in this store. So let's say we want to sell a Pixel. And sometimes that is called Google Pixel. And it could also be in plural, so let's say Pixels and Google Pixels. And let's say you also want to sell a home, which could also be Google Home. And let's add the plural. And let's add a Chromecast to that. Chromecasts. And what else? Let's add a Chromebook. OK, and that's enough. Let's save our entity. And now let's define our first intent. So let's make the first intent about service. And let's just add examples of how users would ask for service. So maybe one guy will say, I'd like to fix my Pixel. And you can see that API.AI automatically identified that Pixel is one of the products that I identified earlier and it labeled it as a parameter name called Products. I'm just going to change it to Product, because you just want one product. I'm going to save this. And let's add a few more examples. Let's say, can I please buy a Chromecast? I'd like to get a Chrome. Can I please-- oh, sorry. I'm mixing commerce and service. Let me redo this. I'd like to fix my Pixel. Can I please fix my Chromecast? My Chromebook is not working. And let's start with that. And let's test it now. So I'm going to take this example, but use a different product. So instead of I'd like to fix my Pixel, let's try I'd like to fix my Chromebook. Oh, OK, so that's great. So what you see is it identified an intent that is service. And it identified a parameter name Product that is Chromebook, which is exactly what we wanted. Now let's add a response. Let's say, sure, no problem. Dispatching service for product right away. Save. And let's test it. Can I please fix my Chromecast? And you can see, it says, sure, no problem. Dispatching service from Chromecast right away. And if I click on Show JSON, you can see there's this very rich JSON that you can send to your back end, to your application that can actually process everything that you need to do to actually dispatch someone out there. It's all structured information that you can act on right away. So this is great. And we have something that is doing service right now. Let's also add a Commerce intent. And now let's say, I'd like to buy three Chromecasts, please. OK, so it identifies quantity and product. So let's name this one as Quantity. And instead of Products, let's just call it Product. And let's show a few more examples. So can I please get five Pixels? OK, so this one, it didn't auto recognize, but we can easily fix that. I'm going to remove this. And instead, I'm going to mark the 5 as Quantity and pixels as Product. And let's give it a couple more examples. Can I buy seven Chromebooks? Please get me two Pixels. OK, so it looks like it's working. Let's also add a shipping address. So let's say, can you please send me four cool homes to 5 Fifth Street, New York, New York? OK, so it recognized that we have an address here. It marked it. Let's just show it the full thing. And then let's just mark quantity. And I'm going to save this. And let's add a response. Adding quantity, product, and sending to address. I think this one we don't need. Let's delete it. And let's save. And let's test it out. Let's say, can I buy five Pixels? OK, let me try, I'd like to buy five Pixels, please. OK, you can see the Intent, it recognizes commerce. It got that it's a Pixel. It got that it's five. And the address is missing, obviously, because I didn't give an address. And so it can't really respond, because it doesn't have an address. But everything is working well. Now, the previous sentence I gave should have been recognized, but it wasn't recognized. So this is where API.AI really shines. You can actually go in real time and apply new training based on the data, the experiments you just made. So this is what we tried earlier. Service for Chromebook. That was correct. So I can mark it as correct.