Tag Archives: WordPress

Measuring My Blog’s Emotional Tone with IBM Watson

[Original post, from 2015-12-09:]

I developed a WordPress plugin that shows the emotional tone of blog posts using the “experimental” IBM Watson Tone Analyzer API.

My plugin extracts the contents of a blog post and sends it to the IBM Watson Tone Analyzer API, which returns scores for several attributes, including the three attributes of emotional tone that IBM has found to be most salient, viz. cheerfulness, negativity and anger.

According to IBM:

  • Cheerfulness refers to positive emotions such as joy, optimism, contentment, inspiration, and happiness.
  • Negative emotions include feelings of fear, disgust, despair, guilt, rejection, and humiliation.
  • Anger is a type of negative feeling with strong intensity such as annoyance, hostility, aggression, hurt, frustration and rage.

Finally, the plugin pulls these scores from the API response body and displays a simple bar graph.

The cognitive science behind their analysis is a bit beyond me.  It appears to look for emotitone of post bar chart (using IBM Watson)onally loaded words. For example, if you put the word “lousy” in your post, it will bump the negativity and anger scores way up… (Oooops.. I just put the word “lousy” in this post, which explains the high “negativity” and “anger” scores in the graph below.  (“Oops, I did it again!”))

This product has interesting implications. I’m guessing someone in advertising somewhere is doing A/B testing on copy to see if more “cheerful” ads sell more widgets….

For Further Reading

Rama Akkiraju, IBM Watson Tone Analyzer – new service now available,
https://developer.ibm.com/watson/blog/2015/07/16/ibm-watson-tone-analyzer-service-experimental-release-announcement/ (July 16, 2015).


Update: The State of My Emotional-Tone-Measuring WordPress Plug-In

[Update of 2016-02-26:]

IBM updated the API used by my plugin in February, which broke my implementation of it.  So now it just returns this:

IBM's Watson has scored the emotional tone of this post as follows:
0.0%
cheerfulness

0.0%
negativity

0.0%
anger

 

(Such is the nature of using random, free, experimental APIs….)

This is What We Call a “Blocking Issue”

Their Tone Analyzer API has been promoted from “Experimental” status to “Beta”.  The new version adds some significant enhancements.

It also now requires that you set up BlueMix credentials to use it.  No problem, I’ll just log into my BlueMix (BM) account and set this thing up.

Then this happens:

Locked Out of IBM BlueMix

Locked Out of IBM BlueMix

BM tells me:

Account Not Active

BXNUI0125E: You will be logged out because you are not a member of an active account.

This might happen if your Bluemix account expired or was cancelled, or if you were removed as a user from your org. Check with your org manager. Or, go to DOCS and select Troubleshooting for help and support options.

 

(I have a sneaking suspicion the “org manager” is me. And anyone who thinks that my going to BM DOCS will fix this is overestimating my cognitive abilities.)

Based on a search of my emails, it looks like BM locked me out because I wouldn’t give them a credit card number.

A little history — Last summer, I was evaluating all kinds of cloud hosting services — Cloud9, AWS, Heroku, MongoLab, OpenShift, etc. — and had spun up a sample Bluemix environment.  I found a lot to like, to love, even, about the big BM, but, frankly, I was not sure it was right for my small projects. (I’m just an independent developer/consultant — no longer part of a large enterprise shop.)

Further, I was already a tad confused about Bluemix pricing, then I got this email from an IBM sales rep.:

Is it time to purchase Bluemix? I have a special offer for you. I can offer 6 months of Bluemix for only $1,350.00. Please email me and I can get you a quote.

Lay the foundation to getting your applications to production and working for you.

Discounts grow with longer commitments. If needed we can discuss 12, 24, and 36 month options.

Whoa! Where in the heckvegas did “$1350.00” come from?  I was on a free trial, and figured there would be free (or near-free) option to play with like many of the other services.

This confusion on pricing prevented me from giving BM my digits. (Note: I realize there are valid reasons, such as identity confirmation and fraud prevention, for a cloud host to want a credit card, even if they’re not going to charge it.)

Project Status: On Ice

I don’t rule out using Bluemix for a real production enterprise project, but my WP plugin project was a proof-of-concept done for giggles. No client; no budget.

Perhaps one day, I’ll have more resources (my free time) to figure out how to get my BM account back and amaze the world with an updated, non-experimental IBM Tone Analyzer API-based WordPress plugin. Until then, I’ll consider the concept to be proven and move on to the next adventure.

 

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Hello, World!

Is there a better first statement than “Hello, World!”?

It carries the same powerful message as “Greetings, Planet! I’m here. Deal with it!” in a compact, pithy package.

Many programming students wrote “Hello World” as their first output.  (The original such use is widely attributed to Brian Kernighan of Bell Labs.)

Ways to Say It

The syntax required to produce “Hello World!” gives you a flavor of the language.

In Java one would type the following:

class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

In JavaScript, one would code the following:

document.write('Hello, World!');

A PHP programmer’s first line is typically something like this:

echo "Hello, world!";

This syntax hints that it’s a lot easier to get up and running in JavaScript or PHP than in Java (The further implications of that suggest a subject for another day).

It’s fairly easy to get started with WordPress — the platform does the actual coding for you.

Ways to Say It, Part 2

But what is in between the quotes?  Doesn’t that say something about the programmer’s (human) language?

Shouldn’t there be a comma in “Hello World”?  In English, commas are used to set off words of direct address, and you’re directly addressing the World.  Speaking of which, “World” should be capitalized – you’re not addressing any world, you’re addressing THE World — by name!  And an exclamation point, for that matter — First impressions count – don’t you want to be seen as enthusiastic about your very first output!

So, “Hello to you, World — hello!”

Sources

http://en.wikipedia.org/wiki/Hello_world_program
http://www.helloworldexample.net/
http://docs.oracle.com/javase/tutorial/getStarted/application/index.html
http://www4.ncsu.edu/~wdlloyd/grammarreview-commas.htm
http://stackoverflow.com/questions/602237/where-does-hello-world-come-from

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)