src package

Subpackages

Submodules

src.emotion_set module

This file defines the emotion sets that are available in this work.

class src.emotion_set.AbstractEmotionSet(name: str, count: int, classes: Iterable[str])

Bases: object

This class implements the abstract interface for all emotion sets.

One problem in emotion detection is that a lot of different emotion sets are used throughout the past research. While one paper predicts only positive, neutral and negative emotions, another one might differentiate between 6 or more distinct emotions (joy, anger, fear, …). This class models this behaviour by defining different emotion sets.

get_emotions(indices: Union[int, ndarray]) Union[str, ndarray]

This function returns the emotion strings for given indices

Parameters:

indices – The index or indices of the emotions

Returns:

Array of emotion strings or single emotion string

class src.emotion_set.EkmanEmotions

Bases: AbstractEmotionSet

Emotion set defined by Paul Ekman that is commonly used in research. It contains 6 basic emotions: anger, surprise, disgust, enjoyment, fear, and sadness

class src.emotion_set.EkmanNeutralEmotions

Bases: AbstractEmotionSet

Ekman Emotion set extended by a neutral state.

class src.emotion_set.EmotionMapper

Bases: object

map_emotion(emotion: str) str

Maps an emotion to its equivalent in the NeutralEkman emotion set.

Parameters:

emotion – The name of the emotion to map to Ekman

Returns:

The name of the corresponding Ekman emotion

setup_map() None

One time setup for the emotion map in the class.

class src.emotion_set.EmotionSetFactory

Bases: object

Factory class that generates emotion set instances

static generate(name: str) AbstractEmotionSet

Method that creates and returns an instance of the emotion set specified by the name parameter

Parameters:

name – The name of the desired emotion set

Raises:

ValueError – Raised if the name does not represent an emotion set

Returns:

The created emotion set

class src.emotion_set.ThreeEmotions

Bases: AbstractEmotionSet

Simple emotion set with only three categories: positive, neutral, negative

Module contents

Package containing the entire source code