AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
AWS Machine Learning Blog·2026年6月12日 00:11·約16分で読める

Amazon Bedrock Data Automation のブループリント抽出精度を最適化する方法

#Document Intelligence#LLM Application#RAG#Amazon Bedrock
TL;DR

AWS は Amazon Bedrock Data Automation の新機能「Blueprint instruction optimization」を発表し、数例のドキュメントと正解値を入力するだけで抽出指示を自動改善し、高精度な構造化データ抽出を実現可能にした。

AI深層分析2026年6月12日 01:06
4
重要/ 5段階
深度40%
4
関連度30%
5
実用性20%
5
革新性10%
3

キーポイント

1

ブループリント指示の最適化機能

ユーザーが 3〜10 件の例文と期待値を提供するだけで、BDA が自動的に抽出指示を調整し、精度向上を図る新機能が追加された。

2

複雑なドキュメントへの対応

ベンダーごとのフォーマット違いやスキャン品質の低下など、従来の単純な自然言語指示では対応が難しかった実務上の課題を解決する。

3

迅速な改善と運用効率化

モデルのファインチューニングを不要とし、数週間かかっていた調整プロセスを数分以内に短縮し、コンソールまたは API で実行可能である。

4

最適化ジョブの実行方法

サンプルドキュメントと正解データ(ground truth)の S3 URI をペアにして InvokeBlueprintOptimizationAsync API を呼び出すことで、ブループリントスキーマの自動最適化を開始します。

5

非同期処理の監視

最適化ジョブは非同期で実行されるため、GetBlueprintOptimizationStatus API を定期的にポーリングしてステータスが 'Success' になるまで待機する必要があります。

影響分析・編集コメントを表示

影響分析

この機能は、IDP(インテリジェント・ドキュメント・プロセッシング)の実装において最も時間がかかる「抽出ルールの調整」プロセスを自動化することで、企業の実装コストと時間を劇的に削減する。特に、多様なベンダーやフォーマットに直面する実務現場において、迅速かつ高精度なデータ抽出を実現するための重要なステップとなる。

編集コメント

ドキュメント処理の実装において、最も時間がかかる「プロンプト調整」の部分を自動化した点は実務者にとって非常に魅力的です。モデル再学習が不要なため、迅速なプロトタイプ開発から本番環境への移行までをスムーズにします。

請求書、契約書、税務申告書、入学申込書などの非構造化ドキュメントから構造化データを抽出することは、組織における一般的な自動化の目標です。高い抽出精度を達成し続けることは依然として主要な課題となっています。ドキュメントが想定されたテンプレートから逸脱した場合や、ベンダー間でフォーマットが異なる場合、スキャン品質が悪い場合に精度は低下します。

Amazon Bedrock Data Automation(BDA)を使用すれば、単一の API を通じてドキュメントからのデータの分類、抽出、正規化、検証を行うことができます。カスタマイズ可能なブループリントを使用して、特定のドキュメントフォーマットやビジネス要件に合わせてカスタム出力を生成します。ただし、生産環境で扱う多様なすべてのドキュメントに対応するブループリントの抽出精度を最適化するには、依然として反復的な調整が必要です。

Blueprint instruction optimization(ブループリント指示の最適化)は、この課題に直接対処するために抽出指示を自動的に改善する BDA の機能です。期待される値を含む 3〜10 件の例ドキュメントを提供すると、BDA は数週間ではなく数分でブループリントの指示を調整し、精度を向上させます。モデルの個別微調整は不要です。

本記事を終える頃には、精度向上のためにブループリントを最適化する方法を理解し、Amazon Bedrock コンソールまたは API を通じて最適化ワークフローを実行し、例とグランドトゥルース(正解データ)の選択に関するベストプラクティスを適用できるようになります。

ドキュメントフィールド抽出の課題

