Inspiration
We were inspired by the idea of connecting natural language processing to the stock market; many online websites that indicate whether a stock is bullish or bearish do not mention how they arrive at their conclusion. We wanted to approach this problem using natural language processing, and specifically, co:here's API.
What it does
StockBoard displays a stock chart with the current stock information of a given stock as well as a projected line for how the stock will fare based on sentiment analysis of recent headlines related to the stock. In addition, StockBoard scrapes and presents select featured articles that mention the given stock. Finally, StockBoard shows whether a stock is bullish or bearish based on the general sentiment of recent headlines discussing the stock.
How we built it
We used co:here's natural language processing API (finance-sentiment model) to perform sentiment analysis on headlines that were scraped through the use of BeautifulSoup and NewsAPI. We also used Yahoo Finance's API to fetch information about the current information on any given stock. We used Pandas and Altair's API to graph the current and forecasted stock charts.
Challenges we ran into
One of the main challenges we ran into was retrieving the confidence values from the output provided by co:here's API. We were able to work around this by typecasting the class object created by co:here to a string and parsing
Accomplishments that we're proud of
[] create a consistent model for forecasting stocks based. [] successfully retrieve confidence values for negative, neutral, and positive sentiments. [*] present the findings in a clean manner on a simple, easy-to-read page.
What we learned
[] using the co:here NLP API to perform sentiment analysis. [] scraping headlines from the web. [*] presenting the data on graphs using pandas and pyplot.
What's next for StockBoard
We hope to also incorporate the Twitter API Tweepy in order to scrape a few tweets related to stocks through profiles that tweet often about how stocks are faring (such as Thomas Thornton, Hedge Fund Telemetry Founder).
Built With
- altair
- beautiful-soup
- co:here
- newsapi
- pyplot
- python
- streamlit
- yfinance



Log in or sign up for Devpost to join the conversation.