Skip to content

Transcribe Stream API (Python) not having IdentifyMultipleLanguages Parameter

0

Hi there, My customer is writing a python code to call Transcibe Stream API (StartStreamTranscription) using Python. The intention was to use the auto-detect language option, which in our documentation here is controled by the parameter IdentifyMultipleLanguages. However, when running into this codelet

    stream = await client.start_stream_transcription(
        media_sample_rate_hz=SAMPLE_RATE,
        media_encoding="ogg-opus",
        identify_multiple_languages=True,
        language_options=["en-US","fr-FR","de-DE","es-ES"],
    )

Python reports an error of unexpected keyword argument 'identify_multiple_languages' .

The original code was very much similar to the sample here , and the amazon-transcribe package version is 0.6.2.

AWS
asked a year ago278 views
1 Answer
0

I apologize, but there seems to be a misunderstanding in your customer's approach. The StartStreamTranscription API for real-time streaming transcription does not support the IdentifyMultipleLanguages parameter. This parameter is actually available for batch transcription jobs, not for streaming transcription.

For the StartStreamTranscription API, you can use the IdentifyLanguage parameter to enable automatic language identification for a single language. However, if you need to identify multiple languages in a streaming scenario, that feature is not currently available through this API.

If your customer needs to transcribe audio with multiple languages in real-time, they might need to consider alternative approaches. One option could be to use the IdentifyLanguage parameter with LanguageOptions to specify the potential languages that might be present in the audio stream. This won't identify multiple languages simultaneously, but it will attempt to identify the predominant language from the options provided.

Here's how the corrected code might look:

stream = await client.start_stream_transcription(
    media_sample_rate_hz=SAMPLE_RATE,
    media_encoding="ogg-opus",
    identify_language=True,
    language_options=["en-US","fr-FR","de-DE","es-ES"],
)

If identifying multiple languages in the same stream is a critical requirement, your customer might need to consider using batch transcription with the StartTranscriptionJob API instead, which does support the IdentifyMultipleLanguages parameter. However, this would not provide real-time streaming results.

It's also worth noting that the features and parameters available can sometimes vary between different versions of the SDK and the service itself. Always refer to the most up-to-date documentation for the specific version of the SDK being used.
Sources
StartStreamTranscription - Amazon Transcribe
StartCallAnalyticsStreamTranscription - Amazon Transcribe
StartTranscriptionJob - Amazon Transcribe

answered a year ago
  • Thanks for the suggestion, I think what my customer want is actually IdentifyLanguage rather than IdentifyMutipleLanguages, as you've stated. However, I also found this identify_language not supported in Python API 0.6.2 either.

  • Since it looks like you're using the latest version of the SDK, if the parameter isn't supported yet I'd suggest also raising this on their GitHub so the maintainers see it directly? https://github.com/awslabs/amazon-transcribe-streaming-sdk/issues

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.