File size: 2,538 Bytes
7ab5858
b45ba66
 
 
 
 
 
 
 
 
 
 
 
7ab5858
 
 
 
 
 
 
b45ba66
 
 
 
 
 
7ab5858
b45ba66
7ab5858
 
 
b45ba66
 
7ab5858
b45ba66
 
7ab5858
b45ba66
7ab5858
 
 
 
b45ba66
 
 
7ab5858
 
 
 
 
 
 
b45ba66
 
 
 
 
 
7ab5858
b45ba66
 
 
 
 
 
7ab5858
b45ba66
 
 
7ab5858
b45ba66
 
 
7ab5858
 
b45ba66
7ab5858
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# analyzer.py (Meeting Analysis)
import re
from datetime import datetime, timedelta

class MeetingAnalyzer:
    def __init__(self):
        self.transcript_chunks = []
        self.action_items = []
        self.decisions = []
        
    def process_chunk(self, text_chunk):
        self.transcript_chunks.append(text_chunk)
        
        # Simple action item detection
        if "action item" in text_chunk.lower() or "todo" in text_chunk.lower():
            self.action_items.append({
                "task": text_chunk,
                "owner": "Unassigned",
                "deadline": "ASAP"
            })
    
    def generate_summary(self):
        full_text = " ".join(self.transcript_chunks)
        
        # If text is too short, skip summarization
        if len(full_text.split()) < 50:
            return "Meeting in progress... summary will appear here"
            
        # Simple summary - just the first few sentences
        sentences = full_text.split('. ')
        return ". ".join(sentences[:3]) + "."
    
    def extract_action_items(self):
        # Extract action items from transcript
        action_items = []
        
        # Look for assignment patterns
        patterns = [
            r"(\bassign\b.*? to \b(.*?)\b)",
            r"(\baction item\b: (.*?))",
            r"(\btodo\b: (.*?))",
            r"(\bplease\b (.*?))"
        ]
        
        for pattern in patterns:
            for match in re.finditer(pattern, " ".join(self.transcript_chunks), re.IGNORECASE):
                task = match.group(1).strip()
                action_items.append({
                    "task": task,
                    "owner": "Unassigned",
                    "deadline": "ASAP"
                })
        
        return action_items
    
    def detect_urgent_action_items(self):
        urgent_items = []
        for item in self.action_items:
            if "urgent" in item['task'].lower() or "asap" in item['task'].lower():
                urgent_items.append(item)
        return urgent_items
    
    def extract_decisions(self):
        decisions = []
        
        # Look for decision patterns
        patterns = [
            r"\bdecided to\b (.*?)[\.\n]",
            r"\bagreed that\b (.*?)[\.\n]",
            r"\bconsensus is\b (.*?)[\.\n]"
        ]
        
        for pattern in patterns:
            for match in re.finditer(pattern, " ".join(self.transcript_chunks), re.IGNORECASE):
                decisions.append(match.group(1).strip())
        
        return decisions