 Welcome to the Visual Studio 2019 launch. I'm going to be talking to you about machine learning and artificial intelligence for every developer with ML.NET and Visual Studio 2019. My name is Pranav Rastogi, and I'm a program manager on the.NET team, and I'm specifically working on enabling machine learning for developers through our tools and frameworks. .NET has been a great platform for building any kind of application ranging from desktop, web, cloud, mobile, gaming, IoT, and now I'll show you how easy it is to build machine learning applications with.NET. ML.NET is a machine learning framework for.NET developers. You can build your own models. It's proven and extensible. It's been used heavily inside of Microsoft across all groups. It's open source and cross-platform, so it works on Windows, Mac, and Linux, and it's highly developer focused in terms of the scenarios that we are enabling and how you can build with ML.NET. ML.NET is available at .NET slash ML. Here are some of the machine learning scenarios we are targeting with ML.NET. You can do sentiment analysis, issue classification, ranking, image classification, forecasting, predictive maintenance, recommendation, and the idea behind this is all of the developers know scenarios versus knowing ML tasks, so we are making ML.NET very approachable for .NET developers. ML.NET is proven at scale. It's enterprise ready. Microsoft has been using internally ML.NET for the last 10 years across various products. If you've seen Bing ads or you've done chart recommendations, design ideas in PowerPoint, Windows Defender, anomaly detection in Azure Stream Analytics, key influencers in Power BI, and a lot more product groups using ML.NET at scale that we have sort of over years, we've made the machine learning tech behind it perform much better by dock voting this ourselves. Beyond our internal customers, we have lots of external customers using ML.NET at scale in production as well. SIG parser is an example of a customer using ML.NET. SIG parser is trying to make the CRM management much more easier by automating various tasks around email parsing, email classification, entity extraction. Here's an example use case of SIG parser using ML.NET. With ML.NET, they were able to train the model and immediately test inside of the code. This makes shipping new changes faster because all of the tooling was in one place. The great benefit of ML.NET is a developer focus framework. So it integrates to your existing tool sets across CLI, across Visual Studio, across DevOps, across CI CD. So it is just another.NET library that you would use in your application. SIG parser was able to take these advantages of ML.NET and improve their productivity for their own business. So I'm going to show you ML.NET in action right now. We'll look an example of how can we do sentiment analysis using ML.NET. Let me explain you a few concepts before we see the demo. This is an example dataset for doing sentiment analysis. It is the Wikipedia detox data and it has two columns. One is the common column and the other is the toxic column whether this piece of comment is toxic or not. We'll split this column with data into two categories. One column becomes the features, which is the data that we'll use to train the model, and the second column is going to become the label or the output or the column that we're going to predict. So simply put sentiment analysis is a problem where we're trying to classify a text into two categories A or B. In this case, is the comment toxic or not. So we'll get a yes and no answer. At a very core, here is an example of a typical machine learning workflow process. The first step in this process is to prepare your data where you load this data. In our case, the sentiment, the Wikipedia detox dataset, we'll extract the features. In our case, we'll extract the comments as a feature. Then we'll train the model and we'll evaluate the model. Eventually, we'll test the model in production. So let us see how this sentiment analysis looks like in practice inside Visual Studio 2019. Here is a sample application showing you how we can do sentiment analysis using ML.NET. This is a console application, and the dataset is the same dataset I showed you where I have two columns, sentiment and sentiment text, and I'm going to debug through this application to show you how easy it is to build a sentiment analysis model in ML.NET. The first step in this process is to new up a context, and then we load our training data. In our case, we are loading the Wikipedia detox dataset that we just saw. In the third step, we are building the pipeline. This is where we'll extract the data, we can extract our features. In this case, we have the features column as a comment, and we're going to predict the output which is going to be our sentiment. Since it's a type of binary classification problem, I've added this SDCL learner to my pipeline. After building this pipeline, I'm going to call training on this dataset. So I'm going to call pipeline.fit, which is going to take the pipeline that we built earlier. It's going to train and build a model against my training dataset, and then I'm going to test my data against my test data to see how the model performed. So if I go back to my console, we see that we got the model of accuracy 70 percent, which is not bad for this dataset. Then after I've built the model, I'm going to try out this model with my own data. So in this case, I'm creating a new type called sentiment data. I'm giving this input to the model that I just built. So if I step over this, we'll see what was the predicted sentiment for this text. ML.NET is fun, the sentiment was positive. The last step in our process is to save the model. So I can save the model as a binary artifact as a zip file. So I can take it and load it from any other application that.NET is running on. So it could be web app, mobile app, it could be running on the Edge, it could be running on the Cloud. It's just an artifact of your.NET project that you can run. So let me run through this application. You'll see I loaded my data in this application, I extracted the features, I built the model, then I trained the model, then I evaluated the model, and then I use the model on my own dataset. So this was very easy for me to get started with ML.NET and build a sentiment analysis model. Let's switch to image classification. ML.NET not only supports classical machine learning scenarios like text classification or price prediction or recommendation, it also supports deep learning scenarios. I'm going to show you how you can do image classification with a model built using TensorFlow. Deep learning is a revolutionizing space which includes vision and speech recognition. It's very useful when you have lots of data to train your neural network. In our example, I'll show you how to classify an image whether it's a dog or not a dog. In this case, we'll use a pre-trained TensorFlow model called inception to classify these images. So let's go ahead and see this application in practice. This is my dataset that I'm going to use to predict whether an image is a broccoli or not or a canoe or not or a teddy or not. So I have these different images that I've captured. I've built this console application where I'm going to build an ML.NET pipeline to load a pre-trained TensorFlow model and then use it inside a.NET application to classify these images. So let's go ahead and run this application. The first step in our application is to load the model. In this case, we are loading a model into the ML context pipeline. This is the path to where all the images are stored. I'm doing some basic transformations on the images in terms of resizing and extracting pixel, and I'm then using the pre-trained TensorFlow model to train this ML.NET pipeline. So let's go ahead and run this function. So far, we have loaded the model, and in this section, we will use the loaded model to take each image and classify the type of this image. So in this code over here, I'm reading all the images and I'm predicting what's the output classification for this image. So let's go ahead and run this program. It'll iterate over all the images and it'll give me what was the output prediction with the probability score. So you can see it predicted some of these images correctly, like the coffee pot was predicted incorrectly and the probability was 60 percent. So you get this metrics to figure out whether the predictions are happening correctly or not. So this was a quick and easy way to use pre-trained TensorFlow models in ML.NET for image classification. So I hope you enjoyed this short video about ML.NET in Visual Studio 2019. ML.NET is a framework for .NET developers to use machine learning. It's open source and it's proven on scale since it's being used internally at Microsoft. I showed you an example of how to do sentiment analysis and image classification. If you're interested in trying out ML.NET, here are some links to getting started. We have lots of samples which you can follow for your use case. You can read the getting started tutorials. If you have a feature or a request for a new area to add to ML.NET, you can follow this link. If you're looking to use ML.NET in production, you can use this link to reach out to an ML.NET engineer who can help you get to production as well.