stock-trend-predictions
Stock trend prediction based on the news headlines
Introduction
Problem statement:
- Input: a news headline: a string
- Output: a predicted stock trend: an integer
0
or1
Project structure:
.
├── data
│ ├── daily-financial-news
│ └── huge-stock-market
│ ├── Data
│ │ ├── ETFs
│ │ └── Stocks
│ ├── ETFs
│ └── Stocks
├── modules
├── papers
└── weights
└── 20220314_distilbert
Installation
pip install transformers fastapi torch
DistilBert weights: https://drive.google.com/drive/folders/1KFmdF-8GHaY0viOoHxxu-xG-QE_FdLEM?usp=sharing Download and extract and rename to the same as it is in the project structure above.
Usage
Run in the terminal:
uvicorn api:app --host 0.0.0.0 --port 8000
The easiest way to test is to open a browser, e.g., Google Chrome, and enter:
http://0.0.0.0:8000/docs
Here you can try out some availables API
Progress
- Data Preparation (See README in the
data
folder) - Model training
- I tried random prediction for the baseline
- I tried fine-tuning DistilBert for classification task where the target is the up/down trend
Project limited
- I haven't worked on NLP so that it took me a while to understand some terms and research topics.
- Only predict the trend, e.g., upward (1) or downward (0). Don't provide the quantity nor the volumne