1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-09-20 22:01:41 +00:00
Go to file
J. Fernando Sánchez 98ec4817cf Squashed 'emotion-anew/' content from commit e8a3c83
git-subtree-dir: emotion-anew
git-subtree-split: e8a3c837e3543a5f5f19086e1fcaa34b22be639e
2018-06-12 10:01:45 +02:00
data@76b75e348a Squashed 'emotion-anew/' content from commit e8a3c83 2018-06-12 10:01:45 +02:00
.gitmodules Squashed 'emotion-anew/' content from commit e8a3c83 2018-06-12 10:01:45 +02:00
emotion-anew.py Squashed 'emotion-anew/' content from commit e8a3c83 2018-06-12 10:01:45 +02:00
emotion-anew.pyc Squashed 'emotion-anew/' content from commit e8a3c83 2018-06-12 10:01:45 +02:00
emotion-anew.senpy Squashed 'emotion-anew/' content from commit e8a3c83 2018-06-12 10:01:45 +02:00
README.md Squashed 'emotion-anew/' content from commit e8a3c83 2018-06-12 10:01:45 +02:00
test.py Squashed 'emotion-anew/' content from commit e8a3c83 2018-06-12 10:01:45 +02:00

Plugin emotion-anew

This plugin consists on an emotion classifier that detects six possible emotions:

  • Anger : general-dislike.
  • Fear : negative-fear.
  • Disgust : shame.
  • Joy : gratitude, affective, enthusiasm, love, joy, liking.
  • Sadness : ingrattitude, daze, humlity, compassion, despair, anxiety, sadness.
  • Neutral: not detected a particulary emotion.

The plugin uses ANEW lexicon dictionary to calculate VAD (valence-arousal-dominance) of the sentence and determinate which emotion is closer to this value. To do this comparision, it is defined that each emotion has a centroid, calculated according to this article: http://www.aclweb.org/anthology/W10-0208.

The plugin is going to look for the words in the sentence that appear in the ANEW dictionary and calculate the average VAD score for the sentence. Once this score is calculated, it is going to seek the emotion that is closest to this value.

The response of this plugin uses Onyx ontology developed at GSI UPM, to express the information.

Installation

  • Download
git clone https://lab.cluster.gsi.dit.upm.es/senpy/emotion-anew.git
  • Get data
cd emotion-anew
git submodule update --init --recursive
  • Run
docker run -p 5000:5000 -v $PWD:/plugins gsiupm/senpy:python2.7 -f /plugins

Data format

data/Corpus/affective-isear.tsv contains data from ISEAR Databank: http://emotion-research.net/toolbox/toolboxdatabase.2006-10-13.2581092615

##Usage

Params accepted:

  • Language: English (en) and Spanish (es).
  • Input: input text to analyse.

Example request:

http://senpy.cluster.gsi.dit.upm.es/api/?algo=emotion-anew&language=en&input=I%20love%20Madrid

Example respond: This plugin follows the standard for the senpy plugin response. For more information, please visit senpy documentation. Specifically, NIF API section.

Known issues

alt GSI Logo