A stock prediction method based on multi-modal fusion and momentum spillover effect

By constructing a spatiotemporally dynamic hierarchical complex network and a cross-attention graph convolutional model, combined with a gated graph convolutional network, the accuracy and reliability issues of stock prediction in existing technologies are solved. This achieves more comprehensive multimodal information fusion and utilization of momentum spillover effects, thereby improving the accuracy of stock price prediction.

CN115482102BActive Publication Date: 2025-11-25TIANJIN UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210943505.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-08
Publication Date
2025-11-25
Estimated Expiration
2042-08-08

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately and reliably predict stock price changes, especially given the high volatility of the stock market and the impact of unforeseen events. Single historical trading data and simple mathematical models are insufficient to provide reliable predictions, and existing methods fail to effectively integrate multimodal information from trading data and textual data.

Method used

A stock prediction method based on multimodal fusion and momentum spillover effect is adopted. By collecting transaction data and text data, a spatiotemporal dynamic hierarchical complex network is constructed. Deep learning modules with cross attention and graph convolution are used for feature fusion. Combined with a gated graph convolutional network, joint learning and prediction of multimodal data are achieved.

Benefits of technology

It improves the accuracy and reliability of stock forecasting, better handles the impact of sudden events, utilizes the changing patterns of related stocks to assist in predicting future price changes of target stocks, and enhances the model's noise resistance and forecasting stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115482102B_ABST
    Figure CN115482102B_ABST
Patent Text Reader

Abstract

A stock prediction method based on multi-modal fusion and momentum spillover effect, comprising: collecting transaction data and text data of a target stock and N-1 stocks related to the target stock; data preprocessing; constructing a relationship matrix among N stocks; extracting features from the text data of the N stocks and converting them into text feature vectors for each trading day; setting input samples of a stock prediction model; establishing a stock prediction model; iteratively training and predicting the stock prediction model using the input samples, and updating the trainable parameters of the stock prediction model during training. The stock prediction method based on multi-modal fusion and momentum spillover effect mainly designs suitable and effective deep learning modules from the aspects of multi-modal data feature fusion and market momentum spillover effect to improve the accuracy and reliability of the stock prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to a stock prediction method. BACKGROUND

[0002] The stock market is an important part of the financial industry, and the prediction of stocks can provide important reference value for the portfolio selection of investors. However, the stock market is affected by many external factors and has characteristics such as high volatility and randomness, making the prediction of target stocks a very challenging task. Therefore, although stock prediction can be simply regarded as a binary classification task, it is difficult to provide reliable stock trend prediction using single target stock historical data and simple mathematical models. We need to use multi-source historical data containing more information and complex and targeted deep learning models to predict target stocks to improve prediction accuracy.

[0003] The most reflective historical data of stock price change is transaction data, including the opening price, closing price, maximum value, trading volume, etc. of the stock. However, more and more studies have shown that feature learning and rule exploration on only historical transaction data of stocks cannot well predict future stock trends. Because the change of stock price is directly related to the attitude of investors towards the future trend of the stock, and the attitude of investors towards the trend of the stock is not only affected by the historical price of the stock, but also by the news related to it and the opinions of other investors. Therefore, the collection and information extraction of text data such as news and forum content of stocks are also an important part of predicting stock price changes.

[0004] In existing stock prediction systems, most studies directly use sentiment dictionaries to extract the sentiment of text data, such as positive, negative, etc. However, this method does not extract sentiment through deep analysis of text context information, but relies on some keywords to judge the overall sentiment of the text, which cannot accurately reflect the overall sentiment of the text and cannot contain the overall information content of the text. It is undoubtedly a better method to directly extract the overall features of the text through a deep learning model and integrate them into feature embeddings, which makes the text features contain more effective information. The BERT (Bidirectional Encoder Representation from Transformers) model is a deep learning model based on Transformer, which is used for natural language processing, including feature extraction of text to obtain corresponding feature representations, i.e. feature vectors. After training, the model only needs to add an additional output layer for fine-tuning to achieve excellent results in various downstream tasks.

