Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

fix: handle empty strings after event removal in transcription processing (def rich_transcription_postprocess(s)) (#2681)

TnR2528f92f7a2a2
diff --git a/funasr/utils/postprocess_utils.py b/funasr/utils/postprocess_utils.py
index 60ebb56fd..39a8a10dd 100644
--- a/funasr/utils/postprocess_utils.py
+++ b/funasr/utils/postprocess_utils.py
@@ -414,6 +414,8 @@ def rich_transcription_postprocess(s):
continue
if get_event(s_list[i]) == cur_ent_event and get_event(s_list[i]) != None:
s_list[i] = s_list[i][1:]
+ if len(s_list[i]) == 0:
+ continue
# else:
cur_ent_event = get_event(s_list[i])
if get_emo(s_list[i]) != None and get_emo(s_list[i]) == get_emo(new_s):