阿里云智能语义理解UploadDictionary

调用UploadDictionary上传自定义词表。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String UploadDictionary

系统规定参数。取值:UploadDictionary。

DictionaryFileUrl String http://iqa-console.oss-cn-hangzhou.aliyuncs.com/example/iqa_example_dict.xlsx?Expires=2179049786&OSSAccessKeyId=LTAI2WA8174xk3ii&Signature=4CgIWGPYnYgfN%2FaSGK8AipYKT7U%3D

自定义词表excel文件地址,参考示例中的示例文件。

ProjectId String bqhxd1qf4bcnhjh8

项目ID,是访问项目的唯一标识。

DictionaryData String [{“stdWord”:”充值”,”extWords”:[“充钱”,”充话费”]}]

自定义词表文本数据(JSON格式),参考示例中的文本数据示例。

返回数据

名称 类型 示例值 描述
FileDataCount Integer 8

文件解析数据条数。

JsonDataCount Integer 2

JSON文本解析数据条数。

ProjectId String bqhxd1qf4bcnhjh8

项目ID,是访问项目的唯一标识。

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

请求ID。

TotalCount Integer 10

总共解析数据条数。

示例

请求示例


http(s)://[Endpoint]/?Action=UploadDictionary
&DictionaryFileUrl=http://iqa-console.oss-cn-hangzhou.aliyuncs.com/example/iqa_example_dict.xlsx?Expires=2179049786&OSSAccessKeyId=LTAI2WA8174xk3ii&Signature=4CgIWGPYnYgfN%2FaSGK8AipYKT7U%3D
&ProjectId=bqhxd1qf4bcnhjh8
&<公共请求参数>

正常返回示例

XML 格式

<TotalCount>3</TotalCount>
<JsonDataCount>1</JsonDataCount>
<RequestId>97E36512-2EF1-495E-89C2-6E07D7AD847F</RequestId>
<ProjectId>bqhxd1qf4bcnhjh8</ProjectId>
<FileDataCount>2</FileDataCount>

JSON 格式

{
	"TotalCount":3,
	"RequestId":"97E36512-2EF1-495E-89C2-6E07D7AD847F",
	"JsonDataCount":1,
	"ProjectId":"bqhxd1qf4bcnhjh8",
	"FileDataCount":2
}

错误码

HttpCode 错误码 错误信息 描述
403 Forbbiden You are not authorized to operate on the specified resource. 用户未被授权操作指定的资源。
500 InternalError An error occurred while processing your request. 未知错误。
400 InvalidAccountStatus.ServiceUnavailable The Intelligent Semantic Understanding service has not been activated. 用户未开通智能语义理解服务。
400 InvalidDataFileFormat The data file format is invalid. 数据文件格式不合法。
400 InvalidDataFileSize The data file size cannot exceed 10 MB. 数据文件大小不能超过10M。
400 InvalidParameter.FileUrl The specified fileUrl is invalid. 参数fileUrl不合法。
400 InvalidParameter.ProjectId The specified projectId is invalid. 参数projectId不合法。
400 MissingParameter.Dictionary Either dictionaryFileUrl or dictionaryData must be specified. 参数dictionaryFileUrl或dictionaryData必须指定一个。
400 ParseDataFileError An error occurred while parsing the data file. Please check that the data file URL
is valid.
解析数据文件失败,请确认数据文件地址是正确的。
404 ResourceNotFound The specified project does not exist. 指定的项目不存在。
503 ServiceUnavailable An error occurred while processing your request. 服务内部错误。

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

原创文章,作者:网友投稿,如若转载,请注明出处:https://www.cloudads.cn/archives/33916.html

发表评论

登录后才能评论