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

Fixed some bugs

This commit is contained in:
militarpancho
2017-01-17 11:49:01 +01:00
parent 7b583f504c
commit f9c4e4bd59
3 changed files with 8 additions and 5 deletions

View File

@@ -28,12 +28,13 @@ class unifiedPlugin(SentimentPlugin):
logger.info('TXT:%s' % txt)
endpoint = params["endpoint"]
lang = params.get("language")
key = params["apiKey"]
sentiplug = params["sentiments-plugin"]
s_params = params.copy()
s_params.update({'algo':sentiplug,'language':lang})
s_params.update({'algo':sentiplug,'language':lang, 'meaningCloud-key':key})
senti_response = requests.get(endpoint, params=s_params).json()
logger.info('SENTIPARAMS: %s' % s_params)
logger.info('SENTIRESPONSE: %s' % senti_response)
if 'entries' not in senti_response:
raise Error(senti_response)
senti_response = Results(senti_response)

View File

@@ -30,7 +30,7 @@
"default": "http://senpy.cluster.gsi.dit.upm.es/api/"
},
"apiKey": {
"aliases": ["apiKey","meaningCloud-key"],
"aliases": ["meaningCloud-key","apiKey"],
"required": false
}