Human emotions can be difficult to understand, even for trained professionals. But what if a computer could decipher your feelings, perhaps even better than a therapist?
That possibility is a step closer to becoming reality, thanks to a computer program that can detect with near-human accuracy nuanced emotions using Twitter data. In this Q&A, Muhammad Abdul-Mageed, assistant professor in UBC’s school of library, archival and information studies who developed the program, explains the possibilities for the software.
Why is it important to have computers that can detect emotion, especially on social media?
Emotion is key to communication and decision-making. With people using computers for everything from shopping to health-care decisions, it is becoming increasingly important to have computers that can detect emotions. For example, in classes where students use computers to learn, emotion-detection software— which we call emotional “chatbots”— can help students stay motivated by sending messages like, “I know that is a frustrating problem. Let’s try addressing it from a different angle,” or “Excellent! You’re right to be proud having solved that.” This can increase engagement and reduce student frustration and dropout.
Social media is pervasive in our lives and people freely express their emotions online. Emotional chatbots can help improve individual and community wellbeing in several ways. They can help assess the mood of groups of people, such as stress levels at work. Since emotions can be contagious— in that we are all affected by the emotions of people surrounding us— emotional chatbots can be used to improve the overall wellbeing of people by exposing them to more positive emotions on social media. With proper consent and privacy guarantees, it can also help in the early detection of mental health problems.
Technology companies could also use this type of software to develop more advanced artificial intelligence that has the potential to better understand human emotions. For example, Apple could use emotional chatbots to develop a more intuitive, emotionally aware Siri.
What were some of the challenges you faced developing this software?
Previous research has shown it is possible to build machines that can successfully detect emotions like anger, disgust, fear, joy, sadness, surprise, and sometimes anticipation and trust. But the human emotional experience is more complex than just eight emotions.
Recent advances in “deep learning”— a branch of artificial intelligence inspired by information processing in the human brain— show that, given enough labeled data, it should be possible to build better models. Manual labeling of data, however, is expensive, so it is desirable to develop labeled emotion data without annotators. While the proliferation of social media has made it possible for us to acquire large datasets with implicit labels in the form of hashtags (in the case of emotion), these labels are not always reliable.
For example, while the tweet “I can’t wait to eat my lunch in this amazing Vancouver waterfront restaurant with my friends. #thrilled” clearly expresses happiness, a tweet like “My kid gets to play #angry birds to learn basic physics. And she’s complaining about it?! #parenting” does not.
How did you address these challenges?
Our team developed a number of successful techniques that let us use the noisy cues of emotion hashtags in tweets as a way to build a large labeled emotion dataset that we then learn from using deep learning methods.
Our new state-of-the-art program can detect 24 nuanced emotions with near-human level accuracy (an average of 87 per cent accuracy for the computers, compared to 90 per cent accuracy for humans.) When we combined some closely related categories of emotions, such as ecstasy, joy, and serenity as one happiness category— reducing the 24 emotion categories to only eight— we reached an even higher accuracy of 95 per cent.
The paper, co-authored by Lyle Ungar, computer science professor at the University of Pennsylvania, will be presented Aug. 1 at the Annual Meeting of the Association for Computational Linguistics in Vancouver.