we've encountered a strange watson API behaviour.
We're using Watson's speech-to-text to transcribe audio files and recently have upgraded to newer version of python sdk. Now, for one particular file (49 min, 45 MB wave file), Watson API keeps responding with status code 408 and message Session timed out.
It happens mostly on our staging server and works fine most of the times in our local environment (we were able to reproduce it only once for multiple attempts). Our logic assumes that new session is created before each request.
We've checked API documentation, but couldn't find any solution. We're using python 3.5 along with watson-developer-cloud==0.26.0.
Do you have any idea how to solve that problem?
Edit: Code that's responsible for the request
speech_to_text = SpeechToTextV1(
username=WATSON_USER,
password=WATSON_PASSWORD
)
with open(path, 'rb') as audio_file:
return speech_to_text.recognize(
audio_file,
content_type=kwargs.get('content_type'),
timestamps=kwargs.get('timestamps'),
inactivity_timeout=kwargs.get('inactivity_timeout'),
word_alternatives_threshold=kwargs.get('word_alternatives_threshold'),
word_confidence=kwargs.get('word_confidence'),
model=kwargs.get('model'),
profanity_filter=kwargs.get('profanity_filter'),
smart_formatting=kwargs.get('smart_formatting'),
speaker_labels=kwargs.get('speaker_labels'),
)
Parameters that we're sending
content_type = "wav"
timestamps = True
inactivity_timeout = -1
word_alternatives = 0.99
word_confidence = True
profanity_filter = False
smart_formatting = True
speaker_labels = True
model = en-US_NarrowbandModel