Study guide
Technical reference and lesson notes
Purpose of This Lesson
AWS provides managed machine learning and artificial intelligence services for common application capabilities. Instead of training and operating custom models, architects can call purpose-built APIs from serverless and event-driven applications.
This lesson focuses on recognizing the business capability required and selecting the corresponding AWS service. Common integration patterns use Amazon S3, AWS Lambda, Amazon SNS, and Amazon DynamoDB.
Key Concepts
Amazon Rekognition
Amazon Rekognition adds image and video analysis capabilities to applications. It can identify:
- Objects and scenes
- People and faces
- Text in images
- Activities in video
- Facial attributes and emotions, where supported
- Celebrities
A common workflow is:
- An image is uploaded to Amazon S3.
- An S3 event invokes an AWS Lambda function.
- Lambda calls Rekognition to analyze the image.
- The result is published to Amazon SNS, stored in DynamoDB, or passed to another processing component.
Rekognition can analyze images directly. Stored-video analysis is generally an asynchronous workflow: the video is placed in Amazon S3, analysis is started, and completion status can be delivered through Amazon SNS or retrieved using the service APIs.
Amazon Transcribe
Amazon Transcribe converts recorded or streaming speech into text using automatic speech recognition. It is useful for:
- Creating transcripts from audio or video
- Generating subtitles and captions
- Processing call-center recordings
- Making spoken content searchable
- Extracting text for downstream analysis
A typical pipeline stores the source media in Amazon S3, invokes Transcribe, and stores the resulting transcript for further processing.
Amazon Translate
Amazon Translate is a neural machine translation service. It converts text from one language to another and is useful for:
- Localizing websites and applications
- Translating user-generated content
- Producing multilingual documents
- Translating transcripts created by Amazon Transcribe
For example, a workflow can transcribe a video, store the transcript as JSON in Amazon S3, and invoke Translate when an S3 event occurs.
Amazon Comprehend
Amazon Comprehend uses natural language processing to extract insights from unstructured text. Typical analysis includes:
- Sentiment
- Key phrases
- Entities such as people, places, or organizations
- Language detection
- Important topics or concepts
It can analyze customer reviews, support tickets, surveys, and other text to determine what users are saying and whether their sentiment is positive, negative, neutral, or mixed.
Amazon Lex
Amazon Lex builds conversational interfaces using voice and text. It is suited to chatbots and virtual agents, including contact-center use cases.
Lex is selected when an application needs to understand user input and maintain a conversational interaction. It is different from Amazon Transcribe: Transcribe produces text from speech, while Lex provides the conversational bot experience and intent-oriented interaction.
Amazon DevOps Guru
Amazon DevOps Guru uses machine learning to identify abnormal operational behavior and provide insights into application availability and performance.
It can help teams:
- Detect deviations from normal operating patterns
- Identify potential operational issues
- Reduce alert noise
- Produce ML-based recommendations for resolving problems
- Analyze operational behavior as applications scale
DevOps Guru is an operations and reliability service, not a general-purpose application ML platform. It is used to improve detection and diagnosis of operational problems.
Amazon CodeGuru Security
Amazon CodeGuru Security helps identify security vulnerabilities in source code and dependencies during the development lifecycle. It can integrate with development environments and CI/CD tooling through supported integrations and APIs.
Capabilities include:
- Detecting security vulnerabilities
- Tracking findings
- Suggesting remediation or code fixes
- Providing code-quality and security recommendations
- Detecting some application anomalies through runtime profiling capabilities
CodeGuru Security belongs in the secure software development and automated code-analysis category. It is not the service to choose for analyzing user text, images, or speech.
Architecture Decision Guide
| Requirement | AWS service | Typical integration |
|---|---|---|
| Identify objects, faces, text, or activities in images and video | Amazon Rekognition | S3, Lambda, SNS, DynamoDB |
| Convert speech or recorded audio to text | Amazon Transcribe | S3, Lambda, downstream NLP |
| Translate text between languages | Amazon Translate | Transcribe, S3, Lambda |
| Extract sentiment, entities, or key phrases from text | Amazon Comprehend | S3, Lambda, analytics or databases |
| Build a conversational bot using text or voice | Amazon Lex | Application front end, contact center, Lambda |
| Detect abnormal application operations and availability behavior | Amazon DevOps Guru | CloudWatch and operational workflows |
| Find vulnerabilities and suggest fixes in source code | Amazon CodeGuru Security | IDEs, repositories, CI/CD pipelines |
Event-Driven AI Processing Pattern
Managed AI services fit naturally into event-driven architectures:
Object uploaded to S3
|
v
S3 event
|
v
Lambda
|
v
Managed AI service
|
+--> SNS notification
+--> DynamoDB result
+--> S3 output
This pattern decouples ingestion, analysis, and result processing. Lambda can validate the event, call the appropriate AI service, transform the response, and persist application-specific results.
For long-running or asynchronous analysis, the architecture should account for job status, retries, duplicate events, and eventual completion rather than assuming that the result is returned immediately.
Exam-Relevant Takeaways
- Choose Amazon Rekognition for image and video understanding.
- Choose Amazon Transcribe for speech-to-text conversion.
- Choose Amazon Translate for language translation.
- Choose Amazon Comprehend for natural language analysis such as sentiment and entity extraction.
- Choose Amazon Lex for conversational voice and text bots.
- Choose Amazon DevOps Guru for ML-assisted detection of abnormal operational behavior and application availability issues.
- Choose Amazon CodeGuru Security for automated source-code security analysis and remediation recommendations.
- Amazon S3 event notifications and AWS Lambda commonly connect media ingestion to AI processing.
- Amazon SNS can communicate completion or status notifications for asynchronous workflows.
- DynamoDB is a possible destination for structured metadata extracted from images, videos, or text; it is not required by the AI services.
- Distinguish the capability from the surrounding architecture. S3, Lambda, SNS, and DynamoDB are integration components, while Rekognition, Transcribe, Translate, and Comprehend perform specialized analysis.
Common Exam Traps
- Confusing Transcribe and Translate: Transcribe converts speech to text; Translate converts text between languages.
- Using Comprehend for translation: Comprehend extracts meaning and attributes from text. It does not primarily translate content.
- Using Lex for simple transcription: Lex is a conversational bot service. Transcribe is the direct speech-to-text service.
- Confusing Rekognition with Comprehend: Rekognition analyzes visual media; Comprehend analyzes text.
- Assuming every AI job is synchronous: Stored-video analysis and other longer-running jobs may be asynchronous and require completion handling.
- Choosing DevOps Guru for source-code vulnerabilities: DevOps Guru focuses on operational behavior and application performance or availability insights. CodeGuru Security is the code-security choice.
- Treating AI services as a replacement for application persistence: The service returns analysis results; the application still needs a storage and processing design.
- Ignoring event duplication and retries: S3 and Lambda-based workflows should be designed to tolerate repeated events and safely retry failed processing.
Real-World Engineer Notes
- Use a correlation ID or source-object identifier when storing analysis results so retries do not create confusing duplicate records.
- Keep raw media and generated outputs in separate S3 prefixes or buckets, with appropriate encryption and access controls.
- Design asynchronous pipelines around explicit states such as
SUBMITTED,IN_PROGRESS,SUCCEEDED, andFAILED. - Use least-privilege IAM policies. A processing Lambda should have access only to the required S3 objects, AI API actions, notification topics, and destination tables.
- Consider privacy and data-governance requirements before processing faces, voices, customer conversations, or other sensitive content.
- Use dead-letter handling or an equivalent retry strategy for failed asynchronous processing.
- Select the managed AI API based on the required capability first; choose orchestration, storage, and notification services separately.
Quick Reference Summary
- Vision analysis: Amazon Rekognition
- Speech to text: Amazon Transcribe
- Text translation: Amazon Translate
- Text understanding: Amazon Comprehend
- Conversational bots: Amazon Lex
- Operational anomaly detection: Amazon DevOps Guru
- Code security analysis: Amazon CodeGuru Security
- Common event source: Amazon S3
- Common compute integration: AWS Lambda
- Common notification mechanism: Amazon SNS
- Common structured result store: Amazon DynamoDB
Flashcards
- Q: Which AWS service identifies objects, faces, and text in images?
A: Amazon Rekognition.
- Q: Which service converts recorded speech into text?
A: Amazon Transcribe.
- Q: Which service translates text between languages?
A: Amazon Translate.
- Q: Which service detects sentiment and extracts entities from text?
A: Amazon Comprehend.
- Q: Which service provides conversational interfaces through voice and text?
A: Amazon Lex.
- Q: Which service identifies abnormal operational behavior and availability issues?
A: Amazon DevOps Guru.
- Q: Which service scans source code for security vulnerabilities and suggests fixes?
A: Amazon CodeGuru Security.
- Q: What service commonly triggers processing when an image is uploaded to a bucket?
A: Amazon S3 event notifications, often invoking AWS Lambda.
- Q: What is the difference between Transcribe and Translate?
A: Transcribe converts speech to text; Translate converts text from one language to another.
- Q: Which service should be selected to determine whether customer reviews are positive or negative?
A: Amazon Comprehend.
- Q: Which service analyzes stored video for visual content?
A: Amazon Rekognition, typically through an asynchronous video-analysis workflow.
- Q: Which service is intended for chatbot and contact-center conversational experiences?
A: Amazon Lex.
Practice Questions
Question 1
A media company stores recorded interviews in Amazon S3. It needs to create text transcripts, translate those transcripts into several languages, and store the resulting documents for its website. Which design best meets the requirement?
A. Use Amazon Rekognition for transcription and Amazon Comprehend for translation.
B. Use Amazon Transcribe to create transcripts, Amazon Translate for language conversion, and Amazon S3 for output storage.
C. Use Amazon Lex to transcribe the interviews and Amazon Rekognition to translate them.
D. Use Amazon Translate directly on the audio files.
Correct answer: B
Amazon Transcribe converts speech to text, and Amazon Translate converts the resulting text into other languages. S3 can store both the source media and generated documents.
Question 2
An application receives product reviews as text. The business wants to classify sentiment and identify important phrases and named entities. Which AWS service should the architect recommend?
A. Amazon Rekognition
B. Amazon Lex
C. Amazon Comprehend
D. Amazon Transcribe
Correct answer: C
Amazon Comprehend performs natural language analysis, including sentiment, key-phrase, and entity extraction.
Question 3
A company uploads customer images to Amazon S3. It wants to identify objects and detected text, then store the results as searchable metadata. Which architecture is most appropriate?
A. S3 event notification invokes Lambda, Lambda calls Amazon Rekognition, and the results are stored in DynamoDB.
B. S3 event notification invokes Lex, and Lex stores the image labels in SNS.
C. Lambda calls Amazon Translate directly on each image and stores the result in Comprehend.
D. Amazon DevOps Guru analyzes the image and writes the result to CloudWatch.
Correct answer: A
Rekognition provides image analysis. S3 events and Lambda are suitable for invoking processing, while DynamoDB can store structured labels and metadata for lookup.
Question 4
An operations team wants a managed AWS capability that identifies deviations from normal application behavior and helps reduce alert noise. Which service is the best fit?
A. Amazon CodeGuru Security
B. Amazon DevOps Guru
C. Amazon Comprehend
D. Amazon Rekognition
Correct answer: B
DevOps Guru applies machine learning to operational behavior and can provide insights into availability and performance issues. CodeGuru Security focuses on code vulnerabilities.