Categorize¶
Discrete emotion categorization via Plutchik's wheel (Plutchik, 1980).
Maps continuous (valence, arousal) coordinates from the Russell circumplex to one of 8 primary emotions with three intensity tiers. An optional dominance value disambiguates the fear/anger region following the PAD model (Mehrabian & Russell, 1974).
emotional_memory.categorize.EmotionLabel
¶
Bases: BaseModel
Discrete emotion label derived from continuous affect coordinates.
primary — one of Plutchik's 8 primary emotions intensity — low / moderate / high (Plutchik intensity tiers) name — canonical dyadic tier name (e.g. "serenity", "joy", "ecstasy") confidence — how close the point is to the sector centre [0, 1]
emotional_memory.categorize.categorize_affect(core_affect: CoreAffect, dominance: float | None = None) -> EmotionLabel
¶
Map a CoreAffect point to a discrete Plutchik emotion label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
core_affect
|
CoreAffect
|
The continuous valence-arousal point. |
required |
dominance
|
float | None
|
Optional PAD dominance value [0, 1]. When provided, disambiguates fear vs anger in the high-arousal / negative-valence region. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
EmotionLabel
|
class: |
EmotionLabel
|
canonical tier name, and sector-centre confidence. |
Notes
Arousal is re-centred to [-0.5, 0.5] and then scaled *2 to [-1, 1] so that both axes have equal span. This makes the 45° sectors isotropic in the valence-arousal plane.
Points within radius _NEUTRAL_RADIUS of the origin are too
ambiguous to categorise reliably; they are returned with
confidence=0.0.
Source code in src/emotional_memory/categorize.py
emotional_memory.categorize.label_tag(tag: EmotionalTag, dominance: float | None = None) -> EmotionalTag
¶
Return a copy of tag with the emotion_label field populated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
EmotionalTag
|
The emotional tag to label. |
required |
dominance
|
float | None
|
Optional dominance value for fear/anger disambiguation.
If |
None
|
Returns:
| Type | Description |
|---|---|
EmotionalTag
|
A new frozen :class: |
EmotionalTag
|
|