nade

Natural affect detection allows to infer basic emotions from social media messages


License
MIT
Install
pip install nade==0.1.1

Documentation

Readme

try it

This package allows to infer basic emotions from social media messages. While human raters are often too resource-intensive, lexical approaches face challenges regarding incomplete vocabulary and the handling of informal language. Even advanced machine learning-based approaches require substantial resources (expert knowledge, programming skills, annotated data sets, extensive computational capabilities) and tend to gauge the mere presence, not the intensity, of emotion. This package solves this issue by predicting a vast array of emojis based on the surrounding text, then reduces these predicted emojis to an established set of eight basic emotions.

Architecture

Usage

After installation, the module can be loaded and the predict method can be used for inference.

from nade import Nade

n = Nade()
n.predict('I love this')

The method returns a dictionary containing the scores for all eight basic emotions.

{
 'anger': [0.004],
 'anticipation': [0.15],
 'disgust': [0.017],
 'fear': [0.027],
 'joy': [0.451],
 'sadness': [0.02],
 'surprise': [0.142],
 'trust': [0.242]
}

Installation

The package can be installed as follows:

pip install git+https://github.com/inkrement/nade.git

Performance

The prediction method features a lleaves option that provides much faster inference. However, you will have to install lleaves first.

Notes

  • Usage on Apple M1 chips require additional dependencies (i.e., brew install cmake libomp)

Links