A multi-level sentiment analysis method and system for trading markets based on mixed frequency data
By designing a multi-level sentiment index system in trading market sentiment analysis and combining multiple data processing models, the shortcomings of processing mixed data in the existing technology and the incompleteness of sentiment analysis are solved, and more accurate and detailed Market sentiment analysis.
Patent Information
- Application Number
- CN202411301326.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-09-18
Smart Images

Figure CN118822613B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of combining natural language processing with mixed frequency data prediction, and in particular relates to a multi-level sentiment analysis method and system for a trading market based on mixed frequency data. Background Art
[0002] Trading market sentiment analysis in the wholesale and retail sectors such as commodities is an important analytical method that aims to measure and understand the emotions and psychological states of trading market participants through quantitative and qualitative methods. Market sentiment can reflect market participants' expectations of future market trends and sentiments. By deeply understanding market sentiment, market participants can better understand market dynamics, predict market fluctuations, and optimize decision-making; market regulators can better assess market risks, monitor market behavior, and evaluate market reactions to policies. Therefore, an efficient and accurate trading market sentiment analysis method is needed to improve the accuracy and efficiency of market sentiment analysis.
[0003] With the development of the Internet and social media, a large amount of sentiment data such as policy news related to the trading market has become easier to obtain, providing a rich source of data for market sentiment analysis. In addition, the development of artificial intelligence technologies such as machine learning and large language models has made it possible to extract market sentiment information from massive data.
[0004] At present, common market sentiment analysis methods mainly include two categories: one is to analyze text content such as news, social media, and reports through natural language processing (NLP) technology and supervised machine learning methods, and to explore the market news sentiment implicit in text information; the other is to use traditional unsupervised machine learning methods such as principal component analysis to process and analyze the screened investor sentiment proxy indicators to construct quantitative indicators that reflect investor sentiment.
[0005] However, the above common market sentiment analysis methods have some shortcomings. On the one hand, the various macro policy information, market transaction information, news and public opinion information contained in the trading market usually appear in the form of high, medium and low frequency mixing, while the existing market sentiment analysis methods usually require the data to have the same frequency. If the data is of different frequencies, it is necessary to convert the data frequency in the data preprocessing stage, and use aggregation, downsampling and other methods to convert high-frequency data into low-frequency data, or use interpolation and other methods to convert low-frequency data into high-frequency data. As a result, the characteristics of high-frequency data are lost or additional noise or errors are introduced; on the other hand, the existing market sentiment analysis methods usually only quantify market sentiment from one aspect such as news sentiment or investor sentiment and the same time dimension, resulting in an incomplete portrayal of market sentiment. Market sentiment is affected by the macro policy environment, market transaction information and news and public opinion, and includes expectations of long-term and short-term emotions. Summary of the invention
[0006] In view of the above, the purpose of the present invention is to provide a method and system for multi-level sentiment analysis of trading markets based on mixed data, by designing a multi-level sentiment index system including a long-term policy sentiment index, a medium-term trading sentiment index, a short-term news sentiment index and a comprehensive sentiment index, so as to more comprehensively and precisely quantify the public opinion sentiment of the trading market and improve the coverage and interpretability of the sentiment index; by combining the traditional principal component analysis method with a large language model and a mixed data prediction model, it is more effective to process multi-source heterogeneous data such as mixed structured data and text data commonly found in the trading market, and improve the utilization rate of low-frequency data and limited news corpus, so as to construct a more reasonable and accurate multi-level sentiment index for the trading market and realize multi-level sentiment analysis of the trading market.
[0007] To achieve the above-mentioned purpose of the invention, an embodiment provides a method for multi-level sentiment analysis of a trading market based on mixed frequency data, comprising the following steps:
[0008] Real-time acquisition of multi-source heterogeneous mixed-frequency data sets related to market transactions, including low-frequency macroeconomic policy data sets, medium-frequency market transaction information data sets, high-frequency transaction-related policy news corpus, and expert market sentiment judgment data sets;
[0009] Generate a long-term policy sentiment index based on a low-frequency macro policy dataset;
[0010] After removing the impact of macro policy indicators from the medium-frequency market transaction information data set, a medium-term trading sentiment index is generated;
[0011] Generate a short-term news sentiment index based on a corpus of high-frequency trading-related policy news;
[0012] Predict the comprehensive sentiment index based on the long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and expert market sentiment judgment data set;
[0013] Real-time storage and display of long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and comprehensive sentiment index.
[0014] Preferably, a long-term policy sentiment index is generated based on a low-frequency macro policy dataset, including:
[0015] The data in the low-frequency macro policy dataset are time-aligned and then standardized;
[0016] The correlation analysis method is used to remove the indicators with high correlation in the low-frequency macro policy data after standardization, and the proxy indicator of macro policy sentiment is obtained. ;
[0017] Conduct principal component analysis on the proxy indicators of macroeconomic policy sentiment, and retain the first principal component when the cumulative explanatory contribution rate reaches the first threshold , get the eigenvalues of each first principal component , where the expression relationship between each principal component and the original proxy index is:
[0018] ;
[0019] in, is the principal component The rotated factor loading matrix of
[0020] Based on the eigenvalues of each first principal component, the first principal component is weighted averaged to obtain the long-term policy sentiment index of the trading market. , .
[0021] Preferably, a medium-term trading sentiment index is generated based on the medium-frequency market trading information data set after removing the influence of macroeconomic policy indicators, including:
[0022] The data in the medium frequency market transaction information dataset is time aligned and then standardized;
[0023] The correlation analysis method is used to remove the indicators with high correlation in the medium-frequency market transaction information data after standardization, and the market transaction sentiment proxy indicator is obtained. ;
[0024] Using the residual method to trade sentiment proxy indicators from the market Excluding macro policy proxy indicators The influence of and obtain the residual sequence As a proxy indicator of new market trading sentiment;
[0025] ;
[0026] in, It is a proxy indicator of market trading sentiment. As the dependent variable, the macro policy proxy indicator Model parameters when performing regression modeling for independent variables;
[0027] Conduct principal component analysis on the new market trading sentiment proxy indicator and retain the second principal component when the cumulative explanation contribution rate reaches the second threshold , get the eigenvalues of each second principal component , the expression relationship between each second principal component and the new proxy index is:
[0028]
[0029] in, is the principal component The rotated factor loading matrix of
[0030] The medium-term trading sentiment index of the trading market is obtained by weighted averaging the second principal component based on the eigenvalues of each second principal component. , .
[0031] Preferably, a short-term news sentiment index is generated based on a high-frequency trading-related policy news corpus, including:
[0032] Translate the text of the news sample sequence in the high-frequency trading related policy news corpus into English news samples;
[0033] Use the pre-trained FinBERT tokenizer to tokenize English news samples;
[0034] Use the pre-trained FinBERT language classification model to judge the sentiment of news samples after word segmentation and output the sentiment label of each news item and the corresponding probability , where the emotion labels include positive ,neutral and negative ; Probability is the probability of each emotion category, ranging from 0 to 1;
[0035] Label each emotion and its probability Multiply and sum to calculate the sentiment score for each news item ;
[0036] ;
[0037] Summarize the sentiment scores of all news within a preset time period, and obtain the short-term news sentiment index of the trading market after weighted average. , ,in, For news index, The total number of news items.
[0038] Preferably, the comprehensive sentiment index is predicted based on the long-term policy sentiment index, the medium-term trading sentiment index, the short-term news sentiment index, and the expert market sentiment judgment data set, including:
[0039] The short-term news sentiment index is aggregated according to the frequency of the medium-term trading sentiment index using the weighted average method to obtain the medium-term news sentiment index. ,in, , is the number of news sentiment indices within the medium-term frequency, is the news sentiment index, is the short-term news sentiment index;
[0040] Based on the expert market sentiment judgment data set, the equal-weighted average method is used to calculate the expert's medium-term subjective judgment score on market sentiment. ,in, , Indicates the judgment of various experts on market sentiment, including positive ,neutral and negative , is the number of experts.
[0041] Mid-term subjective judgment score As the target variable, the medium-term trading sentiment index and the mid-term news sentiment index As a characteristic factor, machine learning is used to train the model and output the current comprehensive sentiment index. , and the overall sentiment index Trading Sentiment Index with Medium Term and the mid-term news sentiment index the relationship between;
[0042] Based on the Long-Term Policy Sentiment Index and the current composite sentiment index , using the RU-MIDAS mixed data forecasting model to predict the comprehensive sentiment index of the future market .
[0043] To achieve the above-mentioned purpose of the invention, the embodiment of the present invention provides a multi-level sentiment analysis system for a trading market based on mixed frequency data, comprising:
[0044] A mixed frequency data acquisition unit, which is used to obtain multi-source heterogeneous mixed frequency data sets related to market transactions in real time, including a low-frequency macro policy data set, a medium-frequency market transaction information data set, a high-frequency transaction-related policy news corpus, and an expert market sentiment judgment data set;
[0045] A long-term policy sentiment index construction unit, which is used to generate a long-term policy sentiment index based on a low-frequency macro policy dataset;
[0046] A medium-term trading sentiment index construction unit, which is used to generate a medium-term trading sentiment index based on the medium-frequency market trading information data set after removing the influence of macro policy indicators;
[0047] A short-term news sentiment index construction unit, which is used to generate a short-term news sentiment index based on a corpus of high-frequency trading-related policy news;
[0048] A comprehensive sentiment index prediction unit, which is used to predict the comprehensive sentiment index based on the long-term policy sentiment index, the medium-term trading sentiment index, the short-term news sentiment index, and the expert market sentiment judgment data set;
[0049] A multi-level sentiment index visualization display unit is used to store and display long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and comprehensive sentiment index in real time.
[0050] To achieve the above-mentioned purpose of the invention, an embodiment further provides a computing device, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the above-mentioned multi-level sentiment analysis method for the trading market based on mixed frequency data.
[0051] To achieve the above-mentioned purpose of the invention, the embodiment further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned multi-level sentiment analysis method of the trading market based on mixed frequency data is implemented.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] 1. According to the update frequency and data structure differences of market transaction-related data, the present invention divides the sentiment index into long-term policy sentiment index, medium-term transaction sentiment index, short-term news sentiment index and comprehensive sentiment index in more detail, which can more accurately quantify the sentiment factors of the trading market, improve the interpretability of the sentiment index and the accuracy of market sentiment judgment;
[0054] 2. The present invention uses the FinBERT language classification model to process news text data, thereby improving the accuracy of news text sentiment recognition; uses the RU-MIDAS mixed-frequency data prediction model to combine low-frequency macroeconomic policy data with medium-frequency market transaction data, and uses low-frequency data to predict high-frequency data. Compared with the traditional method of using interpolation to fill and convert low-frequency data, this method can more effectively capture the impact of low-frequency data on market sentiment. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 is a flow chart of a method for multi-level sentiment analysis of a trading market based on mixed frequency data provided by an embodiment;
[0057] Figure 2 is a flow chart of collecting a multi-source heterogeneous mixed frequency data set provided by an embodiment;
[0058] Figure 3 is a long-term policy sentiment index analysis flow chart provided by an embodiment;
[0059] Figure 4 is a flow chart of medium-term trading sentiment index analysis provided by an embodiment;
[0060] Figure 5 is a short-term news sentiment index analysis flow chart provided by the embodiment;
[0061] Figure 6 is a comprehensive emotion index analysis flow chart provided by an embodiment;
[0062] Figure 7 is a multi-level emotion index storage and display flow chart provided by the embodiment;
[0063] Figure 8 It is a structural schematic diagram of a multi-level sentiment analysis system for a trading market based on mixed frequency data provided by an embodiment;
[0064] Fig. 9 It is a schematic diagram of the structure of a computing device provided in an embodiment. DETAILED DESCRIPTION
[0065] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0066] like Figure 1 As shown, the embodiment provides a method for multi-level sentiment analysis of a trading market based on mixed frequency data, comprising the following steps:
[0067] S1, real-time acquisition of multi-source heterogeneous mixed-frequency data sets related to market transactions, including low-frequency macro policy data sets, medium-frequency market transaction information data sets, high-frequency transaction-related policy news corpus, and expert market sentiment judgment data sets.
[0068] In the embodiment, multi-source heterogeneous mixed frequency data sets related to market transactions are obtained in real time, specifically including low-frequency macro policy data sets , Medium Frequency Market Transaction Information Dataset , High Frequency Trading Related Policy News Corpus , and expert market sentiment judgment dataset .like Figure 2 As shown in FIG. 1 , the specific acquisition process includes:
[0069] 1) Determine candidate long-term policy sentiment proxy indicators, and obtain low-frequency macro policy data through public channels based on the candidate long-term policy sentiment proxy indicators, clean and pre-process the low-frequency macro policy data, and construct a low-frequency macro policy data set , where preprocessing includes missing value filling, deletion, outlier processing, etc.
[0070] Among them, the candidate long-term policy sentiment proxy indicators determined optionally include: gross domestic product (GDP), primary industry GDP (GDP_1), secondary industry GDP (GDP_2), tertiary industry GDP (GDP_3), total retail sales of consumer goods (LSZE), fixed asset investment (GDZC), real estate investment (FDC), total imports and exports (JCK), debt-to-asset ratio (ZCFZL), etc.
[0071] 2) Determine candidate medium-term trading sentiment proxy indicators, and obtain medium-frequency market trading information data through public channels based on medium-term trading sentiment proxy indicators, clean and pre-process the medium-frequency market trading information data, and construct a medium- and high-frequency market trading information data set .
[0072] Among them, determining the candidate medium-term trading sentiment proxy indicators is optional. According to the actual trading situation of the target market, 10 relevant indicators are selected and used separately. 1 , T 2 ,…,T 10 Indicates obtaining daily market transaction information data.
[0073] 3) Use web crawler technology to obtain trading-related policy news data, including news titles, release time, text and sources, clean and pre-process the data, sort them according to release time and source, and build a corpus of high-frequency trading-related policy news .
[0074] Optionally, you can search for keywords related to the target trading market from news websites, institutional official websites, forums and other channels to obtain daily relevant policy news data from January 2021 to May 2023.
[0075] 4) Obtain the trading market sentiment judgment data, clean and pre-process the data, and fill in the data that is not marked by experts according to the balanced sentiment label to build the market sentiment judgment data set of medium-frequency industry experts .
[0076] Optionally, the obtained trading market sentiment judgment data includes sentiment labels of three categories: tense, loose and balanced; and the data columns include: trading sequence, trader identification, date, sentiment judgment label, etc.
[0077] S2, generates a long-term policy sentiment index based on a low-frequency macro policy dataset.
[0078] like Figure 3 As shown in the figure, a long-term policy sentiment index is generated based on a low-frequency macro policy data set, including:
[0079] 1) Use missing value filling, resampling and other methods to analyze low-frequency macroeconomic policy data sets Time alignment is performed to ensure the consistency of different time series data at different time points. The candidate long-term policy sentiment proxy indicators determined in this example are basically monthly data, and the gross domestic product (GDP), primary industry GDP, secondary industry GDP, and tertiary industry GDP are quarterly data. The current monthly data are filled according to the data of the previous quarter.
[0080] 2) Use methods such as Min-Max Scaling and Z-score to standardize the low-frequency macroeconomic policy dataset after time alignment Standardize the process;
[0081] 3) Using correlation analysis to remove low-frequency macroeconomic policy data sets after standardization Indicators with high correlation, Table 1 shows the correlation coefficients of the selected candidate proxy indicators. The indicators with high correlation are selected and eliminated: GDP of the secondary industry (GDP_2), GDP of the tertiary industry (GDP_3), total retail sales of consumer goods (LSZE), and real estate investment (FDC), and five macroeconomic sentiment proxy indicators are obtained: gross domestic product (GDP), GDP of the primary industry (GDP_1), fixed asset investment (GDZC), total import and export (JCK), and debt-to-asset ratio (ZCFZL);
[0082] Table 1
[0083] ;
[0084] 4) Conduct principal component analysis on the proxy indicators of macroeconomic policy sentiment to obtain the contribution rate, cumulative contribution rate and eigenvalue of each principal component (PC1, PC2, PC3, PC4, PC5), as shown in Table 2, and retain the first principal component when the cumulative explanatory contribution rate reaches the first threshold and the eigenvalues of each first principal component.
[0085] Table 2
[0086] ;
[0087] In the embodiment, the cumulative explanation contribution rate reaches the first threshold The principal components of the time, select the first three principal components As the first principal component, the cumulative contribution rate is , the eigenvalues of the first principal components are , and the expression relationship between each principal component and the original proxy index:
[0088] ;
[0089] Among them, the coefficients of each proxy indicator are the rotated factor loading matrix of each principal component, as shown in Table 3:
[0090] Table 3
[0091] ;
[0092] 5) Based on the eigenvalues of each first principal component, the first principal component is weighted averaged to obtain the long-term policy sentiment index of the trading market .
[0093]
[0094] The weight is the ratio of the eigenvalue of each first principal component to the sum of the eigenvalues.
[0095] S3, generates a medium-term trading sentiment index based on the medium-frequency market trading information dataset after removing the impact of macro policy indicators.
[0096] like Figure 4 As shown in the figure, after removing the impact of macro policy indicators from the medium-frequency market transaction information data set, a medium-term trading sentiment index is generated, which includes:
[0097] 1) Interbank fund transaction information dataset Perform time alignment. For example, select data between January 1, 2016 and May 31, 2023; then forward fill in the null values and perform mean-variance standardization (Z-score) processing;
[0098] 2) Perform correlation analysis to remove the medium frequency market transaction information data set after standardization The medium-strong correlation index is used to obtain the proxy index of market trading sentiment. The correlation analysis results are shown in Table 4:
[0099] Table 4
[0100] ;
[0101] Select indicators with high correlation: T 4 , T 6 , T 8 and T 9 ; Get the remaining six market trading sentiment proxy indicators: T 1 , T 2 , T 3 , T 5 , T 7 and T 10 .
[0102] 3) Use the residual method to eliminate the impact of macro policy proxy indicators from the market trading sentiment proxy indicators, and obtain the residual series as the new market trading sentiment proxy indicator.
[0103] Optionally, the residual method is used to eliminate the impact of macro policy proxy indicators such as gross domestic product (GDP), primary industry GDP (GDP_1), fixed asset investment (GDZC), total imports and exports (JCK) and debt-to-asset ratio (ZCFZL), and the residual sequence T is obtained. 1 _1.T 2 _1.T 3 _1.T 5 _1.T 7 _1 and T 10 _1 as a proxy indicator of new market trading sentiment. 1 The residual T of the indicator 1 _1 calculation as an example:
[0104] ;
[0105] in, It is the model parameter when performing multiple linear regression modeling with market trading sentiment proxy indicators as dependent variables and macro policy proxy indicators as independent variables.
[0106] 4) Perform principal component analysis on the new market trading sentiment proxy index to obtain the contribution rate, cumulative contribution rate and eigenvalue of each principal component (PC1, PC2, PC3, PC4, PC5), as shown in Table 5, and retain the second principal component when the cumulative explanation contribution rate reaches the second threshold and the eigenvalues of each second principal component.
[0107] Table 5
[0108] ;
[0109] In the embodiment, the cumulative explanation contribution rate is retained to reach the second threshold The first three principal components at 0.86 As the second principal component, the eigenvalues of each second principal component are: , and the expression relationship between each principal component and the original proxy index, such as
[0110] ;
[0111] The rotated factor loading matrix of other principal components is shown in Table 6:
[0112] Table 6
[0113] ;
[0114] 5) Based on the eigenvalues of each second principal component, the second principal component is weighted averaged to obtain the medium-term trading sentiment index of the trading market .
[0115] ;
[0116] The weight is the ratio of the eigenvalue of each second principal component to the sum of the eigenvalues.
[0117] S4, generates a short-term news sentiment index based on the high-frequency trading-related policy news corpus.
[0118] like Figure 5 As shown in the figure, a short-term news sentiment index is generated based on the high-frequency trading related policy news corpus, including:
[0119] 1) You can use tools such as Google Translate API to translate the high-frequency trading-related policy news corpus The main text of the Chinese news sample sequence is translated into English news samples;
[0120] 2) Use the pre-trained FinBERT tokenizer to tokenize English news samples;
[0121] 3) Use the pre-trained FinBERT language classification model to judge the sentiment of news samples after word segmentation and output the sentiment label of each news item and the corresponding probability :
[0122]
[0123] Among them, emotional labels include positive ,neutral and negative ; Probability is the probability of each emotion category, is the sentiment label index, ranging from 0 to 1.
[0124] 4) Multiply each sentiment label and its probability and sum them to calculate the sentiment score of each news item. ;
[0125] ;
[0126] 5) Summarize the sentiment scores of all news within the preset time period at the hourly level, and obtain the short-term news sentiment index of the trading market after weighted average. :
[0127]
[0128] in, For news index, The total number of news items.
[0129] S5, predicts a comprehensive sentiment index based on the long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and expert market sentiment judgment dataset.
[0130] like Figure 6 As shown in the figure, the comprehensive sentiment index is predicted based on the long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and expert market sentiment judgment data set, including:
[0131] 1) Use the weighted average method to convert the short-term news sentiment index According to the medium-term trading sentiment index The frequency of the news is aggregated to obtain the medium-term news sentiment index , is the number of news sentiment indices within the medium-term frequency, Is the news sentiment index. When the frequency is selected as daily frequency, There are 24 short-term news sentiment indices representing daily frequencies.
[0132] 2) Expert market sentiment judgment dataset , using the equal-weighted average method to calculate the medium-term subjective judgment score of experts on market sentiment , Indicates the judgment of various experts on market sentiment, including positive ,neutral and negative , is the number of experts, and the expert sentiment judgment samples are shown in Table 7:
[0133] Table 7
[0134] ;
[0135] 3) Mid-term subjective judgment score As the target variable, the medium-term trading sentiment index and the mid-term news sentiment index As a characteristic factor, machine learning is used to train the model and output the current comprehensive sentiment index. ,as well as and and The relationship between.
[0136] Specifically, the multivariate linear regression model is used to fit the independent variables and the target variables, and the medium-term comprehensive sentiment index of capital transactions is calculated based on the results of the model fitting. :
[0137] ;
[0138] in, is the intercept, and is the regression coefficient, is the error term.
[0139] 4) Based on the long-term policy sentiment index and the overall sentiment index , using the RU-MIDAS mixed data forecasting model to predict the comprehensive sentiment index of the future market .
[0140] The RU-MIDAS model is an improvement of the mixed data prediction model (MIDAS). It is a reverse unrestricted mixed data sampling model (Reverse Unrestricted Mixed Data Sampling) that uses low-frequency data to predict high-frequency data. The specific formula is as follows:
[0141] ;
[0142] in, is a high frequency variable, is the lag operator, yes The corresponding lag polynomial can be expressed as , represents the lag order; is a low frequency variable, is the corresponding lag polynomial, and the lag step size is , represents the frequency ratio, i.e., the time span between low-frequency variables and high-frequency variables; is the error term. The model assumes that high-frequency variables It is an autoregressive process that captures the impact of low-frequency data on high-frequency data by adjusting the lag step size. When the lag is large enough, the low-frequency variable is treated as an exogenous variable, and the high-frequency data can be predicted directly from the low-frequency data without the need for upscaling through interpolation.
[0143] In the embodiment, the RU-MIDAS mixed data prediction model predicts the comprehensive sentiment index of the future market When , it is expressed as:
[0144] ;
[0145] in, is a daily high-frequency variable, is a monthly low-frequency variable, and the lag step length of the low-frequency variable is selected as , the lag order is 1, that is, the policy sentiment index of the previous month is used for prediction; the lag step size of the high-frequency variable is selected as 1, and the lag order is 30, that is, the daily comprehensive sentiment index of the previous 30 days is used to predict the comprehensive sentiment index of the next day .
[0146] S6, real-time storage and display of long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and comprehensive sentiment index.
[0147] like Figure 7 As shown, the real-time multi-level sentiment index is calculated through steps S1-S5. The data sequence is stored in the database, and the real-time multi-level sentiment index The results are transmitted to the application for visual display.
[0148] like Figure 8 As shown, the embodiment also provides a multi-level sentiment analysis system for a trading market based on mixed frequency data, including a mixed frequency data acquisition unit, a long-term policy sentiment index construction unit, a medium-term trading sentiment index construction unit, a short-term news sentiment index construction unit, a comprehensive sentiment index prediction unit, and a multi-level sentiment index visualization display unit, wherein the mixed frequency data acquisition unit is used to obtain multi-source heterogeneous mixed frequency data sets related to market transactions in real time, including a low-frequency macro policy data set, a medium-frequency market transaction information data set, a high-frequency transaction-related policy news corpus, and an expert market sentiment judgment data set; the long-term policy sentiment index construction unit is used to generate a long-term policy sentiment index based on the low-frequency macro policy data set; the medium-term trading sentiment index construction unit is used to generate a medium-term trading sentiment index based on the medium-frequency market transaction information data set after eliminating the influence of macro policy indicators; the short-term news sentiment index construction unit is used to generate a short-term news sentiment index based on the high-frequency transaction-related policy news corpus; the comprehensive sentiment index prediction unit is used to predict the comprehensive sentiment index based on the long-term policy sentiment index, the medium-term trading sentiment index, the short-term news sentiment index, and the expert market sentiment judgment data set; the multi-level sentiment index visualization display unit is used to store and display the long-term policy sentiment index, the medium-term trading sentiment index, the short-term news sentiment index, and the comprehensive sentiment index in real time.
[0149] It should be noted that the multi-level sentiment analysis system for trading markets based on mixed frequency data provided in the above-mentioned embodiments should be illustrated by the division of the above-mentioned functional units when conducting multi-level sentiment analysis of trading markets. The above-mentioned functions can be assigned to different functional units as needed, that is, the internal structure of the terminal or server is divided into different functional units to complete all or part of the functions described above. In addition, the multi-level sentiment analysis system for trading markets based on mixed frequency data provided in the above-mentioned embodiments and the embodiment of the method for constructing multi-level sentiment analysis for trading markets based on mixed frequency data belong to the same concept. The specific implementation process is detailed in the embodiment of the method for constructing multi-level sentiment analysis for trading markets based on mixed frequency data, which will not be repeated here.
[0150] Based on the same inventive concept, an embodiment further provides a computing device, including a memory and one or more processors, wherein executable code is stored in the memory, and when the one or more processors execute the executable code, the method for multi-level sentiment analysis of a trading market based on mixed frequency data is implemented, specifically including the following steps:
[0151] S1, real-time acquisition of multi-source heterogeneous mixed-frequency data sets related to market transactions, including low-frequency macroeconomic policy data sets, medium-frequency market transaction information data sets, high-frequency transaction-related policy news corpus, and expert market sentiment judgment data sets;
[0152] S2, generates a long-term policy sentiment index based on a low-frequency macro policy dataset;
[0153] S3, generates a medium-term trading sentiment index based on the medium-frequency market trading information dataset after removing the impact of macro policy indicators;
[0154] S4, generates a short-term news sentiment index based on a corpus of high-frequency trading-related policy news;
[0155] S5, predicts the comprehensive sentiment index based on the long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and expert market sentiment judgment dataset;
[0156] S6, real-time storage and display of long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and comprehensive sentiment index.
[0157] like Fig. 9As shown, the computing device provided in the embodiment, in addition to the processor and memory, also includes hardware required for other services such as internal bus, network interface, memory, etc. at the hardware level. The memory is a non-volatile memory, and the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above-mentioned S1-S6 multi-level sentiment analysis method for the trading market based on mixed frequency data. Of course, in addition to the software implementation, the present invention does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0158] Based on the same inventive concept, an embodiment further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned multi-level sentiment analysis method for a trading market based on mixed frequency data is implemented, specifically including the following steps:
[0159] S1, real-time acquisition of multi-source heterogeneous mixed-frequency data sets related to market transactions, including low-frequency macroeconomic policy data sets, medium-frequency market transaction information data sets, high-frequency transaction-related policy news corpus, and expert market sentiment judgment data sets;
[0160] S2, generates a long-term policy sentiment index based on a low-frequency macro policy dataset;
[0161] S3, generates a medium-term trading sentiment index based on the medium-frequency market trading information dataset after removing the impact of macro policy indicators;
[0162] S4, generates a short-term news sentiment index based on a corpus of high-frequency trading-related policy news;
[0163] S5, predicts the comprehensive sentiment index based on the long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and expert market sentiment judgment dataset;
[0164] S6, real-time storage and display of long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and comprehensive sentiment index.
[0165] In an embodiment, computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0166] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-level sentiment analysis method for trading markets based on mixed frequency data, characterized in that: include: Real-time acquisition of multi-source heterogeneous mixed-frequency data sets related to market transactions, including low-frequency macroeconomic policy data sets, medium-frequency market transaction information data sets, high-frequency transaction-related policy news corpus, and expert market sentiment judgment data sets; Generate a long-term policy sentiment index based on a low-frequency macro policy data set, including: time-aligning the data in the low-frequency macro policy data set and then performing standardization processing; using a correlation analysis method to remove indicators with high correlation in the low-frequency macro policy data set after standardization processing, and obtain a macro policy sentiment proxy indicator; perform principal component analysis on the macro policy sentiment proxy indicator, retain the first principal component when the cumulative explanation contribution rate reaches the first threshold, and obtain the eigenvalues of each first principal component; perform weighted average of the first principal component based on the eigenvalues of each first principal component to obtain the long-term policy sentiment index of the trading market; After removing the influence of macro policy indicators from the medium frequency market transaction information data set, a medium-term transaction sentiment index is generated, including: time-aligning the data in the medium frequency market transaction information data set and then performing standardization processing; using a correlation analysis method to remove the indicators with high correlation in the medium frequency market transaction information data set after standardization processing, and obtaining a market transaction sentiment proxy indicator; using a residual method to remove the influence of macro policy proxy indicators from the market transaction sentiment proxy indicator, and obtaining a residual sequence as a new market transaction sentiment proxy indicator; performing a principal component analysis on the new market transaction sentiment proxy indicator, retaining the second principal component when the cumulative explanation contribution rate reaches the second threshold, and obtaining the eigenvalues of each second principal component; performing a weighted average of the second principal components based on the eigenvalues of each second principal component to obtain a medium-term transaction sentiment index for the trading market; Generate a short-term news sentiment index based on a high-frequency trading-related policy news corpus, including: translating the main text of a news sample sequence in the high-frequency trading-related policy news corpus into English news samples; using a pre-trained FinBERT word segmenter to segment the English news samples; using a pre-trained FinBERT language classification model to make sentiment judgments on the news samples after segmentation, and output the sentiment label and corresponding probability of each news; multiplying each sentiment label and its probability and summing them to calculate the sentiment score of each news; summing up the sentiment scores of all news in a preset time period, and obtaining a short-term news sentiment index of the trading market after weighted average; Predicting a comprehensive sentiment index based on the long-term policy sentiment index, the medium-term trading sentiment index, the short-term news sentiment index, and the expert market sentiment judgment data set, including: using a weighted average method to aggregate the short-term news sentiment index according to the frequency of the medium-term trading sentiment index to obtain the medium-term news sentiment index; based on the expert market sentiment judgment data set, using an equal-weighted average method to calculate the expert's medium-term subjective judgment score on market sentiment; using the medium-term subjective judgment score as the target variable, the medium-term trading sentiment index and the medium-term news sentiment index as feature factors, using machine learning to train the model, and outputting the current comprehensive sentiment index, as well as the relationship between the comprehensive sentiment index and the medium-term trading sentiment index and the medium-term news sentiment index; based on the long-term policy sentiment index and the current comprehensive sentiment index, using the RU-MIDAS mixed data prediction model to predict the future market's comprehensive sentiment index; Real-time storage and display of long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and comprehensive sentiment index.
2. The method for multi-level sentiment analysis of a trading market based on mixed frequency data according to claim 1, characterized in that: Medium-term News Sentiment Index , is the number of news sentiment indices within the medium-term frequency, is the news sentiment index, It is the short-term news sentiment index.
3. The method for multi-level sentiment analysis of a trading market based on mixed frequency data according to claim 1, characterized in that: Mid-term subjective judgment score , Indicates the judgment of various experts on market sentiment, including positive ,neutral and negative , is the number of experts.
4. A multi-level sentiment analysis system for trading markets based on mixed frequency data, characterized in that: include: A mixed frequency data acquisition unit, which is used to obtain multi-source heterogeneous mixed frequency data sets related to market transactions in real time, including a low-frequency macro policy data set, a medium-frequency market transaction information data set, a high-frequency transaction-related policy news corpus, and an expert market sentiment judgment data set; A long-term policy sentiment index construction unit is used to generate a long-term policy sentiment index based on a low-frequency macro policy data set, including: performing time alignment on the data in the low-frequency macro policy data set and then performing standardization processing; using a correlation analysis method to remove indicators with high correlation in the low-frequency macro policy data set after standardization processing, and obtaining a macro policy sentiment proxy indicator; performing principal component analysis on the macro policy sentiment proxy indicator, retaining the first principal component when the cumulative explanation contribution rate reaches the first threshold, and obtaining the eigenvalues of each first principal component; performing weighted average of the first principal component based on the eigenvalues of each first principal component to obtain the long-term policy sentiment index of the trading market; A medium-term trading sentiment index construction unit is used to generate a medium-term trading sentiment index based on a medium-frequency market trading information data set after eliminating the influence of macro-policy indicators, including: time-aligning the data in the medium-frequency market trading information data set and then performing standardization processing; using a correlation analysis method to eliminate the indicators with high correlation in the medium-frequency market trading information data set after standardization processing to obtain a market trading sentiment proxy index; using a residual method to eliminate the influence of macro-policy proxy indicators from the market trading sentiment proxy index, and obtaining a residual sequence as a new market trading sentiment proxy index; performing a principal component analysis on the new market trading sentiment proxy index, retaining the second principal component when the cumulative explanation contribution rate reaches the second threshold, and obtaining the eigenvalues of each second principal component; performing a weighted average of the second principal components based on the eigenvalues of each second principal component to obtain a medium-term trading sentiment index for the trading market; A short-term news sentiment index construction unit is used to generate a short-term news sentiment index based on a high-frequency trading-related policy news corpus, including: translating the text part of the news sample sequence in the high-frequency trading-related policy news corpus into English news samples; using the pre-trained FinBERT word segmenter to segment the English news samples; using the pre-trained FinBERT language classification model to perform sentiment judgment on the news samples after segmentation, and output the sentiment label and corresponding probability of each news; multiplying each sentiment label and its probability and summing them to calculate the sentiment score of each news; summing up the sentiment scores of all news in a preset time period, and obtaining the short-term news sentiment index of the trading market after weighted average; A comprehensive sentiment index prediction unit is used to predict the comprehensive sentiment index based on the long-term policy sentiment index, the medium-term trading sentiment index, the short-term news sentiment index, and the expert market sentiment judgment data set, including: using the weighted average method to aggregate the short-term news sentiment index according to the frequency of the medium-term trading sentiment index to obtain the medium-term news sentiment index; based on the expert market sentiment judgment data set, using the equal-weighted average method to calculate the expert's medium-term subjective judgment score on market sentiment; using the medium-term subjective judgment score as the target variable, the medium-term trading sentiment index and the medium-term news sentiment index as feature factors, using machine learning to train the model, and outputting the current comprehensive sentiment index, as well as the relationship between the comprehensive sentiment index and the medium-term trading sentiment index and the medium-term news sentiment index; based on the long-term policy sentiment index and the current comprehensive sentiment index, using the RU-MIDAS mixed data prediction model to predict the future market's comprehensive sentiment index; A multi-level sentiment index visualization display unit is used to store and display long-term policy sentiment index, medium-term trading sentiment index, short-term news sentiment index, and comprehensive sentiment index in real time.
5. A computing device comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the one or more processors execute the executable code, they are used to implement the multi-level sentiment analysis method for a trading market based on mixed frequency data as described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, the multi-level sentiment analysis method for a trading market based on mixed frequency data as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Text classification-based sentiment index analysis system
CN107885849A
VWAP quantitative transaction system and method based on investor emotion
CN110309508A