A text-enhanced time series prediction method based on numerical state and consistency perception
Patent Information
- Application Number
- CN202611399498.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-10-16
AI Technical Summary
同时,现有方法通常采用模态级或统一权重控制文本信息,无法针对不同时间步和不同特征维度调节文本贡献,且容易削弱数值时间序列在预测过程中的主体作用
(1)本发明以数值时间序列提取的当前状态作为文本语义选择条件,根据不同数值状态从事件文本窗口中选择相关文本语义,避免将全部文本信息无差别引入预测过程,从而降低冗余文本和弱相关文本造成的干扰,最终提高事件文本选择的针对性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence, time series analysis, and multimodal data processing, specifically to a text-enhanced time series forecasting method based on numerical state and consistency awareness. This invention is applicable to forecasting scenarios with historical numerical observation data and textual information, including but not limited to environmental monitoring, energy load forecasting, traffic condition forecasting, and financial indicator forecasting. Background Technology
[0002] Time series forecasting is a technique that estimates target variables for future times based on one or more observed variables collected in historical time periods. It is widely used in fields such as environmental monitoring, energy dispatching, industrial operation, traffic management, financial analysis, and public safety early warning. For multivariate time series forecasting tasks, it is usually necessary to extract the correlations between variables, their temporal trends, periodic characteristics, and local fluctuation characteristics from historical numerical sequences, and then predict the target value for future times based on this information.
[0003] In practical applications, changes in time series data are influenced not only by historical data but also by external events. For example, changes in environmental quality may be affected by pollution emissions, extreme weather, or adjustments to environmental policies; changes in energy load may be affected by weather changes, holiday arrangements, or energy consumption policies; the operating status of industrial equipment may be affected by equipment alarms, maintenance records, or operational procedures; and traffic conditions may be affected by traffic accidents, road construction, or sudden traffic control measures. These external events are typically generated in textual form, such as news articles, operation logs, alarm records, maintenance records, policy documents, or manual records, and have corresponding occurrence times, publication times, or effective time intervals.
[0004] Therefore, jointly modeling event text with historical numerical time series can provide external event information beyond numerical observations for time series prediction. However, existing text-enhanced time series prediction methods typically introduce text information into the numerical time series prediction process by directly concatenating text vectors with numerical features, using overall weighting, or simple cross-attention fusion. Due to the varying degrees of correlation between event text and the current prediction target, and because text information has temporal location and effective scope, existing methods suffer from at least the following problems: First, existing methods typically input multiple text messages within the prediction window into the model as a whole, or use only a unified text representation for fusion. This makes it difficult to select semantic information relevant to the current prediction task from multiple event texts based on the current numerical change state. For regular records, weakly related texts, or texts that do not match the current numerical state, direct use may introduce redundant information or noise, causing the text information to negatively impact numerical prediction.
[0005] Second, existing methods for fusing text and numerical information typically control text contributions using modal-level weights or uniform fusion weights, making it difficult to distinguish the role of text at different time steps, and also difficult to distinguish the role of different feature dimensions in text enhancement representation. Since different events have varying degrees of influence on the prediction target at different time locations and under different numerical states, it is difficult to achieve precise injection and suppression of text information using single weights or coarse-grained weights.
[0006] Third, existing methods do not adequately consider the temporal consistency between text and numerical time series. There may be delays in publication time, differences in event duration, recording lag, or misaligned time windows between text events and numerical observations. When the temporal relationship between a text event and the current prediction time does not match, the predictive value of the text may decrease; if the model still uses it as valid information input, it may cause the prediction results to be biased or reduce the model's ability to respond to numerical changes.
[0007] Fourth, existing methods, when incorporating textual information, may directly use the text fusion results to replace or drastically alter the numerical time series representation, making it difficult to maintain the role of the numerical time series as the predictive subject. When the text contains missing information, noise, weak correlations, or temporal misalignments, the unconstrained textual information may interfere with the original numerical prediction path, leading to a decrease in model stability.
[0008] Fifth, while existing technologies can filter and weight text information to a certain extent through attention weights or gating weights, they usually lack a collaborative processing mechanism between numerical state-driven semantic selection and temporal consistency-aware contribution regulation, making it difficult to simultaneously solve the two problems of "which text information to select" and "to what extent the selected text information should participate in the prediction".
[0009] In summary, when using event text to assist time series forecasting, there is still a need for a time series forecasting method that can select relevant text semantics based on historical numerical states, combine the temporal consistency and state matching relationship between text and numerical values, implement fine-grained contribution control of text enhancement information, and at the same time maintain the main role of numerical time series forecasting. Summary of the Invention
[0010] I. Technical Problem to be Solved by the Invention Existing text-enhanced time series prediction methods typically incorporate event text into numerical time series through direct concatenation, uniform weighting, or simple attention fusion. This makes it difficult to select relevant text semantics based on the current numerical changes and to accurately determine the temporal consistency between the text event and the prediction time. This results in weakly correlated, noisy, or temporally misaligned text interfering with the prediction results. Furthermore, existing methods often use modal-level or uniform weighting to control text information, failing to adjust text contributions for different time steps and feature dimensions, and easily weakening the primary role of the numerical time series in the prediction process.
[0011] Therefore, this invention aims to provide a text-enhanced time series prediction method based on numerical state and consistency awareness, in order to: select relevant semantics from the event text corresponding to the current numerical state; suppress text information that is time-displaced or mismatched according to the temporal consistency between the text and the numerical state; implement contribution control of the text information step by step and feature dimension by feature, and integrate it into the numerical time series representation in a controlled manner.
[0012] To address the aforementioned technical problems, this invention provides a text-enhanced time series prediction method based on numerical state and consistency awareness, comprising the following steps:
[0013] The system acquires historical multivariate numerical time series and time-stamped event text information. It constructs a numerical input window based on the prediction time and historical window length, and establishes a correspondence between the event texts and their occurrence, publication, or available time with the corresponding numerical time steps. For multiple texts at the same time location, filtering, summarizing, or merging can be performed; for locations without valid text, empty text or no event representation is set. Prediction uses only information available up to the current time, and the system divides the data into training, validation, and test sets according to chronological order.
[0014] The numerical input window is standardized and feature-mapped, and then input into the numerical time series encoding module to extract trends, local fluctuations, time dependencies, and inter-variable correlations from historical numerical sequences, thus obtaining a numerical state representation. The event text corresponding to the time is then semantically encoded, feature-compressed, normalized, and spatially mapped to obtain a textual semantic representation, ensuring that the numerical state representation and the textual semantic representation have matching feature dimensions.
[0015] Numerical state representations are used as text semantic retrieval conditions, and text semantic representations are used as the information to be selected. A cross-modal attention mechanism is used to calculate the correlation between numerical states and different text semantics. Based on the correlation, text information is selected and aggregated to obtain the text-enhanced representation. Since the text input has already undergone time correspondence and information availability constraints during the sample construction stage, text semantic selection is further carried out within the text range that satisfies the time correspondence.
[0016] The numerical state representation and the text augmentation representation are jointly input into the text contribution control module to generate gating weights corresponding to the time step and feature dimension, thereby fine-grained adjusting the injection intensity of the text augmentation information. Subsequently, the controlled text augmentation information is fused into the numerical state representation in a residual manner, ensuring that historical numerical information always remains the main predictor, while text information participates in the prediction as auxiliary information, thus reducing the interference of weakly correlated, noisy, or low-effective text information on the prediction results.
[0017] Window-level prediction features are extracted from the fused temporal representation and input into the continuous value prediction module, outputting the prediction results for the future target variable. During the training phase, the numerical temporal encoding module, text semantic processing module, cross-modal attention module, text contribution regulation module, and prediction module are jointly optimized based on the error between the prediction results and the true target values, and model parameters are selected based on the validation set results. During the testing phase, the selected model is loaded for prediction, and the prediction results are restored to the original dimensions of the target variable.
[0018] During model training and inference, data is always processed in chronological order, and the prediction time is limited to using only numerical information and event text information obtained at or before that time to avoid future information leakage. Beneficial effects
[0019] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention uses the current state extracted from the numerical time series as the text semantic selection condition. Based on different numerical states, relevant text semantics are selected from the event text window to avoid introducing all text information into the prediction process indiscriminately, thereby reducing the interference caused by redundant text and weakly related text, and ultimately improving the targeting of event text selection.
[0020] (2) In the process of text semantic selection and contribution regulation, the present invention introduces time consistency information between text events and numerical time steps or prediction moments, so that event texts with matching time relationships can be utilized to a higher degree, and text information that is time-lagging, time-misaligned or exceeds the effective range is suppressed, thereby improving the matching degree between text information and numerical changes.
[0021] (3) The present invention generates text contribution adjustment weights in the time step dimension and feature dimension respectively, and performs fine-grained adjustment of text enhancement representation. It can control the injection intensity of text information according to different time positions and different semantic features, and has a stronger text information adjustment capability compared with the unified weight fusion method.
[0022] (4) This invention injects text information into the numerical state representation through a controlled residual method, so that the text information participates in the prediction as an adjustable auxiliary information, rather than replacing the main prediction path of the numerical time series. Therefore, even in cases where the text is missing, the text noise is large, or the text does not match the numerical state, the adverse effects of the text information on the numerical prediction results can still be reduced. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Attached Figure Description
[0024] Appendix Figure 1 Overall processing flow and network structure; Appendix Figure 2 Construction of time-corresponding samples of numerical sequences and event texts and extraction of bi-branch representations; Appendix Figure 3 A text semantic selection process based on numerical state and temporal consistency; Appendix Figure 4 Text contribution regulation and numerical subject-preserving fusion process; Appendix Figure 5 Predicted output and model training process.
[0025] The technical solution of the present invention will be further described below with reference to the accompanying drawings. It should be noted that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Technical features in these embodiments can be combined with each other without contradiction.
[0026] This embodiment provides a text-enhanced time series prediction method based on numerical state and consistency awareness. The method uses historical multivariate numerical time series as the prediction subject and event texts with temporal correspondences to the numerical series as auxiliary information. It sequentially performs time-corresponding sample construction, numerical state representation extraction, text semantic representation extraction, text semantic selection based on numerical state, text contribution adjustment, residual fusion, and prediction output.
[0027] As attached Figure 1 As shown, this implementation includes a numerical time series branch, an event text processing branch, a cross-modal text semantic selection module, a text contribution control module, and a continuous value prediction module.
[0028] The numerical time series branch is used to extract trend changes, local fluctuations, and time dependencies from historical multivariate numerical sequences; the event text processing branch is used to extract event text semantics corresponding to each historical time position; the cross-modal text semantic selection module uses the numerical state representation as the query condition to dynamically select semantic information related to the current numerical change state from the text semantic sequence; the text contribution control module is used to control the injection intensity of the selected text information step by step and feature dimension by feature; and the continuous value prediction module outputs the prediction results of the future target variable based on the fused time series representation.
[0029] In this embodiment, time consistency awareness is mainly reflected in the construction of the time correspondence between event text and numerical observation, as well as the constraint on the availability of prediction information. Only event texts obtained at or before the prediction time that can establish a time correspondence with the corresponding historical numerical time steps are used as model input, thereby avoiding the use of text information generated after the prediction time and reducing interference caused by obvious time misalignment information.
[0030] As attached Figure 2 As shown, suppose the original multivariate numerical time series is at the prediction starting point. The corresponding history window length is Each time step contains Numerical variables.
[0031] For the prediction starting point Construct a historical data input window:
[0032] And construct an event text window corresponding to the time of the numerical input window:
[0033] in, Indicates the first Multivariate numerical observations at each time step Indicates the number of numerical variables. This indicates the total length of the time series.
[0034] The event text includes one or more of the following: news, environmental event records, equipment alarm records, operation logs, maintenance records, policy information, weather event records, or manual records.
[0035] When multiple event texts exist at the same time location, they can be filtered, summarized, merged, or corresponding text descriptions can be constructed according to preset rules. When there is no valid event text at a certain time location, it can be set to empty text, no event marker, or preset no event representation, while retaining the time location, thereby ensuring that the numerical sequence and text sequence have a consistent time length within the history window.
[0036] The prediction task of this invention is represented as follows: in, The parameter is Time series prediction models; Indicates the prediction step size; Indicates the future number The predicted value of the target variable at each time step.
[0037] when When, it means using the current length is The historical window is used to predict the target variable for the next time step.
[0038] To avoid future information leaks, the original data was divided into training, validation, and test sets in chronological order, rather than using a random partitioning method.
[0039] For the For each numerical variable, its mean is calculated using only the training set. and standard deviation and time step Standardize the numerical observations:
[0040] in, Indicates time step The One original numerical feature; This represents the corresponding standardized value; A very small positive number set to prevent the denominator from being zero.
[0041] Both the validation set and the test set are obtained from the training set. and Perform the same standardization process.
[0042] When constructing the event text window, retain the event occurrence time, text publication time, or information indicating the event's time location. For the prediction starting point... Only event text that is already available at the prediction time is allowed; information generated after the prediction time is not used.
[0043] Therefore, the time consistency in this implementation is not achieved by introducing future text or independent time weights, but rather by first ensuring a clear time relationship between the text input and the historical value window through strict time correspondence sample construction.
[0044] As attached Figure 2 As shown, the input window for the standardized historical values is denoted as:
[0045] First, a numerical feature projection layer is used to project the data at each time step. 3D original numerical features mapped to Public Hidden Spaces: in, and These represent the learnable weight matrix and bias term of the numerical feature projection layer, respectively; This represents the numerical embedding sequence after linear projection; This represents the characteristic dimension of a public hidden space.
[0046] Subsequently, the numerical embedding sequence is input into the numerical timing encoder:
[0047] in, Indicates a numerical timing encoder; This indicates the timing hidden state of the numerical branch output.
[0048] The numerical time series encoder is used to extract trend changes, local fluctuations, time dependencies, and correlations between different numerical variables in historical numerical time series.
[0049] In one implementation, the numerical time encoder employs a Transformer-based time coding network; alternatively, it may employ a recurrent neural network, a long short-term memory network, a gated recurrent network, a time-series convolutional network, an iTransformer, or other coding networks capable of outputting time-step-level time-series representations.
[0050] In this embodiment, a Transformer-based encoder is used, and the common hidden space dimension is... The encoder layer count is set to 128, the number of encoder layers is set to 3, and the Dropout value is set to 0.1. These parameters are used to illustrate specific implementation methods and do not constitute a limitation on the scope of protection of this invention.
[0051] The event text processing branch performs semantic encoding on the text descriptions corresponding to each time position within the history window.
[0052] Let the pre-trained text semantic encoder be... The initial text semantics corresponding to the history text window are then represented as:
[0053] in, This represents the dimension of the sentence vector output by the pre-trained text encoder; This represents a semantic embedding sequence formed by the event text corresponding to all times within the history window.
[0054] In this embodiment, the text semantic encoder preferably uses Sentence-BERT, or SBERT. Other pre-trained language models or text encoding networks that can map text descriptions into fixed-dimensional semantic vectors can also be used.
[0055] Since the original text sentence vectors are typically high-dimensional and may contain redundant semantic information irrelevant to the current prediction task, the initial text representation is input into a text compressor for non-linear compression and normalization. in, and These are learnable parameters for a text compressor. Represents a non-linear activation function; Presentation layer normalization operation; This represents the semantic representation of the compressed text.
[0056] Subsequently, the compressed text semantics are mapped to the same public hidden space as the numerical state:
[0057] in, and These represent the learnable weight matrix and bias term of the text projection layer, respectively; This represents the semantic sequence of the mapped text.
[0058] Through the above processing, the numerical state representation is made possible. With text semantic representation Having the same hidden feature dimension This provides a unified representation space for subsequent cross-modal semantic selection and residual fusion.
[0059] The formal mathematical structure of the numerical and text branches in the experimental design adopts the sequence of linear numerical projection, temporal coding, SBERT coding, text compression, and common space projection.
[0060] As attached Figure 3 As shown, this implementation uses a cross-modal attention mechanism to establish a dynamic matching relationship between numerical temporal states and event text semantics.
[0061] Temporal consistency is first guaranteed by the historical window construction in step 1, i.e., the text sequence. With numerical sequences Establish a correspondence based on the corresponding historical time position, and only include text information that can be obtained before the prediction time.
[0062] Based on the above time correspondence processing, the text semantics are further actively selected by utilizing the current numerical state.
[0063] Hiding state using numerical time sequence As query information, in a text semantically hidden state As the source of information for keys and values, linear mapping is performed respectively: in, Represents the query matrix; Represents the key matrix; Represents a value matrix; , and These represent the corresponding learnable projection matrices.
[0064] Since the query information comes directly from the numerical status, the same text information can receive different levels of attention in different numerical change states or different historical windows.
[0065] In other words, the present invention does not input all text information into the prediction module indiscriminately, but first uses the numerical state as the text semantic retrieval condition.
[0066] Calculate the scaled dot product attention based on the numerical query matrix and the text key matrix:
[0067] in, This represents the feature dimension of the key vector; This represents the cross-modal attention weight matrix.
[0068] The attention weights are used to characterize the degree of matching between different text semantic representations in the historical text window at each numerical time step.
[0069] When the semantic features of a text event have a high degree of matching with the current numerical state, its corresponding attention weight increases relatively; when the text content has a low degree of correlation with the current numerical state, its corresponding attention weight decreases relatively.
[0070] Since the event text has already been mapped and constrained according to the predicted time before entering this module, cross-modal attention further performs semantic relevance selection within the text range that satisfies the time availability constraint.
[0071] Weighting text value representations using cross-modal attention weights:
[0072] in, This represents the text enhancement representation after cross-modal attention selection.
[0073] Therefore, the numerical branch no longer passively accepts fixed text representations, but dynamically retrieves event information related to the current prediction task from the text semantic sequence corresponding to the current historical numerical state.
[0074] Therefore, this step forms a processing path of "time correspondence constraint - numerical state query - dynamic selection of text semantics".
[0075] The core definition of this patent is to use numerical representation as the Query, text representation as the Key and Value, and to obtain text-enhanced representation through scaling dot product attention.
[0076] As attached Figure 4 As shown, the text enhancement representation obtained after step 3 It already contains event text information selected based on numerical states, but it may still contain weakly related semantics, noise information, or contribute limited text features in some samples.
[0077] Therefore, this embodiment further includes a text contribution control module, which generates fine-grained gating weights based on the numerical state and the text enhancement representation.
[0078] Hide the numerical state With text enhancement representation The features are concatenated along the feature dimension and then input into the gating network:
[0079] in, This indicates that concatenation is performed along the feature dimension; and These represent the learnable weight matrix and bias term of the gated network, respectively. Limit the output value to the range of 0 to 1; This indicates the weighting of text contribution.
[0080] because Historical time series representations have corresponding time steps and feature dimensions. Therefore, different time positions can obtain different gating weights, and different feature dimensions within the same time position can also have different weights.
[0081] When text augmentation helps to supplement the current numerical state, the gating weight at the corresponding position can be increased, allowing more text augmentation information to participate in the fusion; when the text augmentation representation has a low degree of matching with the numerical state or contains interfering information, the corresponding gating weight can be decreased, thereby suppressing the contribution of that part of the text information.
[0082] Therefore, compared with the fusion method that uses single text modality weights, this implementation can adjust the contribution of text information at a finer granular level at both the time step and feature dimension.
[0083] Adjusting weights using text contribution Text augmentation representation Element-wise modulation is performed, and the modulated text information is injected into the numerical hidden state in the form of residuals to obtain the final fused temporal representation:
[0084] in, This represents element-wise multiplication; Presentation layer normalization operation; This represents the final fusion time sequence.
[0085] The above fusion method is retained As the basic residual path, the text enhancement representation is only gated and modulated before being added to the numerical state as auxiliary information.
[0086] When the text information is valid, it can participate in prediction with a larger gating weight; when the text is missing, has high noise, weak correlation, or its validity is reduced due to changes in time, its gating contribution can be limited.
[0087] Therefore, this implementation does not use text representation to replace the original numerical time series representation, but forms a fusion structure of numerical subject representation + controlled text enhancement information, thereby maintaining the main role of historical numerical sequences in the prediction process.
[0088] The design adopts the method of using and Jointly generate gated weights and use them as a structure for residual fusion.
[0089] As attached Figure 5 As shown, after obtaining the fused time series sequence Then, window-level prediction representations are extracted from them, and the prediction results of future target variables are output using the continuous value prediction module.
[0090] In this implementation, the last time step of the historical fusion sequence is selected as the window-level feature of the current historical window:
[0091] in, Represents the fusion sequence The Middle One, that is, the hidden representation corresponding to the last time step of the history window; This represents a window-level feature used to predict future target values.
[0092] Using the last time step allows the prediction module to make full use of the comprehensive numerical state and text enhancement information formed at the end of the historical window.
[0093] In other implementations, time-based average pooling, weighted pooling, or attention aggregation can also be used to... Obtain a window-level representation.
[0094] Input the window-level predicted representation into the multilayer perceptron regression module:
[0095] in, This represents the continuous value prediction module; Indicates the future number The target variable prediction results for each time step.
[0096] when At that time, the model outputs the predicted value of the target variable for the next time step.
[0097] The prediction process also uses the last time step of the fused sequence. As a window-level representation, the prediction results are output through MLP.
[0098] During the training phase, historical numerical inputs and time-corresponding texts are input into the numerical branch and the text branch, respectively. After cross-modal attention, text contribution regulation, and residual fusion, the prediction results are obtained.
[0099] To improve the model's attention to samples whose target values deviate from the general distribution of the current batch, this implementation can employ target deviation-aware regression loss.
[0100] Let the set of sample indices for the current training batch be . The batch sample size is:
[0101] Let the first The true target value of each sample is The mean and standard deviation of the target values for the current batch are as follows:
[0102] in, This represents the average target value for the current batch. This represents the standard deviation of the target value for the current batch.
[0103] Further calculation of the first The standardized deviation of each sample target value from the current batch target distribution:
[0104] in, A very small positive number set to prevent the denominator from being zero; The larger the value, the greater the deviation between the true target value of the sample and the average level of the target value of the current batch.
[0105] Generate sample loss weights based on the degree of deviation:
[0106] in, Weighting adjustment coefficients indicating the degree of deviation; This represents the maximum cutoff value for the sample weights; This represents the truncation function.
[0107] Construct a weighted mean square error based on the sample weights:
[0108] in, Indicates the first The prediction results for each sample.
[0109] To improve the model's adaptability to both normal samples and samples with large residuals, the Smooth L1 loss can be further employed.
[0110] Definition of the first The prediction residuals for each sample are:
[0111] The corresponding single-sample Smooth L1 loss is:
[0112] in, This represents the threshold at which the Smooth L1 loss transitions from the quadratic error region to the linear error region.
[0113] The batch average Smooth L1 loss is expressed as: The final model training loss is:
[0114] in, This represents the weighting coefficient of the Smooth L1 loss term.
[0115] Using the aforementioned loss function, the trainable parameters in the numerical temporal coding module, text semantic coding and compression module, cross-modal attention module, text contribution regulation module, and continuous value prediction module are jointly updated via backpropagation.
[0116] In this implementation, the optimizer uses AdamW. During training, the parameters of the best-performing model are saved based on the prediction error on the validation set.
[0117] During the testing phase, the model weights selected on the validation set are loaded, the test samples are predicted, and the results obtained from the standardized spatial prediction are inversely transformed to the original dimensions of the target variable.
[0118] This embodiment is used to illustrate the application of the text-enhanced time series prediction method based on numerical state and consistency perception described in this invention in the air quality prediction scenario, and to verify the role of numerical state in driving text semantic selection and text contribution regulation.
[0119] This embodiment uses air quality and meteorological monitoring data from the U.S. Environmental Protection Agency's Air Quality System / AirData database, selecting relevant monitoring records from the New York-Newark-Jersey metropolitan area as numerical time series data, covering the period from January 1, 1982 to September 30, 2023. Numerical variables include multiple air quality monitoring variables and meteorological observation variables, with the prediction target being the air quality target variable for the next time step.
[0120] Simultaneously, event text information corresponding to the monitoring area and time range is acquired. This event text includes content such as pollution events, pollutant emissions, environmental policy adjustments, extreme weather, cross-regional pollution transmission, and air quality warnings. The event text is cleaned, relevance-filtered, summarized, and time-stamped, and a time correspondence is established between the event occurrence time, text publication time, or event validity time and the numerical monitoring time. For prediction, only numerical data and event text information obtained up to and including the prediction time are used.
[0121] The experiment divided the dataset into training, validation, and test sets according to chronological order, and used 48 consecutive historical time steps to predict the target variable for the next time step. In the experiment, the text semantic encoding module of this invention adopted SBERT, the numerical temporal encoding module adopted a Transformer-type encoder, and the common feature space dimension was set to 128. The main experimental parameters are shown in Table 1.
[0122] Table 1 Main model parameters History Window L 48 Prediction step size H 1 Public Hidden Dimension d 128 Encoder layers 3 Dropout 0.1 Learning rate <![CDATA[1×10⁻ 4 ]]> Batch size 128 Number of training rounds 40 Optimizer AdamW Parameters Approximately 0.770M The experiment used mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²) to evaluate the overall predictive performance of the model. Simultaneously, the 0.90 quantile of the target variable in the training set was used as the threshold for high-value samples, and the MAE and RMSE for high-value samples were calculated, denoted as Peak MAE and Peak RMSE, respectively, to evaluate the model's predictive ability for high-value and mutation-prone samples of the target variable.
[0123] To verify the effectiveness of the method of the present invention, two main categories were set up for comparison: prediction models that only use numerical time series and multimodal prediction models that use event text.
[0124] Numeric prediction models include Persistence, Numeric MLP, Numeric GRU, Numeric LSTM, Numeric TCN, Numeric Transformer, and Numeric PatchTST. Multimodal prediction models include direct concatenation of original text vectors, concatenation of compressed text vectors, simple gated fusion, temporal cross-modal attention, and the method described in this invention. The method described in this invention employs numerical state-driven text semantic selection, temporal consistency awareness, and time-step and feature-dimensional text contribution regulation, and fuses text information into the numerical temporal representation through controlled residuals. The prediction results of different models are shown in Table 2.
[0125] Table 2 Comparison of prediction errors of different models numerical values Persistence 14.750 23.400 0.325 60.667 69.004 numerical values Numeric MLP 14.913 22.892 0.354 81.508 86.916 numerical values Numeric GRU 15.932 23.058 0.345 71.356 77.380 numerical values Numeric LSTM 14.733 21.964 0.405 72.654 78.608 numerical values Numeric TCN 14.465 21.663 0.422 69.704 76.782 numerical values Numeric Transformer 15.304 22.979 0.349 83.467 87.868 numerical values Numeric PatchTST 15.821 23.599 0.313 80.375 87.258 Multimodal Original text vector concatenation 17.493 26.357 0.144 97.966 104.869 Multimodal Compressed text vector concatenation 15.222 23.791 0.303 90.813 96.118 Multimodal Simple Gating Fusion 15.341 23.451 0.322 85.450 89.504 Multimodal Temporal cross-modal attention 14.604 22.219 0.392 79.577 85.286 Multimodal This invention 14.482 21.895 0.409 75.680 81.157 As shown in Table 2, directly concatenating the original text vector to the numerical features leads to a decrease in prediction performance, indicating that unselected and unregulated text information may introduce redundant semantics and noise.
[0126] Compared to concatenating raw text vectors, concatenating compressed text can reduce prediction error to some extent, but its overall performance is still lower than models using semantic selection and contribution regulation. Simple gating fusion improves model performance, but its control over text information is limited.
[0127] After adopting temporal cross-modal attention, the model's MAE decreased to 14.604 and RMSE decreased to 22.219, indicating that the interaction between numerical temporal sequence and textual semantics can improve the utilization of textual information. The method of this invention further introduces numerical state-driven textual semantic selection, temporal consistency awareness, and fine-grained textual contribution regulation, achieving the lowest MAE and RMSE and the highest R² in multimodal models.
[0128] It should be noted that the overall performance of Numeric TCN is slightly better than the method of this invention across all models, indicating that historical numerical series remain the primary source of information for air quality forecasting. The technical advantage of this invention lies in improving the selective utilization of event text while retaining the primary role of numerical time series forecasting, and reducing the interference of irrelevant, weakly correlated, or temporally inconsistent text on the forecasting process.
[0129] To further verify the role of the three core technical aspects of this invention, the following ablation model was established: A1: Transformer model using only numerical time series; A2: Add text sentence vectors to the numerical Transformer model, but do not perform state-driven semantic selection and contribution regulation; A3: Add text sentence vector and text contribution regulation, but do not perform state-driven semantic selection; A4: Incorporate text sentence vectors and state-driven semantic selection, but do not adjust text contribution; A5: A complete model that simultaneously employs text semantic representation, state-driven semantic selection, and text contribution regulation.
[0130] The experimental results of each ablation model are shown in Table 3.
[0131] Table 3 Ablation Experiment Results A1 Pure numerical Transformer 15.304 22.979 0.3493 83.467 A2 Sentence vector + Transformer 15.222 23.791 0.3025 90.813 A3 Sentence vector + contribution adjustment 15.341 23.451 0.3223 85.450 A4 Sentence vector + semantic retrieval 14.604 22.219 0.3917 79.577 A5 Complete model of the invention 14.482 21.895 0.4092 75.680 As shown in Table 3, although the MAE of A2 decreased slightly compared to A1 after only adding text sentence vectors, the RMSE, R², and PeakMAE did not improve. This indicates that directly introducing text semantics cannot stably improve the prediction effect, and some text information may interfere with the model. When A3 added text contribution regulation but did not perform state-driven semantic selection, the overall prediction performance was lower than A2 and A4, indicating that gating only unselected text information is insufficient to fully eliminate the influence of text semantic redundancy and weakly related information. After adding state-driven semantic selection in A4, MAE, RMSE, and PeakMAE decreased, and R² increased, indicating that selecting relevant text semantics based on numerical state can improve the matching degree between text information and the current prediction state. A5 further added time-step and feature-dimension-based text contribution regulation on the basis of A4, further reducing MAE, RMSE, and PeakMAE, and increasing R². This result shows that state-driven text semantic selection can solve the problem of "which text information to select", and text contribution regulation can further solve the problem of "to what extent the selected text information participates in the prediction". The combination of the two can obtain a more stable text-enhanced prediction effect.
[0132] In summary, the experimental results of this embodiment demonstrate that the present invention, through numerical state-driven text semantic selection, combined with time consistency awareness between text and numerical state, and by implementing time-step and feature-dimension-based contribution control of text enhancement representation, can improve the effective utilization of event text while maintaining the main role of numerical time series prediction and reduce the negative impact of irrelevant and inconsistent text on prediction results.
Claims
1. A text-enhanced time series prediction method based on numerical state and consistency awareness, characterized in that, include: Acquire historical multivariate numerical time series and time-stamped event text information, construct a numerical input window and an event text window corresponding to the time of the numerical input window according to the prediction time and historical window; the event text window only contains event text information that has been obtained at or before the prediction time and can establish a time correspondence with the corresponding historical time step in the numerical input window; The numerical input window is temporally encoded to obtain a numerical state representation; the event text window is semantically encoded and feature-mapped to obtain a text semantic representation with the same feature dimensions as the numerical state representation. Using the numerical state representation as query information and the text semantic representation as key and value information, the matching degree between the numerical state representation and different text semantics is calculated through a cross-modal attention mechanism, and the text semantics are selected and aggregated according to the matching degree to obtain the text-enhanced representation; Based on the numerical state representation and the text enhancement representation, text contribution adjustment weights corresponding to time steps and feature dimensions are generated, and the text enhancement representation is adjusted element by element using the text contribution adjustment weights. The adjusted text enhancement representation is fused to the numerical state representation in a residual manner to obtain a fused temporal representation, and the prediction result of the future target variable is output based on the fused temporal representation.
2. The method according to claim 1, characterized in that, The event text information establishes a time correspondence with the numerical time series according to the event occurrence time, text publication time, or event validity time; multiple event texts at the same time position are filtered, summarized, or merged; for time positions without valid event text, a "no event" indication is set, and the time position is retained.
3. The method according to claim 1, characterized in that, The cross-modal attention mechanism includes: Linear mapping is performed on the numerical state representation and the text semantic representation respectively to obtain the query matrix, the key matrix and the value matrix; Calculate the scaled dot product attention weights based on the query matrix and the key matrix; The value matrix is weighted and aggregated using the scaled dot product attention weights to obtain the text enhancement representation.
4. The method according to claim 1, characterized in that, The text contribution adjustment weights are obtained through the following methods: The numerical state representation and the text enhancement representation are concatenated along the feature dimension; Input the splicing results into the gating network; By restricting the output of the gating network to the range of 0 to 1 using an activation function, text contribution control weights corresponding to the text augmentation representation in the time step dimension and feature dimension are obtained.
5. The method according to claim 1, characterized in that, The residual fusion includes: The text contribution modulation weights are multiplied element-wise with the text enhancement representation to obtain the modulated text enhancement representation; The modulated text enhancement representation and the numerical state representation are added together by residual addition to obtain the fused temporal representation.
6. The method according to claim 1, characterized in that, The semantic representation of the text is obtained by pre-training semantic encoding, semantic feature compression, normalization processing, and common space mapping of the event text.
7. The method according to claim 1, characterized in that, The prediction results of future target variables output based on the fused time series representation include: Extract the representation corresponding to the last time step of the historical window from the fused temporal representation as the window-level prediction feature; The window-level prediction features are input into the continuous value prediction module, which outputs the predicted value of the future target variable.
8. The method according to claim 1, characterized in that, When generating the text-enhanced representation, event text information obtained after the prediction time is masked so that text semantic selection is only performed within the scope of event text that meets the time availability constraint.