liqian 1 year ago
parent
commit
d0d5720a1a
1 changed files with 2 additions and 0 deletions
  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)