Macro-factor-based text sentiment index construction method

By constructing a text sentiment index based on macroeconomic factors, and dynamically adjusting the weights using macroeconomic factor sequences and the sentiment values ​​of news events, the problem of insufficient sensitivity of sentiment indices to changes in the macroeconomic environment in existing technologies is solved, thus achieving more accurate market sentiment early warning and risk management.

CN121501998BActive Publication Date: 2026-05-12ZHEJIANG LAB +1
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG LAB
Filing Date
2026-01-12
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies lack sensitivity to changes in the macroeconomic environment when constructing text sentiment indices, making it difficult to flexibly adjust the impact weight of news event sentiment. As a result, the sentiment index cannot reflect the market sentiment impact under different economic cycles in a timely manner.

Method used

By acquiring a predefined sequence of macro factors and standardizing it, the sentiment value of news events is calculated. Static weights are determined based on the Beta coefficient, and dynamic weights are adjusted according to the current level of macro factors to generate a text sentiment index.

Benefits of technology

It enhances the sensitivity of the sentiment index to changes in the macroeconomic environment, making it superior to traditional methods in its ability to provide early warnings and responses to the market at different economic stages, and has broad application prospects in investment decision-making and risk management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121501998B_ABST
    Figure CN121501998B_ABST
Patent Text Reader

Abstract

The application discloses a text sentiment index construction method based on macro factors, comprising the following steps: obtaining a pre-defined macro factor sequence and performing standardization processing to obtain a standardized macro factor sequence; obtaining sentiment values of various news events; calculating static weights of the various news events based on the standardized macro factors and the sentiment values of the various news events; adjusting the static weights according to current macro factor levels to obtain dynamic weights of the various news events; and performing weighted summation of the sentiment values of the various news events and the corresponding dynamic weights to generate a text sentiment index. The application adjusts the weights of news event text sentiment by using macro factors, and realizes quantitative analysis and index expression of market sentiment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of macroeconomic analysis and natural language processing, and in particular to a method for constructing a text sentiment index based on macroeconomic factors. Background Technology

[0002] In recent years, the relationship between media sentiment and financial markets has received widespread attention. Early research has shown that the sentiment expressed in media reports can influence market prices. For example, Tetlock (2007) analyzed the textual sentiment of Wall Street Journal columns and found that pessimistic sentiment could predict short-term downward pressure on the stock market, although this downward trend would quickly recover to fundamental levels. Manela and Moreira (2017) constructed an uncertainty index based on news text using front-page news from the Wall Street Journal since 1890. This index rose significantly during events such as stock market crashes, periods of policy uncertainty, world wars, and financial crises. These classic methods typically use sentiment lexicon counting or pre-fixed rules to calculate sentiment indicators, often treating different news texts equally or using static weighting, thus failing to consider the moderating effect of changes in the macroeconomic environment on the influence of news sentiment. This results in a lack of sensitivity of the sentiment index to changes in the macroeconomic situation, making it difficult to reflect the different impacts of news events on market sentiment under different economic cycles.

[0003] Existing technologies also include some automated methods for sentiment analysis of news texts. For example, Chinese patent CN103793371A proposes a method for analyzing the sentiment tendency of news texts, which uses a sentiment dictionary to segment the news text into sentences and words, and calculates the sentiment tendency entropy value of each sentence to determine the overall sentiment. Another example, CN104462065B, discloses a method for analyzing the sentiment type of events, which identifies sentiment words related to the event and calculates the sentiment based on their relevance to the event to determine the sentiment attribute of the event. These technologies focus on the extraction of text sentiment or the classification of event sentiment itself, but they still lack consideration of the dynamic weighting of the event's influence under different macro-contexts when constructing sentiment indices.

[0004] In conclusion, how to integrate macroeconomic factors into the construction of the text sentiment index, flexibly adjust the influence weight of news event sentiment under different macroeconomic conditions, and thus improve the sensitivity of the sentiment index to changes in the macroeconomic environment, has become an urgent problem to be solved. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for constructing a text sentiment index based on macroeconomic factors.

