Lesson 2 of 4 Data Validation and Processing for FMs

Processing Audio, Documents, Images and Tables for Foundation Models

This lesson describes the services and pipeline architecture that turn speech, scanned documents, images, video and tables into something an FM or embedding model can use.

Learning outcomes

After completing this lesson, you will be able to:

  • Transcribe audio with Amazon Transcribe.
  • Extract text and structure from documents and images.
  • Process tabular data before it reaches a prompt.
  • Design a multimodal processing pipeline.

Audio with Amazon Transcribe

Foundation models that accept only text cannot use recorded calls, meetings or voice notes directly, so audio is usually converted to text first. Amazon Transcribe converts speech to text, either in batch mode for files stored in Amazon S3 or in streaming mode for live audio.

Several Transcribe features matter for FM pipelines. Speaker diarisation labels who said each part of the conversation, so that a summary can distinguish the customer from the agent. Custom vocabularies and custom language models improve recognition of product names and domain terms, which otherwise appear as misspellings that harm retrieval and summarisation. Automatic language identification handles multilingual audio, and PII redaction removes personal information such as card numbers from transcripts before they reach a model or a log. Transcribe Call Analytics adds call-specific insights, such as sentiment and interruptions, and generative call summaries. The resulting transcript becomes the input to an FM for summarisation, question answering or classification.

Documents and images

Amazon Textract extracts printed and handwritten text, forms (key-value pairs), tables, layout and answers to natural language queries from scanned documents, with asynchronous APIs for multi-page PDFs. Bedrock multimodal models accept images and documents directly in a Converse request, which suits describing images, answering questions about a chart or extracting fields from a photo without a separate OCR step.

Amazon Bedrock Data Automation (BDA) processes documents, images, audio and video into structured output with one API. Standard output gives common results, such as document text, summaries, image descriptions or video chapters; custom output uses blueprints that define the fields to extract for a document type, such as an invoice or a claim form. BDA can also serve as the parser for a knowledge base.

Sort into groups

Which service processes it?

Exam skills 1.3.2

Choose the service that should process each kind of input.

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

Tabular data and custom processing

Large tables rarely belong in a prompt as raw rows: they consume many tokens, and models are unreliable at scanning and calculating across hundreds of rows. Three approaches work better. Rows can be converted into concise text or JSON records, one per entity, so that each can be embedded and retrieved individually. Tables can be summarised or aggregated first, for example monthly totals per region, so that the prompt contains only the figures the task needs. Or the model can generate SQL that a database executes, so that the numbers come from the data itself rather than from the model's arithmetic.

Some transformations are too heavy or specialised for a Lambda function, such as converting thousands of spreadsheets or running a large document-conversion library. SageMaker Processing jobs run custom scripts or containers, for example with pandas, Apache Spark or a document-conversion tool, on managed instances that are created for the job and removed afterwards, which suits large-scale preparation of data before ingestion or fine-tuning.

True or false

Tables and foundation models

Exam skills 1.3.2

Check four claims about giving tabular data to foundation models.

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

A multimodal pipeline architecture

A typical pipeline lands raw files in S3, emits an S3 event to EventBridge, and starts a Step Functions workflow. A Choice state routes by file type: audio to Transcribe, scanned documents to Textract or BDA, images to a multimodal model or multimodal embeddings, video to BDA. Each branch writes normalised text, extracted fields and metadata to a processed prefix, validation checks the results, and the knowledge base or a downstream application consumes them. The following table maps data types to services.

Data typeServiceResult
Speech audioAmazon TranscribeTranscript with speakers, optional PII redaction
Scanned forms and tablesAmazon Textract or BDAText, key-value pairs, tables
Mixed documents, images, audio, videoAmazon Bedrock Data AutomationStandard or blueprint-defined structured output
Images needing interpretationBedrock multimodal modelDescriptions, answers, extracted fields
Images for similarity searchMultimodal embeddingsVectors in the same space as text
Large or custom transformationsSageMaker ProcessingTransformed datasets

The following diagram shows a multimodal processing pipeline that routes each file by type, and its branches.

A multimodal processing pipeline. Raw files land in S3, an S3 event reaches EventBridge, and a Step Functions workflow routes each file by type: audio to Amazon Transcribe, scanned documents to Textract or Bedrock Data Automation, images to a multimodal model and video to Bedrock Data Automation. Every branch writes normalised text, fields and metadata to a processed prefix, which is validated before the knowledge base consumes it.
Bedrock Data Automation can replace several branches with one service.
Put in order

A multimodal ingestion pipeline

Exam skills 1.3.2

Put the stages of an event-driven multimodal pipeline in order.

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

Insurance claims

An insurer receives claims as photos of damage, scanned forms and recorded phone calls. It wants a structured claim record and a summary for adjusters with the least custom code.

Bedrock Data Automation with a claim-form blueprint extracts form fields, image descriptions and an audio summary in one service; a Step Functions workflow combines the outputs and calls a Bedrock model to write the adjuster summary. Building separate Textract, Transcribe and vision-model integrations would also work but needs more code.

Check yourself

Which service converts recorded calls to text before they reach a model?

Show answer

Amazon Transcribe. Amazon Textract handles scanned forms and tables.

Exam Tips

Remember for the exam

  • Speech: Transcribe. Scanned forms and tables: Textract.
  • Many data types with one service and custom fields: Bedrock Data Automation blueprints.
  • Images interpreted in a prompt: multimodal Converse request.
  • Route by file type with Step Functions.