Hi, this is Julien from AWS. Welcome to episode 5 of my podcast. Don't forget to subscribe to be notified of future episodes. In this episode, I'm going to cover some new features that came out this year, and I'll share some resources as well, and I'll point you to a pretty cool demo that I recorded.
Let's start with the news. It's the beginning of the year, and things are still a little bit slow, but some cool features came out recently. The first one I want to talk about is a new feature in Amazon Comprehend, our natural language processing service. Comprehend added multiple classification for custom classifiers. Initially, you could do things like sentiment analysis and entity extraction with Comprehend. After that, the team added the ability to create your own custom classifiers. You could upload your own dataset and train your own text classifier on your own labels without worrying about the internals or infrastructure. But that was for single labels. For example, if you wanted to classify movies, a certain movie could only be a certain category, such as action, drama, or comedy. Now you can have multiple labels per document, and classifiers that will be able to assign those multiple labels to new samples. In the example of movies, a movie could be action and comedy, or drama and history. If you have legal documents, you could classify them with a high-level category like contract, cease and desist, or term sheet, and you could have another category giving you extra details. This multi-label feature gives you lots of flexibility to train and build models to classify text data in many different ways.
Let me show you quickly how this works in the console. This is the Amazon Comprehend console. Let's just open that menu, and we can see custom classification here on the left. If you click on the train classifier button, you see that now you can train multi-label documents. Here's that movie example again: text one could be a comedy movie, text two could be a drama movie, text three could be comedy and drama. That's how you do it—just go to the console and select multi-label mode, and of course, this is also present in the APIs.
The next feature I want to talk about is an Amazon Translate feature. Translate can now do batch translation. Previously, you could do real-time translation or translate one piece of text at a time using the API. Now you can actually translate a batch of documents stored in an S3 bucket. These documents can be in plain text or HTML. This is pretty cool if you have a bunch of web pages you want to translate. You can just put all those in S3, create a batch translation job, and get all your files translated in one go into the language you like. One restriction, though, is that at the moment you cannot do automatic language detection with batch processing. So you have to know the language of the input documents. But that's not too bad, I guess.
Let me show you quickly where this is in the console. This is the Amazon Translate console. If we open the menu here, we see a new entry for batch translation. Clicking on this and then create job, we see the parameters for a name, the source language, the target language, and the location of input data, the input file format, which could be text or HTML, and the location of output data. That's about it. So super simple, and using this, you can now translate a ton of documents in one go.
The next feature I want to talk about is actually a bit of a discovery I made while reading API documentation. This wasn't formally announced, and I guess the team thought I wouldn't notice it. But guys, come on, you know me. I'm talking about a new feature in SageMaker Autopilot. As you probably know, SageMaker Autopilot is a new feature in Amazon SageMaker that lets you automatically build a model and selects the algorithm automatically. If you're interested in more detail, I have a bunch of YouTube videos on my channel showing you the Autopilot workflow end-to-end. The feature I'm referring to is the metric that you ask Autopilot to optimize on. When the service launched at re:Invent, you could only optimize for accuracy. As I found out reading the documentation, you can now optimize for more metrics. Let me show you. This is the documentation for the Create AutoML job API, which is the one we use in SageMaker Autopilot to get things going. If we look at the parameters here, we see a parameter called metric name. Accuracy used to be the only metric you could optimize on, but now you can use mean square error, F1, and F1 macro, which are two variations on the F1 score. This is an improvement because different problems require different metrics, and now you can pick the metric that fits your problem best.
The last bit of news I want to mention is not AWS news but is important to many of you. TensorFlow 2.1 came out in the last few days, and of course, there are plenty of bug fixes and feature additions. However, there are two things I want to mention. First, this is the last TensorFlow version that will support Python 2.7. All of you who have procrastinated and delayed upgrading your scripts to Python 3, well, bad news. It's now time to do it. Otherwise, you'll be stuck with TensorFlow 2.1 until the end of time. It's always better to leverage the new frameworks, so time to update those scripts. The second thing I want to mention is that when you install TensorFlow 2.1 and up, as in `pip install TensorFlow`, you're now installing the GPU-enabled version by default. If that's what you want, fine. If you want to install it for a CPU-powered machine, then you have to explicitly `pip install TensorFlow-CPU`. The GPU version will work fine on a CPU machine, but it's a little bulkier, especially if you want to use it inside a container. You want to have the smallest possible container, so don't forget to specifically mention the TensorFlow CPU version. You can, of course, check the release notes for all the other tiny and not-so-tiny additions.
That's it for the news! Last week, I added a bunch of resources that I think you could be interested in. First, I uploaded some conference videos from the O'Reilly AI conference in London, which was kind enough to invite me in 2018 and 2019. The 2018 video is a deep dive on the built-in algorithms in Amazon SageMaker, showing you some benchmarks. All of them are still very relevant. If you're interested in why those built-in algorithms rock, you can take a look at this video. I also uploaded the 2019 talk, which is an introduction to natural language processing models. If you've read a little bit about models like ELMO, BERT, and XLNet, this talk is a gentle introduction to what those models are and to building NLP models in general. Some people on YouTube actually enjoyed this video, and some commented that it was the best intro to NLP models they'd seen. I guess some of you will enjoy it as well. Look for that one.
I also uploaded a video showing you how to deploy models on SageMaker. It's a whiteboard video, and I know some of you are big fans of that. I go through three scenarios: deploying a single model, deploying different model variants on the same endpoint, and multi-model endpoints where you load and unload models dynamically. This recent feature is a great way to optimize cost for customers who have hundreds and maybe thousands of models. Look for that one.
Last but not least, I uploaded a demo of an open-source tool called Sageify, written by my friend Pavlos. Thanks again for this, Pavlos. Sageify is a CLI tool to train and deploy models on SageMaker. If you don't even want to look at the SageMaker SDK and just need simple CLI commands, take a look at Sageify.
What about the demo? I'm sure you're thinking. Well, there is a demo. I'd like to show you how to run the Detectron 2 model on the Deep Learning AMI. Detectron is a very fancy computer vision model designed by Facebook. It was released at the end of November, but with re:Invent and holidays, it might have gone unnoticed by some of you. The demo is a little too long to be recorded here, and it's kind of visual, so it wouldn't work well with the audio version of the podcast. I'm going to reference the video in the podcast description, and you can look at it. I'm basically running the tutorial on the Deep Learning AMI, which requires a few modifications to the notebook. I actually run some sample images and a sample video through Detectron 2, and I think the result is quite spectacular, so you don't want to miss this.
That's the end of episode 5. I'll be back next week with a guest. I'm actually recording a few guest sessions this week, and I'm sure it's going to be really fun. Stay with me and don't forget to subscribe to the channel to be notified of future episodes. Until then, keep rocking!