Is there a way to force Google Speech api to return only words as response?

前提是你 提交于 2019-12-03 01:56:25
blambert

Take a look at this question and answer.

You can give the API "speech context" hints, like this:

"speech_context": {
  "phrases":["zero", "one", "two", ... "nine", "ten", "eleven", ... "twenty", "thirty,..., "ninety"]
 }

I imagine this could work for other languages too, like German.

"speech_context": {
  "phrases":["eins", "zwei", "drei", ..., "elf", "zwölf" ... ]
 }
Christoph Bimminger

You may have to convert numbers (not digits) to words by yourself. As there is some logic in most languages (e.g. English, German), you can do this with an algorithmic approach.

See How to convert number to words in java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!