[0005] After the transaction data and text data reflecting the change of stock price are collected, it is crucial to realize feature extraction, feature fusion of stock data and further realize stock price prediction through effective and reliable data analysis model. In the joint learning process of transaction data and text data, in addition to understanding language semantics and finding price time series change rule, the most important thing is the alignment relationship between the two modes. Finding a suitable and effective modality alignment and feature fusion deep learning module is crucial for the stock prediction system based on multi-source information fusion.

[0006] It is crucial to find an efficient and reliable relationship network construction method. The common methods for calculating the correlation between stocks are calculating Euclidean distance and cosine similarity. However, unlike ordinary regular data sequences, financial price sequences in reality will have mutations due to sudden events (such as terrorist attacks), and these mutations are often unpredictable. SUMMARY

[0007] The technical problem to be solved by the present application is to overcome the shortcomings of the prior art and provide a stock prediction method based on multi-modal fusion and momentum spillover effect which can accurately and reliably predict stocks.

[0008] The technical solution adopted by the present application is: a stock prediction method based on multi-modal fusion and momentum spillover effect, comprising the following steps:

[0009] 1) Collecting transaction data and text data of target stocks and N-1 stocks related to the target stocks;

[0010] 2) Data preprocessing, including:

[0011] (2.1) detecting outliers and filling missing values for transaction data and text data;

[0012] (2.2) extracting features from text data to obtain daily text feature vectors of each stock;

[0013] 3) Constructing a relationship matrix between N stocks, including:

[0014] (3.1) using the opening price sequence of each stock to construct a spatio-temporal dynamic hierarchical complex network between N stocks in a sliding window of T days;

[0015] (3.2) calculating the degree distribution and clustering coefficient distribution of each layer of single stock network respectively, obtaining the degree distribution mutual information and clustering coefficient distribution mutual information between layers, which are respectively used to represent the degree correlation between two stocks and the clustering coefficient correlation between two stocks, so as to obtain a dynamic stock relationship network taking stocks as nodes and the correlation between two stocks as edges;

[0016] (3.3) taking the stock as a node, and constructing a dynamic stock relationship network with the degree correlation between two stocks and the clustering coefficient correlation between two stocks as an edge, obtaining the degree correlation network and the clustering coefficient correlation network between N stocks in each sliding window, calculating the average of the degree correlation network and the clustering coefficient correlation network to obtain the final spatiotemporal dynamic hierarchical complex network ε, denoted as characterizing the relationship network between stocks spanning from the t-T+1th trading day to the tth trading day, denoted as wherein E i,j represents the correlation between stock i and stock j;

[0017] 4) performing feature extraction on the text data of N stocks, and converting into a text feature vector on each trading day;

[0018] 5) setting the input sample of the stock prediction model;

[0019] 6) establishing the stock prediction model;

[0020] 7) iteratively training and predicting the stock prediction model using the input sample, specifically calculating the cross-entropy loss value by using the future up-down prediction label y i and the future up-down prediction value of the ith stock at time t to update the trainable parameters of the stock prediction model in training, wherein when the opening price of the target stock i on the t+1th trading day is greater than the opening price on the tth trading day, the future up-down prediction label y i of the ith stock at time t is set to 1, otherwise 0.

[0021] The stock prediction method based on multi-modal fusion and momentum spillover effect of the present application mainly designs suitable and effective deep learning modules from two aspects of multi-modal data feature fusion and utilization of market momentum spillover effect to improve the accuracy and reliability of the stock prediction model. The stock prediction model based on cross-attention and graph convolution multi-modal information fusion is used to realize multi-modal data joint learning and feature fusion of transaction data and text data, compared with the existing prediction system based only on transaction data, more comprehensive information is considered, and the correlation between the two types of data is utilized for deep and effective feature fusion to improve the prediction ability of the model. At the same time, the influence of momentum spillover effect on the up-down of the target stock is fully utilized, the relationship network of the target stock and related stocks is realized by the proposed spatiotemporal dynamic hierarchical complex network, and the stock relationship network is integrated into the stock prediction by the proposed gating graph convolution module in the deep learning model, compared with the existing method which only considers analyzing the data of the target stock, the market law is utilized to improve the prediction effect of the model. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1This is a flowchart of a stock prediction method based on multimodal fusion and momentum spillover effect according to the present invention;

