Financial NLP: The Internet’s Financial Membrane | by Posey | Towards Data Science

Disclaimer: No investment advice. There is no guarantee of any data herein being accurate or correct; all data is purely educational. Please consult a licensed investment professional before making investing decisions.
Note: API taken down a few weeks ago as it’s being embedded in https://www.spawner.ai. If you want direct access to the API feel free to email luke [at] spawner [dot] ai
I’ve written a lot about Natural Language Processing. It’s been possibly the source of the most innovation in AI/ML for decades, with many of the most interesting use-cases. Recently, companies like Hugging Face have brought together teams of NLP researchers and engineers to build and open-source incredible tooling. Like many others, I’m especially fond of huggingface/transformers.
This sort of open-sourced innovation has enabled a whole new class of applications across all sorts of different domains. It’s making Applied AI, especially in web apps and internet startups, incredibly accessible. At Spawner, we decided to use our massive store of Financial Big Data in tandem with NLP from projects like Hugging Face, spaCy, and others to build something cool around Natural Language Processing for Finance and trading.
We’ve made this part of the Spawner API free, covering select data for stocks from the S&P 500. You can use our Python library to access this endpoint directly.
“Answer” is your natural language plug into financial data. The end goal is to be able to ask any question about financial instruments and get back natural language answers. For now, you can ask all sorts of questions about income statements, balance sheets, and cash flows. We’re working on adding major economic indicators and news next! You’ll get back the raw data from the latest reported quarter’s earnings. Optionally, ask directly and you can get over a decade of quarterly reports.
This is a very early version of our Python library. While the core API is stable, the Python library has a long way to go. Expect answers and data to sometimes be unavailable or inaccurate. We give 0 guarantee of accuracy or liveness of data for our free parts of the API.
The data fueling the free version of the API is sourced from open datasets and corporate earnings/releases. It goes through significant ETL before being ready for the training and understanding portions of our NLP.
pip install spawner
from spawner.nlp import answer
You’ll get back a Pandas DataFrame containing an answer in natural language, all in order of what our model believes is the highest probability to answer your question...
answer('what is the p/e ratio of apple?') The p/e ratio of Apple is 20.45answer('how about the revenue of GE?') The total revenue (Q4) of General Electric Company (GE) is 23,360,000,000answer('where is the S&P 500 at now?') Here is the quote for SPY (S&P 500 ETF): 281.5
For now, you can ask and explore all things income statements, balance sheets, and basic things like price and financial statistics. We’re constantly adding to our data and improving our algorithms. We’re imagining all sorts of web apps and plugins that can be built by plugging into the heart of finance with Natural Language Processing. And we’re partnering with developers who want to build cool stuff. You can join our Discord and help us build the financial membrane of the internet! And if you get a chance, check out Spawner — the future of finance is automated.
I started a newsletter where we share datasets and analysis every Monday Wednesday and Friday.