mirror of
https://github.com/gsi-upm/senpy
synced 2025-08-24 02:22:20 +00:00
Added random plugin and other features
This commit is contained in:
@@ -15,15 +15,19 @@ class Sentiment140Plugin(SentimentPlugin):
|
||||
)
|
||||
)
|
||||
|
||||
response = Response(base=params.get("prefix", None))
|
||||
polarity_value = int(res.json()["data"][0]["polarity"]) * 25
|
||||
p = params.get("prefix", None)
|
||||
response = Response(prefix=p)
|
||||
polarity_value = self.maxPolarityValue*int(res.json()["data"][0]["polarity"]) * 0.25
|
||||
polarity = "marl:Neutral"
|
||||
if polarity_value > 50:
|
||||
polarity = "marl:Positive"
|
||||
elif polarity_value < 50:
|
||||
polarity = "marl:Negative"
|
||||
entry = Entry(id="Entry0", text=params["input"])
|
||||
entry = Entry(id="Entry0",
|
||||
text=params["input"],
|
||||
prefix=p)
|
||||
opinion = Opinion(id="Opinion0",
|
||||
prefix=p,
|
||||
hasPolarity=polarity,
|
||||
polarityValue=polarity_value)
|
||||
opinion["prov:wasGeneratedBy"] = self.id
|
||||
|
@@ -11,5 +11,7 @@
|
||||
"options": ["es", "en", "auto"]
|
||||
}
|
||||
},
|
||||
"requirements": {}
|
||||
"requirements": {},
|
||||
"maxPolarityValue": "1",
|
||||
"minPolarityValue": "0"
|
||||
}
|
||||
|
Reference in New Issue
Block a user