From a79f825f662e2c525f9982b8b598fe8dc044d274 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 23 Aug 2023 15:13:04 +0200 Subject: [PATCH] Fix speaker rendered throughout paragraph Each sentence or 'segment' in whisper would be preceded by a [speaker] notation. This commit fixes that to only include the speaker in front of a larger group (since a new speaker would start a new diarization group this will always work). --- verbanote/process.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/verbanote/process.py b/verbanote/process.py index fa045a4..eb36eee 100644 --- a/verbanote/process.py +++ b/verbanote/process.py @@ -72,10 +72,11 @@ def output_txt(diarized_groups: list, transcription_path: Path) -> TxtTranscript if captions: speaker = g[0].split()[-1] - + + txt.append(f"[{speaker}] ") for c in captions: - txt.append(f"[{speaker}] {c['text']}\n") - txt.append("\n") + txt.append(f"{c['text']}") + txt.append("\n\n") output = "".join(txt) fname = Path.joinpath(transcription_path, "transcription_result.txt")