fixed bug when only one speaker exists
This commit is contained in:
@@ -54,9 +54,11 @@ class Diariser:
|
|||||||
# This loop removes these duplicates
|
# This loop removes these duplicates
|
||||||
###
|
###
|
||||||
|
|
||||||
|
if len(dia_list) == 1:
|
||||||
|
normalized_output.append([0, 0, dia_list[0]])
|
||||||
|
else:
|
||||||
|
|
||||||
for i, (_, _, speaker) in enumerate(dia_list):
|
for i, (_, _, speaker) in enumerate(dia_list):
|
||||||
|
|
||||||
if i == 0:
|
if i == 0:
|
||||||
current_speaker = speaker
|
current_speaker = speaker
|
||||||
|
|
||||||
@@ -84,7 +86,6 @@ class Diariser:
|
|||||||
|
|
||||||
diarization_output["segments"].append([start, end])
|
diarization_output["segments"].append([start, end])
|
||||||
diarization_output["speakers"].append(outp[2])
|
diarization_output["speakers"].append(outp[2])
|
||||||
|
|
||||||
return diarization_output
|
return diarization_output
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user