Skip to content

Merge consecutive same-speaker utterances in file transcripts - #464

Open
cipoklean wants to merge 1 commit into
AssemblyAI:mainfrom
cipoklean:fix/file-transcript-speaker-merge
Open

cipoklean wants to merge 1 commit into
AssemblyAI:mainfrom
cipoklean:fix/file-transcript-speaker-merge

Conversation

@cipoklean

Copy link
Copy Markdown

Closes #463.

FileTranscriber.text(of:) now folds consecutive same-speaker utterances into one SpeakerTurn before labelling — the exact rule LiveTranscript.speakerTurns already applies on the live path — so a transcript reads the same whether the conversation was recorded live or uploaded as a file.

The async API cuts an utterance at every pause, which means one speaker's unbroken turn otherwise becomes a run of one-line Speaker A: paragraphs that the live version of the same audio never produces. Since the labelled format is deliberately shared between the two writers ("the async transcripts' shape, so the transforms read both the same way"), the merge is what makes that claim true for real speech, where speaker changes rarely align with pauses.

The merge logic is the live writer's own: same speaker as the previous turn, append with one joining space; otherwise start a new turn. swift-format lint --strict clean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File transcripts don't merge consecutive same-speaker utterances the way live recordings do

1 participant