本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
即時分析的輸出
文字輸入的輸出
如果您使用Text
參數輸入文字,則輸出會由分析偵測到的圖元陣列組成。下列範例顯示偵測到兩個判斷實體的分析。
{ "Entities": [ { "BeginOffset": 0, "EndOffset": 22, "Score": 0.9763959646224976, "Text": "John Johnson", "Type": "JUDGE" }, { "BeginOffset": 11, "EndOffset": 15, "Score": 0.9615424871444702, "Text": "Thomas Kincaid", "Type": "JUDGE" } ] }
半結構化輸入的輸出
對於半結構化輸入文件或文字檔案,輸出可以包含下列其他欄位:
DocumentMetadata — 擷取有關文件的資訊。元數據包括文檔中的頁面列表,其中包含從每個頁面中提取的字符數。如果請求包含
Byte
參數,則此字段存在於響應中。DocumentType — 輸入文件中每頁的文件類型。此欄位會出現在包含
Byte
參數之要求的回應中。區塊 — 輸入文件中每個文字區塊的相關資訊。圖塊是巢狀的。頁面區塊會針對每一行文字包含一個區塊,其中包含每個字詞的區塊。此欄位會出現在包含
Byte
參數之要求的回應中。BlockReferences — 此圖元每個圖塊的參考。此欄位會出現在包含
Byte
參數之要求的回應中。文字檔案不存在此欄位。Error — 系統在處理輸入文件時偵測到的頁面層級錯誤。如果系統沒有發生任何錯誤,則此欄位為空白。
如需這些輸出欄位的說明,請參閱 Amazon Comprehend API 參考DetectEntities中的。如需有關版面配置元素的詳細資訊,請參閱 Amazon Textract 開發人員指南中的 Amazon Textract 分析物件。
下列範例顯示單頁掃描 PDF 輸入文件的輸出。
{ "Entities": [{ "Score": 0.9984670877456665, "Type": "DATE-TIME", "Text": "September 4,", "BlockReferences": [{ "BlockId": "42dcaaee-c484-4b5d-9e3f-ae0be928b3e1", "BeginOffset": 0, "EndOffset": 12, "ChildBlocks": [{ "ChildBlockId": "6e9cbb43-f8be-4da0-9a4b-ff9a6c350a14", "BeginOffset": 0, "EndOffset": 9 }, { "ChildBlockId": "599e0d53-ae9f-491b-a762-459b22c79ff5", "BeginOffset": 0, "EndOffset": 2 }, { "ChildBlockId": "599e0d53-ae9f-491b-a762-459b22c79ff5", "BeginOffset": 0, "EndOffset": 2 } ] }] }], "DocumentMetadata": { "Pages": 1, "ExtractedCharacters": [{ "Page": 1, "Count": 609 }] }, "DocumentType": [{ "Page": 1, "Type": "SCANNED_PDF" }], "Blocks": [{ "Id": "ee82edf3-28de-4d63-8883-40e2e4938ccb", "BlockType": "LINE", "Text": "Your Band", "Page": 1, "Geometry": { "BoundingBox": { "Height": 0.024125460535287857, "Left": 0.11745482683181763, "Top": 0.06821706146001816, "Width": 0.12074867635965347 }, "Polygon": [{ "X": 0.11745482683181763, "Y": 0.06821706146001816 }, { "X": 0.2382034957408905, "Y": 0.06821706146001816 }, { "X": 0.2382034957408905, "Y": 0.09234252572059631 }, { "X": 0.11745482683181763, "Y": 0.09234252572059631 } ] }, "Relationships": [{ "Ids": [ "b105c561-c8d9-485a-a728-7a5b1a308935", "60ecb119-3173-4de2-8c5d-de182a5f86a5" ], "Type": "CHILD" }] }] }
下列範例顯示原生 PDF 文件分析的輸出。
範例 PDF 文件的自訂實體辨識分析輸出範例
{ "Blocks": [ { "BlockType": "LINE", "Geometry": { "BoundingBox": { "Height": 0.012575757575757575, "Left": 0.0, "Top": 0.0015063131313131314, "Width": 0.02262091503267974 }, "Polygon": [ { "X": 0.0, "Y": 0.0015063131313131314 }, { "X": 0.02262091503267974, "Y": 0.0015063131313131314 }, { "X": 0.02262091503267974, "Y": 0.014082070707070706 }, { "X": 0.0, "Y": 0.014082070707070706 } ] }, "Id": "4330efed-6334-4fc4-ba48-e050afa95c8d", "Page": 1, "Relationships": [ { "ids": [ "f343ce48-583d-4abe-b84b-a232e266450f" ], "type": "CHILD" } ], "Text": "S-3" }, { "BlockType": "WORD", "Geometry": { "BoundingBox": { "Height": 0.012575757575757575, "Left": 0.0, "Top": 0.0015063131313131314, "Width": 0.02262091503267974 }, "Polygon": [ { "X": 0.0, "Y": 0.0015063131313131314 }, { "X": 0.02262091503267974, "Y": 0.0015063131313131314 }, { "X": 0.02262091503267974, "Y": 0.014082070707070706 }, { "X": 0.0, "Y": 0.014082070707070706 } ] }, "Id": "f343ce48-583d-4abe-b84b-a232e266450f", "Page": 1, "Relationships": [], "Text": "S-3" } ], "DocumentMetadata": { "PageNumber": 1, "Pages": 1 }, "DocumentType": "NativePDF", "Entities": [ { "BlockReferences": [ { "BeginOffset": 25, "BlockId": "4330efed-6334-4fc4-ba48-e050afa95c8d", "ChildBlocks": [ { "BeginOffset": 1, "ChildBlockId": "cbba5534-ac69-4bc4-beef-306c659f70a6", "EndOffset": 6 } ], "EndOffset": 30 } ], "Score": 0.9998825926329088, "Text": "0.001", "Type": "OFFERING_PRICE" }, { "BlockReferences": [ { "BeginOffset": 41, "BlockId": "f343ce48-583d-4abe-b84b-a232e266450f", "ChildBlocks": [ { "BeginOffset": 0, "ChildBlockId": "292a2e26-21f0-401b-a2bf-03aa4c47f787", "EndOffset": 9 } ], "EndOffset": 50 } ], "Score": 0.9809727537330395, "Text": "6,097,560", "Type": "OFFERED_SHARES" } ], "File": "example.pdf", "Version": "2021-04-30" }