调用CreateAsyncPredict创建一个异步预测。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateAsyncPredict |
系统规定参数。取值:CreateAsyncPredict。 |
Content | String | 是 | 自然语言处理 |
预测内容,最大长度:10000字。 |
ModelId | Integer | 是 | 1818 |
模型ID。 |
ModelVersion | String | 是 | 1 |
模型版本。 |
DetailTag | String | 否 | false |
文本实体抽取类型模型,是否返回详细抽取结果。可选值:true/false。 |
TopK | Integer | 否 | 3 |
关键短语抽取模型,返回top几的结果。 |
FileType | String | 否 | docx |
文件类型。 |
FileUrl | String | 否 | http://127.0.0.1/example.docx |
文件HTTP保存地址。 |
FileContent | String | 否 | [base64 encode content] |
文件内容Base64编码。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | C579D954-E53C-49FD-B987-FAF1A1C5E2A5 |
请求ID。 |
AsyncPredictId | Long | 123 |
异步预测唯一ID,用于查询异步预测结果。 |
示例
请求示例
http(s)://[Endpoint]/?Action=CreateAsyncPredict
&Content=自然语言处理
&ModelId=1818
&ModelVersion=1
&<公共请求参数>
正常返回示例
XML
格式
<CreateAsyncPredictResponse>
<requestId>A357B459-3EA6-4F68-B285-FFDDF4E4662D</requestId>
<asyncPredictId>1634</asyncPredictId>
</CreateAsyncPredictResponse>
JSON
格式
{
"requestId": "A357B459-3EA6-4F68-B285-FFDDF4E4662D",
"asyncPredictId": 1634
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
403 | Forbbiden | You are not authorized to operate on the specified resource. | 用户未被授权操作指定的资源。 |
503 | ServiceUnavailable | An error occurred while processing your request. | 服务内部错误。 |
404 | ResourceNotFound | The specified Model does not exist. | 指定的模型不存在。 |
400 | InvalidAccountStatus.ServiceUnavailable | The NLP Auto Machine Learning service has not been activated. | 用户未开通NLP自学习服务。 |
400 | InvalidAccountStatus.ServiceLimit | The maximum number of free API daily visits is exceeded. | API每天访问次数超过了免费额度限制。 |
400 | InvalidParameter.ModelId | The specified modelId is invalid. | 参数modelId不合法。 |
400 | InvalidParameter.ModelVersion | The specified modelVersion is invalid. | 参数modelVersion不合法。 |
400 | InvalidContentLength | The length of content exceeds the limit. | 内容长度过长。 |
500 | InternalError | An error occurred while processing your request. | 未知错误。 |
访问错误中心查看更多错误码。