Introduction to OpenAI’s Whisper for Podcasters
Recently, I delved into the potential of Whisper, an advanced transcription tool from OpenAI that aims to assist content creators, especially podcasters, in maximizing their online presence. The goal was to develop an automated assistant capable of transcribing, summarizing, and preparing posts for social media. The results obtained are noteworthy and promising.
Functionality of the AI Assistant
This assistant uses Whisper technology to accurately transcription podcasts. It then applies OpenAI’s GPT model to summarize the transcription, creating an informative and appealing post for social networks. This means an opportunity to transform audio content into publications for platforms like Instagram and Twitter.
Practical Application: Pilot Episode
To validate the tool’s effectiveness, I tested it with our (Thais Lancman and I) pilot episode.
The assistant transformed the podcast into a clear and appealing post, exemplified below:
🎙️📚 Novo episódio no ar! Descubra os segredos do caderninho cheio de desenhos e recados que encontramos. 🖌️📝✨No episódio de hoje, vamos explorar um caderninho cheio de mistérios! Encontramos desenhos incríveis de corvos e raposas, juntamente com anotações e listas. Venha desvendar conosco as histórias por trás desses rascunhos e descobrir como eles se relacionam com nossas características principais. 🤔✨Se você é apaixonado por tecnologia e adora conteúdos relacionados à computação, esse episódio é perfeito para você! Não perca tempo e mergulhe nessa aventura com a gente. 🎧💻🔥 Clique no link da bio para ouvir agora mesmo! Não deixe de compartilhar com seus amigos apaixonados por tecnologia. podcast #tecnologia1
Advantages for Podcast Creators
This method saves time and directly connects the audio content to the social media audience. It allows maintaining a solid and consistent online presence, reducing the effort required to create written content.
Code Availability
The code to implement the assistant is available for reference and use. It combines Python with OpenAI APIs, making it accessible even to those with basic programming knowledge.
Step-by-Step Guide Based on the Provided Code
Import Necessary Libraries
import openai
from openai import OpenAI
from dotenv import load_dotenv
import os
Function to Transcribe Audio with Whisper
def openai_whisper_transcrever(caminho_audio, nome_arquivo, modelo_whisper, cliente):
print(f"Transcribing the file {nome_arquivo}")
audio = open(caminho_audio, "rb")
resposta = cliente.audio.transcriptions.create(
model=modelo_whisper,
file=audio
)
transcricao = resposta.text
with open(f"texto_completo_{nome_arquivo}.txt", "w", encoding='utf-8') as arquivo_texto:
arquivo_texto.write(transcricao)
return transcricao
Function to Summarize Transcription Using GPT
def openai_gpt_resumir(transcricao_completa, nome_arquivo, cliente):
print(f"Summarizing the transcription of {nome_arquivo}")
# System and user prompts for summarization
prompt_sistema = """
[Your system prompt here]
"""
prompt_usuario = ". \nRewrite the above transcription to be posted as a social media post. It should summarize the text for a social media call. Include hashtags"
resposta = cliente.chat.completions.create(
model="gpt-3.5-turbo-16k",
messages=[
{"role": "system", "content": prompt_sistema},
{"role": "user", "content": transcricao_completa + prompt_usuario}
],
temperature=0.6,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0.25
)
resumo_transcricao = resposta.choices[0].message.content
with open(f"resumo_transcricao_{nome_arquivo}.txt", "w", encoding='utf-8') as arquivo_texto:
arquivo_texto.write(resumo_transcricao)
return resumo_transcricao
Main Function to Execute the Workflow
def main():
load_dotenv()
cliente = OpenAI(api_key=os.getenv("API_KEY_OPENAI"))
caminho_audio = "01-Áudio 1.wav"
nome_arquivo = "01-Áudio 1.wav"
modelo_whisper = "whisper-1"
transcrição_completa = openai_whisper_transcrever(caminho_audio, nome_arquivo, modelo_whisper, cliente)
resumo_transcricao = openai_gpt_resumir(transcrição_completa, nome_arquivo, cliente)
if __name__ == "__main__":
main()
Execution
- Set up your environment with the required API keys (
API_KEY_OPENAI). - Place your audio file in the specified path (
caminho_audio). - Run the main function to see the transcription and summarization process in action.
This code creates a streamlined process for converting podcast audio into engaging social media content, leveraging OpenAI’s advanced AI tools.
Conclusion
This tool represents a significant advancement for podcasters looking to expand their reach and engage their audience on social networks more effectively. The implementation is simple, and the benefits are numerous.
Stay Informed
We will continue to share tips and innovative tools in the technology field. We invite everyone who uses this tool to share their experiences and feedback.
- Translation: ““New episode available! We explored a notebook full of mysteries, drawings, and notes, revealing fascinating secrets. Discover how these elements connect with the main characters of the story. If you are passionate about technology and digital content, this episode is especially for you. Access it through the link in the bio and share it with technology enthusiasts. #podcast #technology” ↩︎


Deixe um comentário