[0023] Figure 2 This is a schematic diagram of the stock prediction model in this invention;

[0024] Figure 3 This is a structural diagram of the cross-feature fusion module in this invention;

[0025] Figure 4 This is a schematic diagram illustrating the construction of a single stock network in this invention. Detailed Implementation

[0026] The following detailed description of a stock prediction method based on multimodal fusion and momentum spillover effect according to the present invention, with reference to embodiments and accompanying drawings, is provided in conjunction with the embodiments and accompanying drawings.

[0027] like Figure 1 As shown, the present invention provides a stock prediction method based on multimodal fusion and momentum spillover effect, comprising the following steps:

[0028] 1) Collect transaction data and text data of the target stock and N-1 stocks related to the target stock, where N can be set to 5 to 10;

[0029] The stock trading data refers to the data information generated by the stock trading on the stock market, including five attributes: opening price, closing price, highest price, lowest price, and trading volume; the stock text data includes daily Tencent News and Eastmoney Forum discussions on the target stock and related stocks.

[0030] 2) Data preprocessing, including:

[0031] (2.1) Perform outlier detection and missing value completion on transaction data and text data;

[0032] (2.2) Extract features from the text data to obtain the daily text feature vector for each stock; specifically including:

[0033] (2.2.1) Remove stop words from each piece of text data using the jieba stop word library (Python library);

[0034] (2.2.2) Each text data is converted to the same length by cropping and padding, that is, each text data contains the same number of words;

[0035] (2.2.3) The pre-trained BERT model is used to extract features from each text data after removing stop words, and the text feature vector of each text data is obtained. The average pooling of all text feature vectors of each stock for each trading day is performed to obtain the text feature vector of each stock for each trading day.

[0036] 3) Construct a relationship matrix among the N stocks, including:

[0037] (3.1) Using the opening price sequence of each stock, construct a spatiotemporal dynamic hierarchical complex network among N stocks within a sliding window of size T days; specifically including:

[0038] (3.1.1) Set the finite crossing line of sight to e;

[0039] (3.1.2) Treat each trading day as a single stock network node;

[0040] (3.1.3) such as Figure 4 As shown, at two nodes and Horizontal lines are constructed between the histograms of the two nodes, with the height of the line being the height of the lower histogram of the two nodes. Among them, setting nodes This indicates that the i-th stock is in the t-th phase. a The opening price for the day was node This indicates that the i-th stock is in the t-th phase. b The opening price for the day was t a ,t b ∈[t-T+1,t] represents the range from the t-th trading day to the t-th trading day. a Tianhe t b sky;

[0041] The two nodes are specified. and If a horizontal line intersects only e or fewer intermediate nodes, then these two nodes... and If there is an edge between them, then the nodes are considered to be in a single-stock network with a finite traversal distance of e. and nodes There are no connecting edges between them; therefore, a single-layer single-stock network G is constructed for each stock. i That is, to obtain an N-layer single-stock network for N stocks.

[0042] (3.2) respectively calculate the degree distribution and clustering coefficient distribution of each layer of single stock network, obtain the degree distribution mutual information and clustering coefficient distribution mutual information between layers, respectively representing the degree correlation between stocks and the clustering coefficient correlation between stocks, thereby obtaining a dynamic stock relationship network taking stocks as nodes and the correlation between stocks as edges; wherein,

[0043] The degree distribution mutual information between layers is used to represent the degree correlation between stocks, and specifically includes:

[0044] The degree value of the single stock network of the i-th stock, i.e. the single stock network node of the i-th layer, is h i The degree value of the single stock network of the i-th layer at the node is The degree distribution of the stock network node is represented as p(h i ); the degree correlation between the i-th stock and the j-th stock is expressed by calculating the mutual information of the degree value sequence of the single stock network node of the i-th stock and the degree value sequence of the single stock network node of the j-th stock , determining the correlation size between the two channels, and the degree correlation between the i-th stock and the j-th stock is:

