emotion2vec情感通用表征模型base

我要开发同款
匿名用户2024年07月31日
22阅读
开发技术pytorch
所属分类ai
开源地址https://modelscope.cn/models/iic/emotion2vec_base
授权协议Apache License 2.0

作品详情

EMOTION2VEC

emotion2vec通用语音情感表征模型
emotion2vec: Self-Supervised Pre-Training for Speech Emotion Representation

模型简介

emotion2vec是第一个通用的语音情感表征模型。通过自监督预训练,emotion2vec能够在不同的任务、语言和场景中提取情感表征。

版本是未经微调的基座模型,可以用于特征提取。

安装环境

pip install -U funasr modelscope

用法

input: 16k Hz 的语音

granularity:

  • "utterance": 提取整句语音特征
  • "frame": 提取帧级别特征(50 Hz)

extract_embedding: 是否提取特征

基于modelscope进行推理

from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

inference_pipeline = pipeline(
    task=Tasks.emotion_recognition,
    model="iic/emotion2vec_base")

rec_result = inference_pipeline('https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav', output_dir="./outputs", granularity="utterance", extract_embedding=True)
print(rec_result)

基于FunASR进行推理

from funasr import AutoModel

model = AutoModel(model="iic/emotion2vec_base")

res = model(input='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav', output_dir="./outputs", granularity="utterance", extract_embedding=True)
print(res)

注:模型会自动下载

支持输入文件列表,wav.scp(kaldi风格): ```cat wav.scp wavname1 wavpath1.wav wavname2 wavpath2.wav …

输出为情感表征向量,保存在`output_dir`中,格式为numpy格式(可以用np.load()加载)

# 说明

本仓库为emotion2vec的modelscope版本,模型参数完全一致。

原始仓库地址: [https://github.com/ddlBoJack/emotion2vec](https://github.com/ddlBoJack/emotion2vec)

modelscope版本仓库:[https://github.com/alibaba-damo-academy/FunASR](https://github.com/alibaba-damo-academy/FunASR/tree/funasr1.0/examples/industrial_data_pretraining/emotion2vec)

# 相关论文以及引用信息

BibTeX @article{ma2023emotion2vec, title={emotion2vec: Self-Supervised Pre-Training for Speech Emotion Representation}, author={Ma, Ziyang and Zheng, Zhisheng and Ye, Jiaxin and Li, Jinchao and Gao, Zhifu and Zhang, Shiliang and Chen, Xie}, journal={arXiv preprint arXiv:2312.15185}, year={2023} } ```

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论