CreateModelAsyncPredict
Creates an asynchronous prediction task for Document AutoML.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
documentautoml:CreateModelAsyncPredict |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ModelVersion |
string |
No |
The model version. If unspecified, the latest active model version is used. |
V1 |
| BinaryToText |
boolean |
No |
Specifies how the document content is provided. |
false:表示content传入的是url true:表示body是直接传入图片进行base64的内容 |
| Content |
string |
No |
The URL of the image or PDF file. |
https://doc-automl-public.oss-cn-hangzhou.aliyuncs.com/3/1559855998794593/stage/upload/20230206/oss-hlfCRJ1SorSWs10MkqxK6YcL4OVAFSv4.png?Expires=1675665563&OSSAccessKeyId=XXXX&Signature=WLKghBc3zKzWJ3Td69%2B4C21jrbE%3D |
| ModelId |
integer |
No |
The model ID. You can find this ID on the Model List Page in the console. |
123 |
| ServiceName |
string |
No |
The name of the pre-trained service. |
pre_train_service |
| ServiceVersion |
string |
No |
The version of the pre-trained service. |
V1 |
| Body |
string |
No |
The Base64-encoded content of the document. |
data:image/png;base64,xxxxx |
You must specify either the Content or Body parameter.
When providing a document URL, use the Content parameter. When providing the document's content directly, use the Body parameter for the Base64-encoded content and set BinaryToText to true.
PDF files are limited to 20 MB and 10 pages. All prediction services process only the first page, except for services that support the long document type.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| RequestId |
string |
The request ID. |
3EAC98E6-8DD6-511F-8764-DEE8B6EB6BB4 |
| Code |
integer |
The status code of the request. A value of |
200 |
| Message |
string |
The error message. |
success |
| Data |
string |
A JSON-formatted string that contains the result. The |
{ "RequestId": "292D1584-134C-1221-B9BB-1B847C623D41", "Message": "", "Data": 1, "Code": 200 } |
The Data field returns a JSON string. The Data field within this string is the asynchronous task ID. Use this ID with the GetModelAsyncPredict operation to retrieve the prediction result.
Examples
Success response
JSON format
{
"RequestId": "3EAC98E6-8DD6-511F-8764-DEE8B6EB6BB4",
"Code": 200,
"Message": "success",
"Data": "{\n \"RequestId\": \"292D1584-134C-1221-B9BB-1B847C623D41\",\n \"Message\": \"\",\n \"Data\": 1,\n \"Code\": 200\n}"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 200 | 21002 | 模板预测超时 | |
| 200 | 21003 | 模板预测失败 | |
| 200 | 10001 | 参数出错 | |
| 200 | 10005 | 服务不存在 | |
| 200 | 16001 | 未找到可预测的模型 | |
| 200 | 13018 | 未找到模型信息 | |
| 200 | 16004 | 指定的模型不存在 | |
| 200 | 23002 | 获取资源HTTP异常 | |
| 200 | 11002 | 账号没有开通服务 | |
| 200 | 19999 | 未知异常 |
See Error CodesError Codes for a complete list.
Release notes
See Release NotesRelease Notes for a complete list.