如要將擷取的實體轉換為 Document AI Warehouse 屬性,請設定或更新結構定義。
使用對應設定結構定義之前,請先瞭解 Document AI 處理器類型及其結構定義和實體類型。管道會將巢狀實體扁平化,因此您也需要為子實體建立對應。
舉例來說,處理器 INVOICE_PROCESSOR 具有下列實體類型:
line_itemline_item/amounttotal_amount
{
"property_definitions": [
{
"name": "line_item",
"display_name": "line_item",
"is_searchable": true,
"is_filterable": true,
"text_type_options": {}
},
{
"name": "my_new_receiver_name",
"display_name": "my_new_receiver_name",
"is_searchable": true,
"is_filterable": true,
"text_type_options": {},
"schema_sources": [
{
"name": "receiver_name_in_invoice",
"processor_type": "INVOICE_PROCESSOR"
},
{
"name": "receiver_name_in_w2",
"processor_type": "FORM_W2_PROCESSOR"
}
]
}
]
}
如要讓屬性名稱與實體類型相同,可以直接使用該名稱,例如上述範例中的 line_item。如要將發票處理器中類型為 receiver_name_in_invoice 的所有實體,以及表單 W2 處理器中類型為 receiver_name_in_w2 的所有實體,轉換為新名稱 my_new_receiver_name,請在 schema_sources 欄位中新增對應項目,如上例所示。但轉換後,您可以使用 my_new_receiver_name 搜尋及篩選。屬性名稱和 schema_source 名稱不得重複。