

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# ドキュメントを分析する
<a name="a2i-textract-run-analyze-document"></a>

Amazon A2I を Amazon Textract ドキュメント分析ワークフローに組み込むには、`HumanLoopConfig`の[https://docs.aws.amazon.com/textract/latest/dg/API_AnalyzeDocument.html](https://docs.aws.amazon.com/textract/latest/dg/API_AnalyzeDocument.html)オペレーション.

Eclipse`HumanLoopConfig`でヒューマンレビューワークフロー (フロー定義) ARN を指定します。`FlowDefinitionArn`で、あなたの人間のループに名前を付けて`HumanLoopName`。

------
#### [  Analyze the Document (AWS SDK for Python (Boto3)) ]

次の例では、SDK for Python (Boto3) を使用して`analyze_document`us-west-2. を交換してください。{{赤、斜体}}リソースを含むテキスト。詳細については、「」を参照してください。[document](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/textract.html#Textract.Client.analyze_document)の*AWSSDK for Python (Boto) API リファレンス*。

```
client.analyze_document(Document={'S3Object': {"Bucket": "DOC-EXAMPLE-BUCKET", "Name": "document-name.png"}},
         HumanLoopConfig={"FlowDefinitionArn":"arn:aws:sagemaker:us-west-2:111122223333:flow-definition/flow-definition-name",
                          "HumanLoopName":"human-loop-name",
                          "DataAttributes":{"ContentClassifiers":["FreeOfPersonallyIdentifiableInformation"|"FreeOfAdultContent",]}},
         FeatureTypes=["FORMS"])
```

------
#### [  Analyze the Document (AWS CLI) ]

次の例ではを使用しています。AWSコールするCLI`analyze_document`。これらの例はAWSCLI バージョン 2. 1つ目は短縮構文で、2番目の構文はJSON構文です。詳細については、「」を参照してください。[ドキュメント分析](https://docs.aws.amazon.com/cli/latest/reference/textract/analyze-document.html)の*[AWS CLIコマンドリファレンス](https://docs.aws.amazon.com/cli/latest/reference/)*。

```
aws textract analyze-document \
     --document '{"S3Object":{"Bucket":"{{bucket_name}}","Name":"{{file_name}}"}}' \
     --human-loop-config HumanLoopName="test",FlowDefinitionArn="arn:aws:sagemaker:eu-west-1:xyz:flow-definition/hl_name",DataAttributes='{ContentClassifiers=["FreeOfPersonallyIdentifiableInformation","FreeOfAdultContent"]}'\
     --feature-types '["FORMS"]'
```

```
aws textract analyze-document \
     --document '{"S3Object":{"Bucket":"{{bucket_name}}","Name":"{{file_name}}"}}' \
     --human-loop-config \
          '{"HumanLoopName":"test","FlowDefinitionArn":"arn:aws:sagemaker:eu-west-1:xyz:flow-definition/hl_name","DataAttributes": {"ContentClassifiers":["FreeOfPersonallyIdentifiableInformation","FreeOfAdultContent"]}}' \
     --feature-types '["FORMS"]'
```

------

**注記**  
 —human-loop-config パラメーターには空白文字を使用しないでください。これにより、コードの処理の問題が発生する可能性があります。

このリクエストに対する応答には、次のものが含まれます。[HumanLoopActivation出力](https://docs.aws.amazon.com/textract/latest/dg/API_HumanLoopActivationOutput.html)である。これは、人間のループが作成されたかどうかを示し、もしあれば、その理由を示す。ヒューマンループが作成された場合、このオブジェクトには`HumanLoopArn`。

の詳細とを使用した例については、`AnalyzeDocument`オペレーション、「」を参照してください[Amazon Textract を使用したドキュメントテキストの分析](analyzing-document-text.md)。