1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-24 02:22:20 +00:00

Multiple changes in the API, schemas and UI

Check out the CHANGELOG.md file for more information
This commit is contained in:
J. Fernando Sánchez
2019-01-07 12:08:19 +01:00
parent 4ba30304a4
commit 8a516d927e
111 changed files with 9670 additions and 46155 deletions

View File

@@ -1,25 +1,20 @@
from senpy import SentimentBox, MappingMixin, easy_test
from senpy import SentimentBox, easy_test
from mypipeline import pipeline
class PipelineSentiment(MappingMixin, SentimentBox):
'''
This is a pipeline plugin that wraps a classifier defined in another module
(mypipeline).
'''
class PipelineSentiment(SentimentBox):
'''This is a pipeline plugin that wraps a classifier defined in another module
(mypipeline).'''
author = '@balkian'
version = 0.1
maxPolarityValue = 1
minPolarityValue = -1
mappings = {
1: 'marl:Positive',
-1: 'marl:Negative'
}
def predict_one(self, input):
return pipeline.predict([input, ])[0]
def predict_one(self, features, **kwargs):
if pipeline.predict(features) > 0:
return [1, 0, 0]
return [0, 0, 1]
test_cases = [
{