Datasets:
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
Our FinSen Dataset
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.
Finsen Data Sample:
We also provide other NLP datasets for text classification tasks here, please cite them correspondingly once you used them in your research if any.
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)
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
Download the Dataset:
- The
AG_NEWS
dataset is downloaded usingtorchtext.datasets.AG_NEWS
. Thesplit=('train', 'test')
argument returns iterators for the training and test sets.
- The
Tokenization:
- The
get_tokenizer('basic_english')
function is used to tokenize the text data.
- The
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.
- The
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.
Collate Function:
collate_batch
is a custom function that processes batches by padding sequences and converting labels and texts into tensors.
DataLoader:
DataLoader
is used to create batches of data, shuffle them, and apply thecollate_fn
to each batch.
Step 3: Customization:
- You can change the
batch_size
and other parameters in theDataLoader
to suit your needs. - The tokenizer and vocabulary can be customized for more complex preprocessing.
- 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
DAN-3.
Gobal Pooling CNN.
Models - Regression Prediction
- LSTM
Using Sentiment Score from FinSen Predict Result on S&P500
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 !