Unlocking Customer Calls for AI, With Personal Data Kept On-Premises
Overview
Key Highlights
Client-controlled processing
Transcription and PII detection run on the client's on-premises Kubernetes cluster. No recording is downloaded to a developer machine.
Speaker-labeled transcripts
Each call becomes a time-stamped dialogue with the sales representative and the customer identified.
Text and audio redaction
Detected PII is masked in the transcript and, using word-level timings, in the audio file.
Multi-GPU pipeline
Load benchmarks on the client's cluster guided a multi-GPU version of the pipeline, orchestrated with Metaflow.
The Challenge
- Strict data residency: All development and processing had to happen on the client's cluster, with access limited to a whitelisted team.
- Unstructured audio: Recordings had no transcripts and no speaker labels. The client needed a consistent, machine-readable call log.
- PII in two formats: Masking text is a known problem. Masking the same words in the audio track, without inserting confusing silences, is not.
- Volume: Thousands of historical calls plus a daily flow of new ones meant the pipeline had to use the GPUs efficiently.
The Journey
-
Scoping the Opportunity
The client provided a Kubernetes cluster with three GPUs, a first batch of around 5 GB of recordings, and the expected output format for the call logs. The pipeline design, the use of the cluster, and the full list of what counts as PII in these calls were worked out by Postindustria during the project. Transcription and redaction were the first workstream of a wider R&D programme that also covered call analysis.
-
Strategic Development
We built the pipeline as a chain of stages:
- Transcription with WhisperX, chosen for its word-level timestamps, which the audio redaction step depends on.
- Diarization: the audio is split into segments by speaker.
- Text redaction with spaCy and Flair entity models plus regex rules for emails, card numbers, and dates. Every detected item is replaced with a neutral placeholder, so the transcript keeps its structure but no longer contains the personal data.
- Role assignment: an LLM reads the redacted transcript and labels each speaker as the sales representative or the customer. This is the only step that uses an external service, and it runs after redaction, so the service receives masked text only. The third-party model was used to prove that LLM-based labeling works. We also tested a locally hosted LLM on the cluster, which gave comparable results, and left the choice between the two with the client.
- Audio redaction driven by the redacted transcript: the word timings locate each masked item in the recording, and that span is replaced with a short beep. A beep was chosen over silence because a pause sounds like a normal part of a call, while a beep tells a listener that something was removed on purpose.
-
Iterative Execution
Each stage was reviewed with the client on real recordings, and redaction results were tracked in a shared quality-control document. Some of the problems identified on the first batch, and how each one shaped the next iteration:
- Wrong speaker on short phrases. Diarization alone assigned interjections such as "Yeah" or "Sorry" to the wrong side. We added the LLM-based role assignment step, which reads the whole redacted conversation and corrects the labels using context.
- Partial masking. Addresses and dates of birth were sometimes only half masked, while every long number was masked, including harmless ones. We tuned the entity models with custom recognizers and regex rules for the formats that appear in these calls.
- Drifting audio timings. When the transcription timings were off, the beep landed slightly before or after the spoken PII. We moved to WhisperX word-level alignment, so the audio redaction uses the same timings as the text.
Transcription quality also improved across iterations: better punctuation, correct currency symbols, fewer dropped phrases.
In parallel, we benchmarked GPU and CPU utilization at different process counts, and a multi-GPU variant of the pipeline was written using Metaflow orchestration.
The Technology
- WhisperX gave transcription and alignment in one model, so redaction timings come from the same source as the text.
- spaCy, Flair, and regex covered both named entities and fixed-format data without training a custom model.
- Metaflow on Kubernetes splits the pipeline into steps, so each step can run on its own GPU and a failure in one step does not restart the whole call
The Results
Conclusion
Key Takeaways:
- Redact before you share: PII detection happens on client-controlled infrastructure, before any text reaches an external LLM.
- Open-source first: WhisperX, spaCy, and Flair covered the core pipeline without licensing costs.
- Validate on real data early: Reviewing real calls with the client surfaced the problems while they were still cheap to fix.