Detecting language in speech recognition

Ravi Bhushan
1 min readOct 20, 2021

--

A client came up with a requirement to identify the language in which a user will speak with its bot. The motive was to nudge the user to stick to one language in conversation instead of a mix of… say English + Hindi. To narrow down the use case, the client provided four languages which their users widely spoke.

Now, most of the speech recognition engines need the language as an input itself. Thus making the task a twisted one.

The way I attempted it (though somehow a constrained approach) -

Prepare a list of languages, for each language,

Convert the speech to text nd store the confidence interval and transcript….

Compare the confidence interval of the transcripts detected for each language.

The one with highest confidence interval is most likely to be the language spoken by the user.

Tools Used — Py Library : speech_recognition | Speech Recognition Engine : Google Speech Recognition API

Looking for comments with alternate approach and improvement suggestions.

https://sites.google.com/view/ravi-bhushan

Scan the QR Code and check out my other works…

--

--