Creates an asynchronous prediction task for document self-learning.
Try it now
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 version is used. |
V1 |
| BinaryToText |
boolean |
No |
Specifies the document source. Set to |
false:表示content传入的是url true:表示body是直接传入图片进行base64的内容 |
| Content |
string |
No |
The URL of the image or PDF file for analysis. |
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. |
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 |
The BinaryToText parameter is optional.
You must specify either the Content parameter for a document URL or the Body parameter for base64-encoded content. When using Body, set BinaryToText to true.
PDF documents are limited to 20 MB and 10 pages. All prediction services process only the first page, except for those designed for long documents.
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 response message. Returns "success" if the request is successful, or an error message if it fails. |
success |
| Data |
string |
The response data, formatted as a JSON string. For details, see the sample response. |
{ "RequestId": "292D1584-134C-1221-B9BB-1B847C623D41", "Message": "", "Data": 1, "Code": 200 } |
The Data parameter returns a JSON string representing a nested response. Parse this string to retrieve the value from its inner Data field, which contains the asynchronous task ID. You can then pass this ID to the GetModelAsyncPredict operation to retrieve the prediction results.
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 Codes for a complete list.
Release notes
See Release Notes for a complete list.