AI/ML: Speech, Vision, and Documents (Polly, Transcribe, Rekognition, Textract)

Part 2 of 3 in the AWS managed AI/ML series.

PartTopic
1 — Text and chatbotsComprehend, Translate, Lex
2 (this page)Polly, Transcribe, Rekognition, Textract
3 — Search and recommendationsKendra, Personalize

Prerequisites

aws sts get-caller-identity
export AWS_REGION=us-east-1
export BUCKET=your-unique-demo-bucket-$(aws sts get-caller-identity --query Account --output text)

Create a bucket in the same Region as your API calls (required for Transcribe, Rekognition, and Textract with S3 input):

aws s3 mb "s3://${BUCKET}" --region "$AWS_REGION"

Upload a test image (JPEG/PNG) and optional audio (FLAC/MP3/WAV) before Transcribe/Rekognition/Textract sections.


Amazon Polly

Use when: text-to-speech for apps, IVR, or accessibility.

Console

  1. Open Amazon Polly.
  2. Text-to-Speech tab.
  3. Turn SSML off for plain text.
  4. Enter a short sentence.
  5. Choose Engine (Standard, Neural, Long Form, or Generative where available), Language, and Voice.
  6. Listen, or Download (MP3 and other formats under Additional settings).

Reference: Synthesizing speech example.

AWS CLI (Polly)

Synthesize to a local file:

aws polly synthesize-speech \
  --region "$AWS_REGION" \
  --output-format mp3 \
  --voice-id Joanna \
  --text "Hello from Amazon Polly." \
  hello.mp3

List voices in the Region:

aws polly describe-voices --region "$AWS_REGION" --language-code en-US

Long text to S3 (async task):

echo "Long narration text goes here." > polly-input.txt
aws polly start-speech-synthesis-task \
  --region "$AWS_REGION" \
  --output-format mp3 \
  --output-s3-bucket-name "$BUCKET" \
  --voice-id Joanna \
  --text file://polly-input.txt

On Windows PowerShell, keep --text in single quotes if the string contains double quotes.

Docs: synthesize-speech.


Amazon Transcribe

Use when: speech in a media file → text transcript (meetings, call recordings, captions).

Transcribe batch jobs read audio from S3 in the same Region as the job.

Console

  1. Upload audio to your bucket (for example s3://BUCKET/audio/sample.flac).
  2. Open Amazon Transcribe.
  3. Transcription jobs → Create job.
  4. Name the job, choose Language (or language identification if enabled).
  5. Point Input media at your S3 object; optional output bucket.
  6. Create the job and open it when status is Completed; download or open the transcript JSON.

Reference: What is Amazon Transcribe.

AWS CLI (Transcribe)
aws s3 cp ./your-audio.flac "s3://${BUCKET}/audio/sample.flac" --region "$AWS_REGION"

aws transcribe start-transcription-job \
  --region "$AWS_REGION" \
  --transcription-job-name demo-job-$(date +%s) \
  --language-code en-US \
  --media MediaFileUri="s3://${BUCKET}/audio/sample.flac"

aws transcribe get-transcription-job \
  --region "$AWS_REGION" \
  --transcription-job-name YOUR_JOB_NAME \
  --query 'TranscriptionJob.{Status:TranscriptionJobStatus,Uri:Transcript.TranscriptFileUri}'

When Status is COMPLETED, fetch the transcript URL with curl or open it in a browser (presigned or public per bucket policy).

Docs: Getting started with the CLI.


Amazon Rekognition

Use when: labels/objects in images or Detect text (OCR). CLI requires S3 image reference (not raw bytes).

Console

  1. Upload photo.jpg to s3://BUCKET/images/photo.jpg.
  2. Open Amazon Rekognition.
  3. Label detection or Text detection → upload or choose S3 object.
  4. Review labels or detected lines of text.

Reference: Detecting labels, Detecting text.

AWS CLI (Rekognition)

Labels:

aws rekognition detect-labels \
  --region "$AWS_REGION" \
  --image "{\"S3Object\":{\"Bucket\":\"${BUCKET}\",\"Name\":\"images/photo.jpg\"}}" \
  --max-labels 10 \
  --min-confidence 70

Text (OCR):

aws rekognition detect-text \
  --region "$AWS_REGION" \
  --image "{\"S3Object\":{\"Bucket\":\"${BUCKET}\",\"Name\":\"images/photo.jpg\"}}"

Docs: detect-labels, detect-text.


Amazon Textract

Use when: forms, tables, or layout on documents (PDF/TIFF/PNG/JPEG)—more structure than plain Rekognition OCR.

Console

  1. Open Amazon Textract.
  2. Use Analyze document (demo) or upload a sample invoice/form.
  3. Enable Forms, Tables, or Queries as needed and inspect blocks in the UI.

For your own files, upload to S3 first (same Region).

Reference: Getting started with Textract, Analyzing document text.

AWS CLI (Textract)

Upload a one-page PDF or image:

aws s3 cp ./document.pdf "s3://${BUCKET}/docs/document.pdf" --region "$AWS_REGION"

Analyze forms and tables (sync, single-page or first page of PDF):

aws textract analyze-document \
  --region "$AWS_REGION" \
  --document "{\"S3Object\":{\"Bucket\":\"${BUCKET}\",\"Name\":\"docs/document.pdf\"}}" \
  --feature-types '["TABLES","FORMS"]'

Multi-page PDFs: use start-document-analysis and get-document-analysis instead of analyze-document.

Docs: analyze-document.


Troubleshooting

SymptomCheck
Transcribe job fails immediatelyInput bucket and job Region match; audio format supported.
Rekognition / Textract invalid S3Object exists; caller has s3:GetObject; bucket Region matches API Region.
Textract empty tablesEnable TABLES in --feature-types; scanned PDF quality and rotation.
Polly voice errorVoice supports chosen Engine (Neural vs Standard); try describe-voices.

Next

Continue with Part 3 — Kendra and Personalize.