语言: "zh"
缩略图:
标签:
- 音频分类
- 语音大脑
- 情感识别
- 说话人日志
- wavlm
- pytorch
许可证: "apache-2.0"
数据集:
- Zaion情感数据集
- iemocap
- ravdess
- jl-corpus
- esd
- emov-db
评估指标:
- 情感日志错误率(EDER)
推理: false
基于WavLM Large模型在五大情感数据集上的情感日志系统
本仓库提供使用SpeechBrain对wavlm(large)模型进行微调后执行语音情感日志分析的全套工具。
该模型在拼接音频上进行训练,并在Zaion情感数据集上进行测试。评估指标为情感日志错误率(EDER)。更多细节请参阅论文。
为获得最佳体验,建议您深入了解SpeechBrain。模型在ZED测试集上的表现如下:
发布版本 |
EDER(%) |
2023-05-07 |
29.7 (平均: 30.2) |
系统架构
该系统由wavlm编码器和下游帧级分类器组成,旨在预测语音记录中正确的情感成分及其时间边界。当前模型训练使用的音频仅包含1个非中性情感事件。
系统训练采用16kHz采样率(单声道)的录音。调用diarize_file时,代码会自动对音频进行标准化处理(包括重采样和单声道选择)。
安装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版本)训练。从头开始训练的步骤如下:
- 克隆仓库:
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 /ZED路径 --emovdb_folder /EmoV-DB路径 --esd_folder /ESD路径 --iemocap_folder /IEMOCAP路径 --jlcorpus_folder /JL_corpus路径 --ravdess_folder /RAVDESS路径
训练结果(模型、日志等)可在此处获取。
使用限制
SpeechBrain团队不对该模型在其他数据集上的表现提供任何保证。
关于语音情感日志/Zaion情感数据集
@article{wang2023speech,
title={语音情感日志:何时出现何种情绪?},
author={王颖智 and 米科·拉瓦内利 and 阿拉·恩菲西 and 阿利亚·雅库比},
journal={arXiv预印本 arXiv:2306.12991},
year={2023}
}
引用SpeechBrain
若您将SpeechBrain用于研究或商业用途,请予以引用。
@misc{speechbrain,
title={{SpeechBrain}: 通用语音工具包},
author={米科·拉瓦内利 and 提图安·帕克洛 and 彼得·普兰廷加 and 阿库·鲁埃 and 萨穆埃莱·科内尔 and 洛伦·卢戈施 and 杰姆·苏巴坎 and 瑙曼·达瓦拉塔巴德 and 阿卜杜勒瓦哈布·赫巴 and 钟建元 and 周汝杰 and 叶松林 and 傅思伟 and 廖建丰 and 埃琳娜·拉斯托格娃 and 弗朗索瓦·格隆丹 and 威廉·阿里斯 and 娜慧东 and 高岩 and 雷纳托·德莫里 and 约书亚·本吉奥},
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/