1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-10-19 17:58:28 +00:00
This commit is contained in:
J. Fernando Sánchez
2017-06-16 17:53:42 +02:00
parent 312e7f7f12
commit 8e4578dc25
9 changed files with 136 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
import random
from senpy.plugins import EmotionPlugin
from senpy.models import EmotionSet, Emotion
from senpy.models import EmotionSet, Emotion, Entry
class RmoRandPlugin(EmotionPlugin):
@@ -16,3 +16,11 @@ class RmoRandPlugin(EmotionPlugin):
emotionSet.prov__wasGeneratedBy = self.id
entry.emotions.append(emotionSet)
yield entry
def test(self):
params = dict()
results = list()
for i in range(100):
res = next(self.analyse_entry(Entry(text="Hello"), params))
res.validate()
results.append(res.emotions[0]['onyx:hasEmotion'][0]['onyx:hasEmotionCategory'])