This article is more than 1 year old

How are you feeling today? Don't tell us, save for it this handy emotion-detection code

Now computers can sense anger from more than furious button mashing

Computer eggheads from Italy's University of Bari have developed what they claim is "the first open-source toolkit for emotion recognition from text."

Developers of Twitter bots, among others, often employ sentiment analysis to evaluate whether text expresses positive or negative feelings.

Google engineer Max Braun, for example, earlier this year released code for a bot designed to buy and sell the stock of public companies mentioned in President Trump's tweets, based on the sometimes correct premise that Trump's praise or condemnation will move the stock price.

To understand Trump's tweets, the code relies on Google's Cloud Natural Language API, which ingests text and returns a variety of data about it. In addition to identifying people, organizations, products, events, and places, Google's API provides a score ranging from -1.0 (negative) to 1.0 (positive).

There are plenty of open source toolkits that do this, not to mention cloud services.

Researchers Fabio Calefato, Filippo Lanubile, Nicole Novielli have developed and released open source code called EmoTxt that attempts to identify from text six emotions – love, joy, anger, sadness, fear, and surprise – and offers a mechanism for training custom emotion classifiers.

They're scheduled to present their work at ACII 2017, the 7th International Conference on Affective Computing and Intelligent Interaction, in San Antonio, Texas, in October.

The researchers trained EmoTxt's emotion classifiers using two datasets, each composed of more than 4,000 questions and answers from programming community site Stack Overflow and from Atlassian's Jira issue tracking software.

Stack Overflow users were asked to identify the presence or absence of the six basic emotions in a database of SO content from July 2008 through September 2015. Each post was evaluated by three raters and disagreements were resolved by majority vote.

Emotion detection in text, to say nothing of images, is available elsewhere. IBM claims its Watson service can do so. Microsoft has had some success, too. And for those skilled in the dark art of teaching machines, existing natural language processing and machine learning tools can be employed to train custom models on emotion data sets.

But EmoTxt comes prepackaged and ready to go, assuming you know your way around Python, Java, R, and the various required libraries. ®

More about

TIP US OFF

Send us news


Other stories you might like