Skip to content

Commit

Permalink
fix: manage transcription files with no speaker info
Browse files Browse the repository at this point in the history
  • Loading branch information
bakaburg1 committed Mar 8, 2024
1 parent 3c4e877 commit 41b823a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/data_management.R
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,12 @@ extract_text_from_transcript <- function(

# Ignore the `import_diarization` parameter if the transcript does not contain
# speaker information
if (all(is.na(transcript_data$speaker)) ||
if (!"speaker" %in% names(transcript_data) ||
all(is.na(transcript_data$speaker)) ||
n_distinct(transcript_data$speaker, na.rm = T) == 1) {
import_diarization <- FALSE

transcript_data$speaker <- "None"
transcript_data$speaker <- "Unknown"
}

transcript <- transcript_data %>%
Expand Down

0 comments on commit 41b823a

Please # to comment.