[0006] The objective of this invention is achieved through the following technical solution: a method for constructing a text sentiment index based on macroeconomic factors, comprising:

[0007] Obtain a predefined macroeconomic factor sequence and perform standardization processing to obtain a standardized macroeconomic factor sequence;

[0008] Obtain sentiment scores for various news events;

[0009] Based on standardized macro factors and the sentiment values ​​of various news events, the static weights of various news events are calculated.

[0010] The static weights are adjusted based on the current level of macroeconomic factors to obtain the dynamic weights for various news events;

[0011] The sentiment index is generated by summing the sentiment values ​​of various news events with their corresponding dynamic weights.

[0012] Furthermore, the macroeconomic factors include: growth factors representing economic growth, inflation factors representing inflation, interest rate factors representing market interest rate levels, credit factors representing the credit environment, exchange rate factors representing currency exchange rates, and liquidity factors representing liquidity.

[0013] The macroeconomic factor sequence was determined by constructing financial market data and performing principal component analysis.

[0014] Furthermore, the types of news events include: employment and economic growth events, inflation-related events, monetary policy events, fiscal policy events, financial risk events, and geopolitical events; news events are mapped to the above categories through a pre-defined event ontology, and natural language processing algorithms are used to identify the type labels of news events and calculate the sentiment value of news events.

[0015] Furthermore, the Beta coefficients of various news events relative to the macroeconomic factor sequence are calculated to represent the long-term correlation strength between the sentiment of the news event category and macroeconomic changes; the static weights of various news events are determined based on the Beta coefficients of each category.

[0016] Furthermore, static weights for various news events are determined based on the Beta coefficients of each category, including:

[0017] Initial risk weights are assigned based on the absolute value or variance contribution value of the Beta coefficient for each category, so that the expected risk contribution of each macro factor to the text sentiment index tends to be balanced, and then normalization is performed to obtain the static weights of each type of news event.

[0018] Furthermore, it also includes: verifying the rationality of static weights based on historical samples, specifically: verifying whether the sentiment index constructed according to static weights responds equally to changes in macroeconomic factors; if a static weight is unbalanced, then the static weight is adjusted until it is balanced.

[0019] Furthermore, by adjusting the static weights based on the current level of macroeconomic factors, dynamic weights for various news events are obtained, including:

[0020] The current macroeconomic factor values ​​identify the state of the macroeconomy, and pre-set event category weight adjustment coefficients for different states. When the level of macroeconomic factors changes, the corresponding weight adjustment coefficients for the state are used to correct the static weights of each event category, thus obtaining dynamic weights.

[0021] Furthermore, the acquisition of dynamic weights also includes:

[0022] The dynamic weights of each event category are directly calculated by using a neural network attention mechanism to input the current macroeconomic factor value, so that the text sentiment index can adaptively adjust the weights in response to changes in the macroeconomic environment.

[0023] The present invention also provides an electronic device, including a memory and a processor, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-described method for constructing a text sentiment index based on macro factors.

[0024] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for constructing a text sentiment index based on macroeconomic factors.

[0025] Compared with existing technologies, the advantages of this invention are: This invention integrates macroeconomic factors with textual sentiment analysis, dynamically assigning weights to construct a sentiment index. This overcomes the limitation of the unchanging weights of traditional sentiment indices while retaining the effectiveness of textual sentiment indicators in predicting the market. Experiments show that this macroeconomic factor sentiment index outperforms traditional equally weighted or statically weighted sentiment indices in terms of market early warning and responsiveness at different stages of the economy, thus demonstrating broad application prospects in investment decision-making and risk management. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1A schematic diagram of a method for constructing a text sentiment index based on macro factors, provided in an embodiment of the present invention;

[0028] Figure 2 A schematic diagram of a static and dynamic weight generation process provided in an embodiment of the present invention;

