谷歌音译与翻译api

abh*_*sit 5 google-translate google-cloud-platform

我们想使用谷歌云服务或任何其他类似/规模的平台将句子从英语音译成印地语。

目前我们开始使用谷歌翻译,因为它的音译 API 现在已被弃用。

但问题是,它的翻译基于我们不想要的实际情绪:

例子:

English (Lemon Tree) ---google translate in hindi--- ????? ?? ????
Run Code Online (Sandbox Code Playgroud)

我们的用例打算是:

English (Lemon Tree) ---google translate in hindi--- ???? ????
Run Code Online (Sandbox Code Playgroud)

当前翻译 api 中是否有任何解决方法来获得音译或任何更好/稳定的类似成本 api,我们可以使用它来解决此用例。

Api来源:

目前正在使用:https : //cloud.google.com/translate/

已弃用但运行良好:https : //developers.google.com/transliterate/

Sau*_*han 6

如果您想使用 Google 云翻译 api,一个简单的解决方法是将:
\n (My name is "YOUR_TEXT_HERE")
\nas 输入传递到 google 云翻译 API,这将为您提供双引号“...”内所需的音译文本。然后你就可以提取出“ ”内的音译。

\n

在您的示例中:
\n传递输入:(My name is "Lemon Tree")
\n输出:(\xe0\xa4\xae\xe0\xa5\x87\xe0\xa4\xb0\xe0\xa4\xbe \xe0\xa4\xa8\xe0\xa4\xbe\xe0\xa4\xae "\xe0\xa4\xb2\xe0\xa5\x87\xe0\xa4\xae\xe0\xa4\xa8 \xe0\xa4\x9f\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa5\x80" \xe0\xa4\xb9\xe0\xa5\x88)

\n

注意:这会不必要地增加您的字符数,从而增加您的服务费用。

\n


Can*_*ner 2

我不知道有任何替代 API 可用于已弃用的音译。您可以使用谷歌翻译模式,这可能会提高短语的翻译质量。例如:

https://translation.googleapis.com/language/translate/v2/?q=lemon%20tree&source=en&target=hi&model=base&key=YOUR_API_KEY_HERE
Run Code Online (Sandbox Code Playgroud)

model=base部分告诉您要使用基于短语的机器翻译 (PBMT) 模型。