how to detect language spoken in google cloud platform machine learning speech api

老子叫甜甜 提交于 2019-11-29 07:08:46
john316

As of last month, Google added support for detection of spoken languages into its speech-to-text API. Google Cloud Speech v1p1beta1

It’s a bit limited though - you have to provide a list of probable language codes, up to 3 of them only, and it’s said to be supported only for voice command and voice search modes. It’s useful if you have a clue what other languages may be in your audio.

From their docs:

alternative_language_codes[]: string

Optional A list of up to 3 additional BCP-47 language tags, listing possible alternative languages of the supplied audio. See Language Support for a list of the currently supported language codes. If alternative languages are listed, recognition result will contain recognition in the most likely language detected including the main language_code. The recognition result will include the language tag of the language detected in the audio. NOTE: This feature is only supported for Voice Command and Voice Search use cases and performance may vary for other use cases (e.g., phone call transcription).”

Requests to Google Cloud Speech API require the following configuration parameters: encoding, sampleRateHertz and languageCode. https://cloud.google.com/speech/reference/rest/v1/RecognitionConfig

Thus, it is not possible for the Google Cloud Speech API service to automatically detect the language used. The service will be configured by this parameter (languageCode) to start recognizing speech in that specific language.

If you had in mind a parallel with Google Cloud Translation API, where the input language is automatically detected, please consider that automatically detecting the language used in an audio file requires much more bandwidth, storage space and processing power than in a text file. Also, Google Cloud Speech API offers Streaming Speech Recognition, a real-time speech-to-text service, where the languageCode parameter is especially required.

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