Audio content moderation is essential for maintaining platform safety, user trust, and regulatory compliance. This guide demonstrates how to implement real-time AI audio moderation using Sieve's powerful transcription and content moderation APIs. Learn how to automatically detect and filter harmful content including hate speech, profanity, adult content, harassment, and more.
Modern platforms face growing challenges with user-generated audio content:
Our solution helps detect multiple types of harmful content:
Let's build a practical audio moderation system using Sieve's APIs. Our approach combines audio transcription with text-based content moderation.
First, sign up and get your API key. Then install the Python client and log in:
pip install sievedata
sieve login
Here's how to implement audio moderation in Python as a pipeline that uses Sieve's pre-built transcription and content moderation functions:
import sieve
# Step 1: Transcribe the audio
file = sieve.File("path/audio.mp3")
backend = "groq-whisper-large-v3"
word_level_timestamps = False
transcribe = sieve.function.get("sieve/transcribe")
output = transcribe.run(file, backend,
word_level_timestamps,segmentation_backend = "none")
text = list(output)[0]
# Step 2: Moderate the transcription
text_list = [seg['text'] for seg in text["segments"]] # Get list of text
text_moderation = sieve.function.get("sieve/text-moderation")
moderation_output = text_moderation.run(text_list,filters="all")
# Tabulate sentences with explicit-content
from tabulate import tabulate
results = [
{
"Text Segment": text,
"Moderation Result": moderation_output[i]['classes'][0]['class'],
"Severity Score": moderation_output[i]['classes'][0]['score']
}
for i, text in enumerate(text_list) if moderation_output[i]['classes']
]
# Print results in a table format
print(tabulate(results, headers="keys", tablefmt="grid"))
Refer to the README of the sieve/text-moderation
function for customization options and additional features.
Implementing robust audio moderation is crucial for maintaining platform safety and user trust. With Sieve's AI-powered solution, you can easily build a scalable content moderation system that protects your users and platform. Start building safer audio experiences today.
Need help implementing audio moderation? Join our Discord community or contact us at contact@sievedata.com.