Inspiration

We wanted to learn about using new technologies and were inspired by Buf's and Cohere's challenges. We brainstormed ideas and ended on a stock sentiment classifier.

What it does

We pull tweets from the Twitter API and classify them using the Cohere NLP API. We then calculate an average sentiment based on the ratio of positive tweets (tweets are classified as positive or negative).

How we built it

  • Protobuf: we used protobufs (with help with the Buf CLI and Buf BSR) to communicate data between our Go & Python backend with our React frontend.
  • Cohere NLP API: We trained a fine-tuned model to classify tweets to have either positive or negative sentiment.
  • MYSQL: Database hosted on Google Cloud to cache sentiment data for a specific date and stock.
  • Python - Flask backend to retrieve stock price data from Yahoo Finance API.
  • Go - Backend service that queries tweets from Twitter API, filters the tweets and sends it to the Cohere NLP Classifier.
  • React Frontend: UI to retrieve sentiment data for specified stock. Display graph with 7 days worth of stock prices and sentiment data along with examples of classified tweets.

Challenges we ran into

We primarily ran into two challenges:

  1. Creating a fine-tuned classifier model (required a large dataset of labeled data)
  2. Querying Twitter to return high quality tweets (needed to continuously improve our queries and filters)

Accomplishments that we're proud of

Learning new technologies like protobufs and using Cohere's NLP Classification API.

What we learned

Everything!

What's next for Happy Stocks

We want to make it possible to determine sentiment from various data sets (e.g. Reddit, Bloomberg News). We also would like to implement our own NLP model and improve it even more. We also would like to incorporate more data, by getting more tweets to increase the accuracy of the sentiment data.

Built With

Share this project:

Updates