EagleWHLiang commited on
Commit
d8c9b9a
·
verified ·
1 Parent(s): e234437

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +118 -3
README.md CHANGED
@@ -1,3 +1,118 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Enhancing Financial Market Predictions: Causality-Driven Feature Selection
2
+
3
+ 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.
4
+
5
+ ### Technical Framework
6
+
7
+ ![image](https://github.com/user-attachments/assets/2984d8d1-e827-488e-bc73-ed9677b86b64)
8
+
9
+
10
+
11
+ # Our FinSen Dataset
12
+ [![arXiv](https://img.shields.io/badge/stat.ML-arXiv%3A2006.08437-B31B1B.svg)](https://arxiv.org/abs/2408.01005)
13
+ [![Pytorch 1.5](https://img.shields.io/badge/pytorch-1.5.1-blue.svg)](https://pytorch.org/)
14
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/EagleAdelaide/FinSen_Dataset/LICENSE)
15
+
16
+ This repository contains the dataset for [*Enhancing Financial Market Predictions:
17
+ Causality-Driven Feature Selection*](https://arxiv.org/abs/2408.01005), which has been accepted in ADMA 2024.
18
+
19
+ If the dataset or the paper has been useful in your research, please add a citation to our work:
20
+
21
+ ```
22
+ @inproceedings{wenhao2024enhancing,
23
+ title={Enhancing Financial Market Predictions:
24
+ Causality-Driven Feature Selection},
25
+ author={Liang, Wenhao and Li, Zhengyang and Chen, Weitong},
26
+ booktitle={Advanced Data Mining and Applications},
27
+ year={2024},
28
+ publisher={Springer},
29
+ }
30
+ ```
31
+
32
+ ### Datasets
33
+
34
+ **[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).)
35
+
36
+ **We only provide US for research purpose usage, please contact [email protected] for other countries (total 197 included) if necessary.**
37
+
38
+ ![image](https://github.com/user-attachments/assets/f28e670a-7329-409d-81cb-1fe47da22140)
39
+
40
+ Finsen Data Sample:
41
+
42
+ <img width="341" alt="image" src="https://github.com/user-attachments/assets/6ab08486-85b7-4cf6-b4fe-7d4294624f91">
43
+
44
+ We also provide other NLP datasets for text classification tasks here, please cite them correspondingly once you used them in your research if any.
45
+
46
+ 1. **20Newsgroups**. Joachims, T., et al.: A probabilistic analysis of the rocchio algorithm with tfidf for
47
+ text categorization. In: ICML. vol. 97, pp. 143–151. Citeseer (1997)
48
+
49
+ 2. **AG News**. Zhang, X., Zhao, J., LeCun, Y.: Character-level convolutional networks for text
50
+ classification. Advances in neural information processing systems 28 (2015)
51
+
52
+ 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:
53
+
54
+ #### Step 1: Install Required Libraries
55
+
56
+ If you don't have `torchtext` installed, you can install it using pip:
57
+
58
+ ```bash
59
+ pip install torchtext
60
+ ```
61
+ #### Step 2: Utilize ag_news.py in Dataloader
62
+
63
+ 1. **Download the Dataset**:
64
+ - The `AG_NEWS` dataset is downloaded using `torchtext.datasets.AG_NEWS`. The `split=('train', 'test')` argument returns iterators for the training and test sets.
65
+
66
+ 2. **Tokenization**:
67
+ - The `get_tokenizer('basic_english')` function is used to tokenize the text data.
68
+
69
+ 3. **Build Vocabulary**:
70
+ - 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.
71
+
72
+ 4. **Text and Label Pipelines**:
73
+ - `text_pipeline` converts text into a sequence of token indices based on the vocabulary.
74
+ - `label_pipeline` converts labels (which are initially strings) into integers.
75
+
76
+ 5. **Collate Function**:
77
+ - `collate_batch` is a custom function that processes batches by padding sequences and converting labels and texts into tensors.
78
+
79
+ 6. **DataLoader**:
80
+ - `DataLoader` is used to create batches of data, shuffle them, and apply the `collate_fn` to each batch.
81
+
82
+ #### Step 3: Customization:
83
+
84
+ - You can change the `batch_size` and other parameters in the `DataLoader` to suit your needs.
85
+ - The tokenizer and vocabulary can be customized for more complex preprocessing.
86
+
87
+ 3. **Financial PhraseBank**. Malo, P., Sinha, A., Korhonen, P., Wallenius, J., Takala, P.: Good debt or bad debt:
88
+ Detecting semantic orientations in economic texts. Journal of the Association for
89
+ Information Science and Technology 65(4), 782–796 (2014)
90
+
91
+ ### Dataloader for FinSen
92
+
93
+ We provide the preprocessing file finsen.py for our FinSen dataset under dataloaders directory for more convienient usage.
94
+
95
+ ### Models - Text Classification
96
+
97
+ 1. DAN-3.
98
+
99
+ 2. Gobal Pooling CNN.
100
+
101
+ ### Models - Regression Prediction
102
+
103
+ 1. LSTM
104
+
105
+ ### Using Sentiment Score from FinSen Predict Result on S&P500
106
+
107
+ ![image](https://github.com/user-attachments/assets/2d9b4dd7-7f59-425c-b812-2cca57719243)
108
+
109
+ ### Dependencies
110
+
111
+ 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.
112
+
113
+ :smiley: ☺ Happy Research !
114
+
115
+
116
+ ---
117
+ license: mit
118
+ ---