이 섹션에서는 문서 파일에서 API 작업 InvokeDataAutomationAsync를 실행하여 수신하는 다양한 응답 객체에 중점을 둡니다. 아래에서는 응답 객체의 각 섹션을 분류한 다음 예제 문서에 채워진 전체 응답을 확인합니다. 첫 번째 섹션은 metadata입니다.
"metadata":{
"logical_subdocument_id":"XXXX-XXXX-XXXX-XXXX",
"semantic_modality":"DOCUMENT",
"s3_bucket":"bucket",
"s3_prefix":"prefix"
},
위의 첫 번째 섹션에서는 문서와 연결된 메타데이터의 개요를 제공합니다. 이 섹션에서는 S3 정보와 함께 응답에 어떤 양식이 선택되었는지도 알려줍니다.
"document":{
"representation":{
"text":"document text",
"html":"document title document content",
"markdown":"# text"
},
"description":"document text",
"summary":"summary text",
"statistics":{
"element_count":5,
"table_count":1,
"figure_count":1,
"word_count":1000,
"line_count":32
}
},
위 섹션에서는 문서 수준 세부 정보를 제공합니다. 설명 및 요약 섹션은 문서를 기반으로 생성된 필드입니다. 표현 섹션은 문서의 실제 콘텐츠를 다양한 형식 지정 스타일로 제공합니다. 마지막으로, 통계에는 존재하는 의미 체계 요소 수, 그림, 단어, 줄 수 등 문서의 실제 콘텐츠에 대한 정보가 포함됩니다.
테이블 엔터티에 대한 정보입니다. InvokeDataAutomationAsync(비동기) 요청의 경우 위치 정보, 텍스트, 테이블 및 읽기 순서의 다양한 형식 외에도 특히 S3 버킷에 테이블의 csv 정보와 잘린 이미지를 반환합니다. CSV 정보에는 다양한 헤더, 바닥글 및 제목이 표시됩니다. 이미지는 InvokeDataAutomationAsync 요청에 설정된 접두사의 s3 버킷으로 라우팅됩니다. InvokeDataAutomation(동기화) 요청의 경우 S3 버킷에 있는 테이블의 csv 및 잘린 이미지는 지원되지 않습니다.
PDF를 처리할 때 응답의 통계 섹션에는 문서에 존재하는 하이퍼링크 수를 알려주는 hyperlinks_count도 포함됩니다.
{
"id":"entity_id",
"type":"TEXT",
"representation":{
"text":"document text",
"html":"document title document content",
"markdown":"# text"
},
"reading_order":2,
"page_indices":[
0
],
"locations":[
{
"page_index":0,
"bounding_box":{
"left":0.0,
"top":0.0,
"width":0.05,
"height":0.5
}
}
],
"sub_type":"TITLE/SECTION_TITLE/HEADER/FOOTER/PARAGRAPH/LIST/PAGE_NUMBER"
},
문서 내 텍스트에 사용되는 엔터티로, 응답의 TYPE 줄로 표시됩니다. 다시 표현하면 텍스트가 다양한 형식으로 표시됩니다. reading_order는 독자가 논리적으로 텍스트를 볼 수 있는 시기를 보여줍니다. 연결된 키와 값을 기반으로 하는 의미 체계 순서입니다. 예를 들어 단락의 제목을 해당 단락과 읽기 순서대로 연결합니다. page_indices는 텍스트가 있는 페이지를 알려줍니다. 다음은 위치 정보이며, 응답에서 활성화된 경우 제공된 텍스트 경계 상자가 있습니다. 마지막으로 엔터티 하위 유형이 있습니다. 이 하위 유형은 감지되는 텍스트 종류에 대한 자세한 정보를 제공합니다. 하위 유형의 전체 목록은 API 참조를 참조하세요.
{
"id":"entity_id",
"type":"TABLE",
"representation":{
"html":"table.../table",
"markdown":"| header | ...",
"text":"header \t header",
"csv":"header, header, header\n..."
},
"csv_s3_uri":"s3://",
"headers":[
"date",
"amount",
"description",
"total"
],
"reading_order":3,
"title":"Title of the table",
"footers":[
"the footers of the table"
],
"crop_images":[
"s3://bucket/prefix.png",
"s3://bucket/prefix.png"
],
"page_indices":[
0,
1
],
"locations":[
{
"page_index":0,
"bounding_box":{
"left":0,
"top":0,
"width":1,
"height":1
}
},
{
"page_index":1,
"bounding_box":{
"left":0,
"top":0,
"width":1,
"height":1
}
}
],
"sub_type":"TITLE/SECTION_TITLE/HEADER/FOOTER/PARAGRAPH/LIST/PAGE_NUMBER"
},
테이블 엔터티에 대한 정보입니다. 위치 정보, 텍스트, 테이블 및 읽기 순서의 다양한 형식 외에도 특히 S3 버킷에 있는 테이블의 csv 정보와 잘린 이미지를 반환합니다. CSV 정보에는 다양한 헤더, 바닥글 및 제목이 표시됩니다. 이미지는 InvokeDataAutomation 요청에 설정된 접두사의 S3 버킷으로 라우팅됩니다.
{
"id":"entity_id",
"type":"FIGURE",
"summary":"",
"representation":{
"text":"document text",
"html":"document title document content",
"markdown":"# text"
},
"crop_images":[
"s3://bucket/prefix.png",
"s3://bucket/prefix.png"
],
"locations":[
{
"page_index":0,
"bounding_box":{
"left":0,
"top":0,
"width":1,
"height":1
}
}
],
"sub_type":"CHART",
"title":"figure title",
"rai_flag":"APPROVED/REDACTED/REJECTED",
"reading_order":1,
"page_indices":[
0
]
}
,
이 엔터티는 문서 그래프 및 차트와 같은 그림에 사용됩니다. 테이블과 마찬가지로 이러한 그림은 잘리고 이미지는 접두사의 S3 버킷 세트로 전송됩니다. 또한 제목 텍스트에 대한 sub_type 및 그림 제목 응답과 그림 종류에 대한 표시를 받게 됩니다.
"pages":[
{
"id":"page_id",
"page_index":0,
"detected_page_number":1,
"representation":{
"text":"document text",
"html":"document title document content",
"markdown":"# text"
},
"statistics":{
"element_count":5,
"table_count":1,
"figure_count":1,
"word_count":1000,
"line_count":32
},
"asset_metadata":{
"rectified_image":"s3://bucket/prefix.png",
"rectified_image_width_pixels":1700,
"rectified_image_height_pixels":2200
}
}
],
표준 출력을 통해 추출되는 마지막 엔터티는 페이지입니다. 페이지는 텍스트 엔터티와 동일하지만 감지된 페이지 번호가 페이지에 있는 페이지 번호를 추가로 포함합니다.
"text_lines":[
{
"id":"line_id",
"text":"line text",
"reading_order":1,
"page_index":0,
"locations":{
"page_index":0,
"bounding_box":{
"left":0,
"top":0,
"width":1,
"height":1
}
}
}
],
"text_words":[
{
"id":"word_id",
"text":"word text",
"line_id":"line_id",
"reading_order":1,
"page_index":0,
"locations":{
"page_index":0,
"bounding_box":{
"left":0,
"top":0,
"width":1,
"height":1
}
}
}
]
이 마지막 두 요소는 개별 텍스트 부분을 위한 것입니다. 단어 수준 세분화는 각 단어에 대한 응답을 반환하는 반면, 기본 출력은 텍스트 줄만 보고합니다.
이 섹션에서는 문서 파일에서 API 작업 InvokeDataAutomation을 실행하여 수신하는 다양한 응답 객체에 중점을 둡니다. 아래에서는 응답 객체의 각 섹션을 분류한 다음 예제 문서에 채워진 전체 응답을 확인합니다. 첫 번째 섹션은 metadata입니다.
"metadata": {
"logical_subdocument_id": "1",
"semantic_modality": "DOCUMENT",
"number_of_pages": X,
"start_page_index": "1",
"end_page_index": X,
"file_type": "PDF"
},
위의 첫 번째 섹션에서는 문서와 연결된 메타데이터의 개요를 제공합니다. 동기식 InvokeDataAutomation API는 현재 문서 분할을 지원하지 않으므로 logical_subdocument_id는 항상 1과 같습니다.
"document":{
"representation":{
"text":"document text",
"html":"document title document content",
"markdown":"# text"
},
"description":"document text",
"summary":"summary text",
"statistics":{
"element_count":5,
"table_count":1,
"figure_count":1,
"word_count":1000,
"line_count":32
}
},
위 섹션에서는 문서 수준 세부 정보를 제공합니다. 설명 및 요약 섹션은 문서를 기반으로 생성된 필드입니다. 표현 섹션은 문서의 실제 콘텐츠를 다양한 형식 지정 스타일로 제공합니다. 마지막으로, 통계에는 존재하는 의미 체계 요소 수, 그림, 단어, 줄 수 등 문서의 실제 콘텐츠에 대한 정보가 포함됩니다.
참고: 비동기식 InvokeDataAutomationAsync 요청과 달리 동기식 InvokeDataAutomation 요청은 S3 버킷에 테이블의 csv 정보 및 잘린 이미지 반환을 지원하지 않습니다.
{
"id":"entity_id",
"type":"TEXT",
"representation":{
"text":"document text",
"html":"document title document content",
"markdown":"# text"
},
"reading_order":2,
"page_indices":[
0
],
"locations":[
{
"page_index":0,
"bounding_box":{
"left":0.0,
"top":0.0,
"width":0.05,
"height":0.5
}
}
],
"sub_type":"TITLE/SECTION_TITLE/HEADER/FOOTER/PARAGRAPH/LIST/PAGE_NUMBER"
},
이는 문서 내의 텍스트에 사용되는 엔터티로, 응답에서 TYPE 줄로 표시됩니다. 다시 표현하면 텍스트가 다양한 형식으로 표시됩니다. read_order는 독자가 논리적으로 텍스트를 볼 수 있는 시기를 보여줍니다. 연결된 키와 값을 기반으로 하는 의미 체계 순서입니다. 예를 들어, 읽기 순서로 단락의 제목을 해당 단락과 연결합니다. page_indices는 텍스트가 있는 페이지를 알려줍니다. 다음은 위치 정보이며, 응답에서 활성화된 경우 제공된 텍스트 경계 상자가 있습니다. 마지막으로 엔터티 하위 유형이 있습니다. 이 하위 유형은 감지되는 텍스트 종류에 대한 자세한 정보를 제공합니다. 하위 유형의 전체 목록은 API 참조를 참조하세요.
{
"id": "entity_id",
"type": "TABLE",
"representation": {
"html": "table.../table",
"markdown": "| header | ...",
"text": "header \t header",
"csv": "header, header, header\n..."
},
"headers": ["date", "amount", "description", "total"],
"reading_order": 3,
"title": "Title of the table",
"footers": ["the footers of the table"],
"page_indices": [0, 1],
"locations": [{
"page_index": 0,
"bounding_box": {
"left": 0,
"top": 0,
"width": 1,
"height": 1
}
}, {
"page_index": 1,
"bounding_box": {
"left": 0,
"top": 0,
"width": 1,
"height": 1
}
}]
},
테이블 엔터티에 대한 정보입니다. CSV 정보에는 다양한 헤더, 바닥글 및 제목이 표시됩니다.
{
"id": "entity_id",
"type": "FIGURE",
"summary": "",
"representation": {
"text": "document text",
"html": "document title document content",
"markdown": "# text"
},
"locations": [
{
"page_index": 0,
"bounding_box": {
"left": 0,
"top": 0,
"width": 1,
"height": 1
}
}
],
"sub_type": "CHART",
"title": "figure title",
"reading_order": 1,
"page_indices": [
0
]
},
이 엔터티는 문서 그래프 및 차트와 같은 그림에 사용됩니다. 제목 텍스트에 대한 sub_type 및 그림 제목 응답과 그림 종류에 대한 표시를 받게 됩니다.
"pages":[
"pages":[
{
"id":"page_id",
"page_index":0,
"detected_page_number":1,
"representation":{
"text":"document text",
"html":"document title document content",
"markdown":"# text"
},
"statistics":{
"element_count":5,
"table_count":1,
"figure_count":1,
"word_count":1000,
"line_count":32
},
"asset_metadata":{
"rectified_image":"s3://bucket/prefix.png",
"rectified_image_width_pixels":1700,
"rectified_image_height_pixels":2200
}
}
],
표준 출력을 통해 추출되는 마지막 엔터티는 페이지입니다. 페이지는 텍스트 엔터티와 동일하지만 감지된 페이지 번호가 페이지에 있는 페이지 번호를 추가로 포함합니다.
"text_lines":[
{
"id":"line_id",
"text":"line text",
"reading_order":1,
"page_index":0,
"locations":{
"page_index":0,
"bounding_box":{
"left":0,
"top":0,
"width":1,
"height":1
}
}
}
],
"text_words":[
{
"id":"word_id",
"text":"word text",
"line_id":"line_id",
"reading_order":1,
"page_index":0,
"locations":{
"page_index":0,
"bounding_box":{
"left":0,
"top":0,
"width":1,
"height":1
}
}
}
]
이 마지막 두 요소는 개별 텍스트 부분을 위한 것입니다. 단어 수준 세분화는 각 단어에 대한 응답을 반환하는 반면, 기본 출력은 텍스트 줄만 보고합니다.