This is an example of how you can use AssemblyAI's Profanity Filter feature to automatically detect profanities and replace them in your audio file.
To try it out quickly, use this Streamlit App. You'll need an AssemblyAI API key which you can sign up for here!
- Download project files by running
git clone https://github.com/AssemblyAI/profanity-filter-demo.git
- Navigate to the project folder
- Create a new virtual environment
- Activate the new virtual environment and run
pip install -r requirements.txt
to install project dependencies - Run the application using the
streamlit run profanity_filter.py
The YouTube video from the link you submitted is downloaded and then uploaded to AssemblyAI's servers for transcription with filter_profanity
set to true
. When the transcript is complete, a regex search for all words that start with a letter followed by asterisks identifies the timestamps in the original audio with profanity. The original audio is removed and replaced with the censor of the user's choice.
- Streamlit The fastest way to build data apps in Python
- youtube_dl Command-line program to download videos from YouTube.com
- pydub Manipulate audio with an simple and easy high level interface.
If you have any questions, please feel free to reach out to our Support team - [email protected]!