[0045]

[0046] wherein p(h i ) is the degree distribution of the i-th stock network node, and p(h i , h j ) is the joint degree distribution of the nodes of the i-th stock network and the j-th stock network.

[0047] The clustering coefficient distribution mutual information between layers is used to represent the clustering coefficient correlation between stocks, and specifically includes:

[0048] The clustering coefficient of the single stock network node of the i-th stock, i.e. the clustering coefficient of the single stock network of the i-th layer, is c i The clustering coefficient of the single stock network of the i-th layer at the node is wherein represents the number of neighbor nodes of the node , represents the actual number of edges between the node and the neighbor nodes, represents the maximum number of edges between the node and the neighbor nodes, and thereby obtaining the clustering coefficient distribution of the i-th stock as p(c i ); the clustering coefficient correlation between the i-th stock and the j-th stock is expressed by calculating the clustering coefficient sequence of the single stock network node of the i-th stock and the clustering coefficient sequence of the single stock network node of the jth stock to represent the two-two clustering coefficient correlation between the ith stock and the jth stock is:

[0049]

[0050] where p(c i ) is the clustering coefficient distribution of the ith stock, and p(c i ,c j ) is the joint clustering coefficient distribution of the ith stock and the jth stock.

[0051] (3.3) Construct a dynamic stock relationship network with stocks as nodes and the degree correlation between stocks and the clustering coefficient correlation between stocks as edges, respectively, to obtain the degree correlation network and the clustering coefficient correlation network between N stocks in each sliding window. Calculate the average of the degree correlation network and the clustering coefficient correlation network to obtain the final spatiotemporal dynamic hierarchical complex network ε, denoted as characterizes the relationship network between stocks spanning from the t-T+1th trading day to the tth trading day, denoted as where E i,j represents the correlation between stock i and stock j;

[0052] 4) Feature extraction is performed on the text data of N stocks to convert them into text feature vectors for each trading day; including:

[0053] (4.1) Use jieba (a Chinese word segmentation Python library) to remove stop words from each piece of text data to obtain a set of words;

[0054] (4.2) Use the cropping and padding method to convert each piece of text data to the same length, i.e., each piece of text data contains the same number of words;

[0055] (4.3) Put each piece of processed text data for each stock into a pre-trained BERT model for feature extraction to obtain the corresponding text feature vector;

[0056] (4.3) After averaging and pooling all text feature vectors for each stock on each trading day, the fused feature vector for each stock on each trading day is obtained, i.e., the L-dimensional text feature vector extracted from the news and forum evaluation information text collected from the tth trading day of the ith stock

[0057] 5) Set the input sample of the stock prediction model; including:

[0058] Each input sample of the stock prediction model is composed of a transaction data sample, a text feature sample, and a stock relationship network matrix; the transaction data sample, since the stock transaction data includes five attributes, the L' dimensional attribute data of the ith stock on the tth trading day constitutes the transaction feature vector of the trading day The transaction data sample is represented as The text feature sample of the ith stock on the tth trading day is represented as The text feature sample is represented as Where N represents the number of stocks, i = 1, 2, …, N, T represents the number of trading days, i.e. how many trading days of data are used in a sample; the stock relationship network matrix is represented by Where E i,j ∈ε represents the correlation degree between the target stock i and the related stock j after normalization, and E i,j ∈[0, 1], the closer to 1 represents the stronger correlation, and the closer to 0 represents the weaker correlation.

[0059] 6) Establish a stock prediction model; as shown in Figure 2 , including:

[0060] (6.1) Convert the transaction data of each stock in the input data of the set stock prediction model to the same dimension as the text feature data by zero padding, i.e. Where n t represents the transaction data of the tth trading day, N represents a total of N stocks, and L represents the feature dimension of the text feature data;

[0061] (6.2) Introduce a token [class] at the beginning of each stock's text feature sample, represented as Where i represents the ith stock, and L represents the feature dimension of the text feature data