[0029] Figure 3 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Detailed Implementation

[0030] The present invention will now be described in detail with reference to the accompanying drawings. Unless otherwise specified, the features of the following embodiments and implementations can be combined with each other.

[0031] This invention provides a method for constructing a text sentiment index based on macroeconomic factors, see [link to relevant documentation]. Figure 1 and Figure 2 This includes the following steps:

[0032] (1) Obtain a predefined macroeconomic factor sequence and perform standardization to obtain standardized macroeconomic factors. ;

[0033] Specifically, the macroeconomic factors include: growth factors representing economic growth, inflation factors representing inflation, interest rate factors representing market interest rate levels, credit factors representing the credit environment, exchange rate factors representing currency exchange rates, and liquidity factors representing liquidity; the macroeconomic factor sequence is determined by constructing and principal component analysis of financial market data.

[0034] For example, referencing the research framework of Guotai Junan Securities, the main changes in the macroeconomy can be summarized into six major risk factors: growth rate (economic growth), inflation (price level), interest rate (interest rate market), credit (credit environment), exchange rate (currency value), and liquidity (monetary policy interest rate). By performing dimensionality reduction analysis on historical macroeconomic data (e.g., principal component analysis, PCA), it can be verified that these six factors can explain most of the fluctuations in the financial markets. Then, targeting each macroeconomic factor, corresponding high-frequency financial market data is selected to construct factor indicator sequences. For example: daily data such as stock indices and industrial added value are used to synthesize growth factors; data such as CPI / PPI year-on-year growth are used to synthesize inflation factors; data such as the government bond yield curve are used to extract interest rate factors; credit spread indicators are used to construct credit factors; exchange rate indices or the USD / CNY exchange rate represent exchange rate factors; and data such as market interest rates and money supply are combined to form liquidity factors. These factor sequences can be updated daily or weekly, providing a characterization of the current macroeconomic environment across six dimensions. In implementation, existing macroeconomic factor asset allocation frameworks can be referenced to map macroeconomic data into factors. Each factor is standardized to a mean of 0 and a variance of 1 to facilitate comparisons between different dimensions and subsequent weight calculations.

[0035] 1. Growth Factor

[0036] Key indicators: Purchasing Managers' Index (PMI), year-on-year growth of industrial value added, year-on-year growth of cumulative fixed asset investment, year-on-year growth of total retail sales of consumer goods, and year-on-year growth of imports and exports.

[0037] Construction logic: Reflecting the growth of the real economy and changes in demand.

[0038] Solution:

[0039] Calculate the year-on-year or month-on-month change rate for each indicator;

[0040] Use standardization methods (Z-score or min-max) to convert all indicators into the same dimension;

[0041] The comprehensive growth factor sequence is obtained through principal component analysis (PCA) or weighted average (weights based on the contribution of the index variance).

[0042] 2. Inflation Factor

[0043] Key indicators: Consumer Price Index (CPI) and Producer Price Index (PPI).

[0044] The rationale behind its construction is that it reflects price levels and inflationary pressures, serving as an important reference for monetary policy.

[0045] Solution:

[0046] Use year-on-year growth rates (CPI year-on-year, PPI year-on-year);

[0047] The CPI and PPI are weighted, with the weights set to [0.7, 0.3] or determined automatically by PCA;

[0048] The composite inflation factor sequence was obtained.

[0049] 3. Interest Rate Factor

[0050] Key indicators: 10-year Treasury yield, SHIBOR (or DR007) and other short-term interest rates.

[0051] Construction logic: Long-term interest rates reflect market expectations for economic growth and inflation, while short-term interest rates reflect the central bank's monetary policy stance.

[0052] Solution:

[0053] The yield on 10-year Treasury bonds is the primary indicator.

[0054] Short-term interest rates can be incorporated and standardized;

[0055] The interest rate factor is obtained by combining these factors.

[0056] 4. Credit Factor

