Why Swarm Intelligence is a Better Way to Read Emotions

Swarm Intelligence is using many simple machine learning models good at one small task to solve bigger, more complex problems. We examine how it can improve sentiment analysis and measuring emotions.

By Paul Barba, Chief Scientist, Lexalytics.

Artificial Intelligence (AI) is everywhere these days, but it’s rarely discussed in detail, or with specific examples of how and why it will help improve the way we do things. Let’s address that shortcoming by digging into a particular variant of AI that holds great promise: Swarm Intelligence.

Swarm Intelligence is the idea of using many simplistic machine learning models each good at one small task to solve bigger, more complex problems. The idea is analogous to how swarms or hives act in the natural world. Take ants, for example: each performs a simple task that helps that hive work as a complex system.

Understanding how swarm intelligence works and why it’s valuable is easier with real-world examples. In this case we’re going to look at determining the emotions contained within a text.

Measuring sentiment in text is a staple feature for anyone performing social listening or voice-of-the-customer analysis, and is used to understand what’s driving the behavior of customers. So far sentiment measuring has mostly been limited to just positive and negative – not more granular emotions. This is a good start, but if we could accurately measure the real emotions expressed in a piece of content [see New machine learning models can detect hate speech and violence from texts], we could do a far better job of responding to the needs and desires of the text’s author.

So how do we go about measuring emotions? A common approach would be to identify examples of different kinds of emotions and then build a model that could be used to determine the emotion of a statement such as: “As I was brushing my teeth this morning a big spider spun down onto the vanity next to me, and I jumped out of my skin and ran out of the bathroom.”

It takes a lot of resources to analyze such a complex statement. But as Occam’s Razor tell us, simple is always better. And that’s the whole point of swarm intelligence. We don’t build one model that can determine a variety of emotional states, we build a number of models that are each good at measuring one emotion. It’s much easier to build a model that is really good at one thing than it is to build a model that’s good at lots of things.

For the above spider example, you’d expect the “terror” model to score highly, and the joy model to score pretty low. From there we could simply select the model with the highest score as the most likely emotion. Easy enough, right?

But it’s not hard to imagine cases where picking the model with the highest score could cause problems. Take the following statement:

“I was at the game yesterday, and we rocked it in the first half, but those boys terrified me in the second half.”

As humans we know the power of hyperbole. The author of that sentence was anxious, not terrified. But our simplified emotion detector would have scored “terrified” as the most likely emotion simply because of its use in the sentence – giving us an incorrect result.

How would swarm intelligence get around this? Swarm intelligence models can be hierarchical, and can therefore use the output of other models as inputs. In a case like this, you could add an “emotion” model to your overall model and give it the task of looking at all of the individual models to decide which one’s correct.

With the phrase “rocked it” in the first part of the sentence, this model could pick out “excitement” as a sentiment – and with the added mention of a sports setting, it could add these factors together to determine that the sentence actually shows two emotions: excitement and anxiety.

It only takes a quick look at the current state of emotion detection in text mining tools to get an idea of why swarm intelligence is so important.  Vendors have been talking about emotion measurement for at least the last 5 years, but most of them have been trying to build and deploy monolithic “emotion” measuring systems that work with either complex inputs or “overall” emotion analysis. As we saw above, the results are likely to be disappointing.

Swarm intelligence offers a different approach – and a different outcome. Swarm intelligence isn’t expected to understand all of the special cases: it’s just machine learning with a narrow specialization. And thanks to its discrete, hierarchical nature, you can use it to build and deploy very advanced text analysis features quickly. These might include emotions, subject level taxonomies, foreign language understanding, and more.

We know that AI and machine learning will change the world – and swarm intelligence is one of the types of AI that will bring about this change.

Useful references:

  1. https://www.researchgate.net/profile/Christian_Blum/publication/227068137_Swarm_Intelligence_in_Optimization/links/0c96052961698ecf51000000.pdf
  2. https://phys.org/news/2017-04-machine-speech-violence-texts.html
  3. https://books.google.com/books?hl=en&lr=&id=PvTDhzqMr7cC&oi=fnd&pg=PR11&dq=swarm+intelligence
  4. https://www.cs.cmu.edu/~ylataus/files/TausczikPennebaker2010.pdf(page 37, conclusion)
  5. http://www.economist.com/node/16789226

Bio: Paul Barba is a Chief Scientist at Lexalytics, where he is developing, architecting, researching and generally thinking about machine learning, text analytics and NLP software. Paul earned a degree in Computer Science and Mathematics from UMass Amherst.