Watson Text To Speech 罗马数字只能识别 pt-BR 中的 XXXIX (39)

Watson Text To Speech Roman Numerals recognized only up to XXXIX (39) in pt-BR

在对一本书的部分内容进行综合葡萄牙语 (pt-BR) 测试时,我注意到如果数字大于 XXIX (39),则包含罗马数字的章节名称不会被识别为数字。

像数字 L (50) 或 LX (60) 将无法正确合成为数字,而是读作字母。使用 "say-as" SSMLS 标记不会导致任何更改。

这是预期的吗?有没有可能的解决方法?

Is this expected?

我希望,是的,开发人员通常很懒惰地实施通用解决方案。

Is there any possible workaround ?

自己预处理文本并将数字转换为单词。

您的另一个选择是自定义您的模型,如 https://console.bluemix.net/docs/services/text-to-speech/custom-intro.html#customIntro

中所述

这是一个简短的例子

使用此命令创建自定义模型

curl -X POST -u ***:*** --header "Content-Type: application/json" --data "{\"name\":\"cURL Test\",\"language\":\"en-US\", \"description\":\"Customization test via cURL\"}" "https://stream.watsonplatform.net/text-to-speech/api/v1/customizations"

上面的命令将 return customization_id(在本例中,e250e7ee-fbec-47e8-a1b8-59435c1b18e3

然后使用此命令添加翻译

curl -X PUT -u ***:*** --header "Content-Type: application/json" --data "{\"translation\":\"thirty\"}" "https://stream.watsonplatform.net/text-to-speech/api/v1/customizations/e250e7ee-fbec-47e8-a1b8-59435c1b18e3/words/XXX"

终于来试试了

curl -X GET -u ***:*** --header "Accept: audio/wav" --output xxx.wav "https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?text=chapter%20XXX&customization_id=e250e7ee-fbec-47e8-a1b8-59435c1b18e3"

它将生成一个音频文件,上面写着 "chapter thirty"

ps。对于 PT-BR,请参阅 https://console.bluemix.net/docs/services/text-to-speech/custom-models.html#customModels 以便您可以使用选项 "language" 并将 XXX 翻译为 "trinta"