Amazon Bedrock Data Automation を用いてインテリジェントドキュメント処理(IDP)パイプラインを構築する際、ブループリントを作成し、ドキュメントからどのフィールドを抽出するかを定義します。各フィールドには、抽出をガイドする自然言語の指示が含まれています。例えば:

  • フィールド: invoice_number → 指示: "請求書番号"。
  • フィールド: total_amount → 指示: "支払総額"。

これらの初期指示は単純なケースではよく機能します。しかし、実世界のドキュメントには追加の複雑さが伴います:

  • ドキュメントの種類によってフィールドラベルが異なる。
  • 類似したラベルが混乱を招く(例:"小計"と"合計")。
  • ベンダーや時期によってドキュメントのレイアウトが異なる。
  • エッジケースにはより具体的な抽出ガイダンスが必要となる。

以下は、購入注文のブループリントスキーマがどのようなものかを示した簡略化された例です。各フィールドには型(type)、inferenceType(ドキュメントに直接表示される値の場合は明示的、推論が必要な場合は推論型)、および抽出をガイドする指示が含まれています:

翻訳全文

Blueprint 指示の最適化は、各フィールドに対する指示値を精緻化するものです。型と推論タイプは変更されません。完全な注文書スキーマは GitHub リポジトリ で確認できます。

あなたはすでに自社のドキュメントやデータについて熟知しています。Blueprint 指示の最適化により、精度のギャップを埋めるためのより迅速な道筋が得られます。

従来のアプローチ:手動での反復

抽出精度を向上させるには、通常、フィールド指示を手動で反復して調整します。異なる表現を試したり、文脈を追加したり、試行錯誤を通じて記述を洗練させたりします。各サイクルでは、抽出を実行し、結果を期待値と比較し、指示を調整して繰り返す必要があります。数百のベンダーからドキュメントを処理する組織にとって、このプロセスはドキュメントタイプごとに数週間かかることもあります。

最適化されたアプローチ:自動化による改善

ブループリント指示の最適化により、この改善ループ全体を単一のワークフローで自動化できます。BDA は抽出結果と正解データ(ground truth)との差異を分析し、各フィールドの自然言語指示を改善します。これにより、数週間かかる代わりに数分で最適化された指示が提供されます。

ブループリント指示の最適化による精度向上

ワークロードから実際のドキュメントを使用して抽出指示を改善するには、以下の手順に従ってください。

  • 例文ドキュメントの提供 – 生産環境から代表的なドキュメントを 3〜10 件アップロードしてください。抽出が困難だったエッジケースを含むものとし、過学習を防ぐために、生産環境におけるドキュメント分布の多様性をできるだけ広くカバーするようにしてください。
  • グランドトゥルース(正解データ)の提供 – 各例文ドキュメント内の各フィールドに対して、正しい期待値を提供してください。グランドトゥルースとは、抽出品質を測定するためのベンチマークとして機能する、検証済みで正確なデータのことです。これにより、BDA は正解が何であるべきかを理解します。
  • 最適化の実行 – 最適化プロセスを開始します。BDA は初期の抽出結果とグランドトゥルースを比較し、各フィールドに対する自然言語指示を改良していきます。
  • 結果の確認 – 詳細な精度指標と最適化された指示を確認してください。最適化は通常数分で完了します。指標には、F1 スコア(適合率と再現率を組み合わせた測定値)および完全一致率(抽出値がグランドトゥルースと完全に一致するフィールドの割合)が含まれます。

最適化された指示には、例文から学習したパターンが組み込まれ、より詳細で具体的な内容が追加されます。例えば、「請求書番号」という初期の指示は、「ドキュメントヘッダーの右上隅に通常記載され、『Invoice #』または『Invoice No.』の後に続く数値または英数字コードとしてフォーマットされた請求書番号」のように変更される可能性があります。

シナリオ例:発注書の抽出

最適化ワークフローを説明するために、架空の自転車製造会社の文書を用いた発注書抽出シナリオを追跡します。

発注書から注文番号、商品説明、数量、単価、合計額などのフィールドを抽出するためのブループリントを作成します。

Cycle Central や Bike World などの小売業者からの代表的な発注書 4 通と、対応する正解データファイル(ground truth files)をアップロードして最適化を実行すると、精度が向上します:

