Search code examples
google-cloud-speech

Convert ID from speech to text without spaces


I'm using Google Cloud Speech API with IBM Voice Gateway in order to interact with a VoiceBot through a phone.

If I say an identifier contening letters and numbers through the phone, the Google Cloud Speech converts it into string with spaces. For example, if I say "A1B2C3", it will convert it into the following string "a 1 b 2 c 3".

Do you know if there is way to avoid these useless spaces ?

Thanks for your help!

Lucas


Solution

  • I don't see any way in which you can eliminate spaces from the API response. What you could do is experiment with the available features, as this is probably your best chance to get a recognition more similar to what you are looking for.

    For example: you can provide some sample hint phrases echoing your use case, indicate that the audio is a phone call, or use an enhanced model (although for the latter to be available you need to first opt in for data logging).

    Honestly though, for your case, it might be better if you post process the returned string (e.g. with a simple "a 1 b 2 c 3".replace(' ','') ).