[0062] (6.3) Construct a feature cross fusion module of the stock prediction model for each stock, respectively, for cross learning, feature fusion of the transaction data and text feature data of each stock, to obtain the fusion feature embedding of the transaction data and text feature of each stock; the feature cross fusion module is composed of H feature cross fusion layers, and each feature cross fusion layer is composed of three sublayers in series, the three sublayers including: a bidirectional cross attention sublayer, a self-attention sublayer composed of two parallel self-attention mechanisms, and a sublayer composed of two parallel feedforward neural networks, both of which adopt two-layer fully connected neural networks and use tanh function as the activation function, and a residual network structure and normalization processing are introduced after the three sublayers, respectively;

[0063] The transaction data of each stock Text feature data added with [class] token Input into the feature cross fusion module, wherein denotes the transaction data of the i-th stock on the τ-th trading day, denotes the text feature data of the i-th stock on the τ-th trading day, τ belongs to the range from the (t-T+1)-th trading day to the t-th trading day; the stock data of each stock is input into the corresponding feature cross fusion module;

[0064] The bidirectional cross attention sublayer includes two unidirectional cross attention modules, which are respectively used to fuse the transaction data into the text feature data domain and to fuse the text feature data into the transaction data domain, and the specific fusion formula is:

[0065]

[0066]

[0067]

[0068] CrossAtt W-J denotes the fusion of the text feature data into the transaction data domain, CrossAtt J-W denotes the fusion of the transaction data into the text feature data domain; denotes the transaction data sequence fused into the text feature data domain, denotes the transaction data vector fused into the [class] token, denotes the text data feature sequence fused into the transaction data domain and the [class] token, and and is also the output sequence of the bidirectional cross attention sublayer in the k-th cross feature fusion module; τ denotes a trading day from the (t-T+1)-th trading day to the t-th trading day, and there are K cross fusion modules, wherein k denotes the k-th layer;

[0069] The output sequences of the self-attention sublayer and the feedforward neural network sublayer are expressed by the formula:

[0070]

[0071]

[0072]

[0073]

[0074]

[0075]

[0076] t = t - T, t - T + 1,..., t

[0077] where SelfAtt W→W represents the text self-attention mechanism calculation process in the self-attention sublayer, SelfAtt J→J represents the transaction data self-attention mechanism calculation process in the self-attention sublayer; and represents the output sequence of the k-th layer self-attention sublayer, and represents the output sequence of the bidirectional cross-attention sublayer in the k-th layer cross-feature fusion module; FFN W→W represents the calculation process of the text feedforward neural network, FFN J→J represents the calculation process of the transaction feedforward neural network; for the i-th stock, the output of the feature cross-fusion module includes a deep transaction feature sequence a deep text feature sequence and a fusion feature embedding where τ represents the τ-th trading day, and the fusion feature embedding v i is the fusion feature representation of the cross-learning of the transaction data and the text data from the t-T+1th day to the tth day;

[0078] (6.4) Construct a gated graph convolutional neural network for stock prediction model:

[0079]

[0080] c(v i ,v j ) = tanh(W c [v i ||v j ] + b c )

[0081] where E i,j ∈ε represents the correlation degree between the i-th stock and the j-th stock after standardization, and E i,j ∈ [0, 1], the closer to 1 represents the stronger the correlation between the i-th stock and the j-th stock, and the closer to 0 represents the weaker the correlation between the i-th stock and the j-th stock; is a weight matrix common to all stocks, obtained by neural network training; represents a fusion feature embedding set of all stocks; σ is a sigmoid function; s i represents the relationship feature vector of the target stock i and other N-1 related stocks, and is represented as c(·) represents a gating mechanism used to filter out minor changes in related stocks that often do not affect the price movement of the target stock. It is the weight matrix in the gating mechanism. It is a bias;

[0082] (6.5) Constructing the output layer of the stock prediction model: The relationship feature vector s of stocks i A two-layer feedforward neural network with a softmax function is used to obtain a prediction of the future price movement of the i-th stock.

[0083]