指標

最適化前

最適化後

ファイルごとの完全一致(最良ケース)

92%

100%

集計された完全一致

90%

92%

BDA は、発注書セット全体にわたるベンダー固有のフォーマット、フィールドラベルの変動、およびレイアウトの違いに対応するために指示を自動的に洗練させ、集計された完全一致を 90% から 92% に向上させます。

大量処理を行う場合でも、精度が数パーセントポイント向上するだけで、手動レビューキューの削減と処理スループットの高速化に直接寄与します。

はじめに

ブループリント指示の最適化機能は、Amazon Bedrock コンソールまたは API を通じてアクセスできます。独自の文書を使用するか、ブループリント、サンプル PDF 文書、および正解データ JSON ファイルを含むサンプルソリューションをデプロイしてください。

前提条件

本記事の手順に従うには、以下の準備が必要です:

  • AWS アカウント。
  • サポート対象リージョンにおいて、Amazon Bedrock Data Automation が有効化された Amazon Bedrock へのアクセス権限。
  • Amazon Bedrock Data Automation および Amazon Simple Storage Service (Amazon S3) を使用するための権限を持つ、AWS Identity and Access Management (AWS IAM) ロール。
  • 本番ワークロードを代表するサンプルドキュメントが 3〜10 件。
  • 各サンプルドキュメントに対する期待される抽出値を含むグランドトゥルース JSON ファイル、またはデプロイテンプレートに含まれるサンプル。グランドトゥルースファイルはブループリントのスキーマと同一構造を持ち、各フィールドには正しい期待値が設定されています。以下に購入注文書の簡略化された例を示します:

{

"po_number": "PO-2026-0224-1265",

"retailer_name": "Bike World",

"order_date": "2026-02-24",

"order_total": 11571.25,

"order_items": [

{

"sku": "AB-MB-076",

"product_name": "Trail Classic",

"quantity": 6,

"unit_price": 1864.37,

"line_total": 11186.22

}

]

}

サンプルソリューションのデプロイ

ソリューションをデプロイするには、以下の手順に従ってください:

  • GitHub リポジトリから CloudFormation テンプレートをダウンロードします。
  • AWS CloudFormation コンソールを開きます。
  • [スタックの作成] を選択し、[テンプレートファイルのアップロード] を選びます。
  • ダウンロードしたテンプレートファイルをアップロードして、[次へ] を選択します。
  • スタック名には、任意の名前(例:blueprint-optimization-sample)を入力します。
  • 残りのプロンプトに従い、IAM の権限に関する確認に同意した後、[スタックの作成] を選択します。

このスタックは、サンプルブループリント、ドキュメントファイル、グランドトゥルースファイル、および Amazon SageMaker AI ノートブックをデプロイします。**ノートブックでは、API を使用した最適化ワークフローの案内を行います。完全なコードサンプルも GitHub リポジトリ で利用可能です。

スタックのデプロイ完了後、以下の手順に従ってください:

  • AWS Management Console を開きます。
  • Amazon SageMaker AI に移動します。
  • 左側のナビゲーションペインから「Notebooks」を選択します。
  • スタックによって作成されたノートブックインスタンスを探します。
  • 「Open JupyterLab」を選択します。
  • JupyterLab でソースディレクトリに移動します。
  • 「Purchase order optimization notebook」を開きます。
  • カーネルとして Python 3 を選択します。
  • ノートブック内の指示に従って、提供されたサンプルドキュメントを使用してブループリントを作成・最適化します。この最適化には数分かかります。
  • 最適化が完了したら、最適化されたブループリントを確認し、更新された指示と元の指示を比較します。
  • 必要に応じて、最適化されたブループリントを生産環境用にライブプロモーションすることもできます。
  • 作業が終わったら、CloudFormation スタックを削除する前に S3 バケットを空にするために、ノートブック内のクリーンアップセルを実行してください。

