├── requirements.txt ├── Samples ├── Inputs │ ├── Design_Meet_Trans.docx │ └── SalesTeam_Call_Trans.txt └── Summary │ ├── SalesTeam_Call_Trans_Summary.txt │ └── Design_Meet_Trans_Summary.txt ├── .env.example ├── .gitingore ├── LICENSE ├── README.md └── MeetSummAIzer.py /requirements.txt: -------------------------------------------------------------------------------- 1 | python-dotenv==1.0.0 2 | openai==1.12.0 3 | python-docx==0.8.11 -------------------------------------------------------------------------------- /Samples/Inputs/Design_Meet_Trans.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/navindevan/MeetSummAIzer-AzureOpenAI/HEAD/Samples/Inputs/Design_Meet_Trans.docx -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | AZ_OPENAI_API_KEY=your_api_key 2 | AZ_OPENAI_ENDPOINT=your_endpoint 3 | AZ_OPENAI_DEPLOYMENT_NAME=your_deployment_name 4 | FILE_PATH=path_to_your_transcript_file -------------------------------------------------------------------------------- /Samples/Summary/SalesTeam_Call_Trans_Summary.txt: -------------------------------------------------------------------------------- 1 | The sales team discussed improving their outreach strategy. Priya suggested focusing on LinkedIn campaigns, and Ram will prepare a report on last quarter's performance. -------------------------------------------------------------------------------- /Samples/Inputs/SalesTeam_Call_Trans.txt: -------------------------------------------------------------------------------- 1 | Sales Team Call 2 | Date: 2023-10-02 3 | 4 | Naveen: We need to improve our outreach strategy. 5 | Priya: Let's focus on LinkedIn campaigns. 6 | Ram: I'll prepare a report on last quarter's performance. -------------------------------------------------------------------------------- /Samples/Summary/Design_Meet_Trans_Summary.txt: -------------------------------------------------------------------------------- 1 | The team discussed the progress of the new feature. Naveen emphasized finalizing the design, and Ram suggested setting a deadline for next week. Doug will handle backend integration, while Shaukat will update the documentation. -------------------------------------------------------------------------------- /.gitingore: -------------------------------------------------------------------------------- 1 | # Python-specific ignores 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | *.so 6 | .Python 7 | build/ 8 | develop-eggs/ 9 | dist/ 10 | downloads/ 11 | eggs/ 12 | .eggs/ 13 | lib/ 14 | lib64/ 15 | parts/ 16 | sdist/ 17 | var/ 18 | wheels/ 19 | *.egg-info/ 20 | .installed.cfg 21 | *.egg 22 | MANIFEST 23 | 24 | # Virtual environment 25 | venv/ 26 | env/ 27 | .venv/ 28 | ENV/ 29 | 30 | # Environment variables 31 | .env 32 | .secrets 33 | 34 | # IDE and editor files 35 | .vscode/ 36 | .idea/ 37 | *.swp 38 | *.swo 39 | *.sublime-workspace 40 | *.sublime-project 41 | 42 | # Logs and databases 43 | *.log 44 | *.sqlite 45 | *.db 46 | 47 | # Output files 48 | responses.txt 49 | final_summary.txt 50 | 51 | # macOS specific 52 | .DS_Store 53 | 54 | # Windows specific 55 | Thumbs.db -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Naveen Kumar M 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MeetSummAIzer - AI-Powered Meeting Transcript Summarizer 2 | **MeetSummAIzer** is an AI-powered tool designed to simplify the process of summarizing office meeting transcripts. Whether your transcripts are from Microsoft Teams, Skype, or any other platform, MeetSummAIzer can process .docx and .txt files, chunk them into manageable pieces, and generate concise, comprehensive summaries using Azure OpenAI. 3 | 4 | ## Key Features: 5 | - **Multi-Format Support:** Works with .docx and .txt files. 6 | - **AI-Powered Summarization:** Leverages Azure OpenAI for accurate and context-aware summaries. 7 | - **Efficient Chunking:** Breaks down large transcripts into smaller chunks for better processing. 8 | - **Customizable Prompts:** Use JSON-based prompts to tailor the summarization process. 9 | 10 | ## Installation 11 | 1. Clone the repository: 12 | ```bash 13 | git clone https://github.com/navindevan/MeetSummAIzer-AzureOpenAI.git 14 | 15 | 2. Install dependencies: 16 | ```bash 17 | pip install -r requirements.txt 18 | 19 | 3. Set up your .env file with the following variables: 20 | ```bash 21 | AZ_OPENAI_API_KEY=your_api_key 22 | AZ_OPENAI_ENDPOINT=your_endpoint 23 | AZ_OPENAI_DEPLOYMENT_NAME=your_deployment_name 24 | FILE_PATH=path_to_your_transcript_file 25 | 26 | ## Usage 27 | 28 | 1. Place your transcript file in the project directory. 29 | 2. Update the DOC_PATH in the .env file. 30 | 3. Run the script: 31 | ```bash 32 | python MeetSummAIzer.py 33 | 4. Check the _Summary.txt file for the generated summary. 34 | 35 | ## Sample Input and Output 36 | See the **Samples** directory for example input files and their corresponding outputs. 37 | 38 | ## License 39 | 40 | This project is licensed undet the MIT License. See the [LICENSE.md](LICENSE) file for details. 41 | -------------------------------------------------------------------------------- /MeetSummAIzer.py: -------------------------------------------------------------------------------- 1 | import os 2 | import time 3 | import logging 4 | import json 5 | from docx import Document 6 | from dotenv import load_dotenv 7 | from openai import AzureOpenAI 8 | 9 | # Load environment variables from .env file 10 | load_dotenv() 11 | 12 | # Configure logging 13 | logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') 14 | 15 | # Initialize Azure OpenAI Client 16 | def initialize_azure_openai(): 17 | try: 18 | client = AzureOpenAI( 19 | api_key=os.getenv("AZ_OPENAI_API_KEY"), 20 | api_version="2024-02-01", 21 | azure_endpoint=os.getenv("AZ_OPENAI_ENDPOINT") 22 | ) 23 | return client 24 | except Exception as e: 25 | logging.error(f"Failed to initialize Azure OpenAI client: {e}") 26 | exit(1) 27 | 28 | # Read and chunk document 29 | def read_and_chunk_document(file_path, chunk_size=15000): 30 | """ 31 | Reads a document and splits it into manageable chunks. 32 | 33 | Args: 34 | file_path (str): Path to the document file. 35 | chunk_size (int): Maximum size of each chunk. 36 | 37 | Returns: 38 | list: List of text chunks. 39 | """ 40 | try: 41 | if file_path.endswith('.docx'): 42 | doc = Document(file_path) 43 | full_text = [para.text for para in doc.paragraphs] 44 | text = "\n".join(full_text) 45 | elif file_path.endswith('.txt'): 46 | with open(file_path, 'r') as file: 47 | text = file.read() 48 | else: 49 | logging.error("Unsupported file format. Only .docx and .txt are supported.") 50 | return [] 51 | 52 | chunks = [text[i:i+chunk_size] for i in range(0, len(text), chunk_size)] 53 | return chunks 54 | except Exception as e: 55 | logging.error(f"Error reading or chunking document: {e}") 56 | return [] 57 | 58 | # Generate summaries for each chunk 59 | def summarize_chunks(chunks, client, deployment_name, prompt): 60 | """ 61 | Summarizes each chunk of text using Azure OpenAI. 62 | 63 | Args: 64 | chunks (list): List of text chunks. 65 | client (AzureOpenAI): Azure OpenAI client instance. 66 | deployment_name (str): Deployment name for the model. 67 | prompt (list): Initial prompt for summarization. 68 | 69 | Returns: 70 | list: List of summarized responses. 71 | """ 72 | summaries = [] 73 | for chunk in chunks: 74 | try: 75 | messages = prompt + [{"role": "user", "content": chunk}] 76 | response = client.chat.completions.create( 77 | model=deployment_name, 78 | messages=messages, 79 | max_tokens=4096, 80 | temperature=0.5, 81 | top_p=0.5 82 | ) 83 | if response.choices: 84 | summaries.append(response.choices[0].message.content.strip()) 85 | else: 86 | logging.warning(f"No summary generated for chunk: {chunk}") 87 | except Exception as e: 88 | logging.error(f"Error summarizing chunk: {e}") 89 | return summaries 90 | 91 | # Main function 92 | def main(): 93 | start_time = time.time() 94 | 95 | # Load environment variables 96 | api_key = os.getenv("AZ_OPENAI_API_KEY") 97 | endpoint = os.getenv("AZ_OPENAI_ENDPOINT") 98 | deployment_name = os.getenv("AZ_OPENAI_DEPLOYMENT_NAME") 99 | file_path = os.getenv('FILE_PATH') 100 | 101 | if not all([api_key, endpoint, deployment_name, file_path]): 102 | logging.error("Missing required environment variables.") 103 | return 104 | 105 | # Load prompts from JSON 106 | try: 107 | with open("prompts.json", "r") as file: 108 | prompts = json.load(file) 109 | except Exception as e: 110 | logging.error(f"Error loading prompts: {e}") 111 | return 112 | 113 | initial_prompt = prompts.get("initial_prompt", []) 114 | final_prompt = prompts.get("final_prompt", []) 115 | 116 | # Read and chunk the document 117 | logging.info(f"Processing document: {file_path}") 118 | chunks = read_and_chunk_document(file_path) 119 | if not chunks: 120 | logging.error("No chunks to process.") 121 | return 122 | 123 | # Initialize Azure OpenAI client 124 | client = initialize_azure_openai() 125 | 126 | # Summarize each chunk 127 | logging.info("Summarizing document chunks...") 128 | chunk_summaries = summarize_chunks(chunks, client, deployment_name, initial_prompt) 129 | 130 | # Combine summaries and generate final summary 131 | combined_summary = "\n".join(chunk_summaries) 132 | final_summary = summarize_chunks([combined_summary], client, deployment_name, final_prompt) 133 | 134 | # Save final summary to file 135 | if final_summary: 136 | input_filename = os.path.splitext(os.path.basename(file_path))[0] # Extract filename without extension 137 | output_file = f"{input_filename}_Summary.txt" 138 | with open(output_file, "w") as file: 139 | file.write(final_summary[0]) 140 | logging.info(f"Final summary saved to {output_file}") 141 | else: 142 | logging.warning("No final summary generated.") 143 | 144 | # Log execution time 145 | end_time = time.time() 146 | logging.info(f"Execution completed in {end_time - start_time:.2f} seconds.") 147 | 148 | if __name__ == "__main__": 149 | main() --------------------------------------------------------------------------------