Watson Personality Insights Introduction and How to access Watson without SDK
By: Jesus Almaraz Martin
Tags: Data Science, Artificial Intelligence, Ibm Watson, Sdk, Big Data

In short: The Holy Grail for marketing campaign authors. Are we happy? Keep on reading and likely you shouldn´t. Enter some concerns.

“Does it work?” And some Concerns.

I am not qualified to answer this question, because I am not a psychologist. The closer I have been to check this service is this test: I wrote some thoughts in a document and upload it to IBM personality Insights. Next I make a conventional personality test https://www.truity.com/test/big-five-personality-test and I compare the outputs with Watson ones. The Big 5 values are very close in both cases.

This not a serious test, if you want a more accurate opinion, you must ask to Marketing and Psychology experts.

In the other side we can have lots of moral and legal issues with the tool. A good read about these questions: https://medium.com/taraaz/https-medium-com-taraaz-human-rights-implications-of-ibm-watsons-personality-insights-942413e81117 In this post the author talks a lot about the service concerns and its background. Very interesting.

The tech stuff: Accessing without SDK.

The first question is, What is an SDK? An SDK is an additional module, that IBM gives us to access more easily to its services. We import the SDK to our programming language and this way we can access through the module.

The second, Why Do I want to access without the SDK? There are two main reasons:

I work with Microsoft Business Central AL. This programming language doesn´t able to import modules like IBM Watson SDK, so I have to access directly making a HTTPRequest to Watson API. My code could be useful form other people in dev environments that neither allow the use of modules.

The other reason is that IBM doesn´t provide SDK for all its services. Some beta services as Natural Language Understanding, haven´t SDK.

All JavaScript node code is in my GIT repo: https://github.com/JalmarazMartn/Watson-personal-insights-node-whithout-SDK

Remarks:

var request = require(“request”); auth = require(‘./ApiKey.json’); var transUrl = “https://gateway-lon.watsonplatform.net/personality-insights/api/v3/profile?version=2017-10-13&consumption_preferences=true" var data2 = {}; var data2 = require(‘./profile.json’); request.post( { url: transUrl,

auth, headers:{ content_type: ‘application/json’, }, body: JSON.stringify(data2) } , function (err, response, body) { console.log(body); });

We make a HttpRequest to the service, with to files:

Apikey. Are the access keys to Watson. I leave an example in the repo.

Profile. That´s the file with the social media entries. Looks like this:

{ “contentItems”: [ { “content”: “Trump impeachment conclusion is unpredictable due to lack of antecedents.”,”contenttype”: “text/plain”,”created”: 1447639154000, “id”: “666073008692314113”,”language”: “en”}, { “content”: “I have serious doubts about Spain basket team, due important players refusing: Rodr�guez Ibaka Mirotic “contenttype”: “text/plain”,”created”: 1447638226000, “id”: “666069114889179136”,”language”: “en”}, { “content”: “Surprising win over Serbia. The keys: defense and Claver performance.”,

That’s all. Have a nice day and be careful: some people are watching us (put on a silver paper hat to avoid it).