コンソールを使用したい場合は、スタックによって作成された Amazon S3 バケットにサンプルドキュメントとグランドトゥルースファイルが用意されています。

コンソールの使用

Amazon Bedrock コンソールから、自動生成されたスキーマまたは手動で定義したスキーマのいずれかを使用してブループリントを作成できます。デプロイされたスタックからのサンプルを使用する場合は、提供された JSON を貼り付けることができます。

  • Amazon Bedrock Data Automation に移動します。
  • カスタム出力設定を選択します。
  • ブループリンの作成を選択します。
  • 代表的なサンプルドキュメントをアップロードします。
  • JSON スキーマを定義します。
  • デプロイされたスタックからのサンプルを使用する場合は、手動で新しいブループリンを作成を選択してください。
  • JSON ビューに切り替えます。
  • サンプルのブループリン JSON を貼り付けます。図 1: ブループリン作成ページ(JSON スキーマエディタが表示されており、ここにブループリン定義を貼り付けることができます)。
  • ブループリンを保存します。
  • 結果を取得を選択して初期抽出を実行します。これにより、最適化前のベースライン精度が確立されます。
  • ブループリン詳細ページから「ブループリンの最適化」を選択します。追加のサンプルドキュメント(3 つ以上推奨)をアップロードし、各ファイルに対して正解データ(グランドトゥルース)を提供してください。正解データの JSON ファイルをアップロードするか、「自動入力」を選択して現在の抽出結果から値をシードし、その後手動で編集することもできます。
  • 最適化が完了すると、Amazon Bedrock Data Automation は各ファイルおよび集計における最適化前後の精度指標を表示します(以下の画像参照)。最適化されたブループリンを保存を選択して、既存のブループリンを改善されたバージョンに置き換えます。図 2: 最適化結果ページ(各ファイルの最適化前後の精度指標と、集計での改善状況が表示されています)。

⟦CODE_0⟧

結果の解釈

結果ページでは、各サンプルファイルおよび集計値に対して3つの指標が表示されます。各指標が何を意味するかを理解することで、最適化されたブループリントを保存するべきか、それともより多くの例を追加して再実行すべきかを判断できます。

完全一致率 (Exact Match Rate) は、抽出された値があなたの正解データ(グランドトゥルース)と文字通り完全に一致しているフィールドの割合です。これは精度に対する最も厳しい測定基準です。前述の例では、Cycle Central ファイルの完全一致率が 92.4% から 100% に向上しており、BDA が抽出したすべてのフィールドが期待される値と正確に一致したことを意味します。

全体 F1 スコア (Overall F1 Score) は、適合率(BDA が抽出したもののうち正しい割合)と再現率(正解データのうち BDA が見つけた割合)を単一のスコアに統合したものです。F1 スコアは、行項目の説明など値の長さが可変的なフィールドにおいて特に有用です。このような場合、完全一致は厳しすぎる一方で、部分的な評価が意味を持つことがあります。この例では F1 スコアも 92.4% から 100% に向上しており、最適化された指示によって正しい値と適切な量のコンテンツの両方が捉えられたことを示しています。

信頼度スコア (Confidence Score) は、BDA が各抽出値についてどの程度確信を持っているかを示すものです。信頼度スコアが高いほど、BDA はそのフィールドに対して文書内でより明確なシグナルを検出したことになります。このファイルでは信頼度が 57.8% から 60.1% に向上しましたが、これは文書のレイアウトが曖昧な場合に予想される小さな改善幅です。高い信頼度スコアは、ヒューマン・イン・ザ・ループ(人間を介在させた)ワークフローにおいて、人間のレビューに回送されるフィールドの量を削減します。

ファイル別メトリクスタブを使用して、最適化後もスコアが低いドキュメントを特定してください。これらは、よりターゲットを絞った例を追加するための候補となります。集計メトリクスに切り替えて、最適化されたブループリントの保存を選択する前に、サンプルセット全体におけるブループリントの健全性を評価してください。

API のウォークスルー

