Reader small image

You're reading from  AWS Certified Machine Learning - Specialty (MLS-C01) Certification Guide - Second Edition

Product typeBook
Published inFeb 2024
PublisherPackt
ISBN-139781835082201
Edition2nd Edition
Right arrow
Authors (2):
Somanath Nanda
Somanath Nanda
author image
Somanath Nanda

Somanath has 10 years of working experience in IT industry which includes Prod development, Devops, Design and architect products from end to end. He has also worked at AWS as a Big Data Engineer for about 2 years.
Read more about Somanath Nanda

Weslley Moura
Weslley Moura
author image
Weslley Moura

Weslley Moura has been developing data products for the past decade. At his recent roles, he has been influencing data strategy and leading data teams into the urban logistics and blockchain industries.
Read more about Weslley Moura

View More author details
Right arrow

AWS Application Services for AI/ML

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...

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...

Text to speech with Amazon Polly

Amazon Polly is all about converting text into speech, and it does so by using pretrained deep learning models. It is a fully managed service, so you do not have to do anything. You provide the plain text as input for synthesizing or in Speech Synthesis Markup Language (SSML) format so that an audio stream is returned. It also gives you different languages and voices to choose from, with both male and female options. The output audio from Amazon Polly can be saved in MP3 format for further use in the application (web or mobile) or can be a JSON output for written speech.

For example, if you were to input the text “Baba went to the library” into Amazon Polly, the output speech mark object would look as follows:

{"time":370,"type":"word","start":5,"end":9,"value":"went"}

The word "went" begins 370 milliseconds after the audio stream begins, and starts...

Speech to text with Amazon Transcribe

In the previous section, you learned about text to speech. In this section, you will learn about speech to text and the service that provides it: Amazon Transcribe. It is an automatic speech recognition service that uses pre-trained deep learning models, which means that you do not have to train on petabytes of data to produce a model; Amazon does this for us. You just have to use the APIs that are available to transcribe audio files or video files; it supports a number of different languages and custom vocabulary too. Accuracy is the key, and through custom vocabulary, you can enhance it based on the desired domain or industry:

Figure 8.10 – Block diagram of Amazon Transcribe’s input and output

Figure 8.10 – Block diagram of Amazon Transcribe’s input and output

Some common uses of Amazon Transcribe include the following:

  • Real-time audio streaming and transcription
  • Transcripting pre-recorded audio files
  • Enable text searching from a media file by combining...

Implementing natural language processing with Amazon Comprehend

This service helps you extract insights from unstructured text. Unstructured text information is growing exponentially. A few data source examples are as follows:

  • Customer engagement: Call center, issue triage, customer surveys, and product reviews
  • Business processes: Customer/vendor emails, product support messages, and operation support feedback
  • Records and research: Whitepapers and medical records
  • News and social media: Social media analytics, brand trends, and correlated events

Now, the question is, what can you do with this data? How can you analyze it and extract any value out of it? The answer is Amazon Comprehend, which is used to get insights from unstructured data.

Some common uses of Amazon Comprehend include the following:

  • Information management system
  • More accurate search system on organized topics
  • Sentiment analysis of users
  • Support ticket classification
  • ...

Translating documents with Amazon Translate

Most of the time, people prefer to communicate in their own language, even on digital platforms. Amazon Translate is a text translation service. You can provide documents or strings of text in various languages and get it back in a different language. It uses pre-trained deep learning techniques, so you should not be worried about the models, nor how they are managed. You can make API requests and get the results back.

Some common uses of Amazon Translate include the following:

  • If there is an organization-wide requirement to prepare documents in different languages, then Translate is the solution for converting one language into many.
  • Online chat applications can be translated in real time to provide a better customer experience.
  • To localize website content faster and more affordably into more languages.
  • Sentiment analysis can be applied to different languages once they have been translated.
  • To provide non-English...

Extracting text from documents with Amazon Textract

Manually extracting information from documents is slow, expensive, and prone to errors. Traditional optical character recognition software needs a lot of customization, and it will still give erroneous output. To avoid such manual processes and errors, you should use Amazon Textract. Generally, you convert the documents into images to detect bounding boxes around the texts in images. You then apply character recognition to read the text from it. Textract does all this for you, and also extracts text, tables, forms, and other data for you with minimal effort. If you get low-confidence results from Amazon Textract, then Amazon A2I is the best solution.

Textract reduces the manual effort of extracting text from millions of scanned document pages. Once the information has been captured, actions can be taken on the text, such as storing it in different data stores, analyzing sentiments, or searching for keywords. The following diagram...

