How to use AI to summarize meeting transcripts
Quick answer
Use a large language model like
gpt-4o to process meeting transcripts by sending the transcript text as input and requesting a concise summary via the chat.completions.create API. This approach extracts key points and action items efficiently from raw transcript data.PREREQUISITES
Python 3.8+OpenAI API key (free tier works)pip install openai>=1.0
Setup
Install the OpenAI Python SDK and set your API key as an environment variable to authenticate requests.
pip install openai>=1.0 Step by step
Use the gpt-4o model to summarize a meeting transcript by sending the transcript text in a user message and prompting the model to generate a concise summary.
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
transcript = '''
John: Let's start the project timeline discussion.
Mary: We need to finalize the budget by next week.
John: Agreed, and assign tasks by Friday.
Mary: I'll prepare the draft proposal.
'''
prompt = f"Summarize the following meeting transcript with key points and action items:\n\n{transcript}"
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}]
)
summary = response.choices[0].message.content
print("Meeting Summary:\n", summary) output
Meeting Summary: - Discussed project timeline. - Budget finalization due next week. - Task assignments by Friday. - Draft proposal to be prepared by Mary.
Common variations
You can use asynchronous calls for better performance or try other models like claude-3-5-sonnet-20241022 for potentially improved summarization quality. Streaming responses can also be used for real-time summary generation.
import asyncio
import os
from openai import OpenAI
async def async_summarize(transcript: str):
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
prompt = f"Summarize the following meeting transcript with key points and action items:\n\n{transcript}"
response = await client.chat.completions.acreate(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}]
)
print("Async Meeting Summary:\n", response.choices[0].message.content)
transcript = '''
John: Let's start the project timeline discussion.
Mary: We need to finalize the budget by next week.
John: Agreed, and assign tasks by Friday.
Mary: I'll prepare the draft proposal.
'''
asyncio.run(async_summarize(transcript)) output
Async Meeting Summary: - Discussed project timeline. - Budget finalization due next week. - Task assignments by Friday. - Draft proposal to be prepared by Mary.
Troubleshooting
- If the summary is too long or unfocused, add instructions to limit length or focus on action items in the prompt.
- If you get rate limit errors, reduce request frequency or upgrade your API plan.
- For very long transcripts, split them into chunks and summarize each separately before combining.
Key Takeaways
- Use
gpt-4owith clear prompts to extract concise meeting summaries. - Manage long transcripts by chunking to avoid token limits.
- Async and streaming APIs improve responsiveness for large inputs.