更新时间:2021-01-22 15:54
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetSaChGeneral | 系统规定参数,取值:GetSaChGeneral |
ServiceCode | String | 是 | alinlp | 固定值,只支持alinlp |
Text | String | 是 | 服务很好 | 要分析的句子内容,长度不超过1000字 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | FA53D08F-37D1-4D81-BEE7-41F24E825F60 | 唯一请求id,排查问题的依据 |
Data | String | { “result”: { “positive_prob”: 0.9963, “sentiment”: “正面”, “negative_prob”: 0.0036 }, “success”: true} | sentiment:句子情感极性,包含正面、负面、中性三种情况positive_prob:句子极性为正面的概率大小,0-1之间,保留4位小数negative_prob:句子极性为负面的概率大小,0-1之间,保留4位小数 |
请求示例
http(s)://[Endpoint]/?Action=GetSaChGeneral
&ServiceCode=alinlp
&Text=服务很好
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>FA53D08F-37D1-4D81-BEE7-41F24E825F60</RequestId>
<Data>{ "result": { "positive_prob": 0.9963, "sentiment": "正面", "negative_prob": 0.0036 }, "success": true}</Data>
JSON
格式
{"RequestId":"FA53D08F-37D1-4D81-BEE7-41F24E825F60","Data":"{ \"result\": { \"positive_prob\": 0.9963, \"sentiment\": \"正面\", \"negative_prob\": 0.0036 }, \"success\": true}"}
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
403 | Forbidden.NoAuth | Failed to perform user authentication. | 用户鉴权失败 |
411 | FrameworkApiError | Framework API error. | 框架api错误 |
410 | FrameworkError | Framework internal server error. | 框架错误 |
412 | FrameworkFormatError | Framework request format error. | 框架请求格式错误 |
413 | FrameworkReturnError | Framework return type format error. | 框架返回格式错误 |
406 | TextCodingError | An encoding error occurred to the input text. | 输入文本编码错误 |
405 | TextLimitExceeded | The maximum length of the text is exceeded. | 文本长度超过限制 |
429 | Throttling.User | Flow control has been triggered. | 触发流控 |
400 | UserStatusInvalid | The user status is invalid. | 用户状态无效,未开通服务 |
500 | InternalError | A service error occurred. | 服务内部异常 |
401 | InvalidParameter | The parameter is invalid. | 参数无效 |
访问错误中心查看更多错误码。
在文档使用中是否遇到以下问题
更多建议
匿名提交