1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-14 04:32: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 #Senpy Response
response = Results() response = Results()
polarityValue = 0
polarity = 'marl:Neutral' polarity = 'marl:Neutral'
if 'N' in value: if 'N' in value:
polarity = 'marl:Negative' polarity = 'marl:Negative'
polarityValue = -1
elif 'P' in value: elif 'P' in value:
polarity = 'marl:Positive' polarity = 'marl:Positive'
polarityValue = 1
entry = Entry(id="Entry0",nif_isString=txt) 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 opinion["prov:wasGeneratedBy"] = self.id
entry.sentiments = [] entry.sentiments = []
entry.sentiments.append(opinion) entry.sentiments.append(opinion)