 Gabby, she's a Google Developer Advocate. She also maintains an intimidating LEGO collection, which is, I think, a perfect way of describing it, because I'm definitely afraid of stepping on one LEGO, let alone thousands of LEGOs. So she's going to talk to us a little bit about machine learning. So welcome, Gabby. Good afternoon. I think it's afternoon, so good afternoon. I'm going to give you a spoiler. I'm not going to talk about machine learning per se, because I don't know machine learning. I'm a developer. What I know is APIs. So what I want to show you and teach you here is how to use machine learning APIs for you to use in your own applications without having to know machine learning. So that's the point of my talk, and I hope you like it. So let's start. So what is machine learning? It's about solving problems without specific rules. It's all able to learn by the example and set up new answers based on the example that you just gave to them. And I have a colleague that says machine learning is just a thing labeled essentially. And the truth is it's kind of like that. And if you can label anything, you can process the data and then create predictions and that kind of stuff. So I want to do an exercise with you first. How would you identify the following images that are having here? I have an apple, and I have an orange. So tell me, how would you differentiate one thing from another? Color? Shape, okay. So someone said color, and if you have this, how do you differentiate that? Just my shape, right? I could create a script before when it was red and orange. That could count how many pixels reds I have, how many pixels orange I have. And then based on the ratio, say it's an apple, it's an orange, but like if I have a green apple, those just go out of the blue. So this doesn't work. So what about a dog and a muffin? That's easier to differentiate, right? The dog has joints and nose, a mouth and a muffin just looks nice. But what if you have this? Is that a dog and a muffin? That's a bit difficult. And this. It's a mouth or I don't know the brain, but like this one here, it's my favorite. So machine learning comes to solve these kind of problems to help you identify these kind of differences without having to have a human eye to look at it. So it's loosely based on how the brain, the human brain works. It's to solve the problems without knowing specifically setting up ifs to know the answer for it. Or trying every possibility to know the answer for it. And enable systems that improve over time. So when you have a prediction on machine learning, you have a confidence level of that prediction is true or not. And I'm going to show you later. So at Google we have five machine learning APIs that the vision wants for processing images. The cloud video intelligence processing video gives you time stamps on the video, what was said and that kind of stuff. Cloud speech is similar to the video, but it can do live also. And cloud translation also does about a thousand pairs of different languages to translate. And cloud natural language that helps you identify sentiment analysis, for instance, on a given sentence that you give it. So the cloud vision API, that's the first one that I'm going to talk about. I want to talk about three. It's for detecting images that are complex just with a vast API request. And you can do labor and web detection would be saying, hey, this is an elephant. This is gray. And that's going to give you the tags around the image to get the text out of an image using a CR. To detect logos that you have. If there is a popular logo that you have around, it's going to detect and say, hey, there is a logo here. Landmarks also detect for you. You take a picture of a landmark and you can detect where it is. Crop hints is like what you do in Instagram that gives you a hint of how to crop the image to be squared. And explicit content detection because a lot of the content we get sometimes is from users and we don't know what they are doing. So instead of just showing you can see, is this image saved? It's going to tell you it is or not with a confidence level. So I have a demonstration here on the cloud vision API. This first cell here just ignored is just to print it nicely. And I want to help here. I'm importing the cloud vision API and then sending which file it is. Sending out the file URL and getting the image annotated and showing up the image in the end. So this is the image. What it is? Okay. Go to get bridge. So let's see. I'm executing. No. It's a 25th of April bridge from Portugal. It's similar, but it's not the same. And you can do it with another one too. Now you don't trust me anymore. But like, what is this? Okay. Let's see. No. It's as far as an Italian casino. So even images that are similar that looks like landmarks you're able to detect that's different. So it can also get different labels around the image. Besides it's a landmark. It's a power tourism because it's Las Vegas. So it's involved with tourism and other tags. And here I'm getting a random image because we have this thing called Web Detection. And you can say, hey, I want to see visually similar images. It's the one that I just uploaded here. This is useful. If you're looking, you can have full match images too. If you're looking, let's say you took a picture. And you want to see if someone in the web got your picture copied on their blog or something like that. You can look for copyright infringement with this. To know if someone took the same picture as you and put in their content. So that's unused for that. This one is to get visually similar, not necessarily the same, and showing off here. So it's executing. Go Internet. And this is not the same image, but it's similar. You see it's the same monument. And I'm getting a random image. And if I get it again, it's another picture of the same thing. So it's able to detect not only that is landmark, which landmark it is, and find similar images to it too. There's also a cool thing called AutoML that I'm going to talk in the end. And if it is, if there's time, I'm going to show you too. So the Google Cloud Vision, the code in the end is just this. It's 13 lines with comments. And with that, you can put anywhere in your code to just figure out what you're being uploaded, or if it is a safe image, for instance, or not. And in this case, getting a landmark. The next one, I'm sorry. If you use GIFI, you probably use Cloud Vision. You're not realising. If you want to read a bit more, just look at their engineering blog. They have a blog post saying how to use Cloud Vision in production. So when you search by sometimes there, you probably are using a Cloud Vision API to get that answer. Second one, the Google Cloud Translation. It translates over 100, actually 120 languages now. And you can have a thousand pairs or so more, as I said before, of comparison. And you can use to translate text from one language to a target language, or detect the language that a text is from. Let's say you've got a flyer, a post, and you don't know what is written and what language it is. So someone sends you an email, you don't know the language. You can use the Vision API, the Translation API to detect which language is being said there. So one of the examples that we have is the Google Translate app. And you can just show an image and kind of combine the vision, getting the OCR, and translate whatever it's in there to another language, so you know. I have a little demonstration here. So this, I'm going to just say something in Japanese, which I don't know how to pronunciate. I'm not going to try. And I'm going to try to translate to English. And once I say, after instantiating the client here, once I say which is the text, what is the target language, notice, I didn't say it is Japanese at the beginning. It's going to figure out that's from Japanese to English. And that's going to be what it's written there. And you can translate to any language that you want. Just that, if it is possible, we have on the website, there is a list of the languages that are possible to be translated. So you can use this to translate any text that you have, that user input that you got. You can get it in different languages, especially if you're using a multi-language application. So this is the code with comments and the prints. It's about 18 lines. And that does the translation for you. You don't have to go to the Google translate itself to translate for you. You can just use the API. And my favorite one is the natural language. The natural language API helps you understand with a simple request, things like extract entities. And entities here are not like entities on the web. It's like, oh, I went to a restaurant and ordered sushi. And it's going to say that restaurant is a local and sushi, it's a food, and that's a type of entity. And detect the sentiment on a sentence. And when I was, I'm Brazilian, so when I was learning Portuguese, Portuguese is not an easy language. It had like this thick book on analysis, syntax analysis. And I could never get a thing figured out. And with this API, you can actually get, say, this is a verb, this is a conjunction, this is an adverb, and you can stop having to worry about that. And in the end, classifier content, but there is a caveat. The classifying content API only works with English. It doesn't work with other languages. So first off, I have the sentiment API here. I just said I went to the restaurant and ordered sushi. The food was really good. Even though it was negative, the score is still on the neutral zone, because I'm not seeing anything bad about it. It's just a bit, see, it's a neutral. But the overall score of the whole document, it's positive, 0.3. And the magnitude says, like, it's from 0 to infinity. It tells you how much intention and sentiment is on that thing. So 0.9 is the whole overall magnitude of the document. The food was really good. The thing because of the word good is 0.8. It's a bit higher. So as I say, syntax analysis and analyzing the sentence that I just wrote before, we can see how the words depend on each other. So you see here that the root words go, and that's the lemma, which means, like, it's like the main thing on a sentence. In this case, it's go and order. That's two things that you couldn't, if you remove from the sentence, it doesn't make any sense. And the food was really good. It's the b for that. And tells which word depends on each thing. So I would have totally cheated on my exams if I had that before. But that's available for you, too. Content classification. As I said before, it's only in English, but notice here, I don't mention, it says it's baseball, and I said before, I always have a confidence level that says how much confidence it is on the prediction. You don't see baseball mentioned on the news there. You just see some names of a team, maybe, and a player, but he knows that that player, it's from a baseball team, and that he has this probably with 99% chance it's a baseball article, so that's part of it. I have a demonstration here to integrate the three APIs that I showed you before. So I'm going to get the Google Cloud Vision API and going to import an image from our article, translate it to English, detect and see what that article is about. So if you know Portuguese, you may know what this is about. But if you don't know, you can figure it out. So I took a picture from the newspaper, and I have this article here. So I'm going to translate. Let me execute this first one. Okay. I'm going to translate, not translate, I'm going to get the OCR of that image. So notice that it came with the same break lines as the article came, and it has all the tags from there. But when you translate, the break lines doesn't matter because I'm going to tell you, it's not 100% accurate, but it's good enough just to be able to be used formally as a translation. So here it's a translation, and it does a translation even though the tags was not well formatted, was able to do the translation. And on the language classification, it's going to tell you what it is about. And with 82.9%, it's about jobs and education with regards to education. So the article actually was about SATs in Brazil, how the students were going to take the SATs. So it is about education. So that's one of the demos. And as I said before, if I had time, I was going to talk about AutoML vision. So AutoML, it's like, let's say you have... This is all pre-trained models with Google data, public data sets that we got from the internet. But let's say you don't want to use that. You want to use your own data to classify content. And if you use that, that data belongs to you, does not go to the Google's model, only for your model. And in this case here, I wanted to train clouds. And what best place to predict the clouds than the clouds? There is no other place. So I wanted to predict clouds. I know there is way more than five types of clouds, but for simplification purposes, I only did five in here. Yes, I only did five in here. And once you do that, you can train your model because you import the images as you can upload from your computer. If you have a bucket on Google Cloud Storage, you say the CSV, you say the image URL and the label, and you can import that. And once you train your image, you can see here the confusion matrix of how that thing performs. And you can see that Outer Stratas, it's highly confused with Sears and Cumulus. But here, the higher the volume on the diagonal, the better model you have. Probably the problem is with that, it's because I don't have much Outer Stratas pictures. I only have... You need at least 800 of each to train the model, but I only had 135 and all the other ones I have over 400. So that's why it's confusing for the model. And I took a picture, not here, because I tried to take a picture outside and there's no clouds outside. So I took a picture, and I'm going to show you the picture when my... Where's my mouse? So this is a picture in Florida, which was nice. And I'm going to try to predict what type of cloud that is. I'm not sure if the prediction is correct but I'm not a cloud specialist. I once was on a talk that my guy was specifically a meteorologist and he's like, your prediction is wrong. I was like, I'm sorry. But let's try to predict it. And there is a thing called... You need to warm up the model. I hope the model is warmed up to predict. Yeah, it is. So this image was not on my collection. It's a picture that I took myself. And with 97.3%, you can see that's a Sears type. And everything here is tried to sum to one in the end. But you can have it at most one. It's 100% confidence, but that's not always possible. So if a high confidence level, you can see that's a Sears type of cloud. And with that, I'm going to go with questions. And that's it. You're signaling here? Yes. So it was interesting that you said sign language because one of the examples we have is with sign languages. But one of the difficulties is because I don't remember which letter was really complicated to make and was hard to get images. So we had this friend that... I'm not the developer advocate that usually does machine learning. I do it as a side give you sometimes. But she was training the model. Everybody had to learn a bit of sign language to take pictures of her so she could train the model. So, yes, you can do that. But you need to have data. That's the hardest part, you know. You need to train the model to train the model. You need to have images and the label for sure that you know for sure that's right. So you can train the model. So, yes, it's possible without any code. It's really easy because you need to... If you use Google Cloud, you need to go through a project and enable the API because the API comes disabled. So enable the API. And then once it is enabled, if you deploy inside Google Cloud, you don't need to have credentials because you can set up. You can say, if it is on the same project, you can say, hey, it's the same project and it has access to these APIs. But the problem is if you're doing local, you need to create a service account. And that's the hardest part. And what you would do extra step here would be on the... when you call the client here, you would say credential file and pass the file path to the code. So that's the hardest part that would be. Everything else is the same. Yes. Are there any plans to expand that? I don't know. I really don't know. And then my second question is on classification. It comes with the servers. You can actually... There is AutoML for natural language too. So you can create... Let's say you have tickets, support tickets. And you want to categorize which category it is. And you want to be able to predict that kind of... for future tickets. So if you know the label that it is currently, you can train a model based on that. And you get the category, not me. And in the end, have that predicting model for you. Without code again. Thank you.