[0084] in, is the weight matrix of the i-th stock, obtained by training a neural network; C is the number of categories of future stock price increases or decreases; b i It is the bias of the i-th stock, obtained by training the neural network; It is the predicted future price movement of the i-th stock, and also the final output of the stock prediction model.

[0085] 7) The stock prediction model is iteratively trained and predicted using the input samples. Specifically, this is done by predicting the future price movement of the i-th stock at time t using the label y. i and future price fluctuation forecasts The cross-entropy loss value is calculated to update the trainable parameters of the stock prediction model during training. This is achieved when the opening price of target stock i on the (t+1)th trading day is greater than the opening price on the tth trading day. The predicted future price change label y for stock i at time t is calculated as follows: i Set to 1 otherwise set to 0.

[0086] This invention presents a stock prediction method based on multimodal fusion and momentum spillover effect. It innovatively utilizes a neural network module based on a cross-attention mechanism to cross-learn and jointly learn the connections between trading data and textual data, fusing feature information from both modalities. Compared to existing prediction systems based solely on trading data, this method considers more comprehensive information. Furthermore, compared to existing methods that use feature concatenation or matrix transformations for feature fusion, the cross-attention module of this invention achieves more effective multimodal feature fusion by finding correlations between the two modalities, thereby improving the model's utilization of stock information and ultimately enhancing stock prediction performance.

[0087] The second core of the stock prediction method based on multi-modal fusion and momentum spillover effect is to improve the prediction effect of the target stock by using the momentum spillover effect. The introduction of multi-modal information fusion provides a large amount of stock attribute data information for the stock prediction system, and the research on the change rule of related stocks can also provide more help for the prediction of the target stock. In the stock market, momentum spillover effect refers to that the past earnings of a company can be used to predict the earnings of related companies. Therefore, the momentum spillover effect is closely related to the company to which the stock belongs, and constructing a company relationship network is an important part of studying the momentum spillover effect. However, most existing stock prediction systems only perform deep learning on the text data and transaction data of the target stock, and do not consider the influence of other companies on the future price fluctuation of the target stock. The present application fully considers the influence of the momentum spillover effect on the target stock, and combines the transaction information of multiple stocks to predict the future earnings trend of the target stock. It is crucial to find an efficient and reliable relationship network construction method. The financial price sequence in reality will be mutated due to sudden events (such as terrorist attacks), and these mutations are often unpredictable and can be regarded as noise points. Therefore, in order to solve the noise problem and better find the reliable correlation between the target stock and the county stock, the present application innovatively proposes a method for constructing a spatio-temporal dynamic hierarchical complex network to calculate the correlation network between stocks. The spatio-temporal dynamic hierarchical complex network proposed in the present application not only can more accurately model the coupling between network nodes, but also has better noise resistance and can be used for multivariate time signal analysis. The present application constructs a relationship network between the target stock and multiple related stocks by constructing a spatio-temporal dynamic hierarchical complex network. The stock relationship network takes stocks as network nodes and the correlation between two stocks as network edges. After obtaining the relationship network, how to organically combine the stock relationship with the fusion features of each stock to realize the auxiliary prediction of the target stock price change by using the related stock feature information is also an important part of the prediction model. The present application innovatively adds the proposed gate-graph convolutional neural network (GGCN) in the prediction model to calculate the deep features of the target stock and other related stocks, that is, through the correlation between the target stock and other related stocks obtained by the stock relationship network, the deep features of the related stocks are fused into the features of the target stock, so that more comprehensive market information is used in the prediction of the target stock, and the prediction accuracy of the target stock is improved. However, in the actual financial market, not all changes of related stocks will affect the price of the target stock, such as the price of the related stock falling but the trading volume being small, in which case the change of the related stock will not affect the target stock.Therefore, compared with the traditional graph convolutional neural network, the application innovatively introduces a gating mechanism in the graph convolutional network to filter the slight changes of the related stocks and increase the stability and reliability of the prediction of the system. This process realizes the consideration of the momentum spillover effect of the stock prediction model. The prediction accuracy of the change of the target stock price is improved.

Claims

