Drag the edges to resize the window.

Code Editor
Learn
Using the Personality Insights API

Configuring Personality Insights Package

Before we can send the content we retrieve from Twitter to Personality Insights to be analyzed, we need to setup the credentials for the Personality Insights.

We can do this by adding two variables that will store the username and password that are unique to the Personality Insights instance you created in the previous exercise.

For example:

text = "" for s in statuses: if (s.lang =='en'): text+=s.text.encode('utf-8') #The IBM Bluemix credentials for Personality Insights! pi_username = '' pi_password = ''
Instructions

In CelebrityMatch.py, add the corresponding Personality Insights credentials you obtained in the last exercise to the correct variables. Make sure to add each credential in between the single quotes. Use the example above to help you.

Again, you can obtain the necessary credentials by clicking on “Service Credentials” in the navigation area within Bluemix for the Personality Insights service.

Click Run to save your code.

Note: The PI credentials are required to successfully build the rest of the Celebrity Match application. Without them, the application with not work.

Report a Bug
If you see a bug or any other issue with this page, please report it here.