{"Code":200,"Data":{"AigcAttributes":"{}","AigcIsTop":0,"AigcType":"","AlreadyStar":false,"ApplyMeta":"{}","ApprovalMode":1,"ApprovalNotifyEmail":"","Architectures":null,"Avatar":"https://img.alicdn.com/imgextra/i1/O1CN01yhHrHg1Pdl3UKPhGc_!!6000000001864-2-tps-88-88.png","Backbone":[],"BackendSupport":{"architectures":null,"backend_info":{"deploy_task":null,"lmdeploy":null,"lmdeploy_turbomind":null,"ollama":null,"sglang":null,"vllm":null},"model_id":""},"BaseModel":[],"BaseModelRelation":"","CardReady":0,"CardUnreadyReason":"","CertificationCreateBy":"speech_asr","CertificationCreatedTime":1720108284,"ChineseName":"SenseVoice多语言语音理解模型Small","CoverImages":[],"CreatedBy":"speech_asr","CreatedTime":1719368178,"DashSdkParameter":"","Datasets":{},"DemoAvailable":0,"DemoUnavailableReason":"","Description":"SenseVoice多语言音频理解模型，具有包括语音识别、语种识别、语音情感识别，声学事件检测能力。","Domain":[],"Downloads":39974623,"ExampleCodeAvailable":0,"ExampleCodeUnavailableReason":"","ForbiddenVisibilityUpdate":false,"Frameworks":["Pytorch"],"FromSite":"maas","Id":295607,"Integrating":2,"IntegrationFailureLog":"bject is not callable\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/utils/registry.py\", line 212, in build_from_cfg\n    return obj_cls(**args)\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/pipelines/audio/funasr_pipeline.py\", line 62, in __init__\n    super().__init__(model=model, **kwargs)\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/pipelines/base.py\", line 100, in __init__\n    self.model = self.initiate_single_model(model, **kwargs)\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/pipelines/base.py\", line 53, in initiate_single_model\n    return Model.from_pretrained(\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/models/base/base_model.py\", line 183, in from_pretrained\n    model = build_model(model_cfg, task_name=task_name)\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/models/builder.py\", line 35, in build_model\n    model = build_from_cfg(\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/utils/registry.py\", line 215, in build_from_cfg\n    raise type(e)(f'{obj_cls.__name__}: {e}')\nTypeError: GenericFunASR: 'NoneType' object is not callable\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/mnt/workspace/integration_tests/workspace/test_SenseVoiceSmall.py\", line 4, in \u003cmodule\u003e\n    inference_pipeline = pipeline(\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/pipelines/builder.py\", line 169, in pipeline\n    return build_pipeline(cfg, task_name=task)\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/pipelines/builder.py\", line 65, in build_pipeline\n    return build_from_cfg(\n  File \"/usr/local/lib/python3.10/site-packages/modelscope/utils/registry.py\", line 215, in build_from_cfg\n    raise type(e)(f'{obj_cls.__name__}: {e}')\nTypeError: FunASRPipeline: GenericFunASR: 'NoneType' object is not callable","IntegrationFailureReason":"1001","IsAccessible":1,"IsCertification":1,"IsHot":0,"IsNewModel":false,"IsOnline":1,"IsPreTrain":0,"IsPublished":1,"IsTop":0,"Language":[],"LastUpdatedTime":1727321787,"Libraries":["pytorch"],"License":"Apache License 2.0","Meta":"","Metrics":[],"ModelDetail":{},"ModelInfos":{},"ModelRevisions":null,"ModelSource":"USER_UPLOAD","ModelTools":"","ModelType":[],"MuseInfo":null,"NEXA":{"Catalogues":null,"ModelCover":"","ScientificField":"","Source":"","SubScientificField":null},"Name":"SenseVoiceSmall","NewVersion":"","NickName":"","OfficialTags":null,"OpenAiSwingDeployInfo":{"Order":0,"Recommend":null,"lmdeploy":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"ollama":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"pipeline":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"vllm":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""}},"Organization":{"ApplyFailureReason":"","ApplyReason":"","Avatar":"https://resouces.modelscope.cn/avatar/86fc4b9c-4548-463c-8cbb-f37f68b87141.png","CreateCompetition":false,"CreatedBy":"damoadmin","Description":"[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"通义实验室(Institute for Intelligent Computing, aka Tongyi Lab) 专注于各领域大模型技术研发与创新应用。实验室研究方向涵盖LLM、多模态理解与生成、视觉AIGC、语音等多个领域。我们并积极推进研究成果的产业化落地。实验室同时积极参与开源社区建设，全方位拥抱开源社区，共同探索AI模型的开源开放。\"]]]]","DisplayUrl":"","Email":"","FromSite":"","FullName":"通义实验室","GithubAddress":"","GmtCreated":"2022-08-03T17:01:55Z","GmtModified":"2025-11-21T08:30:42Z","Id":1,"InitAdminMembers":"","IsApply":false,"IsCertification":"","Mobile":"","Name":"iic","Path":"","Roles":null,"StarCnt":0,"Status":0,"SubscribeVo":null,"Type":2},"PaiModelGalleryUrl":{"deploy":"https://account.aliyun.com/login/login.htm?oauth_callback=https%3A//pai.console.aliyun.com/regionId%3Dcn-hangzhou%23/quick-start/models/SenseVoiceSmall/intro%3FviewType%3DDeploy%26from%3DModelScope\u0026lang=zh"},"PaiSdkParameter":null,"Path":"iic","ProtectedMode":2,"ReadMeContent":"\n# Highlights\n**SenseVoice**专注于高精度多语言语音识别、情感辨识和音频事件检测\n- **多语言识别：** 采用超过40万小时数据训练，支持超过50种语言，识别效果上优于Whisper模型。\n- **富文本识别：** \n  - 具备优秀的情感识别，能够在测试数据上达到和超过目前最佳情感识别模型的效果。\n  - 支持声音事件检测能力，支持音乐、掌声、笑声、哭声、咳嗽、喷嚏等多种常见人机交互事件进行检测。\n- **高效推理：** SenseVoice-Small模型采用非自回归端到端框架，推理延迟极低，10s音频推理仅耗时70ms，15倍优于Whisper-Large。\n- **微调定制：** 具备便捷的微调脚本与策略，方便用户根据业务场景修复长尾样本问题。\n- **服务部署：** 具有完整的服务部署链路，支持多并发请求，支持客户端语言有，python、c++、html、java与c#等。\n\n\n## \u003cstrong\u003e[SenseVoice开源项目介绍](https://github.com/FunAudioLLM/SenseVoice)\u003c/strong\u003e\n\u003cstrong\u003e[SenseVoice](https://github.com/FunAudioLLM/SenseVoice)\u003c/strong\u003e开源模型是多语言音频理解模型，具有包括语音识别、语种识别、语音情感识别，声学事件检测能力。\n\n[**github仓库**](https://github.com/FunAudioLLM/SenseVoice)\n| [**最新动态**](https://github.com/FunAudioLLM/SenseVoice/blob/main/README_zh.md#%E6%9C%80%E6%96%B0%E5%8A%A8%E6%80%81)\n| [**环境安装**](https://github.com/FunAudioLLM/SenseVoice/blob/main/README_zh.md#%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85)\n\n# 模型结构图\nSenseVoice多语言音频理解模型，支持语音识别、语种识别、语音情感识别、声学事件检测、逆文本正则化等能力，采用工业级数十万小时的标注音频进行模型训练，保证了模型的通用识别效果。模型可以被应用于中文、粤语、英语、日语、韩语音频识别，并输出带有情感和事件的富文本转写结果。\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"fig/sensevoice.png\" alt=\"SenseVoice模型结构\"  width=\"1500\" /\u003e\n\u003c/p\u003e\n\nSenseVoice-Small是基于非自回归端到端框架模型，为了指定任务，我们在语音特征前添加四个嵌入作为输入传递给编码器：\n- LID：用于预测音频语种标签。\n- SER：用于预测音频情感标签。\n- AED：用于预测音频包含的事件标签。\n- ITN：用于指定识别输出文本是否进行逆文本正则化。\n\n\n# 依赖环境\n\n推理之前，请务必更新funasr与modelscope版本\n\n```shell\npip install -U funasr modelscope\n```\n\n# 用法\n\n\n## 推理\n\n### modelscope pipeline推理\n```python\nfrom modelscope.pipelines import pipeline\nfrom modelscope.utils.constant import Tasks\n\ninference_pipeline = pipeline(\n    task=Tasks.auto_speech_recognition,\n    model='iic/SenseVoiceSmall',\n    model_revision=\"master\",\n    device=\"cuda:0\",)\n\nrec_result = inference_pipeline('https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav')\nprint(rec_result)\n```\n\n### 使用funasr推理\n\n支持任意格式音频输入，支持任意时长输入\n\n```python\nfrom funasr import AutoModel\nfrom funasr.utils.postprocess_utils import rich_transcription_postprocess\n\nmodel_dir = \"iic/SenseVoiceSmall\"\n\n\nmodel = AutoModel(\n    model=model_dir,\n    trust_remote_code=True,\n    remote_code=\"./model.py\",  \n    vad_model=\"fsmn-vad\",\n    vad_kwargs={\"max_single_segment_time\": 30000},\n    device=\"cuda:0\",\n)\n\n# en\nres = model.generate(\n    input=f\"{model.model_path}/example/en.mp3\",\n    cache={},\n    language=\"auto\",  # \"zn\", \"en\", \"yue\", \"ja\", \"ko\", \"nospeech\"\n    use_itn=True,\n    batch_size_s=60,\n    merge_vad=True,  #\n    merge_length_s=15,\n)\ntext = rich_transcription_postprocess(res[0][\"text\"])\nprint(text)\n```\n参数说明：\n- `model_dir`：模型名称，或本地磁盘中的模型路径。\n- `trust_remote_code`：\n  - `True`表示model代码实现从`remote_code`处加载，`remote_code`指定`model`具体代码的位置（例如，当前目录下的`model.py`），支持绝对路径与相对路径，以及网络url。\n  - `False`表示，model代码实现为 [FunASR](https://github.com/modelscope/FunASR) 内部集成版本，此时修改当前目录下的`model.py`不会生效，因为加载的是funasr内部版本，模型代码[点击查看](https://github.com/modelscope/FunASR/tree/main/funasr/models/sense_voice)。\n- `vad_model`：表示开启VAD，VAD的作用是将长音频切割成短音频，此时推理耗时包括了VAD与SenseVoice总耗时，为链路耗时，如果需要单独测试SenseVoice模型耗时，可以关闭VAD模型。\n- `vad_kwargs`：表示VAD模型配置,`max_single_segment_time`: 表示`vad_model`最大切割音频时长, 单位是毫秒ms。\n- `use_itn`：输出结果中是否包含标点与逆文本正则化。\n- `batch_size_s` 表示采用动态batch，batch中总音频时长，单位为秒s。\n- `merge_vad`：是否将 vad 模型切割的短音频碎片合成，合并后长度为`merge_length_s`，单位为秒s。\n- `ban_emo_unk`：禁用emo_unk标签，禁用后所有的句子都会被赋与情感标签。默认`False`\n\n```python\nmodel = AutoModel(model=model_dir, trust_remote_code=True, device=\"cuda:0\")\n\nres = model.generate(\n    input=f\"{model.model_path}/example/en.mp3\",\n    cache={},\n    language=\"auto\", # \"zn\", \"en\", \"yue\", \"ja\", \"ko\", \"nospeech\"\n    use_itn=True,\n    batch_size=64, \n)\n```\n\n更多详细用法，请参考 [文档](https://github.com/modelscope/FunASR/blob/main/docs/tutorial/README.md)\n\n\n\n## 模型下载\n上面代码会自动下载模型，如果您需要离线下载好模型，可以通过下面代码，手动下载，之后指定模型本地路径即可。\n\nSDK下载\n```bash\n#安装ModelScope\npip install modelscope\n```\n```python\n#SDK模型下载\nfrom modelscope import snapshot_download\nmodel_dir = snapshot_download('iic/SenseVoiceSmall')\n```\nGit下载\n```\n#Git模型下载\ngit clone https://www.modelscope.cn/iic/SenseVoiceSmall.git\n```\n\n## 服务部署\n\nUndo\n\n# Performance\n\n## 语音识别效果\n我们在开源基准数据集（包括 AISHELL-1、AISHELL-2、Wenetspeech、Librispeech和Common Voice）上比较了SenseVoice与Whisper的多语言语音识别性能和推理效率。在中文和粤语识别效果上，SenseVoice-Small模型具有明显的效果优势。\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"fig/asr_results.png\" alt=\"SenseVoice模型在开源测试集上的表现\"  width=\"2500\" /\u003e\n\u003c/p\u003e\n\n\n\n## 情感识别效果\n由于目前缺乏被广泛使用的情感识别测试指标和方法，我们在多个测试集的多种指标进行测试，并与近年来Benchmark上的多个结果进行了全面的对比。所选取的测试集同时包含中文/英文两种语言以及表演、影视剧、自然对话等多种风格的数据，在不进行目标数据微调的前提下，SenseVoice能够在测试数据上达到和超过目前最佳情感识别模型的效果。\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"fig/ser_table.png\" alt=\"SenseVoice模型SER效果1\"  width=\"1500\" /\u003e\n\u003c/p\u003e\n\n同时，我们还在测试集上对多个开源情感识别模型进行对比，结果表明，SenseVoice-Large模型可以在几乎所有数据上都达到了最佳效果，而SenseVoice-Small模型同样可以在多数数据集上取得超越其他开源模型的效果。\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"fig/ser_figure.png\" alt=\"SenseVoice模型SER效果2\"  width=\"500\" /\u003e\n\u003c/p\u003e\n\n## 事件检测效果\n\n尽管SenseVoice只在语音数据上进行训练，它仍然可以作为事件检测模型进行单独使用。我们在环境音分类ESC-50数据集上与目前业内广泛使用的BEATS与PANN模型的效果进行了对比。SenseVoice模型能够在这些任务上取得较好的效果，但受限于训练数据与训练方式，其事件分类效果专业的事件检测模型相比仍然有一定的差距。\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"fig/aed_figure.png\" alt=\"SenseVoice模型AED效果\"  width=\"500\" /\u003e\n\u003c/p\u003e\n\n\n\n## 推理效率\nSenseVoice-Small模型采用非自回归端到端架构，推理延迟极低。在参数量与Whisper-Small模型相当的情况下，比Whisper-Small模型推理速度快7倍，比Whisper-Large模型快17倍。同时SenseVoice-small模型在音频时长增加的情况下，推理耗时也无明显增加。\n\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"fig/inference.png\" alt=\"SenseVoice模型的推理效率\"  width=\"1500\" /\u003e\n\u003c/p\u003e\n\n\u003cp style=\"color: lightgrey;\"\u003e如果您是本模型的贡献者，我们邀请您根据\u003ca href=\"https://modelscope.cn/docs/ModelScope%E6%A8%A1%E5%9E%8B%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B%E6%A6%82%E8%A7%88\" style=\"color: lightgrey; text-decoration: underline;\"\u003e模型贡献文档\u003c/a\u003e，及时完善模型卡片内容。\u003c/p\u003e\n\n","ReadMeTips":null,"RelatedArxivId":[],"RelatedPaper":[],"Revision":"master","Stars":589,"StorageSize":940016590,"Studios":[],"SubVisionFoundation":"","SupportApiInference":false,"SupportDashDeployment":0,"SupportDashInference":0,"SupportDashTraining":0,"SupportDeployment":1,"SupportExperience":0,"SupportFinetuning":0,"SupportFlexTrain":0,"SupportInference":"","SupportPaiModelGallery":["deploy"],"SupportPaiSdk":0,"SwingDeployInfo":null,"Tags":[],"Tasks":[{"ChineseName":"语音识别","Description":"","DomainName":"audio","Id":31,"IsExhibition":true,"IsHot":0,"IsLeaf":true,"IsLoginRequired":false,"IsRetrieval":true,"Level":1,"Name":"auto-speech-recognition","ParentId":-1,"ParentTask":null,"Sorting":0,"SupportWidgets":true,"TypicalModel":"","WidgetConfig":"{\"task\": \"auto-speech-recognition\", \"inputs\": [{\"type\": \"audio\", \"fileType\": \"pcm\", \"validator\": {\"max_size\": \"10M\"}, \"displayType\": \"AudioTransformer\", \"displayProps\": {\"enableRecording\": true}}], \"output\": {\"displayType\": \"ReadonlyText\", \"displayOutputMapping\": \"text\"}, \"examples\": []}","WidgetValidator":""}],"Tools":[],"TriggerWords":null,"Visibility":5,"VisionFoundation":"","_":null,"widgets":[]},"Message":"success","RequestId":"97ad3964-4d58-4038-9492-be99812971fe","Success":true}