From fdafd3f6bc2f04d16e7cab5afcdb1257e87a8a78 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 17 十二月 2024 11:15:53 +0800
Subject: [PATCH] emotion2vec

---
 examples/industrial_data_pretraining/sense_voice/demo.py |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/examples/industrial_data_pretraining/sense_voice/demo.py b/examples/industrial_data_pretraining/sense_voice/demo.py
index 3a88643..642e825 100644
--- a/examples/industrial_data_pretraining/sense_voice/demo.py
+++ b/examples/industrial_data_pretraining/sense_voice/demo.py
@@ -1,8 +1,7 @@
 #!/usr/bin/env python3
 # -*- encoding: utf-8 -*-
-# Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
+# Copyright FunASR (https://github.com/FunAudioLLM/SenseVoice). All Rights Reserved.
 #  MIT License  (https://opensource.org/licenses/MIT)
-
 
 from funasr import AutoModel
 from funasr.utils.postprocess_utils import rich_transcription_postprocess
@@ -30,6 +29,21 @@
 text = rich_transcription_postprocess(res[0]["text"])
 print(text)
 
+# en with timestamp
+res = model.generate(
+    input=f"{model.model_path}/example/en.mp3",
+    cache={},
+    language="auto",  # "zn", "en", "yue", "ja", "ko", "nospeech"
+    use_itn=True,
+    batch_size_s=60,
+    merge_vad=True,  #
+    merge_length_s=15,
+    output_timestamp=True,
+)
+print(res)
+text = rich_transcription_postprocess(res[0]["text"])
+print(text)
+
 # zh
 res = model.generate(
     input=f"{model.model_path}/example/zh.mp3",
@@ -43,6 +57,21 @@
 text = rich_transcription_postprocess(res[0]["text"])
 print(text)
 
+# zh with timestamp
+res = model.generate(
+    input=f"{model.model_path}/example/zh.mp3",
+    cache={},
+    language="auto",  # "zn", "en", "yue", "ja", "ko", "nospeech"
+    use_itn=True,
+    batch_size_s=60,
+    merge_vad=True,  #
+    merge_length_s=15,
+    output_timestamp=True,
+)
+print(res)
+text = rich_transcription_postprocess(res[0]["text"])
+print(text)
+
 # yue
 res = model.generate(
     input=f"{model.model_path}/example/yue.mp3",

--
Gitblit v1.9.1