liqian hace 1 año
padre
commit
d0d5720a1a
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      utils.py

+ 2 - 0
utils.py

@@ -163,6 +163,8 @@ def download_video(video_path, video_id, download_folder, ftype='mp4'):
 
 def asr_validity_discrimination(text):
     """判断asr识别的文本是否有效"""
+    if len(text) == 0:
+        return False
     words = set(text)
     words_rate = len(words) / len(text)
     print(len(words), len(text), words_rate)