From c57cfff0ccda9250cdba5b259c00a65f9e6c08e4 Mon Sep 17 00:00:00 2001 From: militarpancho Date: Thu, 19 Jan 2017 17:16:42 +0100 Subject: [PATCH] Added polarityValue to meaningCloud plugin --- meaningCloud/meaningCloud.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meaningCloud/meaningCloud.py b/meaningCloud/meaningCloud.py index 2e04ff2..6b44ae3 100644 --- a/meaningCloud/meaningCloud.py +++ b/meaningCloud/meaningCloud.py @@ -35,14 +35,16 @@ class DaedalusPlugin(SentimentPlugin): #Senpy Response response = Results() - + polarityValue = 0 polarity = 'marl:Neutral' if 'N' in value: polarity = 'marl:Negative' + polarityValue = -1 elif 'P' in value: polarity = 'marl:Positive' + polarityValue = 1 entry = Entry(id="Entry0",nif_isString=txt) - opinion = Sentiment(id="Opinion0",marl__hasPolarity=polarity) + opinion = Sentiment(id="Opinion0",marl__hasPolarity=polarity,marl__polarityValue = polarityValue) opinion["prov:wasGeneratedBy"] = self.id entry.sentiments = [] entry.sentiments.append(opinion)