Skip to content

Skill 2.1.8: Apply AWS AI Services to Solve Specific Business Problems

Task 2.1: ML Model and Foundation Model (FM) Development — Choose appropriate modeling approaches for ML and AI solutions

Core objective: Offload an already-solved, pre-defined task to a fully managed, pre-trained service — no training data, no model hosting, no ML expertise, pay-per-unit.

Selection rule: Fixed logic → plain rule. Already-solved task → managed AI service. Patterns in your own data → trained model (SageMaker AI). General language/creative capability → foundation model (Bedrock). Scenarios saying "least development effort," "no labeled data," or "fastest time to market" for a standard task resolve to a managed AI service.

Service → Task → API Decision Matrix

Input Modality Business Task Service Signature APIs
Scanned docs, PDFs, images of text OCR, forms, tables, invoices, IDs Amazon Textract DetectDocumentText, AnalyzeDocument (Forms/Tables/Queries/Signatures/Layout), AnalyzeExpense, AnalyzeID
Images & video Labels, faces, moderation, custom classes Amazon Rekognition DetectLabels, DetectFaces, CompareFaces, IndexFaces/SearchFaces, DetectModerationLabels, RecognizeCelebrities, DetectProtectiveEquipment, Custom Labels
Text (already digitized) Entities, sentiment, key phrases, PII, classification Amazon Comprehend DetectEntities, DetectSentiment, DetectKeyPhrases, DetectDominantLanguage, DetectSyntax, DetectPII, ClassifyDocument, Custom Entity Recognition
Audio / speech Speech→text, speaker separation, call analytics Amazon Transcribe StartTranscriptionJob, StartStreamTranscription, StartCallAnalyticsJob, StartMedicalTranscriptionJob

Adjacent distractors: Polly (text→speech), Translate, Kendra (enterprise search), Lex (bots), A2I (human review), Bedrock (generative).

High-Yield Service Facts

Service Must-Know Trap
Textract Sync = single-page bytes; async = multi-page PDF/TIFF from S3 (Start…Job → JobId → Get…). Handles handwriting. Queries = natural-language questions against a document. Do not use Rekognition DetectText for documents. Textract extracts, it does not understand — chain with Comprehend.
Rekognition Face collections enable search/match. DetectFaces returns attributes (age range, emotion, glasses, beard) — never identity. CompareFaces returns a similarity score. Custom Labels trains a managed CV classifier from a small labeled set. Face Liveness = anti-spoofing for identity verification. Detecting a person ≠ identifying a person. Video analysis is an asynchronous job with notification.
Comprehend Real-time sync APIs cap at ~5 KB UTF-8; larger documents → async jobs on S3. Custom Classification (multi-class/multi-label) and Custom Entity Recognition require annotated data. Comprehend Medical → ICD-10-CM, RxNorm, SNOMED CT, PHI detection. DetectPII returns offsets for redaction. Comprehend never does OCR or ASR — it is text-in, insight-out.
Transcribe Batch vs streaming; speaker diarization (who spoke when); channel identification (stereo call recordings); custom vocabulary (jargon) vs custom language model (domain phrasing); vocabulary filtering (mask profanity); native PII redaction; Transcribe Medical for clinical speech; Call Analytics for talk-time/interruption/sentiment. Transcribe produces text, not meaning — entities/sentiment require Comprehend downstream.

Composition Patterns (Exam-Favorite Pipelines)

  • Document → insight: Textract → Comprehend → S3/OpenSearch.
  • Contact center: Transcribe (or Call Analytics) → Comprehend sentiment → QuickSight.
  • Speech → multilingual: Transcribe → Translate → Polly.
  • Human-in-the-loop: confidence below threshold → Amazon A2I review loop.
  • Media asset search: Rekognition DetectLabels → metadata store → search index.
  • RAG over scanned policy docs: Textract → chunk → embed → Bedrock Knowledge Bases.

Security, Privacy & Compliance

  • IAM: identity-based policies; most inference APIs expose no resource ARN, so scope by role and condition keys — custom models, collections, and entity recognizers are scoped resources.
  • Encryption: TLS 1.2 in transit; KMS at rest for stored outputs and custom model artifacts (CMK supported on custom resources).
  • Network: AWS PrivateLink interface endpoints for Textract, Rekognition, Comprehend, Transcribe keep traffic off the public internet (Transcribe streaming needs the interface endpoint plus private DNS).
  • Data handling: Customer content is not used to train AWS models and is not retained after processing; async outputs land in your S3 bucket, so bucket policy + KMS govern retention.
  • Compliance: HIPAA-eligible under BAA — Textract, Comprehend Medical, Transcribe Medical. Comprehend Medical is purpose-built for PHI; use DetectPII/redaction for GDPR and PCI scrubbing.

Managed AI Service vs Custom Model vs Foundation Model

Dimension Managed AI Service Custom Model (SageMaker AI) Foundation Model (Bedrock)
Effort to first result Lowest Highest Low
Data requirement None Labeled data Prompt/few-shot; labels only for fine-tuning
Cost shape Per page / image / minute / 100 chars Fixed infra + ops Per token
Best when Task is standard and pre-solved Proprietary patterns, custom classes, strict accuracy/interpretability Open-ended language, summarization, generation
Customization escape hatch Custom Labels (Rekognition), Custom Classification/Entity (Comprehend), Custom Vocabulary/LM (Transcribe) Full control of algorithm and features Prompting → RAG → fine-tuning, in that order

Exam gotcha: Always try the managed service first for a standard task. Reaching for a custom model or an FM fine-tune when Textract/Rekognition/Comprehend/Transcribe already solve it is the classic "most effort / highest cost" distractor.

Anti-Patterns & Distractor Traps

  • Custom CV/OCR model for invoices when AnalyzeExpense exists → wasteful and brittle.
  • Coordinate/position-based rules on variable layouts → break on any new vendor template.
  • Rekognition for document text or Textract for scene labels → wrong input modality.
  • Comprehend on audio or Transcribe for sentiment → chain them instead.
  • Assuming DetectFaces identifies people → it does not; use CompareFaces or face collections with governance/consent.
  • Sync API on a multi-page PDF → use the async Start…/Get… job pattern via S3.
  • Fine-tuning an FM for terminology before exhausting prompting/RAG → violates "prompt first, fine-tune last."

Hard limits: Textract sync = 1 page (async for multipage in S3) · Comprehend real-time ≈ 5 KB (async jobs beyond) · Rekognition video = async job · Transcribe streaming ≠ batch job · custom Comprehend models require annotated training data.