From c4ed8603b8192ff596f7a5baeb35f8bb0662d12b Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Thu, 16 Aug 2018 15:54:35 -0700 Subject: [PATCH 01/13] update beta tags --- speech/cloud-client/beta_snippets.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/speech/cloud-client/beta_snippets.py b/speech/cloud-client/beta_snippets.py index 30ca9cde84be..1ef3acf33eb4 100644 --- a/speech/cloud-client/beta_snippets.py +++ b/speech/cloud-client/beta_snippets.py @@ -33,7 +33,7 @@ def transcribe_file_with_enhanced_model(): """Transcribe the given audio file using an enhanced model.""" - # [START speech_transcribe_file_with_enhanced_model] + # [START speech_transcribe_enhanced_model_beta] from google.cloud import speech_v1p1beta1 as speech client = speech.SpeechClient() @@ -60,7 +60,7 @@ def transcribe_file_with_enhanced_model(): print('-' * 20) print('First alternative of result {}'.format(i)) print('Transcript: {}'.format(alternative.transcript)) - # [END speech_transcribe_file_with_enhanced_model] + # [END speech_transcribe_enhanced_model_beta] def transcribe_file_with_metadata(): @@ -110,7 +110,7 @@ def transcribe_file_with_metadata(): def transcribe_file_with_auto_punctuation(): """Transcribe the given audio file with auto punctuation enabled.""" - # [START speech_transcribe_file_with_auto_punctuation] + # [START speech_transcribe_auto_punctuation_beta] from google.cloud import speech_v1p1beta1 as speech client = speech.SpeechClient() @@ -134,7 +134,7 @@ def transcribe_file_with_auto_punctuation(): print('-' * 20) print('First alternative of result {}'.format(i)) print('Transcript: {}'.format(alternative.transcript)) - # [END speech_transcribe_file_with_auto_punctuation] + # [END speech_transcribe_auto_punctuation_beta] def transcribe_file_with_diarization(): From 3fed3700d9d9cffbffee84866a0be879aa635d3a Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Thu, 16 Aug 2018 16:07:08 -0700 Subject: [PATCH 02/13] updates tags for recognition-metadata page --- speech/cloud-client/beta_snippets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/cloud-client/beta_snippets.py b/speech/cloud-client/beta_snippets.py index 1ef3acf33eb4..64d5ce30e0fe 100644 --- a/speech/cloud-client/beta_snippets.py +++ b/speech/cloud-client/beta_snippets.py @@ -65,7 +65,7 @@ def transcribe_file_with_enhanced_model(): def transcribe_file_with_metadata(): """Send a request that includes recognition metadata.""" - # [START speech_transcribe_file_with_metadata] + # [START speech_transcribe_recognition_metadata_beta] from google.cloud import speech_v1p1beta1 as speech client = speech.SpeechClient() @@ -105,7 +105,7 @@ def transcribe_file_with_metadata(): print('-' * 20) print('First alternative of result {}'.format(i)) print('Transcript: {}'.format(alternative.transcript)) - # [END speech_transcribe_file_with_metadata] + # [END speech_transcribe_recognition_metadata_beta] def transcribe_file_with_auto_punctuation(): From e8f5ee58b7e03bd90405ad07cab40017b3abe124 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Thu, 16 Aug 2018 16:09:48 -0700 Subject: [PATCH 03/13] update diarization tag to beta --- speech/cloud-client/beta_snippets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/cloud-client/beta_snippets.py b/speech/cloud-client/beta_snippets.py index 64d5ce30e0fe..3560a2dda6e9 100644 --- a/speech/cloud-client/beta_snippets.py +++ b/speech/cloud-client/beta_snippets.py @@ -139,7 +139,7 @@ def transcribe_file_with_auto_punctuation(): def transcribe_file_with_diarization(): """Transcribe the given audio file synchronously with diarization.""" - # [START speech_transcribe_diarization] + # [START speech_transcribe_diarization_beta] from google.cloud import speech_v1p1beta1 as speech client = speech.SpeechClient() @@ -172,7 +172,7 @@ def transcribe_file_with_diarization(): for word_info in words_info: print("word: '{}', speaker_tag: {}".format(word_info.word, word_info.speaker_tag)) - # [END speech_transcribe_diarization] + # [END speech_transcribe_diarization_beta] def transcribe_file_with_multichannel(): From 394665f8d839a3ba5f74192c83faf005df4f7b06 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Thu, 16 Aug 2018 16:23:29 -0700 Subject: [PATCH 04/13] update word level confidence tags to beta --- speech/cloud-client/beta_snippets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/cloud-client/beta_snippets.py b/speech/cloud-client/beta_snippets.py index 3560a2dda6e9..2c1c9d7ab08e 100644 --- a/speech/cloud-client/beta_snippets.py +++ b/speech/cloud-client/beta_snippets.py @@ -244,7 +244,7 @@ def transcribe_file_with_multilanguage(): def transcribe_file_with_word_level_confidence(): """Transcribe the given audio file synchronously with word level confidence.""" - # [START speech_transcribe_word_level_confidence] + # [START speech_transcribe_word_level_confidence_beta] from google.cloud import speech_v1p1beta1 as speech client = speech.SpeechClient() @@ -270,7 +270,7 @@ def transcribe_file_with_word_level_confidence(): print(u'Transcript: {}'.format(alternative.transcript)) print(u'First Word and Confidence: ({}, {})'.format( alternative.words[0].word, alternative.words[0].confidence)) - # [END speech_transcribe_word_level_confidence] + # [END speech_transcribe_word_level_confidence_beta] if __name__ == '__main__': From 82fec783cb4007aa84167177a668265227c7f307 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Thu, 16 Aug 2018 17:18:37 -0700 Subject: [PATCH 05/13] updates region tags for async-recognize page --- speech/cloud-client/transcribe_async.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/cloud-client/transcribe_async.py b/speech/cloud-client/transcribe_async.py index 0f1bb558535d..89ad1861ca68 100644 --- a/speech/cloud-client/transcribe_async.py +++ b/speech/cloud-client/transcribe_async.py @@ -61,7 +61,7 @@ def transcribe_file(speech_file): # [END def_transcribe_file] -# [START def_transcribe_gcs] +# [START speech_transcribe_async_gcs] def transcribe_gcs(gcs_uri): """Asynchronously transcribes the audio file specified by the gcs_uri.""" from google.cloud import speech @@ -86,7 +86,7 @@ def transcribe_gcs(gcs_uri): # The first alternative is the most likely one for this portion. print(u'Transcript: {}'.format(result.alternatives[0].transcript)) print('Confidence: {}'.format(result.alternatives[0].confidence)) -# [END def_transcribe_gcs] +# [END speech_transcribe_async_gcs] if __name__ == '__main__': From 0d93891bc51ae947f48febaf6d430299d710b453 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Fri, 17 Aug 2018 09:11:49 -0700 Subject: [PATCH 06/13] updates region tag for async-time-offsets --- speech/cloud-client/transcribe_word_time_offsets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/cloud-client/transcribe_word_time_offsets.py b/speech/cloud-client/transcribe_word_time_offsets.py index 2bd0d746d28b..d5f8a23b5df3 100644 --- a/speech/cloud-client/transcribe_word_time_offsets.py +++ b/speech/cloud-client/transcribe_word_time_offsets.py @@ -60,7 +60,7 @@ def transcribe_file_with_word_time_offsets(speech_file): end_time.seconds + end_time.nanos * 1e-9)) -# [START def_transcribe_gcs] +# [START speech_transcribe_async_time_offsets_gcs] def transcribe_gcs_with_word_time_offsets(gcs_uri): """Transcribe the given audio file asynchronously and output the word time offsets.""" @@ -94,7 +94,7 @@ def transcribe_gcs_with_word_time_offsets(gcs_uri): word, start_time.seconds + start_time.nanos * 1e-9, end_time.seconds + end_time.nanos * 1e-9)) -# [END def_transcribe_gcs] +# [END speech_transcribe_async_time_offsets_gcs] if __name__ == '__main__': From 7c701f012f7996611e24d19b6928e4c7d7306cbf Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Fri, 17 Aug 2018 10:02:25 -0700 Subject: [PATCH 07/13] update region tags for sync transcribe --- speech/cloud-client/transcribe.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/speech/cloud-client/transcribe.py b/speech/cloud-client/transcribe.py index 8a47fb3b6ac8..8320cb6bdf9b 100644 --- a/speech/cloud-client/transcribe.py +++ b/speech/cloud-client/transcribe.py @@ -28,7 +28,7 @@ # [END import_libraries] -# [START def_transcribe_file] +# [START speech_transcribe_sync] def transcribe_file(speech_file): """Transcribe the given audio file.""" from google.cloud import speech @@ -57,10 +57,10 @@ def transcribe_file(speech_file): # The first alternative is the most likely one for this portion. print(u'Transcript: {}'.format(result.alternatives[0].transcript)) # [END migration_sync_response] -# [END def_transcribe_file] +# [END speech_transcribe_sync] -# [START def_transcribe_gcs] +# [START speech_transcribe_sync_gcs] def transcribe_gcs(gcs_uri): """Transcribes the audio file specified by the gcs_uri.""" from google.cloud import speech @@ -82,7 +82,7 @@ def transcribe_gcs(gcs_uri): for result in response.results: # The first alternative is the most likely one for this portion. print(u'Transcript: {}'.format(result.alternatives[0].transcript)) -# [END def_transcribe_gcs] +# [END speech_transcribe_sync_gcs] if __name__ == '__main__': From 3968f96012d7c00d19f3a1af8e52182df963caa1 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Fri, 17 Aug 2018 10:09:30 -0700 Subject: [PATCH 08/13] updates multichannel tags to beta --- speech/cloud-client/beta_snippets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/cloud-client/beta_snippets.py b/speech/cloud-client/beta_snippets.py index 2c1c9d7ab08e..3f478f296949 100644 --- a/speech/cloud-client/beta_snippets.py +++ b/speech/cloud-client/beta_snippets.py @@ -178,7 +178,7 @@ def transcribe_file_with_diarization(): def transcribe_file_with_multichannel(): """Transcribe the given audio file synchronously with multi channel.""" - # [START speech_transcribe_multichannel] + # [START speech_transcribe_multichannel_beta] from google.cloud import speech_v1p1beta1 as speech client = speech.SpeechClient() @@ -204,7 +204,7 @@ def transcribe_file_with_multichannel(): print('First alternative of result {}'.format(i)) print(u'Transcript: {}'.format(alternative.transcript)) print(u'Channel Tag: {}'.format(result.channel_tag)) - # [END speech_transcribe_multichannel] + # [END speech_transcribe_multichannel_beta] def transcribe_file_with_multilanguage(): From 093b1d4041e489c6da4dad8781d11986df861e58 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Fri, 17 Aug 2018 10:16:19 -0700 Subject: [PATCH 09/13] updates multilanguage tags to beta --- speech/cloud-client/beta_snippets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/cloud-client/beta_snippets.py b/speech/cloud-client/beta_snippets.py index 3f478f296949..51bd0d16949b 100644 --- a/speech/cloud-client/beta_snippets.py +++ b/speech/cloud-client/beta_snippets.py @@ -210,7 +210,7 @@ def transcribe_file_with_multichannel(): def transcribe_file_with_multilanguage(): """Transcribe the given audio file synchronously with multi language.""" - # [START speech_transcribe_multilanguage] + # [START speech_transcribe_multilanguage_beta] from google.cloud import speech_v1p1beta1 as speech client = speech.SpeechClient() @@ -238,7 +238,7 @@ def transcribe_file_with_multilanguage(): print('-' * 20) print('First alternative of result {}: {}'.format(i, alternative)) print(u'Transcript: {}'.format(alternative.transcript)) - # [END speech_transcribe_multilanguage] + # [END speech_transcribe_multilanguage_beta] def transcribe_file_with_word_level_confidence(): From 98efa89c621651a3cbb243fe2fde7d509b68d684 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Fri, 17 Aug 2018 12:40:28 -0700 Subject: [PATCH 10/13] update streaming region tags --- speech/cloud-client/transcribe_streaming.py | 4 ++-- speech/cloud-client/transcribe_streaming_mic.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/speech/cloud-client/transcribe_streaming.py b/speech/cloud-client/transcribe_streaming.py index 8c826fcf3981..dccdc6b65410 100644 --- a/speech/cloud-client/transcribe_streaming.py +++ b/speech/cloud-client/transcribe_streaming.py @@ -26,7 +26,7 @@ # [END import_libraries] -# [START def_transcribe_streaming] +# [START speech_transcribe_streaming] def transcribe_streaming(stream_file): """Streams transcription of the given audio file.""" from google.cloud import speech @@ -67,7 +67,7 @@ def transcribe_streaming(stream_file): print('Confidence: {}'.format(alternative.confidence)) print(u'Transcript: {}'.format(alternative.transcript)) # [END migration_streaming_response] -# [END def_transcribe_streaming] +# [END speech_transcribe_streaming] if __name__ == '__main__': diff --git a/speech/cloud-client/transcribe_streaming_mic.py b/speech/cloud-client/transcribe_streaming_mic.py index eb6f6ded3dd8..3ca7b7094124 100644 --- a/speech/cloud-client/transcribe_streaming_mic.py +++ b/speech/cloud-client/transcribe_streaming_mic.py @@ -25,7 +25,7 @@ python transcribe_streaming_mic.py """ -# [START import_libraries] +# [START speech_transcribe_streaming_mic] from __future__ import division import re @@ -36,7 +36,6 @@ from google.cloud.speech import types import pyaudio from six.moves import queue -# [END import_libraries] # Audio recording parameters RATE = 16000 @@ -106,7 +105,6 @@ def generator(self): break yield b''.join(data) -# [END audio_stream] def listen_print_loop(responses): @@ -191,3 +189,4 @@ def main(): if __name__ == '__main__': main() +# [END speech_transcribe_streaming_mic] From efbc4fefb8943efabae881f4ab676183045c147f Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Fri, 17 Aug 2018 13:27:43 -0700 Subject: [PATCH 11/13] updates async local tags and fixes beta tags --- speech/cloud-client/transcribe_async.py | 4 ++-- speech/cloud-client/transcribe_model_selection.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/speech/cloud-client/transcribe_async.py b/speech/cloud-client/transcribe_async.py index 89ad1861ca68..d37748de4044 100644 --- a/speech/cloud-client/transcribe_async.py +++ b/speech/cloud-client/transcribe_async.py @@ -26,7 +26,7 @@ import io -# [START def_transcribe_file] +# [START speech_transcribe_async] def transcribe_file(speech_file): """Transcribe the given audio file asynchronously.""" from google.cloud import speech @@ -58,7 +58,7 @@ def transcribe_file(speech_file): print(u'Transcript: {}'.format(result.alternatives[0].transcript)) print('Confidence: {}'.format(result.alternatives[0].confidence)) # [END migration_async_response] -# [END def_transcribe_file] +# [END speech_transcribe_async] # [START speech_transcribe_async_gcs] diff --git a/speech/cloud-client/transcribe_model_selection.py b/speech/cloud-client/transcribe_model_selection.py index bc86bcad782e..ccac314bc3eb 100644 --- a/speech/cloud-client/transcribe_model_selection.py +++ b/speech/cloud-client/transcribe_model_selection.py @@ -27,7 +27,7 @@ import argparse -# [START speech_transcribe_model_selection] +# [START speech_transcribe_model_selection_beta] def transcribe_model_selection(speech_file, model): """Transcribe the given audio file synchronously with the selected model.""" @@ -52,10 +52,10 @@ def transcribe_model_selection(speech_file, model): print('-' * 20) print('First alternative of result {}'.format(i)) print(u'Transcript: {}'.format(alternative.transcript)) -# [END speech_transcribe_model_selection] +# [END speech_transcribe_model_selection_beta] -# [START speech_transcribe_model_selection_gcs] +# [START speech_transcribe_model_selection_gcs_beta] def transcribe_model_selection_gcs(gcs_uri, model): """Transcribe the given audio file asynchronously with the selected model.""" @@ -80,7 +80,7 @@ def transcribe_model_selection_gcs(gcs_uri, model): print('-' * 20) print('First alternative of result {}'.format(i)) print(u'Transcript: {}'.format(alternative.transcript)) -# [END speech_transcribe_model_selection_gcs] +# [END speech_transcribe_model_selection_gcs_beta] if __name__ == '__main__': From 9a9f3b895d9de90276c5752a27d98c5b4f95eb42 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Fri, 17 Aug 2018 13:42:23 -0700 Subject: [PATCH 12/13] updates tags for migration guide --- speech/cloud-client/quickstart.py | 8 ++++---- speech/cloud-client/transcribe.py | 18 ++++++++---------- speech/cloud-client/transcribe_async.py | 8 ++++---- speech/cloud-client/transcribe_streaming.py | 10 ++++------ 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/speech/cloud-client/quickstart.py b/speech/cloud-client/quickstart.py index db93b3fc4d57..f90f52fb04b3 100644 --- a/speech/cloud-client/quickstart.py +++ b/speech/cloud-client/quickstart.py @@ -21,16 +21,16 @@ def run_quickstart(): import os # Imports the Google Cloud client library - # [START migration_import] + # [START speech_python_migration_imports] from google.cloud import speech from google.cloud.speech import enums from google.cloud.speech import types - # [END migration_import] + # [END speech_python_migration_imports] # Instantiates a client - # [START migration_client] + # [START speech_python_migration_client] client = speech.SpeechClient() - # [END migration_client] + # [END speech_python_migration_client] # The name of the audio file to transcribe file_name = os.path.join( diff --git a/speech/cloud-client/transcribe.py b/speech/cloud-client/transcribe.py index 8320cb6bdf9b..26b61d69f1c2 100644 --- a/speech/cloud-client/transcribe.py +++ b/speech/cloud-client/transcribe.py @@ -22,10 +22,8 @@ python transcribe.py gs://cloud-samples-tests/speech/brooklyn.flac """ -# [START import_libraries] import argparse import io -# [END import_libraries] # [START speech_transcribe_sync] @@ -36,8 +34,8 @@ def transcribe_file(speech_file): from google.cloud.speech import types client = speech.SpeechClient() - # [START migration_sync_request] - # [START migration_audio_config_file] + # [START speech_python_migration_sync_request] + # [START speech_python_migration_config] with io.open(speech_file, 'rb') as audio_file: content = audio_file.read() @@ -46,17 +44,17 @@ def transcribe_file(speech_file): encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16, sample_rate_hertz=16000, language_code='en-US') - # [END migration_audio_config_file] + # [END speech_python_migration_config] - # [START migration_sync_response] + # [START speech_python_migration_sync_response] response = client.recognize(config, audio) - # [END migration_sync_request] + # [END speech_python_migration_sync_request] # Each result is for a consecutive portion of the audio. Iterate through # them to get the transcripts for the entire audio file. for result in response.results: # The first alternative is the most likely one for this portion. print(u'Transcript: {}'.format(result.alternatives[0].transcript)) - # [END migration_sync_response] + # [END speech_python_migration_sync_response] # [END speech_transcribe_sync] @@ -68,13 +66,13 @@ def transcribe_gcs(gcs_uri): from google.cloud.speech import types client = speech.SpeechClient() - # [START migration_audio_config_gcs] + # [START speech_python_migration_config_gcs] audio = types.RecognitionAudio(uri=gcs_uri) config = types.RecognitionConfig( encoding=enums.RecognitionConfig.AudioEncoding.FLAC, sample_rate_hertz=16000, language_code='en-US') - # [END migration_audio_config_gcs] + # [END speech_python_migration_config_gcs] response = client.recognize(config, audio) # Each result is for a consecutive portion of the audio. Iterate through diff --git a/speech/cloud-client/transcribe_async.py b/speech/cloud-client/transcribe_async.py index d37748de4044..0f9f5b2dc606 100644 --- a/speech/cloud-client/transcribe_async.py +++ b/speech/cloud-client/transcribe_async.py @@ -34,7 +34,7 @@ def transcribe_file(speech_file): from google.cloud.speech import types client = speech.SpeechClient() - # [START migration_async_request] + # [START speech_python_migration_async_request] with io.open(speech_file, 'rb') as audio_file: content = audio_file.read() @@ -44,9 +44,9 @@ def transcribe_file(speech_file): sample_rate_hertz=16000, language_code='en-US') - # [START migration_async_response] + # [START speech_python_migration_async_response] operation = client.long_running_recognize(config, audio) - # [END migration_async_request] + # [END speech_python_migration_async_request] print('Waiting for operation to complete...') response = operation.result(timeout=90) @@ -57,7 +57,7 @@ def transcribe_file(speech_file): # The first alternative is the most likely one for this portion. print(u'Transcript: {}'.format(result.alternatives[0].transcript)) print('Confidence: {}'.format(result.alternatives[0].confidence)) - # [END migration_async_response] + # [END speech_python_migration_async_response] # [END speech_transcribe_async] diff --git a/speech/cloud-client/transcribe_streaming.py b/speech/cloud-client/transcribe_streaming.py index dccdc6b65410..76829f5ba5a0 100644 --- a/speech/cloud-client/transcribe_streaming.py +++ b/speech/cloud-client/transcribe_streaming.py @@ -20,10 +20,8 @@ python transcribe_streaming.py resources/audio.raw """ -# [START import_libraries] import argparse import io -# [END import_libraries] # [START speech_transcribe_streaming] @@ -34,7 +32,7 @@ def transcribe_streaming(stream_file): from google.cloud.speech import types client = speech.SpeechClient() - # [START migration_streaming_request] + # [START speech_python_migration_streaming_request] with io.open(stream_file, 'rb') as audio_file: content = audio_file.read() @@ -50,9 +48,9 @@ def transcribe_streaming(stream_file): streaming_config = types.StreamingRecognitionConfig(config=config) # streaming_recognize returns a generator. - # [START migration_streaming_response] + # [START speech_python_migration_streaming_response] responses = client.streaming_recognize(streaming_config, requests) - # [END migration_streaming_request] + # [END speech_python_migration_streaming_request] for response in responses: # Once the transcription has settled, the first result will contain the @@ -66,7 +64,7 @@ def transcribe_streaming(stream_file): for alternative in alternatives: print('Confidence: {}'.format(alternative.confidence)) print(u'Transcript: {}'.format(alternative.transcript)) - # [END migration_streaming_response] + # [END speech_python_migration_streaming_response] # [END speech_transcribe_streaming] From 15b6dfe762c87b3657710a17b850a9182c1fbb81 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Tue, 21 Aug 2018 14:29:14 -0400 Subject: [PATCH 13/13] updates word time offsets region tag --- speech/cloud-client/transcribe_word_time_offsets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speech/cloud-client/transcribe_word_time_offsets.py b/speech/cloud-client/transcribe_word_time_offsets.py index d5f8a23b5df3..43ddf38c9aae 100644 --- a/speech/cloud-client/transcribe_word_time_offsets.py +++ b/speech/cloud-client/transcribe_word_time_offsets.py @@ -60,7 +60,7 @@ def transcribe_file_with_word_time_offsets(speech_file): end_time.seconds + end_time.nanos * 1e-9)) -# [START speech_transcribe_async_time_offsets_gcs] +# [START speech_transcribe_async_word_time_offsets_gcs] def transcribe_gcs_with_word_time_offsets(gcs_uri): """Transcribe the given audio file asynchronously and output the word time offsets.""" @@ -94,7 +94,7 @@ def transcribe_gcs_with_word_time_offsets(gcs_uri): word, start_time.seconds + start_time.nanos * 1e-9, end_time.seconds + end_time.nanos * 1e-9)) -# [END speech_transcribe_async_time_offsets_gcs] +# [END speech_transcribe_async_word_time_offsets_gcs] if __name__ == '__main__':