1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-13 04:02:29 +00:00

Added polarityValue to meaningCloud plugin

This commit is contained in:
militarpancho 2017-01-19 17:16:42 +01:00
parent f9c4e4bd59
commit c57cfff0cc

View File

@ -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)