Serverless · Freelance
Container-Image Lambdas for Audio Segmentation and Sentiment
Docker-based Lambdas process uploaded audio with a TensorFlow speech segmenter and score text with several sentiment lexicons.
// Overview
A SAM template deploys an S3 bucket whose notifications invoke a 2 GB, 15-minute Lambda packaged as a container image with TensorFlow, ffmpeg and a segmentation library. It segments speech, music and noise and writes a CSV back to S3. Sibling images score text with several lexicons.
// The problem
Heavy ML libraries and binaries exceed Lambda zip limits, yet processing had to run automatically on upload.
// Flow
- S3 uploadaudio placed under a media prefix
- S3 notificationput and multipart-complete events invoke the function
- Container LambdaECR image, 2048 MB, 900 s timeout
- Format gate gateaccepts wav, mp3 and m4a only
- Segmentationdownload, segment, write CSV
- ResultCSV written under a separate prefix
- Sentiment Lambdasequenced text in, per-lexicon scores out
- DeliveryDocker build, ECR push, SAM deploy with image URI parameter
// Design decisions & guardrails
- Container images bypass zip size limits; non-root user in the image.
- Prefix-filtered notifications avoid recursive triggers.
- One handler tolerates API-style and S3-style event shapes; local test events included.
// Outcome
ML-grade processing on a serverless footprint.