Skip to main content

Documentation Index

Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Streaming profanity filteringFor real-time profanity filtering on streaming transcripts, see Filter profanity.


US & EU
You can automatically filter out profanity from the transcripts by setting filter_profanity to true in your transcription config. Any profanity in the returned text will be replaced with asterisks.
import assemblyai as aai

aai.settings.api_key = "<YOUR_API_KEY>"

# audio_file = "./local_file.mp3"
audio_file = "https://assembly.ai/wildfires.mp3"

config = aai.TranscriptionConfig(
    speech_models=["universal-3-pro", "universal-2"],
    language_detection=True,
    filter_profanity=True
)

transcript = aai.Transcriber(config=config).transcribe(audio_file)

if transcript.status == "error":
  raise RuntimeError(f"Transcription failed: {transcript.error}")

print(transcript.text)
Profanity filter isn’t perfect. Certain words may still be missed or improperly filtered.