AWS Application Services for AI/ML – MLS-C01 Study Guide

In this chapter, you will learn about the AWS AI services for building chatbots, advanced text analysis, document analysis, transcription, and so on. This chapter has been designed in such a way that you can solve different use cases by integrating AWS AI services and get an idea of how they work. AWS is growing every day, and they are adding new AI services regularly.

In this chapter, you will approach different use cases programmatically or from the console. This will help you understand different APIs and how to use them. You will use S3 for storage and AWS Lambda to execute any code. The examples in this chapter are in Python, but you can use other supported languages such as Java, Node.js, .NET, PowerShell, Ruby, and so on.

You will cover the following topics:

  • Analyzing images and videos with Amazon Rekognition
  • Text to speech with Amazon Polly
  • Speech to text with Amazon Transcribe
  • Implementing natural language processing with Amazon Comprehend
  • Translating documents with Amazon Translate
  • Extracting text from documents with Amazon Textract
  • Creating chatbots on Amazon Lex
  • Time series forecasting with Amazon Forecast

Technical requirements

All you need for this chapter is an AWS account.

You can download the code examples for this chapter from GitHub at https://github.com/PacktPublishing/AWS-Certified-Machine-Learning-Specialty-MLS-C01-Certification-Guide-Second-Edition/tree/main/Chapter08.

Analyzing images and videos with Amazon Rekognition

If you need to add powerful visual analysis to your applications, then Amazon Rekognition is the service to choose. Rekognition Image lets you easily build powerful applications to search, verify, and organize millions of images. It lets you extract motion-based context from stored or live stream videos, and helps you analyze them. Rekognition Video also allows you to index metadata such as objects, activities, scenes, celebrities, and faces, making video searches easy. Rekognition Image uses deep neural network models to detect and label numerous objects and scenes in your images. It helps you capture text in an image, a bit like Optical Character Recognition (OCR). A perfect example is a T-shirt with quotes on it. If you were to take a picture of one and ask Amazon Rekognition to extract the text from it, it would be able to tell you what the text says. You can also perform celebrity recognition using Amazon Rekognition. Somebody who is not a celebrity won’t use the celebrity recognition API for their face; instead, they will use the face comparison API.

The official documentation, available at https://aws.amazon.com/rekognition/faqs/, states the following:

“With Rekognition Image, you only pay for the images you analyze and the face metadata you store. You will not be charged for the compute resources if, at any point of time, your training fails.”

Some common uses of Amazon Rekognition include the following:

  • Image and video analysis
  • Searchable image library
  • Face-based user verification
  • Sentiment analysis
  • Text in image
  • Facial recognition
  • Image moderation
  • Search index for video archives
  • Easy filtering of explicit and suggestive content in videos
  • Examples of explicit nudity – sexual activity, graphical nudity, adult toys, and so on
  • Examples of suggestive content – partial nudity, swimwear or underwear, and so on