以下の例は、AWS SDK for Python (Boto3) を使用した最適化ワークフローにおける主要な API コールを示しています。完全な実行可能なノートブックは、GitHub リポジトリで利用可能です。

1. ブループリントの作成

JSON スキーマを CreateBlueprint に渡します。DEVELOPMENTステージをサンドボックスとして使用してください。明示的にプロモートするまで、LIVE ブループリントには影響しません。

python
import boto3, json

bda_client = boto3.client('bedrock-data-automation')

response = bda_client.create_blueprint(
    blueprintName='acme-bikes-purchase-order',
    type='DOCUMENT',
    blueprintStage='DEVELOPMENT',
    schema=json.dumps(blueprint_schema)
)
blueprint_arn = response['blueprint']['blueprintArn'] 

2. 最適化の開始

InvokeBlueprintOptimizationAsync を呼び出し、サンプルドキュメントとグラウンドトゥルースファイルを使用します。各サンプルは、ドキュメント用の S3 URI と、そのグラウンドトゥルース JSON 用の S3 URI のペアで構成されます。

response = bda_client.invoke_blueprint_optimization_async(

blueprint={

'blueprintArn': blueprint_arn,

'stage': 'DEVELOPMENT'

},

samples=[

{

'assetS3Object': {'s3Uri': 's3://my-bucket/samples/PO_001.pdf'},

'groundTruthS3Object': {'s3Uri': 's3://my-bucket/ground-truth/PO_001.json'}

},

# ... additional samples

],

outputConfiguration={

's3Object': {'s3Uri': 's3://my-bucket/optimization-output/'}

},

dataAutomationProfileArn=profile_arn

)

invocation_arn = response['invocationArn']

3. 完了をポーリングする

ジョブは非同期で実行されます。GetBlueprintOptimizationStatus をポーリングし、ステータスが「Success」になるまで待ちます。

import time

while True:

status = bda_client.get_blueprint_optimization_status(

invocationArn=invocation_arn

)['status']

if status == 'Success':

break

elif status in ('ServiceError', 'ClientError'):

raise RuntimeError(f'Optimization failed: {status}')

time.sleep(15)

4. 最適化されたブループリントを取得する

ジョブが完了すると、GetBlueprint は更新されたスキーマを返します。

原文を表示

Extracting structured data from unstructured documents such as invoices, contracts, tax forms, and enrollment applications is a common automation goal for organizations. Achieving high extraction precision remains a key challenge. Accuracy degrades when documents diverge from expected templates, formats vary across vendors, or scan quality is poor. With Amazon Bedrock Data Automation (BDA), you can classify, extract, normalize, and validate data from documents through a single API. You use customizable blueprints that generate custom output tailored to your specific document formats and business requirements. However, optimizing blueprint extraction accuracy to handle the full variety of your production documents still requires iterative tuning.

Blueprint instruction optimization is a BDA feature that automatically refines your extraction instructions to address this challenge directly. You provide three to ten example documents with expected values, and BDA refines your blueprint instructions to improve accuracy in minutes, not weeks. No separate model fine-tuning is required.

By the end of this post, you can optimize your blueprints to improve accuracy, run the optimization workflow through the Amazon Bedrock console or the API, and apply best practices for selecting examples and ground truth.

The challenge of document field extraction

When you build intelligent document processing (IDP) pipelines with Amazon Bedrock Data Automation, you create blueprints that define which fields to extract from documents. Each field includes a natural language instruction that guides the extraction. For example:

  • Field: invoice_number → Instruction: “The invoice number”.
  • Field: total_amount → Instruction: “The total amount due”.

These initial instructions work well for straightforward cases. Real-world documents, however, introduce additional complexity:

  • Field labels vary across document variants.
  • Similar-looking labels can cause confusion (for example, “subtotal” vs. “total”).
  • Document layouts differ between vendors or time periods.
  • Edge cases demand more specific extraction guidance.

The following is an abbreviated example of what a purchase order blueprint schema looks like. Each field has a type, an inferenceType (explicit for values that appear directly in the document, inferred for values that require reasoning), and an instruction that guides extraction:

code
{
  "class": "Purchase Order",
  "type": "object",
  "properties": {
    "po_number": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The unique identifier for the purchase order"
    },
    "order_date": {
      "type": "string",
      "inferenceType": "explicit",
      "instruction": "The date when the order was placed"
    },
    "order_total": {
      "type": "number",
      "inferenceType": "explicit",
      "instruction": "The total amount for the order"
    },
    "special_requests": {
      "type": "string",
      "inferenceType": "inferred",
      "instruction": "Any special requests or notes included in the order"
    }
  }
}

Blueprint instruction optimization refines the instruction values for each field. The type and inferenceType remain unchanged. You can view the full purchase order schema in the GitHub repository.

You already know your documents and your data. Blueprint instruction optimization gives you a faster path to close the accuracy gap.

The traditional approach: Manual iteration

To improve extraction accuracy, you typically iterate on field instructions manually: test different phrasings, add context, and refine descriptions through trial and error. Each cycle means running extractions, comparing results against expected values, adjusting instructions, and repeating. For organizations processing documents from hundreds of vendors, this process can take weeks per document type.

The optimized approach: Automated refinement

With blueprint instruction optimization, you automate this entire refinement loop in a single workflow. BDA analyzes the differences between its extraction results and your ground truth, then refines the natural language instructions for each field, delivering optimized instructions in minutes instead of weeks.

Improve accuracy with blueprint instruction optimization

Follow these steps to refine your extraction instructions using real documents from your workload.

  • Provide example documents – Upload three to ten representative documents from your production workload, including edge cases where extraction has been challenging. Additionally, cover as much diversity of your production document distribution as possible to avoid overfitting.
  • Supply ground truth – Provide the correct expected values for each field in each example document. Ground truth is the verified, accurate data that serves as the benchmark for measuring extraction quality. This tells BDA what the right answers should be.
  • Run optimization – Start the optimization process. BDA compares its initial extraction results against your ground truth and refines the natural language instructions for each field.
  • Review results – Examine the detailed accuracy metrics along with the optimized instructions. Optimization typically completes in minutes. Metrics include F1 score (a combined measure of precision and recall) and exact match rate (the percentage of fields where the extracted value matches the ground truth exactly).

The optimized instructions incorporate patterns learned from your examples and add more detail and specificity. For instance, an initial instruction like “The invoice number” might become “The invoice number, typically found in the upper right corner of the document header, formatted as a numeric or alphanumeric code following ‘Invoice #’ or ‘Invoice No.’”

Example scenario: Purchase order extraction

To illustrate the optimization workflow, we walk through a purchase order extraction scenario using a fictional bike manufacturing company’s documents.

You create a blueprint for extracting fields from purchase orders, including order numbers, item descriptions, quantities, unit prices, and totals.

After you upload four representative purchase orders (from retailers such as Cycle Central and Bike World) with corresponding ground truth files and run optimization, accuracy improves:

Metric

Before optimization

After optimization

Per-file exact match (best case)

92%

100%

Aggregate exact match

90%

92%

BDA automatically refines instructions to address vendor-specific formatting, field label variations, and layout differences across the purchase order set, improving aggregate exact match from 90% to 92%.

If you’re processing high volumes, even a few percentage points of accuracy improvement translates directly into reduced manual review queues and faster processing throughput.

Getting started

You can access blueprint instruction optimization through the Amazon Bedrock console or the API. Use your own documents, or deploy the sample solution, which includes a blueprint, sample PDF documents, and ground truth JSON files.

Prerequisites

To follow along with this post, you need the following:

  • An AWS account.
  • Access to Amazon Bedrock with Amazon Bedrock Data Automation enabled in a supported Region.
  • An AWS Identity and Access Management (AWS IAM) role with permissions to use Amazon Bedrock Data Automation and Amazon Simple Storage Service (Amazon S3).
  • Between three and ten sample documents representative of your production workload.
  • Ground truth JSON files with expected extraction values for each sample document, or the samples included in the deploy template. A ground truth file mirrors your blueprint’s schema, with each field populated with the correct expected value. The following is an abbreviated example for a purchase order:
