不是在语音识别中使用序数 [2nd],而是将 [second] 作为音频输入

Instead of taking an ordinal number [2nd] in voice recognition it is taking [second] as an audio input

在邮政地址插槽类型中,我希望用户按照以下方式说出输出 - “190 east 72nd street”

但它需要输入“190 east 70 second street” 这是不合适的。

那有什么办法吗?我试过使用 SSML 标签,但没有得到正确的输出。谢谢。

我们需要使用正则表达式,我们可以用正确的输出替换字符串。

import re if "0 second" in postal: y = re.sub("0 second","2nd",postal) elif "second" in postal: y = re.sub("second","2nd", postal) else: y = postal