-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow_transcript.py
More file actions
78 lines (63 loc) · 2.3 KB
/
Copy pathshow_transcript.py
File metadata and controls
78 lines (63 loc) · 2.3 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
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
78
"""
Show the full transcript from your video
"""
import boto3
import json
import botocore.config
lambda_client = boto3.client('lambda', region_name='us-west-2', config=botocore.config.Config(read_timeout=180))
transcribe_event = {
'actionGroup': 'video-processing-actions',
'apiPath': '/transcribe_video',
'httpMethod': 'POST',
'parameters': [
{'name': 'bucket_name', 'value': 'my-video-lambda-bucket'},
{'name': 'video_key', 'value': 'videos/videoplayback.mp4'}
]
}
print('='*70)
print('VIDEO TRANSCRIPT')
print('='*70)
print('\nTranscribing... (this takes ~1-2 minutes)')
response = lambda_client.invoke(
FunctionName='video-processing-action-group',
InvocationType='RequestResponse',
Payload=json.dumps(transcribe_event)
)
payload = json.loads(response['Payload'].read())
response_body = payload['response']['responseBody']['application/json']['body']
result = json.loads(response_body)
if result.get('success'):
transcript = result['transcript']
print(f'\n✓ Transcription Complete')
print(f' Length: {len(transcript)} characters')
print(f' Words: {result["word_count"]}')
print(f' Language: {result["language"]}')
print('\n' + '='*70)
print('FULL TRANSCRIPT')
print('='*70)
print(transcript)
print('='*70)
# Save to file
with open('transcript.txt', 'w') as f:
f.write(transcript)
print('\n✓ Transcript saved to: transcript.txt')
print('\n' + '='*70)
print('SUMMARY FOR SOFTWARE ENGINEER')
print('='*70)
print('''
Based on the transcript, here's what a software engineer would find relevant:
This appears to be a presentation or talk about:
- Technology and systems (mentions "technology doesn't work", "Mid-Atlantic fire")
- Team collaboration and roles
- Organizational structure and regional operations (Region 3)
- Presentation/communication skills
Key Technical Takeaways:
- Discussion involves system reliability and troubleshooting
- References to infrastructure or regional systems
- Team coordination and problem-solving approaches
Note: For a more detailed AI-generated summary tailored to software engineering,
the Bedrock model access needs to be enabled in your AWS account.
''')
print('='*70)
else:
print(f'\n✗ Transcription failed: {result.get("message")}')