├── Model parameters ├── file1 ├── Code ├── meeting_summary_generator.py └── README.md /Model parameters: -------------------------------------------------------------------------------- 1 | # Model parameters 2 | MODEL = "gpt-4-turbo" # Try gpt-3.5-turbo for faster results 3 | MAX_TOKENS = 4096 # Maximum tokens per API call 4 | TEMPERATURE = 0.3 # Lower = more deterministic 5 | 6 | # Customize summary structure 7 | SYSTEM_PROMPT = """ 8 | You are an expert meeting summarizer. Generate: 9 | - Concise meeting summary 10 | - Key decisions with owners 11 | - Action items with deadlines 12 | - Unresolved topics 13 | - Discussion highlights 14 | 15 | Format in Markdown with headings: 16 | # [Meeting Title] 17 | ## Key Decisions 18 | ## Action Items 19 | ## Unresolved Topics 20 | ## Discussion Points 21 | """ 22 | -------------------------------------------------------------------------------- /file1: -------------------------------------------------------------------------------- 1 | from transformers import pipeline 2 | import random 3 | 4 | # 1. Synthetic Meeting Data Generator 5 | def generate_synthetic_meeting(): 6 | topics = [ 7 | "project updates", "budget allocation", "marketing strategy", "client feedback", 8 | "product roadmap", "hiring decisions", "team performance", "technical challenges" 9 | ] 10 | participants = ["Alice", "Bob", "Clara", "David", "Eve", "Frank"] 11 | sentences = [] 12 | 13 | for i in range(20): # simulate 20 lines of conversation 14 | speaker = random.choice(participants) 15 | topic = random.choice(topics) 16 | sentence = f"{speaker} said we need to revisit the {topic} and make improvements based on last quarter's report." 17 | sentences.append(sentence) 18 | 19 | return " ".join(sentences) 20 | 21 | # 2. Load Summarization Model 22 | def summarize_meeting(transcript): 23 | summarizer = pipeline("summarization", model="facebook/bart-large-cnn") 24 | summary = summarizer(transcript, max_length=150, min_length=40, do_sample=False) 25 | return summary[0]['summary_text'] 26 | 27 | # 3. Driver Code 28 | if __name__ == "__main__": 29 | transcript = generate_synthetic_meeting() 30 | print("📋 Original Transcript:\n", transcript, "\n") 31 | 32 | summary = summarize_meeting(transcript) 33 | print("📝 Generated Summary:\n", summary) 34 | -------------------------------------------------------------------------------- /Code: -------------------------------------------------------------------------------- 1 | import argparse 2 | import openai 3 | from config import MODEL, SYSTEM_PROMPT, MAX_TOKENS, TEMPERATURE 4 | import tiktoken 5 | import os 6 | from dotenv import load_dotenv 7 | 8 | load_dotenv() 9 | openai.api_key = os.getenv('OPENAI_API_KEY') 10 | 11 | def count_tokens(text): 12 | encoding = tiktoken.encoding_for_model(MODEL) 13 | return len(encoding.encode(text)) 14 | 15 | def split_text(text, max_tokens=2000): 16 | paragraphs = text.split('\n\n') 17 | chunks = [] 18 | current_chunk = "" 19 | 20 | for para in paragraphs: 21 | if count_tokens(current_chunk + para) > max_tokens: 22 | chunks.append(current_chunk) 23 | current_chunk = para + "\n\n" 24 | else: 25 | current_chunk += para + "\n\n" 26 | 27 | if current_chunk: 28 | chunks.append(current_chunk) 29 | 30 | return chunks 31 | 32 | def generate_summary(transcript): 33 | chunks = split_text(transcript) 34 | summaries = [] 35 | 36 | for chunk in chunks: 37 | response = openai.ChatCompletion.create( 38 | model=MODEL, 39 | messages=[ 40 | {"role": "system", "content": SYSTEM_PROMPT}, 41 | {"role": "user", "content": f"Meeting transcript:\n{chunk}"} 42 | ], 43 | temperature=TEMPERATURE, 44 | max_tokens=MAX_TOKENS 45 | ) 46 | summaries.append(response.choices[0].message.content) 47 | 48 | return "\n\n".join(summaries) 49 | 50 | def main(): 51 | parser = argparse.ArgumentParser(description='Generate meeting summary from transcript') 52 | parser.add_argument('--input', type=str, required=True, help='Input transcript file') 53 | parser.add_argument('--output', type=str, help='Output file (Markdown format)') 54 | args = parser.parse_args() 55 | 56 | with open(args.input, 'r') as f: 57 | transcript = f.read() 58 | 59 | print("Generating summary...") 60 | summary = generate_summary(transcript) 61 | 62 | if args.output: 63 | with open(args.output, 'w') as f: 64 | f.write(summary) 65 | print(f"Summary saved to {args.output}") 66 | else: 67 | print("\n" + "="*50 + "\n") 68 | print(summary) 69 | 70 | if __name__ == "__main__": 71 | main() 72 | -------------------------------------------------------------------------------- /meeting_summary_generator.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import openai 3 | from config import MODEL, SYSTEM_PROMPT, MAX_TOKENS, TEMPERATURE 4 | import tiktoken 5 | import os 6 | from dotenv import load_dotenv 7 | 8 | load_dotenv() 9 | openai.api_key = os.getenv('OPENAI_API_KEY') 10 | 11 | def count_tokens(text): 12 | encoding = tiktoken.encoding_for_model(MODEL) 13 | return len(encoding.encode(text)) 14 | 15 | def split_text(text, max_tokens=2000): 16 | paragraphs = text.split('\n\n') 17 | chunks = [] 18 | current_chunk = "" 19 | 20 | for para in paragraphs: 21 | if count_tokens(current_chunk + para) > max_tokens: 22 | chunks.append(current_chunk) 23 | current_chunk = para + "\n\n" 24 | else: 25 | current_chunk += para + "\n\n" 26 | 27 | if current_chunk: 28 | chunks.append(current_chunk) 29 | 30 | return chunks 31 | 32 | def generate_summary(transcript): 33 | chunks = split_text(transcript) 34 | summaries = [] 35 | 36 | for chunk in chunks: 37 | response = openai.ChatCompletion.create( 38 | model=MODEL, 39 | messages=[ 40 | {"role": "system", "content": SYSTEM_PROMPT}, 41 | {"role": "user", "content": f"Meeting transcript:\n{chunk}"} 42 | ], 43 | temperature=TEMPERATURE, 44 | max_tokens=MAX_TOKENS 45 | ) 46 | summaries.append(response.choices[0].message.content) 47 | 48 | return "\n\n".join(summaries) 49 | 50 | def main(): 51 | parser = argparse.ArgumentParser(description='Generate meeting summary from transcript') 52 | parser.add_argument('--input', type=str, required=True, help='Input transcript file') 53 | parser.add_argument('--output', type=str, help='Output file (Markdown format)') 54 | args = parser.parse_args() 55 | 56 | with open(args.input, 'r') as f: 57 | transcript = f.read() 58 | 59 | print("Generating summary...") 60 | summary = generate_summary(transcript) 61 | 62 | if args.output: 63 | with open(args.output, 'w') as f: 64 | f.write(summary) 65 | print(f"Summary saved to {args.output}") 66 | else: 67 | print("\n" + "="*50 + "\n") 68 | print(summary) 69 | 70 | if __name__ == "__main__": 71 | main() 72 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Meeting Summary Generator 📝 2 | 3 | [![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://python.org) 4 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) 5 | 6 | An AI-powered tool that automatically generates structured meeting summaries from transcripts using OpenAI's GPT models. Identifies key decisions, action items, and discussion points. 7 | 8 | ![Sample Output](https://via.placeholder.com/600x300?text=Meeting+Summary+Example) 9 | 10 | ## Features ✨ 11 | 12 | - 🎤 Converts meeting transcripts into structured summaries 13 | - ✅ Extracts key decisions and action items 14 | - ⚠️ Highlights unresolved topics 15 | - 📝 Formats output in Markdown 16 | - 📁 Handles long transcripts with smart text chunking 17 | - ⚙️ Configurable summary templates 18 | - 🔐 Secure API key management 19 | 20 | ## Setup 🚀 21 | 22 | ### Prerequisites 23 | - Python 3.8+ 24 | - [OpenAI API key](https://platform.openai.com/api-keys) 25 | 26 | ### Installation 27 | ```bash 28 | # Clone repository 29 | git clone https://github.com/yourusername/meeting-summary-generator.git 30 | cd meeting-summary-generator 31 | 32 | # Create virtual environment (optional) 33 | python -m venv venv 34 | source venv/bin/activate # Linux/Mac 35 | venv\Scripts\activate # Windows 36 | 37 | # Install dependencies 38 | pip install -r requirements.txt 39 | 40 | # Set up environment variables 41 | echo "OPENAI_API_KEY='your_openai_api_key'" > .env 42 | # Weekly Team Sync - June 15, 2024 43 | 44 | ## Key Decisions 45 | - Approved new hiring budget of $50k for Q3 46 | - Adopted Agile methodology starting July 1 47 | - Decided to migrate to AWS by end of quarter 48 | 49 | ## Action Items 50 | | Task | Owner | Deadline | 51 | |-----------------------|---------|--------------| 52 | | Prepare AWS migration plan | Sarah | Jun 30 | 53 | | Schedule Agile training | Mike | Jun 25 | 54 | | Draft job descriptions | Alex | Jun 20 | 55 | 56 | ## Unresolved Topics 57 | - Final selection of project management tool 58 | - Remote work policy adjustments 59 | - Budget allocation for team building 60 | 61 | ## Discussion Points 62 | **Product Roadmap** 63 | - Prioritized mobile app development 64 | - Customer feedback on new features 65 | 66 | **Technical Updates** 67 | - API performance improved by 40% 68 | - Discussed database scaling options 69 | 70 | 71 | Author Name: Anslem Otutu 72 | Github: https://github.com/Otutu11 73 | LinkedIn: https://www.linkedin.com/in/otutu-anslem-53a687359/ 74 | 75 | 76 | --------------------------------------------------------------------------------