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.

I kept that post high level, so I wanted to follow up with a tutorial on how you can use the code I wrote on your own audio. The examples below are in Python, but it runs over an HTTP API, so you could do these from Javascript, R — Microsoft Excel if you’ve got that axe to grind… (reach out if you need help)

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?

Let’s go!

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

I wrapped all the code you need in a package called audio-analytics (link to repo). Here’s how you can spin up your own instance to run it in a private workspace.

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.