i want to get a word transcript that has punctuation from google-speech-api. i am using python 3 and
i get this error when i run my code which is the exact same code sample from
i get an error
"ValueError: Protocol message RecognitionConfig has no "enableAutomaticPunctuation" field.
".
what can i do to overcome this.
def transcribe_file_with_auto_punctuation(path):
client = speech.SpeechClient()
with io.open(path, 'rb') as audio_file:
content = audio_file.read()
audio = speech.types.RecognitionAudio(content=content)
config = speech.types.RecognitionConfig(
enableAutomaticPunctuation=True,
encoding= speech.enums.RecognitionConfig.AudioEncoding.LINEAR16,
languageCode= 'en-US',
model= 'default')
response = client.recognize(config, audio)
for i, result in enumerate(response.results):
alternative = result.alternatives[0]
print('-' * 20)
print('First alternative of result {}'.format(i))
print('Transcript: {}'.format(alternative.transcript))