This page describes how to use Speech-to-Text to automatically detect profane words in your audio data and censor them in the transcript.
You can enable the profanity filter by setting profanityFilter
=true
in
the RecognitionFeatures
.
If enabled, Speech-to-Text will attempt to detect profane words and return
only the first letter followed by asterisks in the transcript (for example,
f***). If this field is set to false
or not set, Speech-to-Text will
not attempt to filter profanities.
The following sample demonstrates how to enable the profanity filter to recognize audio stored in a Cloud Storage bucket.
Python
To learn how to install and use the client library for Speech-to-Text, see Speech-to-Text client libraries. For more information, see the Speech-to-Text Python API reference documentation.
To authenticate to Speech-to-Text, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.