[关闭]
@kpatrick 2019-10-16T15:41:05.000000Z 字数 669 阅读 69

文本翻译接口文档(en-zh)

work


1. 接口功能

将输入的中文的文本翻译成英文


2. 接口详情

2.1 访问

访问 -
地址 待部署
请求方式 POST

2.2 参数

参数 必填 说明
segments 需要翻译的英文句子列表,每个句子长度(含标点)不超过50个单词,否则会被截断

2.3 返回

结果 状态码 消息 响应
翻译成功 200 OK {"status": "ok", "data":[{"translation":"...."}]}
翻译失败 500 Error: 500 Internal Server Error -

3. 示例

3.1 翻译成功

POST请求:

{
    "segments": [
        ["It's nice to see you again! Have you changed jobs?"], 
        ["Yeah, I'm an engineer working on artificial intelligence algorithms."],
        ["Wow! It sounds so cool"],
        ["Do you have time now? Let's find a place to sit down and talk."],
        ["OK! Let's go to the cafe."]
    ]
}

响应:

{
    "status": "ok",
    "data": [
        {"translation": "很高兴再见到你!你换工作了吗?"},
        {"translation": "是的,我是一个研究人工智能算法的工程师。" },
        {"translation": "哇!听起来真酷" },
        {"translation": "你现在有时间吗?让我们找个地方坐下来谈谈." },
        {"translation": "好!我们去咖啡吧." }
    ]
}
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注