code
{
  "po_number": "PO-2026-0224-1265",
  "retailer_name": "Bike World",
  "order_date": "2026-02-24",
  "order_total": 11571.25,
  "order_items": [
    {
      "sku": "AB-MB-076",
      "product_name": "Trail Classic",
      "quantity": 6,
      "unit_price": 1864.37,
      "line_total": 11186.22
    }
  ]
}

Deploy the sample solution

To deploy the solution, follow these steps:

  • Download the CloudFormation template from the GitHub repository.
  • Open the AWS CloudFormation console.
  • Choose Create stack, then choose Upload a template file.
  • Upload the downloaded template file and choose Next.
  • For Stack name, enter a name (for example, blueprint-optimization-sample).
  • Follow the remaining prompts, acknowledge the IAM capabilities, and choose Create stack.

The stack deploys a sample blueprint, document files, ground truth files, and an Amazon SageMaker AI notebook.** The notebook walks you through the optimization workflow using the API. A complete code sample is also

available in the GitHub repository.

After the stack deploys, follow these steps:

  • Open the AWS Management Console.
  • Navigate to Amazon SageMaker AI.
  • Choose Notebooks from the left navigation pane.
  • Locate the notebook instance created by the stack.
  • Choose Open JupyterLab.
  • In JupyterLab, navigate to the source directory.
  • Open the Purchase order optimization notebook.
  • Select Python 3 as the kernel.
  • Follow the instructions in the notebook to create and optimize a blueprint using the provided sample documents. The optimization takes a few minutes to run.
  • When optimization completes, review the optimized blueprint and compare the updated instructions with the originals.
  • Optionally, promote the optimized blueprint to live for production use.
  • When you’re done, run the cleanup cell in the notebook to empty the S3 bucket before deleting the CloudFormation stack.

If you prefer to use the console instead, the sample documents and ground truth files are available in the Amazon S3 bucket created by the stack.

Using the console

From the Amazon Bedrock console, you can create a blueprint using either an auto-generated schema or one you define manually. If you’re using the sample from the deployed stack, you can paste in the provided JSON.

  • Navigate to Amazon Bedrock Data Automation.
  • Choose Custom output setup.
  • Choose Create blueprint.
  • Upload a representative sample document.
  • Define your JSON schema.
  • To use the sample from the deployed stack, choose Manually create new blueprint.
  • Switch to the JSON view.
  • Paste in the sample blueprint JSON. Figure 1: The Create blueprint page, showing JSON schema editor where you can paste your blueprint definition.
  • Save your blueprint.
  • Choose Get result to run an initial extraction. This establishes your baseline accuracy before optimization.
  • Choose Optimize blueprint from the blueprint detail page. Upload additional sample documents (three or more recommended) and provide ground truth for each file. You can upload ground truth JSON files or choose Auto-populate to seed values from the current extraction results and then edit manually.
  • When optimization completes, Amazon Bedrock Data Automation displays before/after accuracy metrics for each file and in aggregate, as shown in the following image. Choose Save optimized blueprint to replace the existing blueprint with the improved version. Figure 2: The optimization results page, showing before and after accuracy metrics for each file and the aggregate improvement.

Interpreting the results

The results page shows three metrics for each sample file and in aggregate. Understanding what each metric tells you helps you decide whether to save the optimized blueprint or add more examples and re-run.

Exact Match Rate** is the percentage of fields where the extracted value matches your ground truth exactly, character for character. This is the strictest measure of accuracy. In the preceding example, the Cycle Central file’s exact match rate improved from 92.4% to 100%, meaning every field BDA extracted matched the expected value precisely.

Overall F1 Score combines precision (how much of what BDA extracted was correct) and recall (how much of the correct data BDA found) into a single score. F1 is particularly useful for fields with variable-length values like line item descriptions, where an exact match might be too strict but partial credit is meaningful. In this example, the F1 score also improved from 92.4% to 100%, indicating the optimized instructions captured both the right values and the right amount of content.