[0057] Key indicators: credit spread (e.g., yield on AA-rated medium-term notes minus yield on China Development Bank bonds), and corporate financing demand indicators (new social financing and issuance of corporate bonds).

[0058] Construction logic: Reflects the risk appetite and financing conditions of the credit market.

[0059] Solution:

[0060] Calculate and standardize credit spreads;

[0061] The year-on-year growth rate of total social financing is taken into account to construct a credit factor;

[0062] A single credit factor can be synthesized through PCA.

[0063] 5. Exchange Rate Factor

[0064] Key indicators: US Dollar Index (DXY), RMB exchange rate (USD / CNY).

[0065] The design logic reflects the impact of the external environment on the domestic market, particularly capital flows and imported inflation.

[0066] Solution:

[0067] Use the rate of change or level value of the US dollar index;

[0068] The RMB / USD exchange rate change rate can be added to form a comprehensive exchange rate factor.

[0069] 6. Liquidity Factor

[0070] Key indicators: M2 growth rate, total social financing growth rate (Social Financing), M2-Social Financing difference, and funding rate indicators (such as R007-reverse repo rate).

[0071] Construction logic: Reflects the tightness or looseness of the funding environment and market liquidity.

[0072] Solution:

[0073] Calculate the difference between the growth rate of M2 and the growth rate of total social financing;

[0074] Introduce money market interest rate indicators (such as SHIBOR - reverse repo rate spread);

[0075] The liquidity factor is obtained by combining the results.

[0076] 7. Macroeconomic Factor Standardization and Combination

[0077] The six macroeconomic factor sequences were detrended and standardized.

[0078]

[0079] in These are the original values ​​of the factors. These are the historical mean and standard deviation, respectively.

[0080] The obtained standardized macroeconomic factor sequence It can be directly used for subsequent static exposure calculation of event weights and dynamic weight generation.

[0081] (2) Obtain the sentiment value of various news events ;

[0082] Specifically, the types of news events include: employment and economic growth events, inflation-related events, monetary policy events, fiscal policy events, financial risk events, and geopolitical events. The news text is mapped to the above categories through a pre-defined event ontology, and a natural language processing algorithm is used to identify the type labels of the news events and calculate the sentiment value of the news events.

[0083] For example, classifying events mentioned in news texts according to a predetermined ontology classification system is a crucial foundation of this invention. Referring to the Automatic Content Extraction (ACE) 2005 event ontology and related research findings in the financial field, an event category system suitable for financial news is developed. In one embodiment, news events are divided into the following six major types:

[0084] Employment / Growth Events: Events related to macroeconomic growth and employment data, such as GDP releases, employment reports, and corporate expansion;

[0085] Inflation-related events: Events related to inflation and price levels, such as the release of CPI / PPI and changes in the prices of commodities such as crude oil;

[0086] Monetary policy events: Events related to the central bank's monetary policy and interest rate decisions, such as the central bank's decisions on raising or lowering interest rates, and announcements of open market operations;

[0087] Fiscal policy events: Events related to government fiscal revenue and expenditure and policies, such as fiscal stimulus packages, tax adjustments, and infrastructure investment plans;

[0088] Financial risk events: These are related to financial market volatility and risk events, such as stock market crashes, credit crises, bank non-performing loans, and the release of financial regulatory policies.

[0089] Geopolitical events: events related to conflicts, trade frictions, major emergencies, etc.

