🚀 基于WavLM Large在5个流行情感数据集上进行情感分割
本仓库提供了使用SpeechBrain通过微调wavlm(大模型)进行语音情感分割所需的所有工具。
该模型在拼接音频上进行训练,并在ZaionEmotionDataset上进行测试。评估指标为情感分割错误率(EDER)。更多详细信息请查看论文链接。
为了获得更好的体验,我们建议您进一步了解SpeechBrain。该模型在ZED(测试集)上的性能如下:
版本 |
EDER(%) |
05 - 07 - 23 |
29.7(平均:30.2) |
🚀 快速开始
本系统由wavlm编码器和下游逐帧分类器组成。其任务是预测语音记录中正确的情感成分及其边界。目前,该模型使用仅包含1个非中性情感事件的音频进行训练。
系统使用采样率为16kHz(单声道)的录音进行训练。当调用diarize_file时,代码将根据需要自动对音频进行归一化处理(即重采样 + 单声道选择)。
✨ 主要特性
- 提供基于微调wavlm(大模型)的语音情感分割工具。
- 支持在多个流行情感数据集上进行训练和测试。
- 采用情感分割错误率(EDER)作为评估指标。
📦 安装指南
安装SpeechBrain
首先,请使用以下命令安装SpeechBrain的开发版本:
git clone https://github.com/speechbrain/speechbrain.git
cd speechbrain
pip install -r requirements.txt
pip install --editable .
请注意,我们建议您阅读我们的教程并进一步了解SpeechBrain。
💻 使用示例
基础用法
from speechbrain.inference.diarization import Speech_Emotion_Diarization
classifier = Speech_Emotion_Diarization.from_hparams(
source="speechbrain/emotion-diarization-wavlm-large"
)
diary = classifier.diarize_file("speechbrain/emotion-diarization-wavlm-large/example.wav")
print(diary)
diary = classifier.diarize_file("speechbrain/emotion-diarization-wavlm-large/example_sad.wav")
print(diary)
输出将包含一个情感成分及其边界的字典。
高级用法
在GPU上进行推理
要在GPU上进行推理,请在调用from_hparams
方法时添加 run_opts={"device":"cuda"}
。
训练
该模型使用SpeechBrain(aa018540)进行训练。要从头开始训练,请按照以下步骤操作:
- 克隆SpeechBrain:
git clone https://github.com/speechbrain/speechbrain/
- 安装它:
cd speechbrain
pip install -r requirements.txt
pip install -e .
- 运行训练:
cd recipes/ZaionEmotionDataset/emotion_diarization
python train.py hparams/train.yaml --zed_folder /path/to/ZED --emovdb_folder /path/to/EmoV-DB --esd_folder /path/to/ESD --iemocap_folder /path/to/IEMOCAP --jlcorpus_folder /path/to/JL_corpus --ravdess_folder /path/to/RAVDESS
您可以在此处找到我们的训练结果(模型、日志等)。
局限性
SpeechBrain团队不对该模型在其他数据集上的性能提供任何保证。
📚 详细文档
关于语音情感分割/Zaion情感数据集
@article{wang2023speech,
title={Speech Emotion Diarization: Which Emotion Appears When?},
author={Wang, Yingzhi and Ravanelli, Mirco and Nfissi, Alaa and Yacoubi, Alya},
journal={arXiv preprint arXiv:2306.12991},
year={2023}
}
引用SpeechBrain
如果您将SpeechBrain用于研究或商业用途,请引用它。
@misc{speechbrain,
title={{SpeechBrain}: A General-Purpose Speech Toolkit},
author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
year={2021},
eprint={2106.04624},
archivePrefix={arXiv},
primaryClass={eess.AS},
note={arXiv:2106.04624}
}
关于SpeechBrain
- 网站:https://speechbrain.github.io/
- 代码:https://github.com/speechbrain/speechbrain/
- HuggingFace:https://huggingface.co/speechbrain/
📄 许可证
本项目采用Apache 2.0许可证。
属性 |
详情 |
模型类型 |
基于微调wavlm(大模型)的语音情感分割模型 |
训练数据 |
ZaionEmotionDataset、iemocap、ravdess、jl - corpus、esd、emov - db |
评估指标 |
Emotion Diarization Error Rate (EDER) |
许可证 |
apache - 2.0 |