File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed
Filter options
Expand file tree Collapse file tree 5 files changed +9
-9
lines changed
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def transcribe_file(speech_file):
55
55
# them to get the transcripts for the entire audio file.
56
56
for result in response .results :
57
57
# The first alternative is the most likely one for this portion.
58
- print ('Transcript: {}' .format (result .alternatives [0 ].transcript ))
58
+ print (u 'Transcript: {}' .format (result .alternatives [0 ].transcript ))
59
59
# [END migration_sync_response]
60
60
# [END def_transcribe_file]
61
61
@@ -81,7 +81,7 @@ def transcribe_gcs(gcs_uri):
81
81
# them to get the transcripts for the entire audio file.
82
82
for result in response .results :
83
83
# The first alternative is the most likely one for this portion.
84
- print ('Transcript: {}' .format (result .alternatives [0 ].transcript ))
84
+ print (u 'Transcript: {}' .format (result .alternatives [0 ].transcript ))
85
85
# [END def_transcribe_gcs]
86
86
87
87
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def transcribe_file(speech_file):
55
55
# them to get the transcripts for the entire audio file.
56
56
for result in response .results :
57
57
# The first alternative is the most likely one for this portion.
58
- print ('Transcript: {}' .format (result .alternatives [0 ].transcript ))
58
+ print (u 'Transcript: {}' .format (result .alternatives [0 ].transcript ))
59
59
print ('Confidence: {}' .format (result .alternatives [0 ].confidence ))
60
60
# [END migration_async_response]
61
61
# [END def_transcribe_file]
@@ -84,7 +84,7 @@ def transcribe_gcs(gcs_uri):
84
84
# them to get the transcripts for the entire audio file.
85
85
for result in response .results :
86
86
# The first alternative is the most likely one for this portion.
87
- print ('Transcript: {}' .format (result .alternatives [0 ].transcript ))
87
+ print (u 'Transcript: {}' .format (result .alternatives [0 ].transcript ))
88
88
print ('Confidence: {}' .format (result .alternatives [0 ].confidence ))
89
89
# [END def_transcribe_gcs]
90
90
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def transcribe_model_selection(speech_file, model):
51
51
alternative = result .alternatives [0 ]
52
52
print ('-' * 20 )
53
53
print ('First alternative of result {}' .format (i ))
54
- print ('Transcript: {}' .format (alternative .transcript ))
54
+ print (u 'Transcript: {}' .format (alternative .transcript ))
55
55
# [END speech_transcribe_model_selection]
56
56
57
57
@@ -79,7 +79,7 @@ def transcribe_model_selection_gcs(gcs_uri, model):
79
79
alternative = result .alternatives [0 ]
80
80
print ('-' * 20 )
81
81
print ('First alternative of result {}' .format (i ))
82
- print ('Transcript: {}' .format (alternative .transcript ))
82
+ print (u 'Transcript: {}' .format (alternative .transcript ))
83
83
# [END speech_transcribe_model_selection_gcs]
84
84
85
85
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def transcribe_streaming(stream_file):
65
65
# The alternatives are ordered from most likely to least.
66
66
for alternative in alternatives :
67
67
print ('Confidence: {}' .format (alternative .confidence ))
68
- print ('Transcript: {}' .format (alternative .transcript ))
68
+ print (u 'Transcript: {}' .format (alternative .transcript ))
69
69
# [END migration_streaming_response]
70
70
# [END def_transcribe_streaming]
71
71
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def transcribe_file_with_word_time_offsets(speech_file):
48
48
49
49
for result in response .results :
50
50
alternative = result .alternatives [0 ]
51
- print ('Transcript: {}' .format (alternative .transcript ))
51
+ print (u 'Transcript: {}' .format (alternative .transcript ))
52
52
53
53
for word_info in alternative .words :
54
54
word = word_info .word
@@ -83,7 +83,7 @@ def transcribe_gcs_with_word_time_offsets(gcs_uri):
83
83
84
84
for result in result .results :
85
85
alternative = result .alternatives [0 ]
86
- print ('Transcript: {}' .format (alternative .transcript ))
86
+ print (u 'Transcript: {}' .format (alternative .transcript ))
87
87
print ('Confidence: {}' .format (alternative .confidence ))
88
88
89
89
for word_info in alternative .words :
You can’t perform that action at this time.
0 commit comments