[0090] The above classification integrates general event ontology with specific themes in the financial field. For example, ACE2005 provides a hierarchical structure of event categories and subcategories, which can serve as a reference for general event definitions. It also incorporates the classification standards of financial information institutions such as Bloomberg (reportedly, Bloomberg's data system classifies news content into more than 50 event types) and classification methods for news events in academic research (such as Brandt et al. distinguishing news into macroeconomic fundamental events and geopolitical events and comparing their market impact; Engelberg and Parsons studying the impact of local media reports on company announcements on local market transactions). Ultimately, the above six categories basically cover typical macroeconomic and financial market event types. In practical implementation, news can be classified and labeled based on keywords and NLP algorithms. For example, large-scale publicly available financial event corpora or classification models (such as the recently proposed Event-Level Financial Sentiment Analysis (EFSA) framework) can be used to extract information such as *(event subject, event type)* from news texts, classifying each news item into one of the aforementioned event types.

[0091] For each news event included in the sentiment index calculation, its sentiment tendency value needs to be extracted. This step can be achieved using existing financial text sentiment analysis methods. For example, a sentiment dictionary in the financial field can be used to calculate the sentiment score by counting the number of positive and negative words in the news (such as the GI dictionary method used by Tetlock or the Loughran-McDonald financial sentiment dictionary); or a trained machine learning / deep learning model (such as the BERT sentiment classification model) can be applied to directly output the sentiment polarity probability of the news text. Existing patents and literature provide a variety of implementation ideas: for example, CN103793371A uses a pre-set optimistic / pessimistic lexicon and finite state automata to calculate the text sentiment entropy value; CN111414754A mentions integrating multiple sentiment analysis models to improve the accuracy of news sentiment judgment; the EFSA task proposed by Chen et al. in 2024 can extract event quintuples containing sentiment labels. This embodiment is not limited to a specific extraction method, as long as it ensures that each news event m obtains a sentiment score. The value can be a continuous value from -1 to 1 (negative to positive) or a discrete category (positive / neutral / negative mapped to numerical values) for subsequent calculations.

[0092] For multiple news events of the same category i, the average of their sentiment scores can be taken as the sentiment value of that category in the current time period. For example, if the average sentiment of several news items falling under the "financial risk" category is negative on a given day, then... This indicates that pessimism is the dominant sentiment.

[0093] (3) Based on standardized macro factors and the sentiment values ​​of various news events, the static weights of various news events are calculated;

[0094] Specifically, the Beta coefficients of various news events relative to the macroeconomic factor sequence are calculated. The Beta coefficient is used to represent the long-term correlation between sentiment and macroeconomic changes in this news event category; the static weights of each news event category are determined based on the Beta coefficient of each category.

[0095] Among them, the static weights of various news events are determined based on the Beta coefficients of each category, including:

[0096] Initial risk weights are assigned based on the absolute value or variance contribution value of the Beta coefficient for each category, so that the expected risk contribution of each macro factor to the text sentiment index tends to be balanced, and then normalization is performed to obtain the static weights of each type of news event.

[0097] For example, static weights reflect the relative importance of each event category to the sentiment index over a long-term average. The steps for calculating static weights are as follows:

[0098] Beta exposure estimation: This method utilizes historical financial market data over long timescales to establish a model relating event sentiment to macroeconomic factors. For example, it aggregates the sentiment index for each news event category on a monthly basis and regresses it against changes in macroeconomic factors (or future market returns) during the same period. The regression coefficient is the Beta value of that category relative to the macroeconomic factors. The formula is expressed as: For news event categories... Through the model (or a similar factor model) to obtain the coefficients of each factor. .

[0099] Risk weight calculation: The above Beta estimation results are summarized to form risk weights. Various measurement methods can be used, such as calculating by category. Variance contribution of each factor ( (where f is the volatility of factor f), and then the weights are inversely proportional to the variance contribution to achieve risk parity, i.e. Alternatively, the sum of the absolute values ​​of all Beta values ​​can be used. As a basis for weighting, normalization The specific function used depends on design preferences: if the goal is to emphasize events with high macroeconomic correlation, the weights can be proportional to Beta; if the goal is to balance the influence of various macroeconomic factors, the weights can be inversely proportional to Beta or an optimization algorithm can be used to find weights that make the risk contributions of each factor equal.

[0100] In one embodiment, a static approach is used to determine the basic weights of sentiment for each event category. Drawing inspiration from Bridgewater Associates' "All Weather" strategy, each event category is analogous to an asset in the portfolio. The sensitivity of an event category to macroeconomic changes is measured by estimating its long-term Beta exposure relative to macroeconomic factors. Based on long-term historical data, the sum of Beta values ​​for each event category relative to various macroeconomic factors (such as growth and inflation) is calculated, and its risk weight is determined accordingly. For example, a larger absolute Beta value indicates a stronger response to macroeconomic shocks, thus assigning a correspondingly higher risk weight. Simultaneously, to avoid dominance by a single factor, referencing the All Weather risk parity concept, the Beta values ​​of multiple factors are aggregated and balanced to determine the final weights. The static weights can be expressed as:

[0101]

[0102] This represents the long-term Beta value of event category i with respect to macroeconomic factor f. The weighting function f can be a weighted summation and normalization of the absolute contributions of each factor's Beta value. By setting static weights, the sentiment index's long-term risk exposure to major macroeconomic factors is balanced, thus improving the index's robustness.

[0103] In one embodiment, the method further includes: weight verification and adjustment: verifying the rationality of the static weights based on historical samples. Observing whether the sentiment index constructed according to the weights responds evenly to changes in macroeconomic factors. If it is found that the influence of a certain factor is still too large, the weights of categories highly correlated with that factor can be appropriately reduced until the index fluctuations are roughly equivalent under different macroeconomic shocks. Once the static weights are determined, they can be reassessed and updated periodically (e.g., annually or quarterly) during the index's operation.

[0104] The method described above yielded the following results. This highlights the importance of the relative stability of each event category. For example, if events like "monetary policy" have a significant long-term impact on market sentiment (high beta), then the static weight will assign them a larger value; conversely, if events like "geopolitical" have a limited impact on daily market sentiment, then the static weight will be smaller. The static weight essentially constructs a basic configuration that operates around the clock, providing a stable structure for the index.

[0105] (4) Adjust the static weights according to the current level of macro factors to obtain the dynamic weights of various news events;

[0106] Specifically, the current macroeconomic factor values ​​identify the state of the macroeconomy, and pre-set event category weight adjustment coefficients for different states. When the level of macroeconomic factors changes, the corresponding state's weight adjustment coefficients are used to correct the static weights of each event category, resulting in dynamic weights. This invention uses the Kondratiev wave cycle as the dynamic cycle state:

[0107] First, define:

[0108] Factor notation: G = Growth, I = Inflation, R = Interest, C = Credit, X = FX (exchange rate / external demand), L = Liquidity.

[0109] Event categories: E1: Employment / Growth; E2: Inflation; E3: Currency / Interest Rate; E4: Financial / Credit Risk; E5: Exchange Rate / External Demand; E6: Liquidity / Market.

[0110] Stage determination rules:

[0111] Determine the threshold (avoid noise): Set the threshold...

[0112] Then, for a certain macroeconomic factor F at time t:

[0113] like If so, it is determined to be UP;

[0114] like If so, it is determined to be DOWN;

[0115] Otherwise, it is judged as NEUTRAL.

[0116] The Kondratiev wave cycles corresponding to macroeconomic factors are shown in Table 1:

[0117] Table 1

[0118]

[0119] The weight δ for each event category under different economic conditions is shown in Table 2:

[0120] Table 2

[0121]

[0122] Key points for explanation:

[0123] Recovery: Growth (E1) is the most sensitive (δ=1.40), liquidity / market (E6) is also important (policy easing or improved liquidity has a rapid impact); credit risk is less important (δ<1). Growth: Growth remains important, but inflation and interest rates are starting to rise (δ≈1.00–1.05), credit and liquidity are relatively neutral. Prosperity: Inflation (E2) and interest rates (E3) are key (δ high) because rising inflation will quickly affect asset pricing and policy expectations; growth's weight increases but is lower than inflation / interest rate's weight. Recession: Credit risk (E4) and liquidity (E6) become extremely important (δ high), while the weight of positive news related to growth / employment is weakened (E1 decreases).

[0124] In summary, based on the assessment results of each macroeconomic factor (UP, DOWN, NEUTRAL), the current economic state is determined (i.e., the column that best corresponds to the assessment results of the six macroeconomic factors in Table 1 is selected to determine the current economic state). The economic state is categorized into recovery, growth, prosperity, and recession.

[0125] Calculate dynamic weights:

[0126] Adjust the static weights based on the current economic situation: This ensures that the adjusted weights still have a normalized sum of 1. When the macroscopic state changes, the corresponding... As this changes, the weights are updated in real time.

[0127] In implementations that do not require explicit state definition, a soft attention mechanism can be used: for example, constructing a function to directly map factor values ​​to weights. For instance, a neural network model can be used as input to the values ​​of several macroscopic factors and output the corresponding weight coefficients for each category. This data-driven approach allows the model to automatically learn the non-linear relationship between macroscopic factors and optimal weights through training, achieving a similar effect to state recognition. Define the dynamic weights of event category i at the current time t:

[0128]

[0129] in As a factor At any moment The standardized value (or with an appropriate magnification factor). Let i be the static Beta of category i. This softmax form ensures that all weights are positive and sum to 1, and gives greater relative weight to aspects with higher current macroeconomic factor levels. For example, when the inflation factor is high, the weight of inflation-related event categories will increase accordingly; during periods of liquidity tightening, the weight of event categories related to financial risk or liquidity will rise. Through dynamic weight adjustments, the sentiment index of this invention can adaptively adjust to changes in the macroeconomic environment, highlighting the most relevant sentiment drivers in different economic cycles.

[0130] Through dynamic weighting, this index reflects a "susceptibility to economic conditions" characteristic: it automatically adjusts the interpretation of news sentiment under different macroeconomic environments. For example, when signs of liquidity tightening emerge, the index assigns higher weight to news related to "financial risks," thus becoming more sensitive to negative reports of banking risk events; conversely, during periods of rapid economic growth, news related to "employment / growth" carries greater weight, and positive employment reports will significantly boost the sentiment index. This gives the index the ability to intelligently shift with the economic cycle, aligning with investors' intuition about varying sensitivities to information at different times.

[0131] (5) The sentiment values ​​of various news events are weighted and summed with their corresponding dynamic weights to generate a text sentiment index.

[0132] Specifically, a comprehensive text sentiment index is calculated based on the weights and sentiment values ​​of each news event category. Let's assume the time frame... t Each news event category i The average sentiment value is The dynamic weight is Then the macro-factor text sentiment index I(t) is defined as: , in N Total number of event categories (in this embodiment) N =6), where The index is a weighted average. This index comprehensively reflects the market sentiment intensity conveyed by news texts within the macroeconomic environment at different times. When macroeconomic conditions change, the contribution of each type of event to the index changes accordingly, making the index more sensitive and effective to macroeconomic shocks. The index can be constructed at daily, weekly, or other frequencies as needed. For example, a daily index can be calculated by collecting news every trading day; if the amount of news is insufficient, a weekly or monthly index can be used to reduce noise.

[0133] It should be noted that when calculating the sentiment index, the sentiment scores can be smoothed or standardized. For example, to eliminate the impact of differences in news volume across different industries, the historical average of each type of news sentiment can be subtracted before being included in the index calculation; or the index itself can be smoothed to highlight trends. In addition, some extended designs can be added: for example, setting a threshold to reduce the weight fluctuation of a certain type of news when it is extremely scarce; or calibrating the index by incorporating market transaction data, etc.

[0134] In summary, this invention organically integrates all stages from macroeconomic factor extraction, event classification, weight calculation to index generation. In verification, the index successfully captured the interaction between macroeconomic conditions and market sentiment: for example, at major macroeconomic turning points (the start of an interest rate hike cycle, signals of economic recession, etc.), the index weight distribution undergoes significant adjustments, allowing the index to reflect changes in market expectations in advance; in contrast, traditional sentiment indices, due to their fixed weights, often lag behind or miss these changes. The index of this invention can be widely applied in areas such as financial market monitoring, portfolio sentiment risk management, and policy effectiveness evaluation, demonstrating significant practical value.

[0135] Figure 3 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Please refer to... Figure 3 The electronic device provided in this embodiment includes a memory and a processor. The memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, they implement a method for constructing a text sentiment index based on macro factors according to the present invention.

[0136] It should be noted that, in addition to Figure 3 In addition to the memory and processor shown, electronic devices may include other hardware depending on their actual functions, which will not be elaborated further.

[0137] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for constructing a text sentiment index based on macroeconomic factors.

[0138] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0139] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0140] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0141] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0142] The above embodiments are only used to illustrate the design concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made based on the principles and design ideas disclosed in the present invention are within the protection scope of the present invention.

