查询ocr解析结果
功能介绍
查询ocr解析结果
URI
GET /v1/koosearch/doc-search/ocr-results
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| task_id | 是 | String | 解析任务id |
| pages | 否 | String | 页码集合,查询哪些页的ocr结果,多页以逗号分隔,如1,2,3,4,5 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| X-Auth-Token | 是 | String | 参数解释: 接口鉴权使用的Token,Token获取方式参考:3.2节 认证鉴权。 约束限制: 不涉及。 |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| [数组元素] | Array of PageOcrResult objects | 获取ocr结果响应信息 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| table_result | 表格识别结果 | |
| layout_result | 版式识别结果 | |
| kv_result | 键值对识别结果 | |
| ocr_result | 文字识别结果 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| table_count | Integer | 表格的数量 |
| table_list | Array of SmartDocumentRecognizerTableBlock objects | ocr表格数据 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| location | Array<Array<Integer>> | 文字块的区域位置信息,列表形式,包含文字区域四个顶点的二维坐标(x,y);坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向 |
| words_block_count | Integer | 表格中所包含的单元格数量。 |
| words_block_list | Array of SmartDocumentRecognizerTableWordsBlock objects | 单元格识别结果列表 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| words | String | 单元格内的文字识别结果 |
| rows | Array of integers | 文字块占用的行信息,编号从0开始,列表形式,数据类型为Integer |
| columns | Array of integers | 文字块占用的列信息,编号从0开始,列表形式,数据类型为Integer |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| layout_block_count | Integer | 模型识别到的文档版面区域数量 |
| layout_block_list | Array of SmartDocumentRecognizerLayoutBlock objects | 文档版面区域识别结果列表 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| location | Array<Array<Integer>> | 文字块的区域位置信息,列表形式,包含文字区域四个顶点的二维坐标(x,y);坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向 |
| type | String | 文档区域类别,包含text、table等类别 |
| text | String | 文档区域文字内容 |
| words_ids | Array of integers | 文字识别结果索引列表,表示ocr_result的words_block_list中哪些文本框位于该文档区域内 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| kv_block_count | Integer | 模型识别到的键值对数量 |
| kv_block_list | Array of SmartDocumentRecognizerKVBlock objects | 键值对识别结果列表 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| key | String | key-value对(键值对)中的key |
| value | String | key-value对(键值对)中的value |
| words_block_count | Integer | 该键值对中所包含的文本框数量 |
| words_block_list | Array of SmartDocumentRecognizerKVWordsBlock objects | 键值对文本框识别结果列表 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| location | Array<Array<Integer>> | 文字块的区域位置信息,列表形式,包含文字区域四个顶点的二维坐标(x,y);坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向 |
| type | String | 类型 |
| words | String | 文字块识别结果 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| direction | Float | 图片朝向 |
| words_block_count | Integer | 识别文字块数目 |
| words_block_list | Array of SmartDocumentRecognizerWordsBlockList objects | 识别文字块列表,输出顺序从左到右,先上后下 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| location | Array<Array<Integer>> | 文字块的区域位置信息,列表形式,包含文字区域四个顶点的二维坐标(x,y);坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向 |
| confidence | Float | 文字块识别结果的置信度 |
| words | String | 文字块识别结果 |
状态码:400
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | |
| error_msg | String | 错误描述 |
状态码:401
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | |
| error_msg | String | 错误描述 |
状态码:500
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | |
| error_msg | String | 错误描述 |
请求示例
无
响应示例
无
状态码
| 状态码 | 描述 |
|---|---|
| 200 | ocr解析结果 |
| 400 | 请求参数异常 |
| 401 | 鉴权认证异常 |
| 500 | 服务内容异常 |
错误码
请参见错误码。