start_call_analytics_stream_transcription
async
¶
start_call_analytics_stream_transcription(
media_sample_rate_hertz: MediaSampleRateHertz,
media_encoding: MediaEncoding,
audio_stream: AsyncIterator[_AudioStream] | _AudioStream,
*,
config_overrides: Optional[AsyncTranscribeStreamingClientConfig] = None,
language_code: Optional[CallAnalyticsLanguageCode] = None,
vocabulary_name: Optional[VocabularyName] = None,
session_id: Optional[SessionId] = None,
vocabulary_filter_name: Optional[VocabularyFilterName] = None,
vocabulary_filter_method: Optional[VocabularyFilterMethod] = None,
language_model_name: Optional[ModelName] = None,
identify_language: Optional[Boolean] = None,
language_options: Optional[LanguageOptions] = None,
preferred_language: Optional[CallAnalyticsLanguageCode] = None,
vocabulary_names: Optional[VocabularyNames] = None,
vocabulary_filter_names: Optional[VocabularyFilterNames] = None,
enable_partial_results_stabilization: Optional[Boolean] = None,
partial_results_stability: Optional[PartialResultsStability] = None,
content_identification_type: Optional[ContentIdentificationType] = None,
content_redaction_type: Optional[ContentRedactionType] = None,
pii_entity_types: Optional[PiiEntityTypes] = None,
) -> AsyncGenerator[StartCallAnalyticsStreamTranscriptionResponse]
Starts a bidirectional HTTP/2 or WebSocket stream where audio is streamed to Amazon Transcribe and the transcription results are streamed to your application. Use this operation for Call Analytics transcriptions.
The following parameters are required:
-
language-codeoridentify-language -
media-encoding -
sample-rate
For more information on streaming with Amazon Transcribe, see Transcribing streaming audio.
Parameters:
-
language_code(Optional[CallAnalyticsLanguageCode], default:None) –Specify the language code that represents the language spoken in your audio.
For a list of languages supported with real-time Call Analytics, refer to the Supported languages table.
-
media_sample_rate_hertz(MediaSampleRateHertz) –The sample rate of the input audio (in hertz). Low-quality audio, such as telephone audio, is typically around 8,000 Hz. High-quality audio typically ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate you specify must match that of your audio.
-
media_encoding(MediaEncoding) –Specify the encoding of your input audio. Supported formats are:
-
FLAC
-
OPUS-encoded audio in an Ogg container
-
PCM (only signed 16-bit little-endian audio formats, which does not include WAV)
For more information, see Media formats.
-
-
vocabulary_name(Optional[VocabularyName], default:None) –Specify the name of the custom vocabulary that you want to use when processing your transcription. Note that vocabulary names are case sensitive.
If the language of the specified custom vocabulary doesn't match the language identified in your media, the custom vocabulary is not applied to your transcription.
For more information, see Custom vocabularies.
-
session_id(Optional[SessionId], default:None) –Specify a name for your Call Analytics transcription session. If you don't include this parameter in your request, Amazon Transcribe generates an ID and returns it in the response.
-
audio_stream(AsyncIterator[_AudioStream] | _AudioStream) –An encoded stream of audio blobs. Audio streams are encoded as either HTTP/2 or WebSocket data frames.
For more information, see Transcribing streaming audio.
-
vocabulary_filter_name(Optional[VocabularyFilterName], default:None) –Specify the name of the custom vocabulary filter that you want to use when processing your transcription. Note that vocabulary filter names are case sensitive.
If the language of the specified custom vocabulary filter doesn't match the language identified in your media, the vocabulary filter is not applied to your transcription.
For more information, see Using vocabulary filtering with unwanted words.
-
vocabulary_filter_method(Optional[VocabularyFilterMethod], default:None) –Specify how you want your vocabulary filter applied to your transcript.
To replace words with
***, choosemask.To delete words, choose
remove.To flag words without changing them, choose
tag. -
language_model_name(Optional[ModelName], default:None) –Specify the name of the custom language model that you want to use when processing your transcription. Note that language model names are case sensitive.
The language of the specified language model must match the language code you specify in your transcription request. If the languages don't match, the custom language model isn't applied. There are no errors or warnings associated with a language mismatch.
For more information, see Custom language models.
-
identify_language(Optional[Boolean], default:None) –Enables automatic language identification for your Call Analytics transcription.
If you include
IdentifyLanguage, you must include a list of language codes, usingLanguageOptions, that you think may be present in your audio stream. You must provide a minimum of two language selections.You can also include a preferred language using
PreferredLanguage. Adding a preferred language can help Amazon Transcribe identify the language faster than if you omit this parameter.Note that you must include either
LanguageCodeorIdentifyLanguagein your request. If you include both parameters, your transcription job fails. -
language_options(Optional[LanguageOptions], default:None) –Specify two or more language codes that represent the languages you think may be present in your media.
Including language options can improve the accuracy of language identification.
If you include
LanguageOptionsin your request, you must also includeIdentifyLanguage.For a list of languages supported with Call Analytics streaming, refer to the Supported languages table.
You can only include one language dialect per language per stream. For example, you cannot include
en-USanden-AUin the same request. -
preferred_language(Optional[CallAnalyticsLanguageCode], default:None) –Specify a preferred language from the subset of languages codes you specified in
LanguageOptions.You can only use this parameter if you've included
IdentifyLanguageandLanguageOptionsin your request. -
vocabulary_names(Optional[VocabularyNames], default:None) –Specify the names of the custom vocabularies that you want to use when processing your Call Analytics transcription. Note that vocabulary names are case sensitive.
If the custom vocabulary's language doesn't match the identified media language, it won't be applied to the transcription.
This parameter is only intended for use with the
IdentifyLanguageparameter. If you're not includingIdentifyLanguagein your request and want to use a custom vocabulary with your transcription, use theVocabularyNameparameter instead.For more information, see Custom vocabularies.
-
vocabulary_filter_names(Optional[VocabularyFilterNames], default:None) –Specify the names of the custom vocabulary filters that you want to use when processing your Call Analytics transcription. Note that vocabulary filter names are case sensitive.
These filters serve to customize the transcript output.
This parameter is only intended for use with the
IdentifyLanguageparameter. If you're not includingIdentifyLanguagein your request and want to use a custom vocabulary filter with your transcription, use theVocabularyFilterNameparameter instead.For more information, see Using vocabulary filtering with unwanted words.
-
enable_partial_results_stabilization(Optional[Boolean], default:None) –Enables partial result stabilization for your transcription. Partial result stabilization can reduce latency in your output, but may impact accuracy. For more information, see Partial-result stabilization.
-
partial_results_stability(Optional[PartialResultsStability], default:None) –Specify the level of stability to use when you enable partial results stabilization (
EnablePartialResultsStabilization).Low stability provides the highest accuracy. High stability transcribes faster, but with slightly lower accuracy.
For more information, see Partial-result stabilization.
-
content_identification_type(Optional[ContentIdentificationType], default:None) –Labels all personally identifiable information (PII) identified in your transcript.
Content identification is performed at the segment level; PII specified in
PiiEntityTypesis flagged upon complete transcription of an audio segment. If you don't includePiiEntityTypesin your request, all PII is identified.You can’t set
ContentIdentificationTypeandContentRedactionTypein the same request. If you set both, your request returns aBadRequestException.For more information, see Redacting or identifying personally identifiable information.
-
content_redaction_type(Optional[ContentRedactionType], default:None) –Redacts all personally identifiable information (PII) identified in your transcript.
Content redaction is performed at the segment level; PII specified in
PiiEntityTypesis redacted upon complete transcription of an audio segment. If you don't includePiiEntityTypesin your request, all PII is redacted.You can’t set
ContentRedactionTypeandContentIdentificationTypein the same request. If you set both, your request returns aBadRequestException.For more information, see Redacting or identifying personally identifiable information.
-
pii_entity_types(Optional[PiiEntityTypes], default:None) –Specify which types of personally identifiable information (PII) you want to redact in your transcript. You can include as many types as you'd like, or you can select
ALL.Values must be comma-separated and can include:
ADDRESS,BANK_ACCOUNT_NUMBER,BANK_ROUTING,CREDIT_DEBIT_CVV,CREDIT_DEBIT_EXPIRY,CREDIT_DEBIT_NUMBER,EMAIL,NAME,PHONE,PIN,SSN, orALL.Note that if you include
PiiEntityTypesin your request, you must also includeContentIdentificationTypeorContentRedactionType.If you include
ContentRedactionTypeorContentIdentificationTypein your request, but do not includePiiEntityTypes, all PII is redacted or identified.
Raises:
-
BadRequestException–One or more arguments to the
StartStreamTranscription,StartMedicalStreamTranscription, orStartCallAnalyticsStreamTranscriptionoperation was not valid. For example,MediaEncodingorLanguageCodeused unsupported values. Check the specified parameters and try your request again. -
ConflictException–A new stream started with the same session ID. The current stream has been terminated.
-
InternalFailureException–A problem occurred while processing the audio. Amazon Transcribe terminated processing.
-
LimitExceededException–Your client has exceeded one of the Amazon Transcribe limits, typically the concurrent stream service quota. This error can also occur if a stream exceeds the maximum session duration. In rare cases, this error can also occur if you increase your number of concurrent streams too quickly. Reduce your number of concurrent streams and try your request again using an exponential backoff strategy.
-
ServiceUnavailableException–The service is currently unavailable. Try your request later.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_transcribe_streaming/_services/async_transcribe_streaming.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | |