文档

CreateAsyncPredict

更新时间:

调用CreateAsyncPredict创建一个异步预测。

调试

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

请求参数

名称

类型

是否必选

示例值

描述

Action String CreateAsyncPredict

系统规定参数。取值:CreateAsyncPredict

ModelId Integer 1

模型ID。根据服务名称和服务版本创建异步预测的时候,此参数不必传;否则必传。

Content String 全国土地利用总体规划

预测内容,最大长度:1024字节。

ModelVersion String V1

要获取的物模型版本号。不传入此参数,则返回已发布的最新版本。根据模型ID调用异步预测接口的时候传此参数。

DetailTag String false

文本实体抽取类型模型,是否返回详细抽取结果。可选值:true/false。

TopK Integer 0,3

设置返回top结果数量。

FileType String text,html,pdf,docx,doc

文件类型

FileUrl String http://127.0.0.1/example.docx

文件HTTP保存地址。

FileContent String [base64 encode content]

文件内容Base64编码。

FetchContent String true

返回预测文本

ServiceName String ContractNERPretrain

服务名称。

ServiceVersion String V1

服务版本。

返回数据

名称

类型

示例值

描述

AsyncPredictId Long 1

异步预测唯一ID,用于查询异步预测结果。

RequestId String E5C4531B-8331-5CD5-BEB3-2F8B58A4D680

请求ID

示例

请求示例

根据模型ID创建异步调用。  
http(s)://[Endpoint]/?Action=CreateAsyncPredict
&Content=自然语言处理
&ModelId=1818
&ModelVersion=1
&<公共请求参数>

请求示例补充说明

根据服务名称和服务版本创建异步调用。  
http(s)://[Endpoint]/?Action=CreateAsyncPredict
&Content=自然语言处理
&ServiceName=ContractNERPretrain
&ServiceVersion=V1
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateAsyncPredictResponse>
      <requestId>A357B459-3EA6-4F68-B285-FFDDF4E4662D</requestId>
      <asyncPredictId>1634</asyncPredictId>
</CreateAsyncPredictResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "requestId" : "A357B459-3EA6-4F68-B285-FFDDF4E4662D",
  "asyncPredictId" : 1634
}

错误码

HttpCode

错误码

错误信息

描述

200 40002 The specified interface is throttled. 调用接口被限流
200 40013 An error occurred while authenticating the model. 模型鉴权失败
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. 内容长度过长。
400 parameterError The parameter is invalid. 参数错误
400 predictLimit The maximum number of submitted tasks is exceeded. 提交任务到达上限
403 Forbbiden You are not authorized to operate on the specified resource. 用户未被授权操作指定的资源。
404 ResourceNotFound The specified Model does not exist. 指定的模型不存在。
500 InternalError An error occurred while processing your request. 未知错误。
503 ServiceUnavailable An error occurred while processing your request. 服务内部错误。

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

  • 本页导读 (0)
文档反馈