mirror of
https://github.com/gsi-upm/senpy
synced 2025-10-24 04:08:19 +00:00
Multiple changes in the API, schemas and UI
Check out the CHANGELOG.md file for more information
This commit is contained in:
@@ -103,7 +103,9 @@ class CentroidConversion(EmotionConversionPlugin):
|
||||
for i in emotionSet.onyx__hasEmotion:
|
||||
e.onyx__hasEmotion.append(self._backwards_conversion(i))
|
||||
else:
|
||||
raise Error('EMOTION MODEL NOT KNOWN')
|
||||
raise Error('EMOTION MODEL NOT KNOWN. '
|
||||
'Cannot convert from {} to {}'.format(fromModel,
|
||||
toModel))
|
||||
yield e
|
||||
|
||||
def test(self, info=None):
|
||||
|
||||
@@ -31,7 +31,7 @@ centroids_direction:
|
||||
- emoml:pad
|
||||
aliases: # These are aliases for any key in the centroid, to avoid repeating a long name several times
|
||||
A: emoml:pad-dimensions:arousal
|
||||
V: emoml:pad-dimensions:pleasure
|
||||
V: emoml:pad-dimensions:valence
|
||||
D: emoml:pad-dimensions:dominance
|
||||
anger: emoml:big6anger
|
||||
disgust: emoml:big6disgust
|
||||
|
||||
@@ -6,7 +6,7 @@ class MaxEmotion(PostProcessing):
|
||||
author = '@dsuarezsouto'
|
||||
version = '0.1'
|
||||
|
||||
def process_entry(self, entry, params):
|
||||
def process_entry(self, entry, activity):
|
||||
if len(entry.emotions) < 1:
|
||||
yield entry
|
||||
return
|
||||
@@ -32,7 +32,7 @@ class MaxEmotion(PostProcessing):
|
||||
|
||||
entry.emotions[0]['onyx:hasEmotion'] = [max_emotion]
|
||||
|
||||
entry.emotions[0]['prov:wasGeneratedBy'] = "maxSentiment"
|
||||
entry.emotions[0]['prov:wasGeneratedBy'] = activity.id
|
||||
yield entry
|
||||
|
||||
def check(self, request, plugins):
|
||||
@@ -43,12 +43,11 @@ class MaxEmotion(PostProcessing):
|
||||
# 2 Case to return a Neutral Emotion.
|
||||
test_cases = [
|
||||
{
|
||||
"name":
|
||||
"If there are several emotions within an emotion set, reduce it to one.",
|
||||
"name": "If there are several emotions within an emotion set, reduce it to one.",
|
||||
"entry": {
|
||||
"@type":
|
||||
"entry",
|
||||
"emotions": [
|
||||
"onyx:hasEmotionSet": [
|
||||
{
|
||||
"@id":
|
||||
"Emotions0",
|
||||
@@ -94,7 +93,7 @@ class MaxEmotion(PostProcessing):
|
||||
'expected': {
|
||||
"@type":
|
||||
"entry",
|
||||
"emotions": [
|
||||
"onyx:hasEmotionSet": [
|
||||
{
|
||||
"@id":
|
||||
"Emotions0",
|
||||
@@ -107,9 +106,7 @@ class MaxEmotion(PostProcessing):
|
||||
"onyx:hasEmotionCategory": "joy",
|
||||
"onyx:hasEmotionIntensity": 0.3333333333333333
|
||||
}
|
||||
],
|
||||
"prov:wasGeneratedBy":
|
||||
'maxSentiment'
|
||||
]
|
||||
}
|
||||
],
|
||||
"nif:isString":
|
||||
@@ -122,7 +119,7 @@ class MaxEmotion(PostProcessing):
|
||||
"entry": {
|
||||
"@type":
|
||||
"entry",
|
||||
"emotions": [{
|
||||
"onyx:hasEmotionSet": [{
|
||||
"@id":
|
||||
"Emotions0",
|
||||
"@type":
|
||||
@@ -171,7 +168,7 @@ class MaxEmotion(PostProcessing):
|
||||
'expected': {
|
||||
"@type":
|
||||
"entry",
|
||||
"emotions": [{
|
||||
"onyx:hasEmotionSet": [{
|
||||
"@id":
|
||||
"Emotions0",
|
||||
"@type":
|
||||
@@ -181,9 +178,7 @@ class MaxEmotion(PostProcessing):
|
||||
"@type": "emotion",
|
||||
"onyx:hasEmotionCategory": "neutral",
|
||||
"onyx:hasEmotionIntensity": 1
|
||||
}],
|
||||
"prov:wasGeneratedBy":
|
||||
'maxSentiment'
|
||||
}]
|
||||
}],
|
||||
"nif:isString":
|
||||
"Test"
|
||||
|
||||
Reference in New Issue
Block a user