Confidence Score reflects how certain BDA is about each extracted value. A higher confidence score means BDA found clearer signals in the document for that field. Confidence improved from 57.8% to 60.1% for this file, a smaller gain, which is expected when the document layout is ambiguous. Higher confidence scores reduce the volume of fields routed to human review in human-in-the-loop workflows.

Use the Metrics by file tab to identify which documents still have lower scores after optimization. These are candidates for adding more targeted examples. Switch to Aggregated metrics to assess overall blueprint health across your full sample set before choosing Save optimized blueprint.

API walkthrough

The following examples show the key API calls for the optimization workflow using the AWS SDK for Python (Boto3). The full runnable notebook is available in the GitHub repository.

1. Create a blueprint

Pass your JSON schema to CreateBlueprint. Use DEVELOPMENT stage as a sandbox: it won’t affect LIVE blueprints until you explicitly promote it.

code
import boto3, json

bda_client = boto3.client('bedrock-data-automation')

response = bda_client.create_blueprint(
    blueprintName='acme-bikes-purchase-order',
    type='DOCUMENT',
    blueprintStage='DEVELOPMENT',
    schema=json.dumps(blueprint_schema)
)
blueprint_arn = response['blueprint']['blueprintArn']

2. Start optimization

Call InvokeBlueprintOptimizationAsync with your sample documents and ground truth files. Each sample pairs an S3 URI for the document with an S3 URI for its ground truth JSON.

code
response = bda_client.invoke_blueprint_optimization_async(
    blueprint={
        'blueprintArn': blueprint_arn,
        'stage': 'DEVELOPMENT'
    },
    samples=[
        {
            'assetS3Object':       {'s3Uri': 's3://my-bucket/samples/PO_001.pdf'},
            'groundTruthS3Object': {'s3Uri': 's3://my-bucket/ground-truth/PO_001.json'}
        },
        # ... additional samples
    ],
    outputConfiguration={
        's3Object': {'s3Uri': 's3://my-bucket/optimization-output/'}
    },
    dataAutomationProfileArn=profile_arn
)
invocation_arn = response['invocationArn']

3. Poll for completion

The job runs asynchronously. Poll GetBlueprintOptimizationStatus until the status reaches Success.

code
import time

while True:
    status = bda_client.get_blueprint_optimization_status(
        invocationArn=invocation_arn
    )['status']
    if status == 'Success':
        break
    elif status in ('ServiceError', 'ClientError'):
        raise RuntimeError(f'Optimization failed: {status}')
    time.sleep(15)

4. Retrieve the optimized blueprint

After the job completes, GetBlueprint returns the updated schema with

この記事をシェア

関連記事

AWS Machine Learning Blog★42026年6月13日 05:43

スーパーチャージャー構築:Rocket Close がエージェント型 AI でタイトル業務を最適化する方法

ロケット・カンパニーズ傘下のデトロイト拠点タイトル代理店 Rocket Close は、住宅購入プロセスのボトルネックとなっていた時間のかかる州固有のタイトル調査を、エージェント型 AI を活用することで効率化しました。

MarkTechPost★32026年6月14日 02:27

カスタムスキル、モデルプロバイダー、コンソールアクセス、ストリーミング API テストを備えた QwenPaw エージェントワークスペースの構築方法

MarkTechPost は、QwenPaw をインストール・初期化し、認証設定や Colab 経由でのモデルプロバイダー接続、カスタムスキルとローカル知識ファイルによる構造化ワークスペース作成、Cloudflare トンネルを介したコンソール公開、ストリーミング API テストを含むエージェント支援ツールの構築手順を解説している。

Simon Willison Blog★32026年6月13日 08:53

OpenAI WebRTC オーディオセッション、文書コンテキスト機能を追加

Simon Willison氏が開発したツールが、OpenAI の新モデルに対応し、音声対話時に文書のコンテキストを参照可能になった。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む