mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-08-13 11:50:15 +08:00
Batch support bug fixes
This commit is contained in:
@@ -3,7 +3,7 @@ import indicoio.config as config
|
||||
|
||||
JSON_HEADERS = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
||||
|
||||
Version, version, __version__, VERSION = ('0.4.11',) * 4
|
||||
Version, version, __version__, VERSION = ('0.4.12',) * 4
|
||||
|
||||
from indicoio.text.sentiment import political, posneg
|
||||
from indicoio.text.sentiment import posneg as sentiment
|
||||
|
||||
@@ -24,7 +24,8 @@ def api_handler(arg, url, batch=False, auth=None):
|
||||
data_dict = json.dumps({'data': arg})
|
||||
if batch:
|
||||
url += "/batch"
|
||||
auth = auth_query()
|
||||
if not auth:
|
||||
auth = auth_query()
|
||||
response = requests.post(url, data=data_dict, headers=JSON_HEADERS, auth=auth).json()
|
||||
results = response.get('results', False)
|
||||
if not results:
|
||||
|
||||
Reference in New Issue
Block a user