SSL Error IBM Watson personality-insights Python -
i trying use ibm personality insights service inside loop. below.
def generatetoken(username, password): r = requests.get("https://gateway.watsonplatform.net/authorization/api/v1/token?url=https://gateway.watsonplatform.net/personality-insights/api", auth=(username, password)) if r.status_code == requests.codes.ok: return r.text def personalityrequest(text, token): base_url='https://gateway.watsonplatform.net/personality-insights/api/v3/profile?version=2017-08-17&consumption_preferences=true&raw_scores=true' headers = {'x-watson-authorization-token': token, 'content-type': 'text/plain'} r = requests.post(base_url, headers=headers, data={'body': text}) return r.text token = generatetoken('#username', '#password') user in range(0,user_data.shape[0]): user_data["user_personality"][user] = personalityrequest(user_data["user_preferences"][user], token)
the user_data
panda dataframe around 80 observations , user_preferences
column user text.
when run above code proper responses around 30 40 users , gives me below error.
sslerror: ("bad handshake: error([('ssl routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
wiki
Comments
Post a Comment