Connecting Neural Networks, Sentiment Analysis, and Stocks

Matt Schwartz
November 29, 2019

Artificial intelligence is a broad term which fundamentally refers to getting computers to emulate thinking similar to a human. While there are many categories of problems which can be addressed by AI, I have found sentiment analysis to be particularly interesting. Through training and automation, computers can monitor social media and provide insights into how people talk about companies and their products. From this analysis investors can judge public perception and decide if it has any impact on stock value.

Neural Networks

Neural networks are one class of AI tools. They are mathematical models loosely based on the biology of the brain. Neural networks excel at pattern matching. While a simple computer program can compare two items and determine if they are exactly the same, a complex neural network can tell how similar one item is to another set. Most interesting, it can do that without ever having seen that exact item before.

Take an image of an apple, for example. A neural network trained on images of many apples can be given a new image and guess if it contains an apple. Just like a person might do, if the colors, patterns, and shape of the new apple are similar enough, it will say it's an apple.

Existentially, of course, the computer program doesn't know that apples exist or what they are. Yet we can leverage the AI's pattern matching abilities to solve many problems.

Sentiment Analysis

The same concept applies to analyzing patterns in text. We can feed a neural network posts from social media and train it on the sentiment of each. After proper training, if we feed it a post it's never seen before it will "guess" the sentiment. The better the training and neural network configuration, the more accurate the results.

This is exactly what we've done at We scan social media networks every day for mentions of companies and their products. As of this writing we can track any company traded on a US stock exchange. We gather as many posts as possible, run them through our neural networks to determine their sentiment, and graph them over time.


So why do all this?

We believe social network activity is a useful tool to inform investors of the positive and negative opinions people hold of companies. Online chatter about a company will affect brand value. Posts about products can drive or hurt sales.

Social media posts are made both before and after market price changes, so we can't always find a correlation or causation between market prices and social media sentiment. Our sentiment research should be one part of a broad investment strategy.

Browse our charts and see what people are saying about your investments!