Files changed (1) hide show
  1. README.md +238 -0
README.md ADDED
@@ -0,0 +1,238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - es
4
+ license: mit
5
+ library_name: transformers
6
+ pipeline_tag: audio-classification
7
+ tags:
8
+ - emotion-recognition
9
+ - speech-emotion-recognition
10
+ - multimodal-learning
11
+ - audio-classification
12
+ - speech-processing
13
+ - text-processing
14
+ - spanish
15
+ - affective-computing
16
+ - umuteam
17
+ datasets:
18
+ - NLP-UMUTeam/Spanish-MEACorpus-2023
19
+ metrics:
20
+ - accuracy
21
+ - f1
22
+
23
+ model-index:
24
+ - name: UMUTeam/w2v-bert-beto-multihead-emotion-es
25
+ results:
26
+ - task:
27
+ type: audio-classification
28
+ name: Multimodal Speech Emotion Recognition
29
+ dataset:
30
+ name: Spanish MEACorpus 2023
31
+ type: custom
32
+ metrics:
33
+ - type: accuracy
34
+ value: 82.6680
35
+ name: Accuracy
36
+ - type: weighted-f1
37
+ value: 82.4600
38
+ name: Weighted F1
39
+ - type: macro-f1
40
+ value: 75.5606
41
+ name: Macro F1
42
+ ---
43
+
44
+ # UMUTeam/w2v-bert-beto-multihead-emotion-es
45
+
46
+ ## Model description
47
+
48
+ `UMUTeam/w2v-bert-beto-multihead-emotion-es` is a Spanish multimodal emotion recognition model developed as part of **speech-emotion**, an open-source multilingual and multimodal toolkit for emotion recognition from speech, text, and multimodal inputs.
49
+
50
+ This model performs **multimodal emotion classification from Spanish speech and text inputs**.
51
+
52
+ The model combines acoustic representations extracted with Wav2Vec2-BERT and linguistic representations generated with BETO using a multi-head cross-attention fusion strategy.
53
+
54
+ The fusion mechanism uses cross-attention layers to model interactions between acoustic and textual representations, enabling the system to learn relationships between speech and linguistic emotional cues.
55
+
56
+ It is designed to jointly exploit complementary emotional information from speech and text in order to improve emotion recognition performance compared to unimodal approaches.
57
+
58
+ The model predicts one of the following emotion labels:
59
+
60
+ - `anger`
61
+ - `disgust`
62
+ - `fear`
63
+ - `joy`
64
+ - `neutral`
65
+ - `sadness`
66
+
67
+ ## Intended use
68
+
69
+ This model is intended for research and applied scenarios involving multimodal emotion recognition in Spanish, such as:
70
+
71
+ - multimodal conversational analysis
72
+ - speech and text emotion analysis
73
+ - affective computing research
74
+ - emotion-aware conversational systems
75
+ - human-computer interaction
76
+ - multimodal AI research
77
+
78
+ The model is particularly useful in scenarios where both speech audio and transcribed text are available.
79
+
80
+ It can be used through the `speech-emotion` toolkit.
81
+
82
+ ## Out-of-scope use
83
+
84
+ This model should not be used as the sole basis for high-stakes decisions, including but not limited to:
85
+
86
+ - clinical diagnosis
87
+ - mental health assessment
88
+ - employment, legal, or educational decisions
89
+ - biometric profiling or surveillance
90
+ - automated decisions affecting individuals without human oversight
91
+
92
+ Emotion recognition is inherently uncertain and context-dependent. Predictions should be interpreted as model estimates, not as definitive assessments of a person's emotional state.
93
+
94
+ ## Training data
95
+
96
+ The model was trained on the Spanish portion of the datasets used in the `speech-emotion` project, primarily based on the **Spanish MEACorpus 2023** dataset.
97
+
98
+ Spanish MEACorpus 2023 is a multimodal speech-text emotion corpus for Spanish emotion analysis collected from natural environments. The dataset contains aligned speech and textual information for emotion recognition tasks.
99
+
100
+ The emotion labels were harmonized into the following six-class taxonomy:
101
+
102
+ - `anger`
103
+ - `disgust`
104
+ - `fear`
105
+ - `joy`
106
+ - `neutral`
107
+ - `sadness`
108
+
109
+ For the Spanish multimodal emotion recognition setup, the same aligned speech-text samples were used for both the acoustic and textual modalities:
110
+
111
+ - Training samples: 3,692
112
+ - Validation samples: 410
113
+ - Test samples: 1,027
114
+
115
+ More details about the dataset and preprocessing pipeline are available in the project repository:
116
+
117
+ https://github.com/NLP-UMUTeam/umuteam-speech-emotion
118
+
119
+ ## Evaluation
120
+
121
+ The model was evaluated on the Spanish held-out test set used in the `speech-emotion` toolkit.
122
+
123
+ ### Performance comparison on Spanish emotion recognition
124
+
125
+ | Configuration | Accuracy | Weighted Precision | Weighted F1 | Macro F1 |
126
+ |---|---:|---:|---:|---:|
127
+ | Speech-only | 88.1207 | 88.3244 | 88.1357 | 84.4829 |
128
+ | Text-only | 77.0204 | 77.0449 | 76.8367 | 69.3886 |
129
+ | Multimodal (Concat) | **90.0682** | **90.2048** | **90.0642** | **87.7455** |
130
+ | Multimodal (Mean) | 88.5102 | 88.6163 | 88.5011 | 84.1653 |
131
+ | Multimodal (Multihead) | 82.6680 | 82.3820 | 82.4600 | 75.5606 |
132
+
133
+ The results show that combining acoustic and linguistic representations improves emotion recognition performance compared to unimodal speech-only or text-only systems.
134
+
135
+ The multi-head cross-attention strategy enables interaction between modalities through attention mechanisms, although in this experimental setup it achieved lower performance than simpler fusion approaches such as concatenation and mean fusion.
136
+
137
+ ## How to use
138
+
139
+ Install the toolkit:
140
+
141
+ ```bash
142
+ pip install speech-emotion
143
+ ```
144
+
145
+ ### Multimodal emotion recognition using audio and text
146
+
147
+ ```python
148
+ from speech_emotion import predict_emotion
149
+
150
+ emotion = predict_emotion(
151
+ audio_path="audio.wav",
152
+ text="Estoy muy feliz de verte de nuevo.",
153
+ language="es",
154
+ mode="multihead",
155
+ model_config_path="model.json"
156
+ )
157
+
158
+ print("Detected emotion:", emotion)
159
+ ```
160
+
161
+ ### Multimodal emotion recognition using automatic transcription (Whisper)
162
+
163
+ If no transcription is provided, the toolkit can automatically generate it using Whisper before performing emotion recognition.
164
+
165
+ ```python
166
+ from speech_emotion import predict_emotion
167
+
168
+ emotion = predict_emotion(
169
+ audio_path="audio.wav",
170
+ language="es",
171
+ mode="multihead",
172
+ model_config_path="model.json"
173
+ )
174
+
175
+ print("Detected emotion:", emotion)
176
+ ```
177
+
178
+ Repository:
179
+
180
+ https://github.com/NLP-UMUTeam/umuteam-speech-emotion
181
+
182
+ ## Limitations
183
+
184
+ - The model is designed for Spanish multimodal emotion recognition and may not generalize reliably to other languages.
185
+ - It predicts a single label from a fixed set of six emotions.
186
+ - Emotion expression is subjective and highly context-dependent.
187
+ - Performance may decrease with noisy audio, inaccurate transcriptions, overlapping speakers, or domain shifts.
188
+ - The model assumes that audio and text inputs are semantically aligned.
189
+ - Errors in automatic speech transcription may negatively affect multimodal performance.
190
+ - Attention-based fusion mechanisms may require larger datasets or different optimization strategies to generalize effectively.
191
+
192
+ ## Bias and ethical considerations
193
+
194
+ Emotion recognition systems may reflect biases present in their training data, including differences related to accents, speaking styles, demographics, recording conditions, or annotation subjectivity.
195
+
196
+ Users should avoid interpreting predictions as objective truths about a person's internal emotional state. The model should be used with transparency, appropriate consent, and human oversight, especially in sensitive contexts.
197
+
198
+ ## Citation
199
+
200
+ If you use this model in your research, please cite the following works:
201
+
202
+ ### speech-emotion toolkit
203
+
204
+ ```bibtex
205
+ @article{PAN2026102677,
206
+ title = {speech-emotion: A multilingual and multimodal toolkit for emotion recognition from speech},
207
+ journal = {SoftwareX},
208
+ volume = {34},
209
+ pages = {102677},
210
+ year = {2026},
211
+ issn = {2352-7110},
212
+ doi = {https://doi.org/10.1016/j.softx.2026.102677},
213
+ url = {https://www.sciencedirect.com/science/article/pii/S235271102600169X},
214
+ author = {Ronghao Pan and Tomás Bernal-Beltrán and José Antonio García-Díaz and Rafael Valencia-García},
215
+ }
216
+ ```
217
+
218
+ ### Spanish MEACorpus 2023
219
+
220
+ ```bibtex
221
+ @article{PAN2024103856,
222
+ title = {Spanish MEACorpus 2023: A multimodal speech–text corpus for emotion analysis in Spanish from natural environments},
223
+ journal = {Computer Standards & Interfaces},
224
+ volume = {90},
225
+ pages = {103856},
226
+ year = {2024},
227
+ issn = {0920-5489},
228
+ doi = {https://doi.org/10.1016/j.csi.2024.103856},
229
+ url = {https://www.sciencedirect.com/science/article/pii/S0920548924000254},
230
+ author = {Ronghao Pan and José Antonio García-Díaz and Miguel Ángel Rodríguez-García and Rafael Valencia-García},
231
+ }
232
+ ```
233
+
234
+ ## Acknowledgments
235
+
236
+ This work is part of the research project LaTe4PoliticES (PID2022-138099OB-I00), funded by MICIU/AEI/10.13039/501100011033 and the European Regional Development Fund (ERDF/EU - FEDER/UE), “A way of making Europe”.
237
+
238
+ Mr. Tomás Bernal-Beltrán is supported by the University of Murcia through the predoctoral programme.