Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ruokolt committed Apr 5, 2024
1 parent f37f804 commit 5eb50ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/speech2text.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def combine_transcription_and_diarization(transcription_segments,
}
"""

# Convert transcription segments to word-level using wav2vec2 alignment
# Convert transcription segments so that each segment corresponds to a word
wav2vec_model_name = settings.wav2vec_models[language] if language in settings.wav2vec_models else None

align_model, align_metadata = whisperx.load_align_model(language,
Expand All @@ -135,7 +135,7 @@ def combine_transcription_and_diarization(transcription_segments,
settings.compute_device
)

# Combine diarization and word-level transcription segments
# Assign speaker to transcribed word segments
segments = assign_word_speakers(diarization_segments, transcription_segments['segments'])

# Reformat the result (return a dictionary of lists)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __call__(

def assign_word_speakers(diarize_df, transcript_segments):
"""
This function assigns speakers to words and segments in a transcript based on diarization results.
Assign speakers to words and segments in a transcript based on diarization results.
Args:
diarize_df (pd.DataFrame): The diarization dataframe.
Expand Down

0 comments on commit 5eb50ac

Please sign in to comment.