 Okay. Hello everyone. We're going to talk about chatbots and how to make them even smarter with ML.NET. I have just a couple of slides, and then we'll move to the demo, and then I'll show you how you can create a simple bot with your custom ML.NET model in just 10 minutes. Here I have a quick slide just about me. My name is Veronica Kalisnikova. I'm a Microsoft MVP in AI. I am a developer at RightPoint in Boston. Mostly I'm working with Microsoft technologies like C-Sharp.NET, Xamarin, and obviously I'm working with.NET-based CMSs like Episover and Sitecore, and here are my hobbies, and feel free to contact me online and ask me any questions there later if you want to. Let's move to the session and what is a bot? In general, a bot is a software application that can understand what a user wants, whether a user enters his or her questions by just typing them, or he or she just ask those questions using voice commands, and that bot can understand those questions and provide answers or perform some actions based on their request. Here I have a big question, is bot the same as virtual assistant? I am having lots of arguments with people about it. There's lots of people, they have different opinions. I think that bot is pretty much the same as virtual assistant skill, and let me explain to you why I'm thinking that way. For example, if you're using Microsoft technologies, you are first creating just a bot, and then you have an option to connect it to different channels. One of the channels is Cortana, and Cortana is a virtual assistant. By creating a bot and enabling connection to Cortana, you are creating virtual assistant skill. I believe that the base of every virtual assistant skill is a bot. You are creating bot first, and then even if you're using Microsoft technologies, you can create virtual assistant skills using bot by adding libraries that can connect to Alexa and Google Assistant. All kinds of virtual assistant skills you can create starting with a bot. Microsoft offers several options, how you can create a bot. First of all, is a bot framework SDK. You can start it right from your Visual Studio, start it from scratch, create a bot framework solution or a project. If it's part of a bigger solution, then you'll get sample bot right there, or you can create it just clean and start from scratch. You can host it to your bot anywhere you want. It doesn't have to be Azure. It can be on premises, it can be on other Cloud providers, or you can host it on Azure using bot framework. Or you can start with Azure, and on Azure, you have Azure web app bot. You are creating a bot on Azure as a resource, then you can download the code and you will get pretty much the same template as you can get using bot framework. There are two options on Azure when you create in a bot. You can create a bot connected to Luis, so it will already have some machine learning base, or you can create just a simple echo bot there. I'm going to switch to portal later and show how you can do that. Another tool on Azure is Azure Bot Channels Registration. Once you create your bot and it doesn't have if it was through the bot framework, if you started with your Visual Studio, or you started with Azure and created an Azure web app bot. You can register that bot in different channels, meaning connected to different channels. For example, you can connect it to Cortana or Twilio, or Teams, or Skype. There are so many options in different channels. You can go to Azure portal and see how many channels you can connect to, and there are a lot of them. Next one that is relatively new. I saw it only maybe a couple of months ago. I think it was still on preview. I think it's out of preview right now, but someone told me it's been a couple of years since the Microsoft Healthcare Bot was released. You can definitely check it on Azure in Azure portal. There are lots of documentation about it, but basically the Healthcare Bot is pre-trained for healthcare-specific data and interactions. The machine learning part of the Healthcare Bot is pre-trained on some kind of healthcare related questions. But you have an option to customize it. It depends on who are you building it for, whether it's a medical school or it's a hospital, or it's some other healthcare provider that you are building the bot for. It's really a good start for all kinds of Healthcare Bot solutions. In the core of every bot, we have machine learning. I already mentioned it a couple of times, but it's really important. I can't even imagine a bot that can work completely without machine learning underneath. Unless you know that the users have three specific questions that they're going to ask that specific bot and it needs to provide three specific answers. But I don't think it's a valid use case for a bot. There are definitely lots of different options, how you can integrate machine learning with your bot. One of them is ML.NET. ML.NET was mentioned already several times throughout the conference that.NET.conf. Brie was talking about it during the keynote, and then Cesar was talking about it during his session. He provided lots of insights and he told a lot of information about new features of ML.NET. But in general, ML.NET allows you to train, build, and ship custom machine learning models using C-Sharp or F-Sharp. There are lots of different scenarios available. You can use it for sentiment analysis, object detection, price prediction, and other scenarios. It also can be connected to TensorFlow and Onyx. A great tool is AutoML. You can use it through command line, you can use it through API, or there is a model builder that is really awesome and really useful if you don't have much experience, or maybe you just don't want to dig deeper into machine learning, trying to figure out what model you need to build, what kind of data you need to collect. Then the model builder is the best tool for you, and I'm going to show it in my demo. ML.NET is open source. Here I have a link to the GitHub repo that you can check. There are lots of different samples there. You can use it in all kinds of applications. It's really simple. Now let's move to the demo. I am going to show you the Azure portal. I wanted to show you that documentation. I think it's also interesting, but I think you can find it online yourself. How to build a bot? You are logging into your Azure portal. Again, I want to remind you that you can always start with the bot framework and start from scratch in your Visual Studio. I'm going to show you how you can start on Azure. You're basically searching for a bot and you are selecting that bot. It's a new resource here you can create. You are filling in the form and it's pretty straightforward. If you are not new to Azure, it's really easy just a couple of fields that you need to fill in. The thing that you need to remember for, if you want to follow my demo or if you want to try it on yourself after my session, so the bot template I'm using, it's going to be just simple ecobot. Basic bot here, it's already connected to some machine learning, and it is actually part of cognitive services. It's a Lewis or language understanding intelligence service, and I'm not saying you can't use several machine learning solutions in your bot. In fact, for one of my recent projects, we used several tools for machine learning, and they complement each other really well, and it's a great experience. But for this demo, I'm going to use just the ecobot, and I'm not going to create the resource right now because it might take some time. I already have my resources created and we have the web at bot. Let's check it here. Here we have an overview, that's some basic information, lots of documentation in resources part. But when you go to the build section, you have an option to download bot source code. When you download it, you are getting that basic ecobot that you can create through using bot framework in Visual Studio. Acobot doesn't have any machine learning attached to it, because it is just repeating whatever a user types in. When you download it, you have it downloaded just to save the time, because I know we don't have a lot of time today. That's the clean ecobot that I downloaded right from my Azure portal. There are lots of files here. You can see that the activity here is just getting whatever text the user types in and just echoing it back. We can end using the model builder. I will install model builder, but if you don't have it in your Visual Studio, there are lots of documentation how to get it. Basically, you're going to the marketplace or you are managing your extensions right from your Visual Studio, and you are getting ML.NET model builder. It's still on preview, but I think it's working great. When you have that extension, you go here and you add in machine learning. Here you have some options, what kind of scenario you want to build. Again, they have really great documentation that explains every scenario. By here, you can see a couple of lines explaining what's going on. I'm going to select the sentiment analysis. I'm going to build just the basic example here, so I'm selecting this one. Input can be a file or a SQL Server. I am choosing a file. There are some restrictions there. You can either use CSV files or CSV files. I'll open and then column to predict. Here we have two columns and my data set is really simple. It has the sentiment and sentiment text, so it's basically some data from Wikipedia, how people were commenting, and it's rated if it's toxic information or non-toxic. The column to predict is sentiment here. It's really important to remember that data is really important. You need to make sure that your data is clean, that you have valid information there. Because when you are creating your machine learning model, and it doesn't matter if you're building it with ML.NET or any other tools, it's really important that the data is clean, it's up to date, and you have valid information there. Otherwise, your machine learning model will be trained on maybe biased data or incorrect data, and then it won't provide correct results to you later. Here, I selected this column, here is sentiment, and then click on train. Here you can choose time to train. It might be 10 seconds, so we can start training. Here we're seeing the best accuracy that we're getting, the best algorithms, and then the least effective algorithm. It's really awesome that model builder can actually select a model type perfect for your data. You don't need to do anything. You don't need to know much about types of the models. You can evaluate it. It provides you some statistical information here, and then we click on code, and we add in projects, and it's going to add two projects to your solution. I am going to switch here where I already added those projects. There will be two projects. One is the model itself, and it is this one. The model is going to be a model.zip, and then some helpers here for you to develop, and also there will be a console app for you to test. I copied actually pretty much everything from that console application here. Here I am loading the model, and then I'm passing the text that user enters, and then passing it to the model, and then based on the text, model engine can predict if it's toxic or non-toxic. That is a pretty basic example, but if you are combining it with Lewis, or maybe you're extending the model, then you can do lots of different things with your custom data, and it will be specific for your clients or for your business. Then maybe if you combine it with language understanding, then you can check if it's, for example, toxic sentiment, then you just stop processing it, and if it's non-toxic, then you're just passing it to Lewis, and then Lewis is going to analyze your user's question, and then provide an answer. There are two ways to test it. There is one way is a bot framework emulator, you can just test it on your local machine. You can add, so that is by default, that local host with that port, you will add an API messages, and then if your bot was created on Azure first, you need to add an app ID and app password here, and then you'll just click and connect, and it will be connected. But in order for it to be connected, you actually need to run your solution here. Or you can publish your bot just regular as you publish it. It will be automatically connected to Azure, and then you'll have the publishing profile here, so you just click publish, and it will be published directly to your Azure where you can test it. Here, we have the test in web chat, let's test it here, let's try. That's a non-toxic sentiment, that is valid response. I think it's really good thing that I love.netcon. Let's try something toxic. This is toxic sentiment. This rain makes me sick, because we were talking about weather a lot throughout the conference, so I think it's a good example. Here, let's go back to the code. You can see it's really straightforward. It's just a basic example. I'm using AutoML and ModelBuilder. You can use CLI or you can use API to out-of-build your model using your data. I think I'm ready for questions. Hey, how's it going? Any questions? Sorry, we're switching stuff over here. I'm going to switch to Q&A. We don't have any questions just yet. Okay. I think everybody was in like an, actually, I think someone asked here about how difficult is this to use with SQL Server? Is that one of the questions there, SOFO 264? I haven't tried it myself, but I know that Cesar was talking about it during his session, so definitely check it out. I don't think it's too hard. I think the main thing, and I will repeat myself several times, because it's really important to have really clean data. The better your data, the better your model will be. Perfect. That's great to know. Well, feel free to jump into the chatroom if there's other questions, and we appreciate the presentation. Thank you so much. Thank you so much, Veronica. I like people on the stream, we're going to be doing our usual dance. We're going to get Isaac Levin. He's going to be talking about, let's see, where is it? Application Insights, so more Azure, more diagnostics, so we'll be right back.