1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-12-22 04:58:12 +00:00
Go to file
J. Fernando Sánchez 23c6cdd58d Squashed 'emotion-wnaffect/' content from commit 74c40d7
git-subtree-dir: emotion-wnaffect
git-subtree-split: 74c40d7e97d54d3c3e30739a85cf9322c92d5a87
2018-06-12 10:01:44 +02:00
.makefiles Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
data@0dc601a871 Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
.gitignore Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
.gitlab-ci.yml Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
.gitmodules Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
Dockerfile-2.7 Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
Dockerfile-3.5 Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
Dockerfile.template Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
emotion-wnaffect.py Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
emotion-wnaffect.senpy Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
emotion.py Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
Makefile Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
README.md Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00
wnaffect.py Squashed 'emotion-wnaffect/' content from commit 74c40d7 2018-06-12 10:01:44 +02:00

WordNet-Affect plugin

This plugin uses WordNet-Affect (http://wndomains.fbk.eu/wnaffect.html) to calculate the percentage of each emotion. The plugin classifies among five diferent emotions: anger, fear, disgust, joy and sadness. It is has been used a emotion mapping enlarge the emotions:

  • anger : general-dislike
  • fear : negative-fear
  • disgust : shame
  • joy : gratitude, affective, enthusiasm, love, joy, liking
  • sadness : ingrattitude, daze, humlity, compassion, despair, anxiety, sadness

Installation

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

Data format

data/a-hierarchy.xml is a xml file data/a-synsets.xml is a xml file

Usage

The parameters accepted are:

  • Language: English (en).
  • Input: Text to analyse.

Example request:

http://senpy.cluster.gsi.dit.upm.es/api/?algo=emotion-wnaffect&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.

The response of this plugin uses Onyx ontology developed at GSI UPM for semantic web.

This plugin uses WNAffect labels for emotion analysis.

The emotion-wnaffect.senpy file can be copied and modified to use different versions of wnaffect with the same python code.

Known issues

![alt GSI Logo][logoGSI] [logoGSI]: http://www.gsi.dit.upm.es/images/stories/logos/gsi.png "GSI Logo"