Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Python 3.5
With streaming_recognize, interim_results=True and enable_speaker_diarization=True I expect to get a WordInfo list for the top alternative for every recognition result. However, I only get a word list for the final result and not for interim results.
from google.cloud.speech_v1 import enums
from google.cloud.speech_v1 import SpeechClient
from google.cloud.speech_v1 import types
client = SpeechClient()
config = types.StreamingRecognitionConfig(
config=types.RecognitionConfig(
enable_speaker_diarization=True, ...
),
interim_results=True
)
request = types.StreamingRecognizeRequest(audio_content=b'...')
requests = [request]
for response in client.streaming_recognize(config, requests):
if response.results:
result = response.result[0]
if result.alternatives:
alternative = result.alternative[0]
if alternative.words:
print(result.is_final)
Console output is always: True
This seems to be backend related and not an issue of the Python library. (See
I'm aware of the fact that interim results may change. Still, I need to do speaker detection on the fly and can't wait for the final result to determine if there was a speaker change.