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

@@ -18,7 +18,7 @@ class BasicBox(SentimentBox):
'default': 'marl:Neutral'
}
def box(self, input, **kwargs):
def predict(self, input):
output = basic.get_polarity(input)
return self.mappings.get(output, self.mappings['default'])

View File

@@ -18,7 +18,7 @@ class Basic(MappingMixin, SentimentBox):
'default': 'marl:Neutral'
}
def box(self, input, **kwargs):
def predict(self, input):
return basic.get_polarity(input)
test_cases = [{

View File

@@ -18,7 +18,7 @@ class PipelineSentiment(MappingMixin, SentimentBox):
-1: 'marl:Negative'
}
def box(self, input, *args, **kwargs):
def predict(self, input):
return pipeline.predict([input, ])[0]
test_cases = [