Emotions¶
TRUNAJOD emotions module.
These measurements are based on the lexicon from [RSG14].
TRUNAJOD already comes bundled with this lexicon, in the following module
constant TRUNAJOD.spanish_emotion_lexicon.SPANISH_EMOTION_LEXICON
.
Caution
Keep in mind this module is still under development. Moreover only Spanish language is supported by this module as we are directly feeding the class with the lexicon.
The following emotions are captured: alegría, enojo, miedo, repulsión, sorpresa, tristeza.
-
class
TRUNAJOD.emotions.
Emotions
(doc: spacy.tokens.doc.Doc, lemmatizer: Optional[Dict[str, str]] = None)¶ Compute emotions from SPANISH EMOTION LEXICON [RSG14].
Computes emotions based on Probability Factor of Affective use (PFA) and averaging over the total analized words from the text (that are found in the lexicon).
Ideas:
How about not using PFA?
Averaging over emotions and not the total count?
-
get_alegria
() → float¶ Get alegria.
- Returns
Average alegria over number of tokens
- Return type
float
-
get_enojo
() → float¶ Get enojo.
- Returns
Average enojo over number of tokens
- Return type
float
-
get_miedo
() → float¶ Get miedo.
- Returns
Average miedo over number of tokens
- Return type
float
-
get_repulsion
() → float¶ Get repulsion.
- Returns
Average repulsion over number of tokens
- Return type
float
-
get_sorpresa
() → float¶ Get sorpresa.
- Returns
Average sorpresa over number of tokens
- Return type
float
-
get_tristeza
() → float¶ Get tristeza.
- Returns
Average tristeza over number of tokens
- Return type
float