TDTech Digest

047. 추출용 블루프린트 만들기 (Creating Blueprints for Extraction)

  • 원문: English
  • 위치: Additional capabilities › Data Automation › Custom output and blueprints › Creating blueprints › Creating Blueprints for Documents › Creating Blueprints for Extraction

한 줄 요약

추출할 필드마다 이름, 지시문(Instruction), 타입, 추론 유형(Explicit/Inferred) 을 정의합니다. 값이 여러 개면 array, 표 데이터면 테이블($ref로 정의 참조하는 array) 로 정의합니다.

쉽게 말하면

“이 문서에서 무엇을, 어떤 타입으로, 그대로 베낄지(Explicit) 추론할지(Inferred)“를 필드별로 적어 주는 작업입니다.

핵심 내용

필드 파라미터

파라미터설명
Field Name필드 이름 (예: employee_id, product_name)
Instruction필드가 무엇인지 자연어로 설명 (API에서는 description)
Typestring, number, boolean, array
Inference TypeExplicit: 문서에서 그대로 추출 / Inferred: 문서 정보를 바탕으로 추론
"product_name": {
  "type": "string",
  "inferenceType": "Explicit",
  "description": "The short name of the product without any extra details"
}
필드 예시지시문추출 유형타입
ApplicantsNameFull Name of the ApplicantExplicitstring
SalesGross receipts or salesExplicitnumber
Statement_starting_balanceBalance at beginning of periodExplicitnumber

다중 값 필드

  • 리스트: "type": "array" + "items": {"type": "string"} (예: OtherExpenses)
  • 테이블: definitions에 행 구조(예: LINEITEM의 quantity, unit price, amount, product name 등)를 정의하고, 필드는 "type": "array", "items": {"$ref": "#/definitions/LINEITEM"} 로 참조 (예: SERVICES_TABLE)
"SERVICES_TABLE": {
  "type": "array",
  "description": "Line items table listing all the items / services charged in the invoice ...",
  "items": { "$ref": "#/definitions/LINEITEM" }
}

SA 관점

  • 청구서 라인아이템처럼 반복 행은 테이블 정의로 받아야 다운스트림 DB에 그대로 적재하기 쉽습니다. 컬럼 description에 계산식(Unit Price * Quantity)을 넣는 것도 원문 예시에 있는 방식입니다.