Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtorry authored and busunkim96 committed Sep 3, 2020
1 parent 8e49fe8 commit 22788d5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-speech/samples/snippets/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def transcribe_file(speech_file):
# 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('Transcript: {}'.format(result.alternatives[0].transcript))
print(u'Transcript: {}'.format(result.alternatives[0].transcript))
# [END migration_sync_response]
# [END def_transcribe_file]

Expand All @@ -81,7 +81,7 @@ def transcribe_gcs(gcs_uri):
# 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('Transcript: {}'.format(result.alternatives[0].transcript))
print(u'Transcript: {}'.format(result.alternatives[0].transcript))
# [END def_transcribe_gcs]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def transcribe_file(speech_file):
# 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('Transcript: {}'.format(result.alternatives[0].transcript))
print(u'Transcript: {}'.format(result.alternatives[0].transcript))
print('Confidence: {}'.format(result.alternatives[0].confidence))
# [END migration_async_response]
# [END def_transcribe_file]
Expand Down Expand Up @@ -84,7 +84,7 @@ def transcribe_gcs(gcs_uri):
# 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('Transcript: {}'.format(result.alternatives[0].transcript))
print(u'Transcript: {}'.format(result.alternatives[0].transcript))
print('Confidence: {}'.format(result.alternatives[0].confidence))
# [END def_transcribe_gcs]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def transcribe_model_selection(speech_file, model):
alternative = result.alternatives[0]
print('-' * 20)
print('First alternative of result {}'.format(i))
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))
# [END speech_transcribe_model_selection]


Expand Down Expand Up @@ -79,7 +79,7 @@ def transcribe_model_selection_gcs(gcs_uri, model):
alternative = result.alternatives[0]
print('-' * 20)
print('First alternative of result {}'.format(i))
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))
# [END speech_transcribe_model_selection_gcs]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def transcribe_streaming(stream_file):
# The alternatives are ordered from most likely to least.
for alternative in alternatives:
print('Confidence: {}'.format(alternative.confidence))
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))
# [END migration_streaming_response]
# [END def_transcribe_streaming]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def transcribe_file_with_word_time_offsets(speech_file):

for result in response.results:
alternative = result.alternatives[0]
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))

for word_info in alternative.words:
word = word_info.word
Expand Down Expand Up @@ -83,7 +83,7 @@ def transcribe_gcs_with_word_time_offsets(gcs_uri):

for result in result.results:
alternative = result.alternatives[0]
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))
print('Confidence: {}'.format(alternative.confidence))

for word_info in alternative.words:
Expand Down

0 comments on commit 22788d5

Please sign in to comment.