1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-24 10:32:20 +00:00

Add support for py3 in emotion-wnaffect

Normalize polarity values in sentiment-basic and sentiment-140
This commit is contained in:
militarpancho
2017-07-14 11:13:59 +02:00
parent dee007eacf
commit b671ff51f9
7 changed files with 119 additions and 78 deletions

View File

@@ -22,7 +22,7 @@ class Sentiment140Plugin(SentimentPlugin):
polarity_value = self.maxPolarityValue*int(res.json()["data"][0]
["polarity"]) * 0.25
polarity = "marl:Neutral"
neutral_value = self.maxPolarityValue / 2.0
neutral_value = 0
if polarity_value > neutral_value:
polarity = "marl:Positive"
elif polarity_value < neutral_value:
@@ -33,4 +33,4 @@ class Sentiment140Plugin(SentimentPlugin):
marl__polarityValue=polarity_value)
entry.sentiments.append(sentiment)
yield entry
yield entry

View File

@@ -14,5 +14,5 @@
},
"requirements": {},
"maxPolarityValue": "1",
"minPolarityValue": "0"
"minPolarityValue": "-1"
}