Lesson 1 of 3 AWS Managed AI Services

Adding Language and Speech Capabilities with Managed AI Services

This lesson explains how AWS managed AI services put pre-trained models behind simple APIs, so you can add language and speech capabilities without machine learning expertise, training or infrastructure.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish Amazon Comprehend, Amazon Translate, Amazon Transcribe, Amazon Polly and Amazon Lex.
  • Explain how intents and slots work in an Amazon Lex bot.
  • Describe how language and speech services are chained into one solution.

The services at a glance

AWS provides ready-made services for language and speech that need no machine learning expertise. Amazon Comprehend analyses text: it finds sentiment, entities such as names and places, key phrases, the language and topics, and can detect and redact personal information; custom models classify text into your own categories. Amazon Translate translates between languages, in real time or in batches, with custom terminology so brand names are kept.

Amazon Transcribe converts speech to text, identifying who spoke when and redacting personal information, with Call Analytics for contact centres. Amazon Polly converts text into lifelike speech in many voices and languages, with SSML markup to control pronunciation and pauses. Amazon Lex builds chatbots and voice bots, using the same technology as Alexa, and works with AWS Lambda. The following table summarises the services.

ServiceDoesKey features
Amazon ComprehendNLP on textSentiment, entities, key phrases, language, topic modelling, PII detection and redaction; custom classification and entities
Amazon TranslateNeural machine translationReal-time or batch; custom terminology for brand names; automatic language detection
Amazon TranscribeSpeech to textSpeaker diarisation (who spoke when), custom vocabularies, language identification, PII redaction, Call Analytics
Amazon PollyText to lifelike speechMany voices and languages, including neural and generative; SSML controls pronunciation, pauses and emphasis; lexicons
Amazon LexChatbots and voice botsIntents and slots; same technology as Alexa; integrates with AWS Lambda; generative AI features
Match the pairs

Language and speech

Exam skills 1.2.5

Match each need with the managed service that meets it.

Log in to try this activity Interactive activities are free with an account.

How Amazon Lex bots work

An Amazon Lex bot is built from three concepts. An intent is what the user wants to do, such as BookHotel; Lex recognises it from what the user says or types. A slot is a piece of information needed to complete the intent, such as the city and the check-in date; the bot asks for any slots the user has not yet given. Fulfilment is the business logic that carries out the request once all slots are filled, usually a Lambda function that makes the booking. The following table summarises the concepts with a hotel booking example.

ConceptMeaningExample
IntentWhat the user wantsBookHotel
SlotA detail needed to fulfil itCity, check-in date
FulfilmentThe business logic, usually a Lambda functionMake the booking

The following diagram follows one request through intent, slots and fulfilment.

How an Amazon Lex bot works. Lex recognises the intent, what the user wants, such as BookHotel, from what the user says or types. The bot asks for any missing slots, the details needed to complete the intent, such as the city and the check-in date. When all slots are filled, fulfilment, usually a Lambda function, carries out the request.
The bot keeps asking until every required slot is filled.
Sort into groups

Intent, slot or fulfilment?

Exam skills 1.2.5

A pizza shop is building an Amazon Lex bot. Place each part of the design in the right concept.

Log in to try this activity Interactive activities are free with an account.

Combining services

These services are often chained: a call is transcribed with Transcribe, translated with Translate, analysed with Comprehend and summarised with a Bedrock model.

Worked example

Analysing a contact centre's calls

A telecoms company records thousands of customer calls a day in several languages and wants to know why customers are unhappy. Chaining managed services answers the question without training a model:

StepServiceOutput
1. Convert speech to text, separating agent and customerAmazon Transcribe (with speaker diarisation and PII redaction)A transcript with card numbers removed
2. Translate non-English callsAmazon TranslateEnglish transcripts
3. Measure sentiment and find topicsAmazon ComprehendNegative sentiment, entities such as "router" and "billing"
4. Summarise each call for the agent's notesAmazon BedrockThree-line summaries

The analysis shows that most negative calls mention a particular router model. A chatbot built with Amazon Lex, with an intent for router troubleshooting, then handles the most common fix automatically, and Amazon Polly reads its answers aloud on the phone line.

Check yourself

Which service converts text into lifelike speech, and which does the reverse?

Show answer

Amazon Polly turns text into speech. Amazon Transcribe turns speech into text.

Exam Tips

Remember for the exam

  • Sentiment, entities or PII in text point to Amazon Comprehend.
  • Converting call recordings or live audio to text points to Amazon Transcribe.
  • Reading text aloud in natural voices points to Amazon Polly.
  • A chatbot or voice bot built from intents and slots points to Amazon Lex.
  • Translation between languages points to Amazon Translate, with custom terminology for brand names.
  • When a pre-trained AI service fits the need, choose it over a custom model for the least effort.