How to index your podcasts with language AI in Python
The other week I wrote about using Language AI to listen to 5500 hours of Joe Rogan’s podcasts. My code reads in MP3s, transcribes them, tags entities and sentiments, and then gives you a query endpoint to search the results.
In 5 minutes, you’ll have analyzed your own audio
In this post, we’ll step through a minimal example where I’ll try to answer 2 questions from one of Joe Rogan’s podcasts:
- What does Edward Snowden say about Trump, Obama, and Biden?
- What makes Edward Snowden sad?
Step 1. Connect to Steamship
We’ll be using Steamship to run our AI pipeline. So you’ll need to set up your Steamship credentials. You can log in and fetch your credentials using the CLI if it's your first time connecting to Steamship.
Step 2. Import my audio-analytics package
A Steamship package instance auto-scales, so you only have to do this once for each workspace. You can browse through the package code here, but here’s the TLDR of what I do: I use distributed Steamship services called plugins to transcribe, analyze, and index audio files.
Step 3. Upload your audio
You can upload your mp3 files by pointing to a publicly accessible URL. Any publicly accessible URL will work, including pre-signed URLs to S3 or Google Storage. If you want to upload local audio files directly to your package, you can use the helper method upload_audio_file featured here.
Step 4. Transcribe and analyze your audio
Your instance will transcribe, analyze, and index your mp3 asynchronously as soon as you’ve uploaded it. You’ll have to wait for the analysis to finish to fetch the transcription and its language AI features.