매핑으로 스키마 설정

추출된 항목을 Document AI Warehouse 속성으로 변환해야 하는 경우 스키마를 설정하거나 업데이트해야 합니다.

매핑을 사용하여 스키마를 설정하기 전에 Document AI 프로세서 유형과 스키마, 항목 유형을 알아야 합니다. 파이프라인은 중첩된 항목을 평면화하므로 하위 항목의 매핑도 만들어야 합니다.

예를 들어 프로세서 INVOICE_PROCESSOR에는 다음과 같은 항목 유형이 있습니다.

  • line_item
  • line_item/amount
  • total_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 이름은 고유해야 합니다.