1. A method for multimodal data feature fusion of transaction data and text data, characterized in that: Includes the following steps: 1) Collect transaction data and text data of the target stock and N-1 related stocks; 2) Data preprocessing: 3) Construct a relationship matrix among the N stocks; 4) Extract features from the text data of N stocks and convert them into text feature vectors for each trading day: 5) Construct a feature cross-fusion module for each stock prediction model, used for cross-learning and feature fusion of trading data and text feature data for each stock, to obtain the fused feature embedding of trading data and text features for each stock; the specific process is as follows: The feature cross-fusion module consists of H feature cross-fusion layers. Each feature cross-fusion layer is composed of three sub-layers connected in series. The three sub-layers include: a bidirectional cross-attention sub-layer, a self-attention sub-layer composed of two parallel self-attention mechanisms, and a sub-layer composed of two parallel feedforward neural networks. The two feedforward neural networks both adopt two fully connected neural networks and use the tanh function as the activation function. A residual network structure and normalization processing are introduced after each of the three sub-layers. Trading data for each stock Text feature data with added [class] token The input is fed into the feature cross-fusion module, where This indicates that the i-th stock is in the... Transaction data for each trading day, This indicates that the i-th stock is in the... Textual feature data for each trading day, It falls within the range of trading day t-T+1 to trading day t; the stock data for each stock is input into the corresponding feature cross-fusion module; The bidirectional cross-attention sublayer contains two unidirectional cross-attention modules, used to fuse transaction data into the text feature data domain and to fuse text feature data into the transaction data domain, respectively. The specific fusion formula is as follows: ; in This indicates that text feature data will be integrated into the transaction data domain. This indicates that transaction data will be integrated into the text feature data domain; This represents a sequence of transaction data integrated into the text feature data domain. This represents the transaction data vector merged into the [class] token. This represents the text data feature sequence and [class] token integrated into the transaction data domain, while , and It is also the output sequence of the bidirectional cross-attention sublayer in the k-th layer cross-feature fusion module; This indicates that there are K layers of cross-fusion modules from trading day t-T+1 to trading day t, where k represents the kth layer.

2. The multimodal data feature fusion method for transaction data and text data according to claim 1, wherein the data preprocessing in step 2) includes: (2.1) Perform outlier detection and missing value completion on transaction data and text data; (2.2) Extract features from the text data to obtain the daily text feature vector for each stock.

3. The multimodal data feature fusion method for transaction data and text data according to claim 1, wherein step 4) involves feature extraction of the text data of N stocks and conversion into text feature vectors for each trading day, specifically includes: (4.1) Use jieba segmentation to remove stop words from each text data to obtain a word set; (4.2) Use the method of trimming and padding to convert each piece of text data into the same length, that is, each piece of text data contains the same number of words; (4.3) Input each text data of each stock into the pre-trained BERT model for feature extraction to obtain the corresponding text feature vector; specifically, after average pooling, all text feature vectors of each stock for each trading day are used to obtain the fused feature vector of each stock for each trading day, that is, extract the L-dimensional text feature vector from the news and forum evaluation information text collected on the t-th trading day of the i-th stock. .

4. In the multimodal data feature fusion method for transaction data and text data according to claim 1, the output sequences of the self-attention sublayer and the feedforward neural network sublayer in step 5) are expressed by the following formula: ; in This represents the computation process of the text self-attention mechanism in the self-attention sublayer. This represents the computation process of the self-attention mechanism for transaction data in the self-attention sublayer; , and This represents the output sequence of the k-th self-attention sublayer. , and This represents the output sequence of the bidirectional cross-attention sublayer in the k-th layer cross-feature fusion module; This represents the computational process of a text feedforward neural network. This describes the computation process of the trading feedforward neural network; for the i-th stock, the output of the feature cross-fusion module includes a deep trading feature sequence. Deep text feature sequence and fusion feature embedding ,in Indicates the first On each trading day, the aforementioned fusion feature embedding It is the feature representation fused after cross-learning of transaction data and text data from day t-T+1 to day t.

