首页 > 解决方案 > 如何在微软翻译中设置语言偏好?

问题描述

要求:

curl -X POST "https://api.cognitive.microsofttranslator.com/detect?api-version=3.0" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json" -d "[{'Text':'No'}]"

回复:

[{"language":"es","score":1.0,"isTranslationSupported":true,"isTransliterationSupported":false}]

我能理解的是,“不”这个词在英语和西班牙语中都是一样的,但是有没有办法告诉翻译,如果发生冲突,那么更喜欢英语。

标签: microsoft-cognitivemicrosoft-translator

解决方案


Detect api does not support setting a preference for language when multiple languages are possible. We recommend using longer sentences to get a more accurate result.


推荐阅读