文档

PredictPreTrainModel - 预置能力服务预测API

更新时间:

预置能力现有:UIE抽取,适用于通用智能预标注。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
Contentstring

预测内容,格式为 JSON 字符串。 UIE 抽取参数格式{"query":"xxx","schema":["字段 1","字段 2"]}, query 对应图片 URL,schema 对应要抽取的字段数组

{"query":"https://doc-automl-public.oss-cn-hangzhou.aliyuncs.com/demo/extractBill.png", "schema":["姓名", "住址"]}
ServiceVersionstring

预置能力服务版本,默认 V1

V1
ServiceNamestring

预置能力服务名称,必填 UIE 抽取对应“FormUIE”

FormUIE
BinaryToTextboolean

content 字段内容为图片 URL 时:false, body 字段内容为图片 base64 时:true

false
Bodystring

图片传递 base64 编码时的预测内容,格式为 json 字符串。 UIE 抽取参数格式{"query":"xxx","schema":["字段 1","字段 2"]}, query 对应图片 base64 编码,schema 对应要抽取的字段数组

{"query":"data:image/png;base64,xxxxx","schema":["姓名", "住址"]}

BinaryToText 为非必填项

content 字段和 body 字段传参二选一,图片内容是 URL,在传递 content 字段,内容是 base64,传递 body 字段,且 BinaryToText 传 true

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

Id of the request

29413C69-11EF-15CB-BE20-70D318E2F4E9
Codeinteger

请求结果状态,200 为成功

200
Messagestring

错误信息

success
Dataobject

接口返回信息

{ "RequestId": "29413C69-11EF-15CB-BE20-70D318E2F4E9", "Message": "success", "Data": { "score": 1, "data": [ { "prob": 0.9138551354408264, "fieldWordRaw": "xx", "wordInfo": [ { "prob": 0.9138551354408264, "pos": [ { "x": 468, "y": 139 }, { "x": 476, "y": 139 }, { "x": 476, "y": 153 }, { "x": 468, "y": 153 } ], "word": "xx", "charInfo": [ { "prob": 0.99, "pos": [ { "x": 468, "y": 139 }, { "x": 471, "y": 139 }, { "x": 471, "y": 153 }, { "x": 468, "y": 153 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 473, "y": 139 }, { "x": 476, "y": 139 }, { "x": 476, "y": 153 }, { "x": 473, "y": 153 } ], "word": "x" } ] } ], "name": "姓名", "location": [ { "x": 468, "y": 139 }, { "x": 476, "y": 139 }, { "x": 476, "y": 153 }, { "x": 468, "y": 153 } ], "fieldWord": "xx" }, { "prob": 0.9594210982322693, "fieldWordRaw": "xxxxxxxxxxx", "wordInfo": [ { "prob": 0.9594210982322693, "pos": [ { "x": 168, "y": 164 }, { "x": 467, "y": 164 }, { "x": 467, "y": 239 }, { "x": 168, "y": 239 } ], "word": "xxxxxxxxxxx", "charInfo": [ { "prob": 0.99, "pos": [ { "x": 366, "y": 164 }, { "x": 383, "y": 164 }, { "x": 383, "y": 179 }, { "x": 366, "y": 179 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 384, "y": 164 }, { "x": 401, "y": 164 }, { "x": 401, "y": 179 }, { "x": 384, "y": 179 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 402, "y": 164 }, { "x": 414, "y": 164 }, { "x": 414, "y": 179 }, { "x": 402, "y": 179 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 418, "y": 164 }, { "x": 427, "y": 164 }, { "x": 427, "y": 179 }, { "x": 418, "y": 179 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 429, "y": 164 }, { "x": 438, "y": 164 }, { "x": 438, "y": 179 }, { "x": 429, "y": 179 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 439, "y": 164 }, { "x": 448, "y": 164 }, { "x": 448, "y": 179 }, { "x": 439, "y": 179 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 450, "y": 164 }, { "x": 467, "y": 164 }, { "x": 467, "y": 179 }, { "x": 450, "y": 179 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 168, "y": 224 }, { "x": 180, "y": 224 }, { "x": 180, "y": 239 }, { "x": 168, "y": 239 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 180, "y": 224 }, { "x": 192, "y": 224 }, { "x": 192, "y": 239 }, { "x": 180, "y": 239 } ], "word": "x" }, { "prob": 0.99, "pos": [ { "x": 195, "y": 224 }, { "x": 209, "y": 224 }, { "x": 209, "y": 239 }, { "x": 195, "y": 239 } ], "word": "1" }, { "prob": 0.99, "pos": [ { "x": 211, "y": 224 }, { "x": 223, "y": 224 }, { "x": 223, "y": 239 }, { "x": 211, "y": 239 } ], "word": "7" }, { "prob": 0.99, "pos": [ { "x": 224, "y": 224 }, { "x": 236, "y": 224 }, { "x": 236, "y": 239 }, { "x": 224, "y": 239 } ], "word": "2" }, { "prob": 0.99, "pos": [ { "x": 237, "y": 224 }, { "x": 249, "y": 224 }, { "x": 249, "y": 239 }, { "x": 237, "y": 239 } ], "word": "7" }, { "prob": 0.99, "pos": [ { "x": 253, "y": 224 }, { "x": 270, "y": 224 }, { "x": 270, "y": 239 }, { "x": 253, "y": 239 } ], "word": "x" } ] } ], "name": "住址", "location": [ { "x": 168, "y": 164 }, { "x": 467, "y": 164 }, { "x": 467, "y": 239 }, { "x": 168, "y": 239 } ], "fieldWord": "xxxxxxxx" } ], "specificType": "formuie-anti", "classType": "preDefinedServer", "predictFile": "https://xxxx" }, "Code": 200 }

