Skip to content

Commit

Permalink
optimizing code
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-roethig-db committed May 30, 2024
1 parent 2dbadd6 commit 986a003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion amondin/post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def merge_rows_consecutive_speaker(transcript: pd.DataFrame) -> pd.DataFrame:
"""
# create a column speaker_group that signals if speakers have consecutive segments
transcript["speaker_group"] = (transcript["speaker"] != transcript["speaker"].shift()).cumsum()

# group by speaker_group and speaker to merge consecutive segments
transcript = transcript.groupby(["speaker_group", "speaker"]).agg({
"start": "min",
Expand Down

0 comments on commit 986a003

Please sign in to comment.