fix: Fix internal text-to-emotion vector labels

- The order of the `convert_dict` now matches the desired order of the emotion vectors, for clarity.

- Internal text labels now match the updated English translations.

- This (and the previous commit) also fixes a bug: The previous, inaccurate Emotion translations meant that QwenEmotion could not understand words such as "low" at all (no emotion mapping), and it always mapped "hate" to "angry". With the fixed translations, QwenEmotion now correctly maps text-to-emotions from English inputs when users input the words that they've been taught by the user interface.
This commit is contained in:
Arcitec 2025-09-08 13:35:17 +02:00
parent cb0e07f982
commit feba501013

View File

@ -603,17 +603,17 @@ class QwenEmotion:
)
self.prompt = "文本情感分类"
self.convert_dict = {
"愤怒": "angry",
"高兴": "happy",
"恐惧": "fear",
"反感": "hate",
"愤怒": "angry",
"悲伤": "sad",
"低落": "low",
"惊讶": "surprise",
"自然": "neutral",
"恐惧": "afraid",
"反感": "disgusted",
"低落": "melancholic",
"惊讶": "surprised",
"自然": "calm",
}
self.backup_dict = {"happy": 0, "angry": 0, "sad": 0, "fear": 0, "hate": 0, "low": 0, "surprise": 0,
"neutral": 1.0}
self.backup_dict = {"happy": 0, "angry": 0, "sad": 0, "afraid": 0, "disgusted": 0, "melancholic": 0,
"surprised": 0, "calm": 1.0}
self.max_score = 1.2
self.min_score = 0.0