注意:以下文档只适用于TOP接口,请谨慎使用!

文档中心 > API类目 > 阿里翻译API

alibaba.intl.translation.cloud.detect (语种识别-标准版)

语种识别服务,上云商业化版本

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
cloud_recognize_task_dto LanguageRecognizeTaskDto 必须 语种识别入参
  • └ app_name
  • String
  • 可选
  • cloud-lang-recognize
  • 应用名称
  • └ text
  • String
  • 必须
  • 你好世界
  • 原文

响应参数

名称 类型 示例值 描述
recognized_language String en 识别出来的语种
text String hello world 原文
lang_map String af:0.000700;am:0.000100; 多种识别结果权重

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaIntlTranslationCloudDetectRequest req = new AlibabaIntlTranslationCloudDetectRequest();
AlibabaIntlTranslationCloudDetectRequest.LanguageRecognizeTaskDto obj1 = new AlibabaIntlTranslationCloudDetectRequest.LanguageRecognizeTaskDto();
obj1.setAppName("cloud-lang-recognize");
obj1.setText("你好世界");
req.setCloudRecognizeTaskDto(obj1);
AlibabaIntlTranslationCloudDetectResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_intl_translation_cloud_detect_response>
    <recognized_language>en</recognized_language>
    <text>hello world</text>
    <lang_map>af:0.000700;am:0.000100;</lang_map>
</alibaba_intl_translation_cloud_detect_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部