Skip to content

Research on all kind of NLP in market forecasting, expert estimation, etc.

Notifications You must be signed in to change notification settings

completelyboofyblitzed/STOCK-MARKET-NLP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 

Repository files navigation

Research on all kinds of NLP for market forecasting, experts estimation, etc.

%%{init: {"theme": "default","fontFamily": "cursive", "sequence": { "securityLevel":"loose" }}}%%
graph TD
    title[<u>Table of Contents:</u>]
    title---F
    style title fill:#FFF,stroke:#FFF
    linkStyle 0 stroke:#FFF,stroke-width:0;

    %%FirstStep-->...
    %%classDef containers fill:#E6E1F7
    
    %% styling the nodes and arrors https://dompl.medium.com/produce-great-looking-flowcharts-in-seconds-7f3bea64f2e2
    %% mermaid editor https://mermaid.live
    Mo[[<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#models'>Models</a>]]
    A(<b>NLP</b>) -->|for| F{<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#1-market-forecasting'>Market Forecasting</a>} 
    
    style A stroke:#333,stroke-width:4px
    subgraph MF [<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#sentiment-based' >Sentiment based</a>]
    Se{{<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#sentiment-analysis'>Sentiment<br>Analysis</a>}}
    Fc{{<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#forecasting'>Forecasting</a>}}
    %% Al{{?}}
    end

    
    Ts[(<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#text-sources'>Text Sources</a>)]
    
    %% Se<-.-Mo
    %% Fc<-.-Al[[<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#algorithms'>Algorithms</a>]]
    F--> Di{{Direct}}

    Sc(((<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#scrapping'>Scrapping</a>)))
    A -->|to identify| M((<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#2-market-movers-identification'>Market Movers</a>))
    A -->|to estimate| E[<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#3-experts-competence-estimation'>Expert's Competence</a>]
    F -->|"  "| MF{{?}}
    style Se stroke:#f66,stroke-width:2px,stroke-dasharray: 5 5,text-decoration: none
   
    
    %%I><a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#interpretability'>Interpretability?</a>]
    %%V<-.-I
    %%Q<-.-I
    %%Di<-.-I
    %%MF<-.-I
    %% class A,B,F,E,E,M,F,Q containers;
Loading

Models

  • FinancialBERT - A Pretrained Language Model for Financial Text Mining 2022 Ahmed Rachid Hazourli [pdf] [demo]
  • FinBert - A Large Language Model for Extracting Information from Financial Text 2019-2022 Allen H. Huanga, Hui Wang, Yi Yang [pdf] [repo] [website] [demo]
  • NFinBERT: A Number-Aware Language Model for Financial Disclosures 2021 Hao-Lun Lin and Jr-Shian Wu, Yu-Shiang Huang, Ming-Feng Tsai, Chuan-Ju Wang [pdf]

1. Market Forecasting

Projection of the market states (high/low volatility, up/down index movements).

Sentiment Based

Text source: newspapers
Sentiment model: BERT
Predictions model: LSTM?

Claimed predictions for Tesla based solely on newspaper text

Sentiment Analysis

Models
Hugging Face Hub #financial-sentiment-analysis

Forecasting

Algorithms

To be added

Interpretability

Essentially we want an answer to a question "what..", but can we as well know "why"?
Is this problem related to long-form question-answering (LFQA)? I don't know. If so, here's something to read:

  • WebGPT: Browser-assisted question-answering with human feedback 2021 OpenAI [blog] [pdf] [demo] + the explanation on habr (by @stalkermustang I presume)
  • GopherCite: Teaching language models to support answers with verified quotes 2022 DeepMind [blog] [pdf]
  • (And obviously) Toolformer: Language Models Can Teach Themselves to Use Tools 2023 Meta [pdf]

Can the task of prediction can be solved as collateral to the Market Movers identification?

2. Market Movers Identification

Market moving information is a term used in stock market investing, defined as information that would cause any reasonable investor to make a buy or sell decision. (Wikipedia)

Example of a stock mover identification taken from Benzinga:

How can such pipeline look:

%%{init: {"theme": "default","fontFamily": "cursive", "sequence": { "securityLevel":"loose" }}}%%
stateDiagram

    classDef Important stroke:#f66,stroke-width:2px,stroke-dasharray: 5 5,text-decoration: none
    direction LR
    A: Get top N gainers/losers
    b: Get latest tweets/news
    c: Summarize as an explanation
    B: ~
    C: Show
    [*] --> A
    A --> B
    B --> C
    state B {
      direction LR
      b --> c
    }
    C --> [*]
    class c Important
Loading

3. Expert's Competence Estimation

Ranking experts, qualification of experts, based on their past predictions/performance.

Tools

Pythonic ways to download market data from Yahoo!Ⓡ finance:
yfinance
yahooquery

Text Sources

%%{init: {"theme": "default","fontFamily": "cursive", "sequence": { "securityLevel":"loose" }}}%%
graph TD
    classDef containers fill:#E6E1F7
    Sc(((<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#scrapping'>Scrapping</a>)))
    Ts[(<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#text-sources'>Text Sources</a>)]
    subgraph Ws [<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#websites'>Websites</a>]
        subgraph Tw [<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#websites'>Twitter</a>]
            subgraph Fb [<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#websites'>Facebook</a>]
                subgraph Tg [<a href='https://github.com/completelyboofyblitzed/NLP-in-STOCK-MARKET/blob/main/README.md#websites'>Telegram</a>]
                Cm[(Plain mentions/tags)]
                Ex[("''Experts''")]
                In[(Highly influential<br> individuals)]
                Of[(Official Media)]
                end
            end
        end
    end
    Ts-->Cm
    Ts-->Ex
    Ts-->In
    Ts-->Of
    Sc-.-Fb
    Sc-.-Tw
    Sc-.-Ws
    Sc-.-Tg
Loading

Scrapping

To be added

Websites

To be added

Twitter

To be added

Facebook

To be added

Telegram

To be added

🤝 Contributing

Contributions, issues and feature requests are welcome.

About

Research on all kind of NLP in market forecasting, expert estimation, etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published