Claims

1. A method for constructing a text sentiment index based on macro factors, characterized in that, include: Obtain a predefined macroeconomic factor sequence and perform standardization processing to obtain a standardized macroeconomic factor sequence; Obtain sentiment scores for various news events; Based on standardized macroeconomic factors and sentiment values ​​of various news events, the static weights of various news events are calculated, including: calculating the Beta coefficient of each news event relative to the macroeconomic factor sequence to represent the long-term correlation strength between the sentiment of the news event category and macroeconomic changes; and determining the static weights of each news event based on the aggregated Beta coefficients of each category. Among them, the static weights of various news events are determined based on the Beta coefficients of each category, including: Initial risk weights are assigned based on the absolute values ​​of the Beta coefficients for each category, so that the expected risk contribution of each macro factor to the text sentiment index tends to be balanced, and then normalization is performed to obtain the static weights of each type of news event. It also includes: verifying the rationality of static weights based on historical samples, specifically: verifying whether the sentiment index constructed according to static weights responds equally to changes in macro factors; if a static weight is unbalanced, then the static weight is adjusted until it is balanced. The static weights are adjusted based on the current level of macroeconomic factors to obtain the dynamic weights for various news events, including: The current macroeconomic factor values ​​identify the state of the macroeconomy, and pre-set event category weight adjustment coefficients for different states; when the level of macroeconomic factors changes, the corresponding state's weight adjustment coefficients are called to correct the static weights of each event category, thus obtaining dynamic weights; The sentiment index is generated by summing the sentiment values ​​of various news events with their corresponding dynamic weights.

