FinSen / README.md
EagleWHLiang's picture
Update README.md
00d4d28 verified
metadata
license: mit
task_categories:
  - text-classification
  - feature-extraction
language:
  - en
tags:
  - finance
size_categories:
  - 10M<n<100M

Enhancing Financial Market Predictions: Causality-Driven Feature Selection

Note:[Please help give a Like ❤️ if you think this FinSen dataset is good for you, Thanks:)]

This paper introduces FinSen dataset that revolutionizes financial market analysis by integrating economic and financial news articles from 197 countries with stock market data. The dataset’s extensive coverage spans 15 years from 2007 to 2023 with temporal information, offering a rich, global perspective 160,000 records on financial market news. Our study leverages causally validated sentiment scores and LSTM models to enhance market forecast accuracy and reliability.

Technical Framework

image

Our FinSen Dataset

arXiv Pytorch 1.5 License: MIT

This repository contains the dataset for Enhancing Financial Market Predictions: Causality-Driven Feature Selection, which has been accepted in ADMA 2024.

If the dataset or the paper has been useful in your research, please add a citation to our work:

@article{liang2024enhancing,
  title={Enhancing Financial Market Predictions: Causality-Driven Feature Selection},
  author={Liang, Wenhao and Li, Zhengyang and Chen, Weitong},
  journal={arXiv e-prints},
  pages={arXiv--2408},
  year={2024}
}

Datasets

[FinSen] can be downloaded manually from the repository as csv file. Sentiment and its score are generated by FinBert model from the Hugging Face Transformers library under the identifier "ProsusAI/finbert". (Araci, Dogu. "Finbert: Financial sentiment analysis with pre-trained language models." arXiv preprint arXiv:1908.10063 (2019).)

We only provide US for research purpose usage, please contact [email protected] for other countries (total 197 included) if necessary.

image

Finsen Data Sample:

image

We also provide other NLP datasets for text classification tasks here, please cite them correspondingly once you used them in your research if any.

  1. 20Newsgroups. Joachims, T., et al.: A probabilistic analysis of the rocchio algorithm with tfidf for text categorization. In: ICML. vol. 97, pp. 143–151. Citeseer (1997)

  2. AG News. Zhang, X., Zhao, J., LeCun, Y.: Character-level convolutional networks for text classification. Advances in neural information processing systems 28 (2015)

To download the AG News dataset and obtain its DataLoader in PyTorch, you can use the torchtext library, which provides convenient access to various text datasets, including AG News. Below is a step-by-step guide to achieve this:

Step 1: Install Required Libraries

If you don't have torchtext installed, you can install it using pip:

pip install torchtext

Step 2: Utilize ag_news.py in Dataloader

  1. Download the Dataset:

    • The AG_NEWS dataset is downloaded using torchtext.datasets.AG_NEWS. The split=('train', 'test') argument returns iterators for the training and test sets.
  2. Tokenization:

    • The get_tokenizer('basic_english') function is used to tokenize the text data.
  3. Build Vocabulary:

    • The build_vocab_from_iterator function constructs a vocabulary from the tokens in the dataset. Special tokens such as <unk> (unknown) are added to handle out-of-vocabulary words.
  4. Text and Label Pipelines:

    • text_pipeline converts text into a sequence of token indices based on the vocabulary.
    • label_pipeline converts labels (which are initially strings) into integers.
  5. Collate Function:

    • collate_batch is a custom function that processes batches by padding sequences and converting labels and texts into tensors.
  6. DataLoader:

    • DataLoader is used to create batches of data, shuffle them, and apply the collate_fn to each batch.

Step 3: Customization:

  • You can change the batch_size and other parameters in the DataLoader to suit your needs.
  • The tokenizer and vocabulary can be customized for more complex preprocessing.
  1. Financial PhraseBank. Malo, P., Sinha, A., Korhonen, P., Wallenius, J., Takala, P.: Good debt or bad debt: Detecting semantic orientations in economic texts. Journal of the Association for Information Science and Technology 65(4), 782–796 (2014)

Dataloader for FinSen

We provide the preprocessing file finsen.py for our FinSen dataset under dataloaders directory for more convienient usage.

Models - Text Classification

  1. DAN-3.

  2. Gobal Pooling CNN.

Models - Regression Prediction

  1. LSTM

Using Sentiment Score from FinSen Predict Result on S&P500

image

Dependencies

The code is based on PyTorch under code frame of https://github.com/torrvision/focal_calibration, please cite their work if you found it is useful.

:smiley: ☺ Happy Research !


license: mit