-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatch_process.py
More file actions
50 lines (36 loc) · 1.41 KB
/
Copy pathbatch_process.py
File metadata and controls
50 lines (36 loc) · 1.41 KB
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
import pandas as pd
import json
import time
from meeting_analyzer import analyze_meeting
def batch_analyze_meetings(input_csv='usable_meetings.csv', output_json='meeting_analysis_results.json'):
"""Batch process meetings through LLM analysis"""
# Load filtered data
df = pd.read_csv(input_csv)
results = []
for idx, row in df.iterrows():
try:
# Extract text (assume 'transcript' column, fallback to 'summary')
meeting_text = row.get('transcript', '') or row.get('summary', '')
if not meeting_text:
continue
# Analyze
analysis = analyze_meeting(meeting_text)
# Combine with original data
result = {
'meeting_id': row.get('meeting_id', idx),
'original_data': row.to_dict(),
'analysis': analysis
}
results.append(result)
print(f"Processed meeting {idx + 1}/{len(df)}")
# Rate limiting
time.sleep(1) # Adjust based on API limits
except Exception as e:
print(f"Error processing meeting {idx}: {e}")
continue
# Save results
with open(output_json, 'w', encoding='utf-8') as f:
json.dump(results, f, ensure_ascii=False, indent=2)
print(f"Saved {len(results)} analyzed meetings to {output_json}")
if __name__ == "__main__":
batch_analyze_meetings()