5. The multimodal data feature fusion method for transaction data and text data according to claim 1, wherein step 3) constructing the relationship matrix among N stocks specifically includes the following steps: (3.1) Using the opening price sequence of each stock, construct a spatiotemporal dynamic hierarchical complex network among N stocks within a sliding window of size T days; (3.2) Calculate the degree distribution and clustering coefficient distribution of each layer of the single stock network to obtain the mutual information of degree distribution and mutual information of clustering coefficient distribution between layers. These are used to characterize the degree correlation between pairs of stocks and the clustering coefficient correlation between pairs of stocks, thus obtaining a dynamic stock relationship network with stocks as nodes and the correlation between pairs of stocks as the connecting edges. (3.3) Using stocks as nodes, construct a dynamic stock relationship network with the degree correlation and clustering coefficient correlation between each pair of stocks as edges. This yields the degree correlation network and clustering coefficient correlation network among N stocks under each sliding window. Calculate the mean of the degree correlation network and clustering coefficient correlation network to obtain the final spatiotemporal dynamic hierarchical complex network. , represented as The network representing the relationships between stocks spanning from trading day t-T+1 to trading day t is denoted as: ,in This represents the correlation between stock i and stock j.

6. The multimodal data feature fusion method for transaction data and text data according to claim 1, wherein step (3.1) further includes: (3.1.1) Set the finite crossing line of sight to e; (3.1.2) Treat each trading day as a single stock network node; (3.1.3) At two nodes and Horizontal lines are constructed between the histograms of the two nodes, with the height of the line being the height of the lower histogram of the two nodes. Among them, setting nodes This indicates that the i-th stock is in the t-th phase. a The opening price for the day was ,node This indicates that the i-th stock is in the t-th phase. b The opening price for the day was , It represents the range from trading day t-T+1 to trading day t. a Tianhe t b sky; The two nodes are specified. and If a horizontal line intersects only e or fewer intermediate nodes, then these two nodes... and If there is an edge between them, then the nodes are considered to be in a single-stock network with a finite traversal distance of e. and nodes There are no connecting edges between them; therefore, a single-stock network is constructed for each stock. That is, to obtain an N-layer single-stock network for N stocks. .

7. The multimodal data feature fusion method for transaction data and text data according to claim 1, wherein the degree distribution mutual information between layers obtained in step (3.2) is used to characterize the degree correlation between pairs of stocks, specifically including: The degree value of the nodes in the single-stock network of the i-th stock, i.e., the single-stock network of the i-th layer, is... The single-stock network of layer i at node i The degree value is The degree distribution of the nodes in this stock network is represented as follows: ; by calculating the degree sequence of individual stock network nodes for the i-th stock. The degree sequence of a single stock network node for the j-th stock. The mutual information is used to describe the degree of correlation between the i-th stock and the j-th stock, and to determine the magnitude of the correlation between each pair of channels, and the degree of correlation between the i-th stock and the j-th stock. for: ; in, It represents the degree distribution of the network nodes of the i-th stock. It represents the node joint degree distribution of the i-th stock network and the j-th stock network; The mutual information of clustering coefficient distributions between layers is used to characterize the correlation of clustering coefficients between pairs of stocks, specifically including: The clustering coefficient of the single-stock network node of the i-th stock, i.e., the single-stock network of the i-th layer, is: The single-stock network of layer i at node i The clustering coefficient is ,in Represents a node The number of its neighboring nodes. Represents a node The actual number of edges between the node and its neighbors. Represents a node The maximum number of edges between the i-th stock and its neighboring nodes is used to determine the clustering coefficient distribution of the i-th stock. ; By calculating the clustering coefficient sequence of individual stock network nodes for the i-th stock. Clustering coefficient sequence of individual stock network nodes of the j-th stock The mutual information is used to represent the correlation of the pairwise clustering coefficients between the i-th stock and the j-th stock. for: ; in, It is the clustering coefficient distribution of the i-th stock. It is the distribution of the joint clustering coefficients of the i-th stock and the j-th stock.

Citation Information

Patent Citations

  • A stock price prediction method and system based on a bidirectional cross-mode attention network model

    CN109598387A

  • Semantic sentiment analysis method fusing in-depth features and time sequence models

    US11194972B1