mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-07-05 17:30:05 +08:00
Email + password auth from client
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from indicoio.utils import api_handler
|
||||
|
||||
def language(api_root, text, batch=False):
|
||||
def language(api_root, text, batch=False, auth=None):
|
||||
"""
|
||||
Given input text, returns a probability distribution over 33 possible
|
||||
languages of what language the text was written in.
|
||||
@@ -23,4 +23,4 @@ def language(api_root, text, batch=False):
|
||||
:rtype: Dictionary of language probability pairs
|
||||
"""
|
||||
|
||||
return api_handler(text, api_root + "language", batch=batch)
|
||||
return api_handler(text, api_root + "language", batch=batch, auth=auth)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from indicoio import JSON_HEADERS
|
||||
from indicoio.utils import api_handler
|
||||
|
||||
def political(api_root, text, batch=False):
|
||||
def political(api_root, text, batch=False, auth=None):
|
||||
"""
|
||||
Given input text, returns a probability distribution over the political alignment of the speaker.
|
||||
|
||||
@@ -27,9 +27,9 @@ def political(api_root, text, batch=False):
|
||||
:rtype: Dictionary of party probability pairs
|
||||
"""
|
||||
|
||||
return api_handler(text, api_root + "political", batch=batch)
|
||||
return api_handler(text, api_root + "political", batch=batch, auth=auth)
|
||||
|
||||
def posneg(api_root, text, batch=False):
|
||||
def posneg(api_root, text, batch=False, auth=None):
|
||||
"""
|
||||
Given input text, returns a scalar estimate of the sentiment of that text.
|
||||
Values are roughly in the range 0 to 1 with 0.5 indicating neutral sentiment.
|
||||
@@ -50,4 +50,4 @@ def posneg(api_root, text, batch=False):
|
||||
:rtype: Float
|
||||
"""
|
||||
|
||||
return api_handler(text, api_root + "sentiment", batch=batch)
|
||||
return api_handler(text, api_root + "sentiment", batch=batch, auth=auth)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from indicoio.utils import api_handler
|
||||
|
||||
def text_tags(api_root, text, batch=False):
|
||||
def text_tags(api_root, text, batch=False, auth=None):
|
||||
"""
|
||||
Given input text, returns a probability distribution over 100 document categories
|
||||
|
||||
@@ -22,4 +22,4 @@ def text_tags(api_root, text, batch=False):
|
||||
:rtype: Dictionary of class probability pairs
|
||||
"""
|
||||
|
||||
return api_handler(text, api_root + "texttags", batch=batch)
|
||||
return api_handler(text, api_root + "texttags", batch=batch, auth=None)
|
||||
|
||||
Reference in New Issue
Block a user