Microsoft’s AI Answers How PM Nawaz Really Feels About Panama Leaks

Back in 2015, Microsoft released its Emotion API (Project Oxford) which could analyze a person’s face and detect a range of feelings. While we can generally assess the emotions through a person’s facial expressions, using Microsoft’s artificial intelligence can unearth many hidden emotions that the human eye might not be able to decipher.

Making use of the Emotion API, Ammar A. Raja, a data analyst from Pakistan, has analyzed Prime Minister Nawaz Sharif’s public address to the nation following the Panama Papers revelations.

Ammar says:

I read an article in which Ben Hubl applied Microsoft Cognitive Service Emotion API for an emotions analysis of the video of Hillary and Trump debate. I was amazed to see the accuracy of results, and the way the graphs of emotions were shown for each frame of the video.

Inspired by this, he carried out the same analysis on PM Sharif’s complete public address post Panama revelations. The observations made by the AI are rather…. interesting.

How it Works?

According to Microsoft, “the Emotion API takes a facial expression in an image as an input, and returns the confidence across a set of emotions for each face in the image, as well as bounding box for the face, using the Face API.”

The API can detect anger, contempt, disgust, fear, happiness, neutral, sadness and surprise as ratios out of 1 (Neutral is not assessed in video analysis). The AI can differentiate cross-cultural facial expressions.

With that introduction out of the way, let’s get to the main issue.

What Does the Emotion API Test Say of PM’s Address?

The Emotion API gives out numbers for its findings. As suggested by one of the pictures above, the highest emotional values were:

  • Neutral – 0.42
  • Anger – 0.30
  • Disgust – 0.20

Happiness was nearly non-existent while Fear was on the lower side as well.

Coming down to the video analysis of the whole video, the API provides a JSON (Java Script Object Notation) file which reports the emotions for each frame of the video.

The graph below shows the average emotions from the whole video:

As expected, Anger remains the most noticeable emotional expression throughout the video followed by sadness and disgust. Pretty much what was noticed in the image, is repeated throughout the video.

A histogram of the reported values during the whole speech is shown below. It reports the emotional values for each frame of the video as it progresses.

Anger, Sadness and Disgust were the noticeable expressions initially, but these dipped as the speech moved towards the finale. Happiness also increased during the video and peaked out at the end of the speech. The rest of the emotions remained nearly the same throughout. Interestingly, as per the Emotion API, Nawaz Sharif did not feel surprised at the leaked information in the Panama Papers.

Either for academic purposes or the other, artificial intelligence has done a remarkable job at giving us a peak into what went behind that address of PM Sharif. As for Ammar, he plans on using natural language processing to use the sound to assess the emotions of the Prime Minister in the future.

So what do you think of the data here? Did it do an accurate enough job of giving us a peek at the emotions? Or do the numbers lie? Sound off in the comments below.

He is the Editor-in-Chief at ProPakistani. Reach out at aadil.s[at]

    • Sorry, i’m away from Paki media…… whats going on with IK bani gala’s home?????

        • Bani Gala area construction are illegal since 90s, a police action was done against resident in 90s and many people died. Status never changed, don’t know how Imran got clearance from local body.

  • Your graphs are in-correct as Neutral is valued at 0.42 and anger comes next to 0.30, yet Neutral value is not displayed in the both the graphs, which clearly shows a biased statement highlighting anger as the main objective.

    Clearly shows that the intentions were biased.

    • Agreed, Time and again PP publishes such posts that highlights their biased approach, m not pro N, but this double standard approach is a let down, how can u claim urself to be different when u actually do the same thing

  • Amazing but findings are not surprised every Pakistani knows every politician is corrupt even many of them have committed crimes. It is general feeling of Pakistani peoples.

  • Pakistani politicians are pro in controlling their emotions, this is literally a joke.

  • Anger remained highest because he doesn’t like to be challenged & has allways suffered due to this adament / proud nature.
    The fear was quite low because he knows that he has successfully appointed his stooges on all the departments who deal with him if there is any investigation etc.
    Moreover a shameless, seasoned crook, habitual liar/cheat can defy such tests to a great extent.
    He was speaking like a seasoned beggar who can repeatedly turn your emotions into helping him.

  • ye kya stupid article hai ? where is diginity of Amir Ataa sahab ?
    shayad kpk gayee hai tabdeeli daikhnay

  • Dear Friends

    I wrote the original article and used Microsoft Cognitive Services video emotions analysis available on Microsoft Azure. This article is also featured at Data Science Central which is the biggest community of Big Data Practitioners and many other local and international blogs. The picture which is shown here was emotional analysis of picture api which gives slightly different output as compared video emotions analysis, that’s why neutral emotion is not available in the graphs. Please see the original post for details.



  • Ltd feature videos

    Watch more at LTD