Skip to content

Transcribe, Polly and Lex

Three services cover the voice loop: Transcribe turns speech into text, Lex works out what the text means and what to do about it, and Polly turns the response back into speech.

Automatic speech recognition. Converts audio and video into text, in batch over stored files or in real time over a stream.

Common uses: call recording transcription, subtitling, meeting notes, and producing text for downstream analysis by Comprehend.

Text to speech, producing spoken audio from written input.

  • Many languages and voices, including neural voices
  • Speech Synthesis Markup Language (SSML) for control over pronunciation, emphasis, pauses and speaking style
  • Output as an audio stream or a file in S3

Common uses: voice responses in contact centres, narration for e-learning and articles, accessibility features, IVR prompts.

Conversational AI for building chatbots and voice interfaces. Lex is the component that understands and drives the conversation: it recognises the caller’s intent, collects the slots (parameters) that intent needs, and decides what to say or do next. It is built on the same speech recognition and natural language understanding technology as Amazon Alexa.

Lex accepts text or speech. It returns JSON containing:

  1. Text response — the bot’s reply
  2. Dialog stateElicitIntent, ElicitSlot, ConfirmIntent, Fulfilled or Failed
  3. Slot data — captured slot values and their validation results
  4. Intent information — the identified intent, confidence scores and fulfilment state
  5. Response cards — buttons, images and other formatted elements
  6. Session attributes — context carried between turns
Input typeExample inputIntentSlot valuesOutput typeExample outputUse case
Text“Book a table for 4 tomorrow at 7 PM”BookRestaurantDate: tomorrow; Time: 7 PM; PartySize: 4Text“I’ve booked a table for 4 tomorrow at 7 PM. Your confirmation number is #12345.”Restaurant reservation
Speech“I want to order a large pepperoni pizza”OrderPizzaSize: large; Topping: pepperoniText and cardText: “Your pizza order total is £18.99”; card showing image, price and confirm buttonFood ordering
Text“What’s the balance in my checking account?”CheckBalanceAccountType: checkingText and session attributesText: “Your current account balance is £1,234.56”; session stores account type for follow-upsBanking
Speech“Book a flight to Seattle next Friday”BookFlightDestination: Seattle; Date: next FridayElicitSlot“What time would you like to depart?”Travel booking
Text“I need to reschedule my appointment”RescheduleAppointmentAction: rescheduleElicitSlot and cardText: “I can help you reschedule. Please select a new date”; card with calendar pickerHealthcare
Text“Track my order #123456”TrackOrderOrderId: 123456Text and response cardText: “Your order is in transit”; card showing tracking mapE-commerce
Speech“Turn on the living room lights”SmartHomeControlDevice: lights; Location: living room; Action: onText and fulfilment“Turning on the living room lights”Smart home
Text“What’s the weather like?”GetWeatherNone (eliciting)ElicitSlot“For which city would you like to know the weather?”Weather
Text“I want to file a complaint”FileComplaintNone (initial)Text and intent confirmation“I understand you want to file a complaint. Is that correct?”Customer service
Speech“Transfer £100 to savings”TransferMoneyAmount: 100; ToAccount: savingsConfirmIntent“Do you want to transfer £100 to your savings account?”Banking transfer
Five boxes summarising each service's inputs and outputs: Polly takes text and returns audio; Translate takes text in one language and returns another; Transcribe takes audio or video and returns text; Comprehend takes text and returns analysis; Lex takes text or audio and returns an intent and response.
Inputs and outputs of the AWS language and speech services.

Speech arrives, is transcribed, is interpreted as an intent, is acted on, and the answer is spoken back. Comprehend is an optional branch for analysing the transcript — sentiment, entities, PII redaction — rather than a step in the main path.

graph TD A[Voice input] --> B[Amazon Transcribe] B --> C[Text transcript] C --> D[Amazon Lex] D --> E{Intent processing} E -->|Query| F[Content generation] E -->|Command| G[Action execution] F --> H[Amazon Polly] G --> H H --> I[Spoken response] C -.->|Optional text analytics| J[Amazon Comprehend] J -.->|Enriched text| D style B fill:#f9d5e5,stroke:#333,stroke-width:2px style D fill:#e06377,stroke:#333,stroke-width:2px style E fill:#b5e7a0,stroke:#333,stroke-width:2px style H fill:#f9d5e5,stroke:#333,stroke-width:2px style J fill:#eeac99,stroke:#333,stroke-width:2px

Where the transcript needs cleaning before Lex sees it — removing disfluencies, redacting PII, normalising domain terms — a Comprehend or Lambda step sits between the raw transcript and Lex, and the response can be published as text as well as spoken.