watson_developer_cloud.personality_insights_v3 module

The v3 Personality Insights service (https://www.ibm.com/watson/developercloud/personality-insights.html)

class PersonalityInsightsV3(version='2016-10-20', url='https://gateway.watsonplatform.net/personality-insights/api', **kwargs)[source]

Bases: watson_developer_cloud.watson_developer_cloud_service.WatsonDeveloperCloudService

Wrapper for the Personality Insights service

default_url = 'https://gateway.watsonplatform.net/personality-insights/api'
default_version = '2016-10-20'
profile(text, content_type='text/plain', content_language=None, accept='application/json', accept_language=None, raw_scores=False, consumption_preferences=False, csv_headers=False)[source]
Parameters:
  • text – The input text to be analyzed; provide a minimum of 100 words and a maximum of 20 MB of content
  • content_type – Type of the input text: ‘text/plain’ (default), ‘text/html’, or ‘application/json’; for plain text or HTML, include the charset parameter to indicate the character encoding
  • content_language – Language of the input text: ‘ar’, ‘en’ (default), ‘es’, or ‘ja’
  • accept – Type of the response: ‘application/json’ (default) or ‘text/csv’
  • accept_language – Language of the response: ‘ar’, ‘de’, ‘en’ (default), ‘es’, ‘fr’, ‘it’, ‘ja’, ‘ko’, ‘pt-br’, ‘zh-cn’, or ‘zh-tw’
  • raw_scores – If True, returns percentage scores not compared with a sample population in addition to normalized scores
  • consumption_preferences – If True, returns consumption preferences in addition to normalized scores
  • csv_headers – If True, returns a row of headers for CSV output
Returns:

A personality profile with normalized percentile scores in JSON or CSV format