1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-23 18:12:20 +00:00

Change Box plugin to mimic a sklearn classifier

This commit is contained in:
J. Fernando Sánchez
2018-01-10 09:50:52 +01:00
parent fbb418c365
commit 92189822d8
5 changed files with 10 additions and 9 deletions

View File

@@ -212,7 +212,7 @@ class PluginsTest(TestCase):
def input(self, entry, **kwargs):
return entry.text
def box(self, input, **kwargs):
def predict(self, input):
return 'SIGN' in input
def output(self, output, entry, **kwargs):
@@ -242,7 +242,7 @@ class PluginsTest(TestCase):
mappings = {'happy': 'marl:Positive', 'sad': 'marl:Negative'}
def box(self, input, **kwargs):
def predict(self, input, **kwargs):
return 'happy' if ':)' in input else 'sad'
test_cases = [