Closed willt0 closed 7 months ago
The configuration is not clear from the issue description. Are you using command line parameters or override.yaml to use deepgram.
The observation is correct that deepgram is unable to recognize any other languages besides english.
I believe the following change will resolve the issue
Add the line
detect_language=True
The method will look like this with the additional option of detecting the language.
def get_transcription(self, wav_file_path: str):
"""Get text using STT
"""
try:
with open(wav_file_path, "rb") as audio_file:
buffer_data = audio_file.read()
payload: FileSource = {
"buffer": buffer_data
}
options = PrerecordedOptions(
model="nova",
smart_format=True,
utterances=True,
punctuate=True,
paragraphs=True,
detect_language=True)
response = self.audio_model.listen.prerecorded.v("1").transcribe_file(payload, options)
# This is not necessary and just a debugging aid
with open('logs/deep.json', mode='a', encoding='utf-8') as deep_log:
deep_log.write(response.to_json(indent=4))
return response
except Exception as exception:
print(exception)
return None
This should resolve the issue.
Thank you!!!The problem has been resolved.
Resolved in #190.