2. The method for constructing a text sentiment index based on macro factors according to claim 1, characterized in that, The macroeconomic factors include: growth factors representing economic growth, inflation factors representing inflation, interest rate factors representing market interest rate levels, credit factors representing the credit environment, exchange rate factors representing currency exchange rates, and liquidity factors representing liquidity. The macroeconomic factor sequence was determined by constructing financial market data and performing principal component analysis.

3. The method for constructing a text sentiment index based on macro factors according to claim 1, characterized in that, The types of news events include: employment and economic growth events, inflation-related events, monetary policy events, fiscal policy events, financial risk events, and geopolitical events. The news text is mapped to the above categories through a pre-defined event ontology, and a natural language processing algorithm is used to identify the type labels of the news events and calculate the sentiment value of the news events.

4. The method for constructing a text sentiment index based on macro factors according to claim 1, characterized in that, The acquisition of dynamic weights also includes: The dynamic weights of each event category are directly calculated by using a neural network attention mechanism to input the current macroeconomic factor value, so that the text sentiment index can adaptively adjust the weights in response to changes in the macroeconomic environment.

5. An electronic device comprising a memory and a processor, characterized in that, The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the text sentiment index construction method based on macro factors as described in any one of claims 1-4.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements a method for constructing a text sentiment index based on macro factors as described in any one of claims 1-4.