Creating chatbots on Amazon Lex

Most of the features that are available in Alexa are powered by Amazon Lex. You can easily build a chatbot using Amazon Lex. It uses natural language understanding and automatic speech recognition behind the scenes. An Amazon Lex bot can be created either from the console or via APIs. Its basic requirements are shown in the upcoming diagram.

Some common uses of Amazon Lex include the following:

  • Apps that both listen and take input as text
  • Chatbots
  • Conversational AI products to provide a better customer and sales experience
  • Custom business bots for assistance through AWS Lambda functions
  • Voice assistants for your call center, which can speak to a user, schedule a meeting, or request the details of your account
  • By integrating with Amazon Cognito, a few aspects such as user management, authentication, and sync across all your devices can be controlled

Next, you will explore the benefits of Amazon Lex.

Exploring the...

Amazon Forecast

Amazon Forecast is a powerful service that enables you to build highly accurate time-series forecasting models without the need for deep expertise in machine learning. Whether you are predicting sales, demand for inventory, or any time-dependent metric, Amazon Forecast simplifies the process, making it accessible to a broader audience.

Amazon Forecast is designed to tackle a variety of forecasting challenges, including:

  • Demand forecasting: Predict future demand for products or services based on historical data, helping optimize inventory and supply chain management.
  • Financial planning: Forecast financial metrics, such as revenue and expenses, aiding in budgeting and financial decision-making.
  • Resource planning: Efficiently plan resources like workforce scheduling based on predicted demand patterns.
  • Traffic and user engagement: Predict website or application traffic, enhancing resource allocation and user experience.

Next, you will explore...

Summary

In this chapter, you learned about a few of the AWS AI services that can be used to solve various problems. You used the Amazon Rekognition service, which detects objects and faces (including celebrity faces), and can also extract text from images. For text to speech, you used Amazon Polly, while for speech to text, you used Amazon Transcribe. Toward the end of this chapter, you built a chatbot in Amazon Lex and learned the usage and benefits of Amazon Forecast.

For language detection and translation in an image, you used Amazon Rekognition, Amazon Comprehend, and Amazon Translate. You learned how to combine all of them into one Lambda function to solve our problem.

For the certification exam, you do not need to remember all the APIs you used in this chapter. There may be questions on a few of the best practices that you learned or on the names of services that solve a specific problem. It is always good to practice using these AWS AI services as it will enhance your...

Exam Readiness Drill – Chapter Review Questions

Apart from a solid understanding of key concepts, being able to think quickly under time pressure is a skill that will help you ace your certification exam. That is why working on these skills early on in your learning journey is key.

Chapter review questions are designed to improve your test-taking skills progressively with each chapter you learn and review your understanding of key concepts in the chapter at the same time. You’ll find these at the end of each chapter.

How To Access These Resources

To learn how to access these resources, head over to the chapter titled Chapter 11, Accessing the Online Practice Resources.

To open the Chapter Review Questions for this chapter, perform the following steps:

  1. Click the link – https://packt.link/MLSC01E2_CH08.

    Alternatively, you can scan the following QR code (Figure 8.30):

Figure 8.30 – QR code that opens Chapter Review Questions for logged-in users

Figure 8.30 – QR code that opens Chapter...

Working On Timing

Target: Your aim is to keep the score the same while trying to answer these questions as quickly as possible. Here’s an example of how your next attempts should look like:

Attempt

Score

Time Taken

Attempt 5

77%

21 mins 30 seconds

Attempt 6

78%

18 mins 34 seconds

Attempt 7

76%

14 mins 44 seconds

Table 8.1 – Sample timing practice drills on the online platform

Note

The time limits shown in the above table are just examples. Set your own time limits with each attempt based on the time limit of the quiz on the website.

With each new attempt, your score should stay above 75% while your “time taken...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
AWS Certified Machine Learning - Specialty (MLS-C01) Certification Guide - Second Edition
Published in: Feb 2024Publisher: PacktISBN-13: 9781835082201
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Authors (2)

author image
Somanath Nanda

Somanath has 10 years of working experience in IT industry which includes Prod development, Devops, Design and architect products from end to end. He has also worked at AWS as a Big Data Engineer for about 2 years.
Read more about Somanath Nanda

author image
Weslley Moura

Weslley Moura has been developing data products for the past decade. At his recent roles, he has been influencing data strategy and leading data teams into the urban logistics and blockchain industries.
Read more about Weslley Moura