模板服务预测接口,返回 Data 字段解释说明:
score 预测服务置信度 0-1
data. 算法返回的预测结果,数组格式
prob 算法结果置信度 0-1
name 抽取 key
fieldWord 抽取 value
location 抽取结果坐标位置 { "x": 119,"y": 48 }表示页面坐标点
wordInfo 抽取内容详细信息,包括了每个字符的位置信息
specificType 算法类型(formuie-anti:UIE 抽取)
classType preDefinedServer: 预置能力
predictFile 预测文件地址(失效时间 60 分钟)

示例

正常返回示例

JSON格式

{
  "RequestId": "29413C69-11EF-15CB-BE20-70D318E2F4E9",
  "Code": 200,
  "Message": "success",
  "Data": {
    "RequestId": "29413C69-11EF-15CB-BE20-70D318E2F4E9",
    "Message": "success",
    "Data": {
      "score": 1,
      "data": [
        {
          "prob": 0.9138551354408264,
          "fieldWordRaw": "xx",
          "wordInfo": [
            {
              "prob": 0.9138551354408264,
              "pos": [
                {
                  "x": 468,
                  "y": 139
                },
                {
                  "x": 476,
                  "y": 139
                },
                {
                  "x": 476,
                  "y": 153
                },
                {
                  "x": 468,
                  "y": 153
                }
              ],
              "word": "xx",
              "charInfo": [
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 468,
                      "y": 139
                    },
                    {
                      "x": 471,
                      "y": 139
                    },
                    {
                      "x": 471,
                      "y": 153
                    },
                    {
                      "x": 468,
                      "y": 153
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 473,
                      "y": 139
                    },
                    {
                      "x": 476,
                      "y": 139
                    },
                    {
                      "x": 476,
                      "y": 153
                    },
                    {
                      "x": 473,
                      "y": 153
                    }
                  ],
                  "word": "x"
                }
              ]
            }
          ],
          "name": "姓名",
          "location": [
            {
              "x": 468,
              "y": 139
            },
            {
              "x": 476,
              "y": 139
            },
            {
              "x": 476,
              "y": 153
            },
            {
              "x": 468,
              "y": 153
            }
          ],
          "fieldWord": "xx"
        },
        {
          "prob": 0.9594210982322693,
          "fieldWordRaw": "xxxxxxxxxxx",
          "wordInfo": [
            {
              "prob": 0.9594210982322693,
              "pos": [
                {
                  "x": 168,
                  "y": 164
                },
                {
                  "x": 467,
                  "y": 164
                },
                {
                  "x": 467,
                  "y": 239
                },
                {
                  "x": 168,
                  "y": 239
                }
              ],
              "word": "xxxxxxxxxxx",
              "charInfo": [
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 366,
                      "y": 164
                    },
                    {
                      "x": 383,
                      "y": 164
                    },
                    {
                      "x": 383,
                      "y": 179
                    },
                    {
                      "x": 366,
                      "y": 179
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 384,
                      "y": 164
                    },
                    {
                      "x": 401,
                      "y": 164
                    },
                    {
                      "x": 401,
                      "y": 179
                    },
                    {
                      "x": 384,
                      "y": 179
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 402,
                      "y": 164
                    },
                    {
                      "x": 414,
                      "y": 164
                    },
                    {
                      "x": 414,
                      "y": 179
                    },
                    {
                      "x": 402,
                      "y": 179
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 418,
                      "y": 164
                    },
                    {
                      "x": 427,
                      "y": 164
                    },
                    {
                      "x": 427,
                      "y": 179
                    },
                    {
                      "x": 418,
                      "y": 179
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 429,
                      "y": 164
                    },
                    {
                      "x": 438,
                      "y": 164
                    },
                    {
                      "x": 438,
                      "y": 179
                    },
                    {
                      "x": 429,
                      "y": 179
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 439,
                      "y": 164
                    },
                    {
                      "x": 448,
                      "y": 164
                    },
                    {
                      "x": 448,
                      "y": 179
                    },
                    {
                      "x": 439,
                      "y": 179
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 450,
                      "y": 164
                    },
                    {
                      "x": 467,
                      "y": 164
                    },
                    {
                      "x": 467,
                      "y": 179
                    },
                    {
                      "x": 450,
                      "y": 179
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 168,
                      "y": 224
                    },
                    {
                      "x": 180,
                      "y": 224
                    },
                    {
                      "x": 180,
                      "y": 239
                    },
                    {
                      "x": 168,
                      "y": 239
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 180,
                      "y": 224
                    },
                    {
                      "x": 192,
                      "y": 224
                    },
                    {
                      "x": 192,
                      "y": 239
                    },
                    {
                      "x": 180,
                      "y": 239
                    }
                  ],
                  "word": "x"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 195,
                      "y": 224
                    },
                    {
                      "x": 209,
                      "y": 224
                    },
                    {
                      "x": 209,
                      "y": 239
                    },
                    {
                      "x": 195,
                      "y": 239
                    }
                  ],
                  "word": "1"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 211,
                      "y": 224
                    },
                    {
                      "x": 223,
                      "y": 224
                    },
                    {
                      "x": 223,
                      "y": 239
                    },
                    {
                      "x": 211,
                      "y": 239
                    }
                  ],
                  "word": "7"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 224,
                      "y": 224
                    },
                    {
                      "x": 236,
                      "y": 224
                    },
                    {
                      "x": 236,
                      "y": 239
                    },
                    {
                      "x": 224,
                      "y": 239
                    }
                  ],
                  "word": "2"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 237,
                      "y": 224
                    },
                    {
                      "x": 249,
                      "y": 224
                    },
                    {
                      "x": 249,
                      "y": 239
                    },
                    {
                      "x": 237,
                      "y": 239
                    }
                  ],
                  "word": "7"
                },
                {
                  "prob": 0.99,
                  "pos": [
                    {
                      "x": 253,
                      "y": 224
                    },
                    {
                      "x": 270,
                      "y": 224
                    },
                    {
                      "x": 270,
                      "y": 239
                    },
                    {
                      "x": 253,
                      "y": 239
                    }
                  ],
                  "word": "x"
                }
              ]
            }
          ],
          "name": "住址",
          "location": [
            {
              "x": 168,
              "y": 164
            },
            {
              "x": 467,
              "y": 164
            },
            {
              "x": 467,
              "y": 239
            },
            {
              "x": 168,
              "y": 239
            }
          ],
          "fieldWord": "xxxxxxxx"
        }
      ],
      "specificType": "formuie-anti",
      "classType": "preDefinedServer",
      "predictFile": "https://xxxx"
    },
    "Code": 200
  }
}

错误码

HTTP status code错误码错误信息
20021002模板预测超时
20021003模版预测失败
20010001参数出错
20016001未找到可预测的模型
20013018未找到模型信息
20016004指定模型不存在
20023002获取资源HTTP异常
20011002账号没有开通服务
20019999未知异常
20050008文件过大
20050007文件格式不支持
20010005服务不存在

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
暂无变更历史
  • 本页导读 (0)