Method, system and device for automatic generation of abnormal analysis text in dhi interpretation report
By using a dynamic trend detection and descriptive text generation model for performance indicators, the system automatically generates anomaly analysis text for the DHI interpretation report. This solves the problems of low efficiency and inadequate interpretation caused by manual writing, and enables efficient multi-indicator joint analysis, thereby enhancing the report's guiding role in ranches.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-03-24
AI Technical Summary
Manually writing anomaly analysis texts in DHI interpretation reports is labor-intensive, inefficient, and results in inadequate interpretation. Existing software cannot perform joint analysis of multiple indicators, thus limiting the report's guiding role in actual ranch production.
A dynamic trend detection and descriptive text generation model for performance indicators is adopted. Using an Encoder-Decoder model with data preprocessing, feature representation, attention layer, and text generation layer, dynamic and static anomaly analysis text for performance indicators is automatically generated. A contrast penalty mechanism is combined to improve the accuracy of text generation.
The system automatically generates descriptive text reflecting the dynamic trends of single and multiple performance indicators, reducing the workload of DHI interpreters, improving the quality of report interpretation and its guiding role, and promoting the popularization and application of DHI measurement.
Smart Images

Figure CN116795952B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the cross field of breeding technology and data text generation technology, and particularly relates to a method, system and device for automatically generating abnormal analysis text in DHI interpretation report. BACKGROUND
[0002] Dairy Herd Improvement (DHI) is of great significance to guide the improvement of dairy herd on the farm, and the DHI interpretation report plays a key role in it. The DHI interpretation report mainly consists of three parts: abnormal analysis of key performance indicators, positioning of abnormal reasons, and corresponding guidance suggestions, among which, the abnormal analysis is the premise of abnormal diagnosis and guidance suggestion. At present, the preparation of the abnormal analysis part in the DHI interpretation report mainly has the following problems:
[0003] (1) The preparation of the DHI interpretation report is completely dependent on manual work, but there is a great gap in professional DHI report interpretation personnel in China. DHI testing centers need to complete the preparation of several DHI interpretation reports every month, which is a heavy workload and low efficiency.
[0004] (2) The preparation of the DHI report is based on the comprehensive analysis of the interpretation personnel on the monthly measured values, continuous measured values and mutual influence between different indicators, so the professional level of the interpretation personnel is required to be high, and it is easy to cause the interpretation to be not in place due to the omission of the interpretation personnel.
[0005] (3) Due to problem (2), the DHI interpretation report only mentions the abnormal situation of the monthly measured values of a small number of performance indicators, rarely describes the trend of the continuous measured values of the performance indicators and the joint analysis of multiple indicators, so that the DHI report cannot fully play a role in the actual production of the farm.
[0006] (4) The commonly seen CNDHI, FreeDMS and other software on the market are limited to analyzing the trend of DHI key indicators, abnormal warning and other data statistics functions, and cannot form a conclusive description, so that the farm is still at a loss when facing the numerical curve of several indicators, and cannot provide interpretable factual basis for abnormal diagnosis.
[0007] The above reasons lead to low quality of the preparation of the DHI interpretation report, which reduces its guiding role in the actual production of the farm, and further leads to low enthusiasm of the farm for participation, which greatly affects the in-depth promotion and popularization of the DHI measurement work in China. SUMMARY
[0008] The present application is to solve the problems of heavy workload, low efficiency and incomplete interpretation due to information omission in the manual writing of abnormal analysis text in the current DHI interpretation report.
[0009] The application discloses an automatic generation method of abnormal analysis text in a DHI interpretation report, comprising the following steps:
[0010] Firstly, DHI key performance indicator data is acquired, and the key performance indicator numerical data comprises current month data and historical data;
[0011] Then, based on the key performance indicator numerical data, a performance indicator dynamic trend detection and description text generation model is utilized to generate performance indicator dynamic trend detection description text; the performance indicator dynamic trend detection and description text generation model comprises a data preprocessing layer, a feature representation layer, an attention layer and a text generation layer, and the processing process is as follows:
[0012] (1) Data preprocessing layer:
[0013] The current month data and the historical data of the acquired DHI key performance indicator numerical data are taken as original data, and global movement, local movement and standardization processing are performed:
[0014] 1) Global movement
[0015]
[0016] Wherein, is the data of the i-th performance indicator in the j-th month, is the data of the i-th performance indicator in the initial month;
[0017] 2) Local movement
[0018]
[0019] Wherein, is the data of the i-th performance indicator in the j-th month, is the data of the i-th performance indicator in the j-1-th month, when j-1=0, is the data of the i-th performance indicator in the initial month;
[0020] 3) Standardization
[0021]
[0022] Wherein, is the data of the i-th performance indicator in the j-th month, and μ and σ represent the average value and the standard deviation of the corresponding data respectively; 1≤i≤n;
[0023] Finally, q ithe original data, global movement, local movement and their corresponding standardized data vectors, i.e. concatenate them into a vector, and input each element in the vector as an input of a time step to the encoder, and continue to input the next performance indicator q i till the last vector input of the last performance indicator is completed. i+1
[0024] (2) Feature representation layer:
[0025] The feature representation layer adopts a single-layer bidirectional GRU network as an encoder to input all the performance indicators' original data, global movement, local movement and their corresponding standardized data vectors, i.e. concatenate them into a vector, and input each element in the vector as an input of a time step to the single-layer bidirectional GRU network.
[0026] Finally, the feature representation layer outputs the hidden states Output of all time steps and the hidden state H k of the last time step.
[0027] 3, Attention layer:
[0028] Take all the hidden states Output of all time steps and the hidden state S t-1 of the t-1 step of the decoder output by the feature representation layer, and calculate the importance weight matrix a t of the input of each time step of the feature representation layer at the t step of the decoder, i.e.
[0029] E t = tanh(W s S t-1 +W h Output) (10)
[0030]
[0031]
[0032] wherein, E t , is an intermediate variable; v, W s , W h are weight matrices of different dimensions, which are to-be-learned parameters; S t-1 is the hidden state of the t-1 step, wherein S0 is the output of the encoder.
[0033] Then, a t is multiplied with Output to obtain the weighted context semantic matrix C t And when the decoder generates text, it is used as decoder input along with the text encoding vector;
[0034] C t =α t Output (13)
[0035] 4. Text generation layer:
[0036] The text generation layer uses an LSTM (Long Short-Term Memory) network as the decoder to encode the text vector emb(y). t The weighted context semantic matrix C and the hidden state input LSTM at step t-1 are used to generate feature words describing the text at step t. Right now:
[0037] S t =LSTM(emb(y t ), C t S t-1 (14)
[0038]
[0039] Among them, y t Feature words for annotated text; emb(y t ) is y t Word vectors after WordEmbedding; S t This represents the hidden state output during the current decoding phase; `align` sets the linear layer used to adjust `emb(y)`. t C t and S t The concatenated matrix is then subjected to linear processing.
[0040] Furthermore, the method for automatically generating anomaly analysis text in a DHI interpretation report also includes the step of generating descriptive text for static anomalies in performance metrics:
[0041] For each month's data for the key performance indicators obtained above, directly based on performance indicator q i Based on this month's data values, locate its position within the corresponding anomaly type array p. (i) The position in the middle The anomaly type m corresponding to this position is the anomaly level of this indicator this month. By directly concatenating the performance indicator name with its corresponding anomaly level value, the anomaly status description text corresponding to this indicator is obtained.
[0042] The abnormality type array p (i) Given a two-dimensional array, where, Let be the lower limit of the threshold value corresponding to the m-th anomaly type of the performance index qi. q is a performance index i the mth abnormality degree type.
[0043] Further, the training process of the performance index dynamic trend detection and description text generation model comprises the following steps:
[0044] Firstly, obtain DHI key performance indicator data and analysis description text of key performance indicators;
[0045] Then, train the performance index dynamic trend detection and description text generation model using historical data of DHI key performance indicator data; add a contrast penalty layer to the model during training; during training, generate a contrast text Y correct by replacing the keywords in the labeled analysis description text Y constractive , which is used to punish the model, calculate the loss Margin_Loss between the outputs of the model participating in model training with analysis description text and contrast text respectively, and participate in parameter optimization of the model together with the loss Loss of the decoder;
[0046] The process of generating a contrast text Y correct by replacing the keywords in the labeled analysis description text Y constractive is as follows:
[0047] Y correct and Y constractive are respectively taken as the input of the decoder to generate description texts and calculate the loss value Margin_Loss of the output probability of the two, that is:
[0048]
[0049] wherein, b∈{0,...,batch_size-1}; ω is the weight given; margin is the preset log-likelihood boundary value; are respectively the probability of the output feature words and of the decoder;
[0050] Add Margin_Loss and the loss Loss of the decoder in the training stage to obtain the total loss Total_Loss of the model, that is:
[0051] Total_Loss=Margin_Loss+Loss
[0052] Based on Total_Loss, gradient descent of the model is performed to realize parameter optimization of the model.
[0053] Further, the loss Loss of the decoder in the training stage is as follows:
[0054]
[0055] Where N is the sentence length of the generated text; ω is the assigned weight; y t , These represent the feature words of the labeled text and the feature words of the generated descriptive text, respectively.
[0056] Furthermore, by replacing the labeled analysis description text Y correct The method of generating comparative text Y using keywords constractive The process is as follows:
[0057] From the input Y correct Randomly select original keywords w v And randomly select a keyword from the set of replacement keywords to pair with w v Perform the replacement to generate Y correct The contrasting text Y constractive .
[0058] An automatic generation system for anomaly analysis text in a DHI interpretation report includes:
[0059] The DHI Key Performance Indicator Data Acquisition Unit is used to acquire DHI key performance indicator data, including monthly data and historical data.
[0060] The performance indicator dynamic anomaly description text generation unit is used to call the performance indicator dynamic trend detection and description text generation model to process the numerical data of key performance indicators and generate description text of the dynamic trends of performance indicators. The performance indicator dynamic trend detection and description text generation model includes a data preprocessing layer, a feature representation layer, an attention layer, and a text generation layer. The processing procedure is as follows:
[0061] (1) Data preprocessing layer:
[0062] The acquired DHI key performance indicator numerical data, including this month's and historical data, were used as raw data and subjected to global shifting, local shifting, and standardization processing.
[0063] 1) Global movement
[0064]
[0065] in, For the data of the i-th performance metric in the j-th month, The data for the initial month of the i-th performance metric;
[0066] 2) Local movement
[0067]
[0068] where, is the data of the jth month of the ith performance indicator, is the data of the j-1th month of the ith performance indicator, when j-1 = 0, is the data of the initial month of the performance indicator;
[0069] 3) Standardization
[0070]
[0071] where, is the data of the jth month of the ith performance indicator, μ and σ represent the mean and standard deviation of the corresponding data, respectively;
[0072] Finally, the original data, global movement, local movement and the corresponding standardized data vector of each performance indicator q i , i.e. are spliced into a vector, and each element in the vector is taken as an input of one time step to the encoder. After the last vector of one performance indicator q i is input, the next performance indicator q i+1 is continued as input until the last vector of the last performance indicator is input.
[0073] (2) Feature representation layer:
[0074] The feature representation layer adopts a single-layer bidirectional GRU network as an encoder to splice the of all performance indicators into a vector, and each element in the vector is taken as an input of one time step to the single-layer bidirectional GRU network.
[0075] Finally, the feature representation layer outputs the hidden state Output of all time steps and the hidden state H k of the last time step.
[0076] 3, Attention layer:
[0077] All time step hidden states Output output by the feature representation layer and the hidden state S t-1 of the t-1th step of the decoder are taken out to calculate the importance weight matrix a t of the input of each time step of the feature representation layer at the tth step of the decoder, i.e.:
[0078] E t = tanh(Ws S t-1 +W h Output) (10)
[0079]
[0080]
[0081] where E t , is an intermediate variable; v, W s , W h are weight matrices of different dimensions, which are to be learned parameters; S t-1 is the hidden state of the t-1 step, where S0 is the output of the encoder;
[0082] Then, α t is multiplied with Output to get the weighted context semantic matrix C t , which is used as the input of the decoder together with the text encoding vector when generating the text.
[0083] C t = α t Output (13)
[0084] 4. Text generation layer:
[0085] The text generation layer uses an LSTM long short-term memory network as the decoder, and inputs the text encoding vector emb(y t ), the weighted context semantic matrix C and the hidden state of the t-1 step into the LSTM to generate the feature word y that describes the text at the t step, i.e.:
[0086] S t = LSTM(emb(y t ), C t , S t-1 ) (14)
[0087]
[0088] where y t is the feature word of the labeled text; emb(y t ) is the word vector of y t after WordEmbedding; S t is the hidden state output in the current decoding stage; align is a linear layer, which is used to linearly process the matrix obtained by splicing emb(y t ), C t and S t .
[0089] Further, the abnormality analysis text automatic generation system in the DHI interpretation report further comprises a performance index static abnormality description text generation unit configured to obtain a description text of an abnormality state of the index in the current month, and specifically comprises the following steps:
[0090] Based on the obtained current month data of the key performance index, the position of the current month data value of the performance index q i in the corresponding abnormality degree type array p (i) is located The abnormality degree type m corresponding to the position is the abnormality degree of the index in the current month, and the performance index name and the corresponding abnormality degree value are directly spliced to obtain the abnormality state description text of the index.
[0091] The abnormality degree type array p (i) is a two-dimensional array, wherein, is the lower limit of the value threshold of the mth abnormality type of the performance index q i , and is the mth abnormality degree type of the performance index q i .
[0092] Further, the performance index dynamic abnormality description text generation unit calls a performance index dynamic trend detection and description text generation model which is pre-trained, and the training process of the performance index dynamic trend detection and description text generation model comprises the following steps:
[0093] First, obtain DHI key performance index data and analysis description text of the key performance index.
[0094] Then, the performance index dynamic trend detection and description text generation model is trained using the DHI key performance index data and historical data. In the training process, a comparison penalty layer is added to the model for training. In the training process, a comparison text Y constractive is generated by replacing the keywords in the labeled analysis description text Y correct , which is used to punish the model. The loss Margin_Loss between the outputs obtained by the model in the analysis description text and the comparison text participating in the model training is calculated, and the loss Loss of the decoder is used together to participate in the parameter optimization of the model.
[0095] The process of generating the comparison text Y constractive by replacing the keywords in the labeled analysis description text Y correct is as follows:
[0096] Y correct and Y constractive are respectively input into the decoder to generate description texts and The loss value Margin_Loss of both output probabilities is calculated, that is:
[0097]
[0098] Wherein, b∈{0,..., batch_size-1}; ω is the weight given; margin is a preset log-likelihood boundary value; The probabilities of the decoder output features words and respectively;
[0099] The Margin_Loss is added to the loss Loss of the decoder in the training stage to obtain the total loss Total_Loss of the model, that is:
[0100] Total_Loss = Margin_Loss + Loss
[0101] Based on the Total_Loss, the model gradient descent is performed to realize the model parameter optimization.
[0102] A computer storage medium, the storage medium has at least one instruction stored therein, the at least one instruction is loaded and executed by the processor to realize the one kind of DHI interpretation report in abnormal analysis text automatic generation method.
[0103] A DHI interpretation report in abnormal analysis text automatic generation device, the device includes a processor and a memory, the memory has at least one instruction stored therein, the at least one instruction is loaded and executed by the processor to realize the one kind of DHI interpretation report in abnormal analysis text automatic generation method.
[0104] Beneficial effects:
[0105] By using the present application, not only can the description text reflecting the static abnormality and dynamic change trend of a single performance indicator be automatically generated, but also the description text of the joint change trend of multiple performance indicators can be generated, which can greatly reduce the work burden of DHI interpretation personnel, improve the work efficiency, effectively avoid the problem of inaccurate interpretation positioning caused by omission, effectively improve the interpretation quality of DHI report, thereby improving the guiding role of DHI report in grass-roots pasture, further improving the enthusiasm of participating pastures, promoting the popularization and generalization of DHI determination work in China, and providing support for the upgrading of China's dairy breeding work. BRIEF DESCRIPTION OF DRAWINGS
[0106] Figure 1 The present application is a method for automatically generating abnormal analysis text in DHI interpretation report.
[0107] Figure 2 Performance index dynamic trend detection and description text generation model result schematic diagram. DETAILED DESCRIPTION
[0108] The present application is based on the DHI report data generated by the DHI center according to the CNDHI software, through the detection and description text generation of the static abnormality of the performance index measured value in the DHI report this month, the detection and description text generation of the dynamic trend of the performance index, solves the problems of large workload, low efficiency and incomplete interpretation caused by information omission in the manual writing of abnormal analysis text in the current DHI interpretation report. The present application first extracts the original data of the key performance index from the DHI report, and captures the overall trend of the data, the trend of the adjacent months and the change degree; then, through the abnormal judgment of the key performance index, the static abnormality of the measured value this month is detected, and the corresponding description text is generated according to the rules; finally, through the improved Encoder-Decoder model, the detection and description text generation of the dynamic change trend of the performance index are carried out, the attention mechanism is introduced into the model, and the contrast punishment mechanism is adopted, which can effectively improve the accuracy of the key words generated by the model.
[0109] Specific implementation method one: combined Figure 1 It is explained that the present embodiment,
[0110] The present embodiment is a kind of automatic generation method of abnormal analysis text in DHI interpretation report, including the establishment process of performance index static abnormality detection and description text generation model, the establishment and training process of performance index dynamic trend detection and description text generation model, and the process of generating description text of performance index static abnormality by using the established performance index static abnormality detection and description text generation model, and the process of generating description text of performance index dynamic trend detection by using the trained performance index dynamic trend detection and description text generation model.
[0111] The establishment and training process of text automatic generation model includes the following steps:
[0112] 1. Obtain DHI key performance index data and key performance index analysis description text;
[0113] (1) The key performance index data includes this month data and historical data; wherein,
[0114] The monthly data can be directly used in the DHI report file made by the China Dairy Herd Improvement (CNDHI) system. The corresponding data of the key performance indicators commonly used for analysis, including lactation days, parity, daily milk yield, fat percentage, protein percentage, fat-protein ratio, somatic cell, milk loss, cell division, 305 milk, peak milk, peak day, persistence, urea nitrogen, and average interval between calving, are automatically extracted by the software, and a JSON file is generated.
[0115] The historical data is stored in the JSON file by traversing the key performance indicator data in the historical DHI report file.
[0116] (2) The key performance indicator analysis description text is a factual description of the static abnormality and dynamic trend of each performance indicator in the month. This text is manually written by professional interpreters in the DHI detection center based on the numerical data of each performance indicator in each DHI report after analysis. It is used as a labeled text for training the Encoder-Decoder model.
[0117] 2. Establish a performance indicator static abnormality detection and description text generation model for the description of performance indicator static abnormality:
[0118] For the monthly data of the key performance indicators obtained above, "performance indicator static abnormality" is defined as the state of a performance indicator that is outside the normal value range of that performance indicator. For example, the normal value range of fat-protein ratio is 1.12-1.30. If the performance indicator is outside this range, it is considered to be in an abnormal state. The description of the abnormality is usually expressed as "high fat-protein ratio this month". Therefore, the degree of abnormality needs to be determined based on the abnormality detection.
[0119] The range of the performance indicator static abnormality detection and description text generation model is determined in the following way:
[0120] The normal range of the performance indicator is determined in the DHI interpretation professional books and literature, or based on the data of each month in the historical data, and then the performance indicator static abnormality detection and description text generation model is established, i.e. the two-dimensional abnormality degree type array p of each performance indicator is determined based on the key performance indicator data (i) , where is the lower threshold value of the mth abnormality type of performance indicator q i , and is the mth abnormality degree type (e.g. lower, slightly lower, normal, slightly higher, higher, etc.) of performance indicator q i .
[0121] In actual use, the numerical data of the key performance indicators in the DHI report is obtained, and the performance indicator q i is directly positioned in the corresponding abnormality degree type array p (i) according to the data value of the performance indicator in this month The abnormality degree type m corresponding to the position is the abnormality degree of the performance indicator in this month, and the performance indicator name and the corresponding abnormality degree value are directly spliced to obtain the abnormality state description text corresponding to the performance indicator.
[0122] 3. A performance indicator dynamic trend detection and description text generation model is established and trained for performance indicator dynamic trend detection and description text generation.
[0123] For the monthly data and historical data of the key performance indicators obtained above, the "performance indicator dynamic change trend" is defined as the increase or decrease of a performance indicator after comparing the monthly data with the historical data, for example, the milk production last month is 25.30 kg, and the milk production this month is 25.75 kg, so it is considered that the milk production increases. However, in the DHI interpretation professional books and literature, the dynamic change trend of a single performance indicator is usually expressed as "milk production sharply rises" or "milk production gradually decreases", therefore, in addition to detecting the change of the performance indicator value between adjacent months, the change in a period of time should also be detected, and the abnormality degree should be determined based on the abnormality state detection.
[0124] It is worth noting that in addition to analyzing the dynamic change trend of a single performance indicator, the dynamic change trends of multiple performance indicators should also be jointly analyzed, for example, "with the increase of lactation days, the milk fat rate increases". Therefore, the present application regards this task as a trend detection and text generation problem of multi-dimensional time series data, establishes and trains a performance indicator dynamic trend detection and description text generation model, and uses an improved Encoder-Decoder model to realize it. The model includes a preprocessing layer, a feature representation layer, an attention layer, a text generation layer, and a contrast penalty layer, and the model structure is as shown in Figure 2 .
[0125] (1) Data preprocessing layer
[0126] The present application performs three kinds of preprocessing on the original data, i.e. the monthly data and historical data of the DHI key performance indicators obtained above, which are global movement, local movement and standardization.
[0127] 1) Global movement
[0128] The purpose of introducing global movement is to capture the overall trend of the data based on the initial month, and the calculation method is:
[0129]
[0130] where, is the data of the jth month of the ith performance indicator, is the data of the initial month of the ith performance indicator.
[0131] 2) Local movement
[0132] Introducing local movement is to capture the trend and the degree of change between adjacent months. The calculation method of is:
[0133]
[0134] where, is the data of the jth month of the ith performance indicator, is the data of the j-1th month of the ith performance indicator, when j-1 = 0, is the data of the initial month of the performance indicator.
[0135] 3) Standardization
[0136] All original data and data after global movement and local movement are standardized respectively to eliminate the influence of data dimension. The calculation method of is:
[0137]
[0138] where, is the data of the jth month of the ith performance indicator, and μ and σ represent the mean and standard deviation of the corresponding data, respectively.
[0139] Finally, the original data, global movement, local movement and the corresponding standardized data vectors of each performance indicator q i (1≤i≤n) are obtained, that is, They are spliced into a vector, and each element in the vector is regarded as the input of a time step to the encoder. When the last (sixth) vector input of each performance indicator q i is completed, the next performance indicator q i+1 is input as input until the last (sixth) vector input of the last performance indicator is completed.
[0140] (2) Feature representation layer
[0141] The feature representation layer adopts a single-layer bidirectional GRU network as the encoder (Encoder) to encode the original data, global movement, local movement and standardized data vectors of all performance indicators q The elements are concatenated into a vector, and each element of the vector is used as the input to the GRU network for one time step. The hidden state H at the τ-th step is... τ for:
[0142]
[0143]
[0144]
[0145] in, For a one-way candidate hidden state; h τ h τ-1 Let Xτ be the hidden state in one direction at steps τ and τ-1, respectively; 为 Input data; Z τ For the update gate; ⊙ is the Hadamard product; W xh W hh The weight matrices are of different dimensions, serving as the parameters to be learned; b h R is the bias parameter; τ To reset the door; Output the positive hidden state at step τ; Let τ be the output of the backward hidden state at step τ, and k be the total time step of the model.
[0146] Finally, the feature representation layer outputs the hidden states at all time steps (Output) and the hidden state at the last time step (H). k The encoder outputs S0 are as follows:
[0147] Output = {H1, H2, H3, ... H} k} (7)
[0148]
[0149] S0 = tanh(dense(H) k (9)
[0150] Where tanh is the activation function; and dense is a linear layer used to process H. k Perform linear processing.
[0151] 3. Attention layer
[0152] The hidden states Output at all time steps of the feature representation layer and the hidden state S at step t-1 of the decoder are calculated. t-1 Extract and calculate the importance weight matrix α of the input of the feature representation layer at each time step in the decoder at step t. t This allows the decoder to focus on more suitable content to generate the corresponding text.
[0153] E t =tanh(W s S t-1 +W h Output) (10)
[0154]
[0155]
[0156] Among them, E t , As intermediate variables; v, W s W h S represents weight matrices of different dimensions, which serve as parameters to be learned. t-1 Let S0 be the hidden state at step t-1, where S0 is the output of the encoder and is used as the initial hidden state of the decoder.
[0157] Then, α t Perform matrix multiplication with Output to obtain the weighted context semantic matrix C. t And when the decoder generates text, it is used as input to the decoder along with the text encoding vector.
[0158] C t =α t Output (13)
[0159] 4. Text Generation Layer
[0160] The text generation layer uses an LSTM (Long Short-Term Memory) network as the decoder to encode the text vector emb(y). t The weighted context semantic matrix C and the hidden state input LSTM at step t-1 are used to generate feature words describing the text at step t. Right now:
[0161] S t =LSTM(emb(y t ), C t S t-1 (14)
[0162]
[0163] Among them, y t Feature words for annotated text; emb(y t ) is y t Word vectors after WordEmbedding; S t This represents the hidden state output during the current decoding phase; `align` sets the linear layer used to adjust `emb(y)`.t C t and S t The concatenated matrix is then subjected to linear processing.
[0164] The decoder uses a negative log-likelihood loss function for parameter optimization during the training phase, that is:
[0165]
[0166] Where N is the sentence length of the generated text; ω is the assigned weight; y t , These represent the feature words of the labeled text and the feature words of the generated descriptive text, respectively.
[0167] 5. Compare the penalty layers
[0168] Using the obtained monthly and historical data of key performance indicators and corresponding labeled text, the performance indicator dynamic trend detection and descriptive text generation model is trained. During the training process, in order to further improve the accuracy of the generated text keywords, a contrast penalty layer is added, and Total_Loss is used as the loss function for training. That is, this invention generates contrast text by actively replacing keywords in labeled text (analyzing descriptive text), which is used to penalize the model. The loss Margin_Loss between the outputs obtained by the model training with labeled text and contrast text respectively is calculated, and it is used together with the loss Loss of the decoder to participate in the parameter optimization of the model.
[0169] Specifically, for generating the comparison text, this invention utilizes the preset keyword replacement rules shown in Table 1 to select keywords from the input labeled text Y. correct Randomly select original keywords w v And randomly select a keyword from the set of replacement keywords to pair with w v Perform the replacement to generate Y correct The contrasting text Y constractive In Table 1, rules 1 to 6 are used to generate descriptive text for the dynamic trends of a single performance indicator, and rules 7 to 10 are used to generate joint descriptive text for the dynamic trends of multiple performance indicators.
[0170] Table 1 Rules for generating comparison text
[0171]
[0172] Y correct Y constractive Each is used as input to the decoder to generate corresponding descriptive text. and Calculate the loss value Margin_Loss for the output probabilities of both, i.e.:
[0173]
[0174] Where b∈{0,...,batch_size-1}; ω is the assigned weight; margin is the preset log-likelihood boundary value; The decoder outputs feature words respectively and The probability of.
[0175] Adding Margin_Loss to Loss yields the model's total loss, Total_Loss, which is then used in gradient descent to optimize model parameters.
[0176] Total_Loss=Margin_Loss+Loss (18)
[0177] In actual prediction, the numerical data of key performance indicators in the DHI report are obtained and input into the performance indicator dynamic trend detection and descriptive text generation model. At this time, the performance indicator dynamic trend detection and descriptive text generation model directly uses the text generated by the text generation layer as the result, that is, there is no comparison penalty layer processing. Specific Implementation Method Two:
[0179] This embodiment is an automatic generation system for anomaly analysis text in a DHI interpretation report, which includes:
[0180] The DHI Key Performance Indicator Data Acquisition Unit is used to acquire DHI key performance indicator data, including monthly and historical data.
[0181] The performance metric static anomaly description text generation unit is used to obtain the anomaly status description text corresponding to the metric for the current month, specifically including the following steps:
[0182] Based on the key performance indicators obtained above and this month's data, directly using performance indicator q... i Based on this month's data values, locate its position within the corresponding anomaly type array p. (i) The position in the middle The anomaly type m corresponding to this position is the anomaly level of this indicator this month. By directly concatenating the performance indicator name with its corresponding anomaly level value, the anomaly status description text corresponding to this indicator is obtained.
[0183] The abnormality type array p (i) Given a two-dimensional array, where, For performance index q i The lower limit of the threshold value corresponding to the m-th anomaly type. For performance index q iThe m-th type of abnormality.
[0184] The performance indicator dynamic anomaly description text generation unit is used to call the performance indicator dynamic trend detection and description text generation model to process the numerical data of key performance indicators and generate description text of the dynamic trends of performance indicators. The performance indicator dynamic trend detection and description text generation model includes a data preprocessing layer, a feature representation layer, an attention layer, and a text generation layer. The processing procedure is as follows:
[0185] (1) Data preprocessing layer:
[0186] The acquired DHI key performance indicator numerical data, including this month's and historical data, were used as raw data and subjected to global shifting, local shifting, and standardization processing.
[0187] 1) Global movement
[0188]
[0189] in, For the data of the i-th performance metric in the j-th month, The data for the initial month of the i-th performance metric;
[0190] 2) Local movement
[0191]
[0192] in, For the data of the i-th performance metric in the j-th month, For the data of the (j-1)th month for the i-th performance indicator, when j-1 = 0, This is the data for the initial month of this performance indicator;
[0193] 3) Standardization
[0194]
[0195] in, Let be the data for the j-th month in the i-th performance indicator, where μ and σ represent the mean and standard deviation of the corresponding data, respectively.
[0196] Finally, we obtain each performance metric q. i The original data (1≤i≤n), global shift, local shift, and their corresponding standardized data vectors, i.e. Concatenate them into a vector, and use each element of the vector as the input to the encoder for one time step. When a performance metric q... iAfter the last vector input is completed, the next performance metric q will be input. i+1 Continue as input until the last vector input for the last performance metric is complete;
[0197] (2) Feature representation layer:
[0198] The feature representation layer uses a single-layer bidirectional GRU network as the encoder to represent all performance metrics. The elements are concatenated into a vector, and each element in the vector is used as the input for a time step and fed into a single-layer bidirectional GRU network.
[0199] Finally, the feature representation layer outputs the hidden states at all time steps (Output) and the hidden state at the last time step (H). k ;
[0200] 3. Attention layer:
[0201] The hidden states Output at all time steps of the feature representation layer and the hidden state S at step t-1 of the decoder are calculated. t-1 Extract and calculate the importance weight matrix α of the input of the feature representation layer at each time step in the decoder at step t. t ,Right now:
[0202] E t =tanh(W s S t-1 +W h Output) (10)
[0203]
[0204]
[0205] Among them, E t , As intermediate variables; v, W s W h S represents weight matrices of different dimensions, which serve as parameters to be learned. t-1 Let S be the hidden state at step t-1, where S0 is the output of the encoder;
[0206] Then, α t Perform matrix multiplication with Output to obtain the weighted context semantic matrix C. t And when the decoder generates text, it is used as decoder input along with the text encoding vector;
[0207] C t =α t Output (13)
[0208] 4. Text generation layer:
[0209] The text generation layer uses an LSTM (Long Short-Term Memory) network as the decoder to encode the text vector emb(y). t The weighted context semantic matrix C and the hidden state input LSTM at step t-1 are used to generate feature words describing the text at step t. Right now:
[0210] S t =LSTM(emb(y t ), C t S t-1 (14)
[0211]
[0212] Among them, y t Feature words for annotated text; emb(y t ) is y t Word vectors after WordEmbedding; S t This represents the hidden state output during the current decoding phase; `align` sets the linear layer used to adjust `emb(y)`. t C t and S t The concatenated matrix is then subjected to linear processing.
[0213] The performance indicator dynamic trend detection and descriptive text generation model called by the performance indicator dynamic anomaly descriptive text generation unit is pre-trained. The training process of the performance indicator dynamic trend detection and descriptive text generation model includes the following steps:
[0214] First, obtain the DHI key performance indicator data and the labeled text of the key performance indicators;
[0215] Then, using this month's and historical data of the DHI key performance indicator data, a dynamic trend detection and descriptive text generation model for performance indicators was trained. During training, a contrastive penalty layer was added to the model. During training, the labeled analytical descriptive text Y was replaced. correct The method of generating comparative text Y using keywords constractive This is used to penalize the model, calculating the Margin_Loss between the outputs obtained from training the model with the analytical descriptive text and the contrasting text, respectively, and participating in the model parameter optimization together with the loss of the decoder;
[0216] By replacing the labeled analysis description text Y correct The method of generating comparative text Y using keywords constractive The process is as follows:
[0217] Y correct Y constractive Each is used as input to the decoder to generate corresponding descriptive text. and Calculate the loss value Margin_Loss for the output probabilities of both, i.e.:
[0218]
[0219] Where b∈{0,...,batch_size-1}; ω is the assigned weight; margin is the preset log-likelihood boundary value; The decoder outputs feature words respectively and The probability of;
[0220] The total loss of the model, Total_Loss, is obtained by adding Margin_Loss to the loss of the decoder during training.
[0221] Total_Loss = Margin_Loss + Loss
[0222] Model gradient descent is performed based on Total_Loss to optimize model parameters. Specific implementation method three:
[0224] This embodiment is a computer storage medium that stores at least one instruction, which is loaded and executed by a processor to implement the automatic generation method of anomaly analysis text in a DHI interpretation report.
[0225] It should be understood that the instructions include computer program products, software, or computerized methods corresponding to any method described in this invention; the instructions can be used to program computer systems or other electronic devices. Computer storage media may include readable media on which instructions are stored, and may include, but are not limited to, magnetic storage media, optical storage media; magneto-optical storage media include read-only memory (ROM), random access memory (RAM), erasable programmable memory (e.g., EPROM and EEPROM), and flash memory layers, or other types of media suitable for storing electronic instructions. Specific implementation method four:
[0227] This embodiment is an automatic generation device for anomaly analysis text in a DHI interpretation report. The device includes a processor and a memory. It should be understood that this includes any device including a processor and a memory as described in this invention. The device may also include other units or modules that perform display, interaction, processing, control, and other functions through signals or instructions.
[0228] The memory stores at least one instruction, which is loaded and executed by the processor to implement the method for automatically generating anomaly analysis text in a DHI interpretation report.
[0229] Example
[0230] The method for automatically generating anomaly analysis text in the DHI interpretation report described in this embodiment includes the following steps:
[0231] 1. Obtain DHI key performance indicator data
[0232] Based on the DHI report produced by the DHI Center using the China Dairy Cattle Production Performance Measurement and Analysis System (CNDHI), the measured values of somatic cell count, daily milk yield, milk fat percentage, milk protein percentage, and fat-to-protein ratio for different months of a certain farm were extracted, as shown in Table 2.
[0233] Table 2. Measurement values of some key performance indicators in the DHI reports of a certain ranch for different months.
[0234]
[0235] 2. Static anomaly detection and descriptive text generation for performance indicators
[0236] This invention detects static anomalies of performance indicators for the current month and generates descriptive text by determining the magnitude of the measured value of the performance indicator for the current month and the lower limit of each value threshold in the corresponding anomaly type array.
[0237] The normal somatic cell count in milk samples is approximately 200,000 cells / mL, which may be lower than 100,000 cells / mL in primiparous cows and well-managed herds. A somatic cell count exceeding 250,000 cells / mL to 300,000 cells / mL indicates a bacterial infection. Therefore, a range of 00,000 cells / mL to 300,000 cells / mL can be defined as the normal range for somatic cell count. Furthermore, an array of abnormal somatic cell count types is obtained, as shown in Table 3.
[0238] Table 3 Array of Somatic Cell Abnormality Types
[0239]
[0240]
[0241] As shown in Table 2, the somatic cell count in December 2020 was 322,000 cells / mL. By comparing it with the lower limit of the somatic cell count threshold in Table 3 from high to low, the range of somatic cell count for this month was determined, and the degree of abnormality corresponding to this month's measurement was located, i.e., 32.20 < 150.00. The judgment was continued until 32.20 > 30.00, then the degree of abnormality was located as "high", and an abnormal description text "sopharyngeal cell count is high this month" was generated. The somatic cell count in November 2020 was 289,000 cells / mL, 0.00 < 28.90 < 30.00, so the degree of abnormality was located as "normal", and no abnormal description text was generated at this time.
[0242] The array of abnormality types of the fat-to-protein ratio is shown in Table 4. As shown in Table 2, the fat-to-protein ratio in December 2020 was 1.09. Based on Table 4, the ratio is judged from high to low until 1.09 > 1.00, at which point the comparison stops and an abnormal description text "the fat-to-protein ratio is low this month" is generated.
[0243] Table 4. Array of Abnormal Types of Fat-to-Egg Ratio
[0244]
[0245] 3. Dynamic trend detection of performance indicators and generation of descriptive text
[0246] (1) The raw data in Table 2 are preprocessed. The data after global movement is called move, and the data after local movement is called dim. The raw_std, move_std, and dim_std are the standardized results of the raw data, global movement data, and local movement data, respectively. The above six types of data are used as the input of the model. Taking somatic cell count and cell fraction as examples, the preprocessed data is shown in Table 5.
[0247] Table 5. Somatic cell count and cell division data after pretreatment.
[0248]
[0249]
[0250] (2) Extract the processed data and concatenate them into a large vector [..., 29.30, 22.40, ..., 32.20, 0.00, -6.90, -5.80, ..., 3.30, -0.98, -1.12, ..., -0.01, ..., 0.10, 3.10, 3.20, 3.00, ...], and use each element as the input of one time step in the feature representation layer.
[0251] (3) The original output of the hidden state of the last time step obtained after the data passes through the feature representation layer is [[[7.0112e-02, -7.6675e-01, 2.1378e-01, 8.4524e-02, 1.0000e+00, ...], ...], [[1.1384e-01, 6.8277e-02, -7.6968e-01, -3.1042e-01, -6.5169e-03, ...], ...]], with dimensions [2, batch_size, 128], where batch_size is the batch size, and the 0th dimension is the hidden state output in both directions of the last time step k. and Will and After splicing, we get H. k The range is [[7.0112e-02, -7.6675e-01, 2.1378e-01, 8.4524e-02, 1.0000e+00, ..., 1.1384e-01, 6.8277e-02, -7.6968e-01, -3.1042e-01, -6.5169e-03, ...], ...], with dimensions [batch_size, 256]. Then H... k After linear processing and activation, the final output S0 of the encoder is [[0.6132, 0.5147, -0.3361, -0.9895, -0.3211, -0.9976, -0.9991, -0.8302, -0.9848, 1.0000, -0.9990, 0.9974, 0.9591, -0.3002, -0.9584, -0.1418, ..., 0.7547, 0.8448, -0.1804, -0.7668, 0.6749, 0.9978, -0.9599, 0.5475], ...], with dimensions [batch_size, 128].
[0252] (4) Utilize the hidden state S obtained from the previous time step of the decoder t-1 The importance weight matrix α is calculated by combining the hidden states at all time steps of the feature representation layer output. t , and then α t Perform matrix multiplication with Output to obtain the weighted context semantic matrix C. tTaking S0 as an example, we obtain α0 as [[[2.8158e-05, 2.7075e-05, 2.7448e-05, 2.6886e-05, 2.3996e-05, ..., 8.2303e-02, 8.2303e-02, 8.2303e-02, 8.2303e-02]], ...], with dimensions [batch_size, 1, k], where k is the total time step. Multiply α0 with Output to obtain the weighted context semantic matrix C0, which is [[[-7.3714e-02, 2.7576e-01, 3.1409e-01, 6.6761e-01, 1.1565e-01, ..., 1.5178e+00, -3.7487e-01, 2.9839e-01, 4.6780e-01, 1.4765e-01], ...]], with dimensions [1, batch_size, 256].
[0253] (5) Enter the text generation layer and obtain the word vector of the first feature word "somatic cell" in the labeled text. The input is [[[0.2015, -0.1242, -0.2367, -0.5121, 0.9338, -0.8660, -1.1047, ..., -0.9356, -0.1996], ...]], and its dimension is [1, batch_size, 64]. After being concatenated with the weighted context semantic matrix C0, the hidden state S1 output by the decoder at the current decoding stage is obtained as [[[0.1533, -0.7109, 0.7016, 0.7175, -0.7323, 0.6228, -0.5240, ..., -0.1197, -0.7394, -0.3453, 0.7523, 0.7243, 0.7144], ...]], with a dimension of [1, batch_size, 128]. After further processing by a linear layer and softmax, the output of the decoder in step 1 is [[-2.9744e+01, -2.9911e+01, -3.0150e+01, -2.5690e+01, ..., -2.5994e+01, -2.3496e+01, -2.0686e+01], ...], with dimensions [batch_size, vocab_size], where vocab_size is the size of the vocabulary consisting of the feature words of the labeled text. The position with the highest probability is found from the above matrix, and the corresponding feature word for generating the descriptive text is extracted from the vocabulary. Then Word vector embeddings are used as input for the next time step.
[0254] (6) Repeat the process described in (5) continuously, and finally the model generates the descriptive text that “the number of somatic cells gradually decreased from August to September 2020, and then gradually increased. The cell fraction showed a gradual upward trend. From October to December 2020, the cell fraction increased with the increase of the number of somatic cells.”
[0255] (7) The contrast penalty layer is applied during the training process. Specifically, the keywords in the labeled text are replaced according to the rules in Table 1 to obtain the contrast text. For example, if the labeled text is "somatic cell count gradually decreased from August to September 2020...", the generated contrast text is "somatic cell count increased sharply from August to September 2020...". The two texts are input into the decoder respectively, and the Margin_Loss between the outputs of the two decoders is calculated. Margin_Loss and Loss are used together to optimize the parameters of the model.
[0256] Through the above process, not only can descriptive text reflecting the static anomalies and dynamic trends of a single performance indicator be automatically generated this month, but descriptive text reflecting the combined trends of multiple performance indicators can also be generated. This can significantly reduce the workload of DHI interpreters, improve work efficiency, and effectively avoid inaccurate interpretation due to omissions. It can effectively improve the interpretation quality of DHI reports, thereby enhancing the guiding role of DHI reports in grassroots farms, increasing the enthusiasm of participating farms, promoting the popularization and application of DHI testing in my country, and providing support for the upgrading of dairy cattle breeding in my country.
[0257] The above examples of the present invention are merely illustrative of the computational model and process of the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is impossible to exhaustively list all possible implementations here. Any obvious variations or modifications derived from the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A method for automatically generating anomaly analysis text in a DHI interpretation report, characterized in that, Includes the following steps: First, obtain DHI key performance indicator data, including monthly and historical data. Then, based on the numerical data of key performance indicators, a performance indicator dynamic trend detection and descriptive text generation model is used to generate descriptive text for the dynamic trend detection of performance indicators. The performance indicator dynamic trend detection and descriptive text generation model includes a data preprocessing layer, a feature representation layer, an attention layer, and a text generation layer. The processing procedure is as follows: (1) Data preprocessing layer: The acquired DHI key performance indicator numerical data, including this month's and historical data, were used as raw data and subjected to global shifting, local shifting, and standardization processing. 1) Global movement : (1) in, For the first The first performance indicator Data for each month, For the first Data for the initial month of each performance indicator; 2) Local movement : (2) in, For the first The first performance indicator Data for each month, For the first The first performance indicator Data for each month, when hour, This is the data for the initial month of this performance indicator; 3) Standardization : (3) in, For the first The first of the performance metrics Data for each month, and These represent the mean and standard deviation of the corresponding data, respectively; 1 ≤ i ≤ n; Finally, we obtain each performance metric. The original data, global movement, local movement, and their corresponding standardized data vectors, i.e. , , , , , They are concatenated into a vector, and each element in the vector is used as the input to the encoder for a time step. When a performance metric is given... After the last vector input is completed, continue with the next performance metric. Continue as input until the last vector input for the last performance metric is complete; (2) Feature representation layer: The feature representation layer uses a single-layer bidirectional GRU network as the encoder to represent all performance metrics. , , , , , The elements are concatenated into a vector, and each element in the vector is used as the input for a time step and fed into a single-layer bidirectional GRU network. Finally, the feature representation layer outputs the hidden states at all time steps. and the hidden state of the last time step ; 3. Attention layer: The hidden states at all time steps output by the feature representation layer Decoder Hidden state of the step Extract, compute the input of the feature representation layer at each time step in the decoder. Importance weight matrix of step time ,Right now: (10) (11) (12) in, , As an intermediate variable; , , The weight matrices are of different dimensions and serve as parameters to be learned. For the first The hidden state of the step, where, This is the output of the encoder; Then, and Perform matrix multiplication to obtain a weighted context semantic matrix. And when the decoder generates text, it is used as decoder input along with the text encoding vector; (13) 4. Text generation layer: The text generation layer uses an LSTM (Long Short-Term Memory) network as a decoder to encode the text vector. Weighted context semantic matrix Passing the exam The hidden state input of the step is used to generate the LSTM, which generates the th step. Feature words in step-time description text ,Right now: (14) (15) in, Feature words for annotated text; for go through Word vectors; This represents the hidden state output during the current decoding phase. A linear layer, used for... , and The concatenated matrix is then subjected to linear processing.
2. The method for automatically generating anomaly analysis text in a DHI interpretation report according to claim 1, characterized in that, It also includes the step of generating descriptive text for static anomalies in performance metrics: For each month's data of the key performance indicators obtained above, directly based on the performance indicators... Based on this month's data values, locate its corresponding anomaly type array. The position in the middle The anomaly type corresponding to this location This is the degree of abnormality of the indicator this month. By directly concatenating the performance indicator name with its corresponding degree of abnormality value, the abnormal status description text corresponding to the indicator is obtained. The array of abnormality levels Given a two-dimensional array, where, For performance indicators The The lower limit of the threshold value corresponding to each type of anomaly For performance indicators The Types of abnormality.
3. The method for automatically generating anomaly analysis text in a DHI interpretation report according to claim 1 or 2, characterized in that, The training process of the performance indicator dynamic trend detection and descriptive text generation model includes the following steps: First, obtain the DHI key performance indicator data and the analysis description text of the key performance indicators; Then, a dynamic trend detection and descriptive text generation model for performance indicators was trained using historical data from the DHI key performance indicator dataset. A contrastive penalty layer was added to the model during training, and the labeled analytical descriptive text was replaced during the training process. Methods for generating comparative text using keywords This is used to penalize the model, calculating the loss between the outputs obtained from training the model with the analytical descriptive text and the contrasting text, respectively. and the loss of the decoder They participated in the parameter optimization of the model. By replacing the labeled analysis description text Methods for generating comparative text using keywords The process is as follows: Will , Each is used as input to the decoder to generate corresponding descriptive text. and Calculate the loss value of the output probabilities of both. ,Right now: in, ; It is the assigned weight; The preset log-likelihood boundary value; , The decoder outputs feature words respectively and The probability of; Will The loss of the decoder during the training phase The sum is the total loss of the model. ,Right now: based on Perform gradient descent on the model to optimize the model parameters.
4. The method for automatically generating anomaly analysis text in a DHI interpretation report according to claim 3, characterized in that, Decoder loss during training as follows: (16) in, The sentence length for generating the text; The weights assigned; , These represent the feature words of the labeled text and the feature words of the generated descriptive text, respectively.
5. The method for automatically generating anomaly analysis text in a DHI interpretation report according to claim 4, characterized in that, By replacing the labeled analysis description text Methods for generating comparative text using keywords The process is as follows: From the input Randomly select original keywords And randomly select a keyword pair from the set of replacement keywords. Replace to generate Comparison text .
6. An automatic generation system for anomaly analysis text in a DHI interpretation report, characterized in that, include: The DHI Key Performance Indicator Data Acquisition Unit is used to acquire DHI key performance indicator data, including monthly data and historical data. The performance indicator dynamic anomaly description text generation unit is used to call the performance indicator dynamic trend detection and description text generation model to process the numerical data of key performance indicators and generate description text of the dynamic trends of performance indicators. The performance indicator dynamic trend detection and description text generation model includes a data preprocessing layer, a feature representation layer, an attention layer, and a text generation layer. The processing procedure is as follows: (1) Data preprocessing layer: The acquired DHI key performance indicator numerical data, including this month's and historical data, were used as raw data and subjected to global shifting, local shifting, and standardization processing. 1) Global movement : (1) in, For the first The first performance indicator Data for each month, For the first Data for the initial month of each performance indicator; 2) Local movement : (2) in, For the first The first performance indicator Data for each month, For the first The first performance indicator Data for each month, when hour, This is the data for the initial month of this performance indicator; 3) Standardization : (3) in, For the first The first of the performance metrics Data for each month, and These represent the mean and standard deviation of the corresponding data, respectively. Finally, we obtain each performance metric. The original data, global movement, local movement, and their corresponding standardized data vectors, i.e. , , , , , They are concatenated into a vector, and each element in the vector is used as the input to the encoder for a time step. When a performance metric is given... After the last vector input is completed, continue with the next performance metric. Continue as input until the last vector input for the last performance metric is complete; (2) Feature representation layer: The feature representation layer uses a single-layer bidirectional GRU network as the encoder to represent all performance metrics. , , , , , The elements are concatenated into a vector, and each element in the vector is used as the input for a time step and fed into a single-layer bidirectional GRU network. Finally, the feature representation layer outputs the hidden states at all time steps. and the hidden state of the last time step ; 3. Attention layer: The hidden states at all time steps output by the feature representation layer Decoder Hidden state of the step Extract, compute the input of the feature representation layer at each time step in the decoder. Importance weight matrix of step time ,Right now: (10) (11) (12) in, , As an intermediate variable; , , The weight matrices are of different dimensions and serve as parameters to be learned. For the first The hidden state of the step, where, This is the output of the encoder; Then, and Perform matrix multiplication to obtain a weighted context semantic matrix. And when the decoder generates text, it is used as decoder input along with the text encoding vector; (13) 4. Text generation layer: The text generation layer uses an LSTM (Long Short-Term Memory) network as a decoder to encode the text vector. Weighted context semantic matrix Passing the exam The hidden state input of the step is used to generate the LSTM, which generates the th step. Feature words in step-time description text ,Right now: (14) (15) in, Feature words for annotated text; for go through Word vectors; This represents the hidden state output during the current decoding phase. A linear layer, used for... , and The concatenated matrix is then subjected to linear processing.
7. The automatic generation system for anomaly analysis text in a DHI interpretation report according to claim 6, characterized in that, It also includes a descriptive text generation unit for static anomalies of performance metrics, used to obtain the descriptive text of the anomaly status corresponding to the metric for the current month, specifically including the following steps: Based on the key performance indicators obtained above and this month's data, directly using the performance indicators... Based on this month's data values, locate its corresponding anomaly type array. The position in the middle The anomaly type corresponding to this location This is the degree of abnormality of the indicator this month. By directly concatenating the performance indicator name with its corresponding degree of abnormality value, the abnormal status description text corresponding to the indicator is obtained. The array of abnormality levels Given a two-dimensional array, where, For performance indicators The The lower limit of the threshold value corresponding to each type of anomaly For performance indicators The Types of abnormality.
8. The automatic generation system for anomaly analysis text in a DHI interpretation report according to claim 6 or 7, characterized in that, The performance indicator dynamic trend detection and descriptive text generation model called by the performance indicator dynamic anomaly descriptive text generation unit is pre-trained. The training process of the performance indicator dynamic trend detection and descriptive text generation model includes the following steps: First, obtain the DHI key performance indicator data and the analysis description text of the key performance indicators; Then, a dynamic trend detection and descriptive text generation model for performance indicators was trained using DHI key performance indicator data and historical data. During training, a contrastive penalty layer was added to the model, and the labeled analytical descriptive text was replaced during the training process. Methods for generating comparative text using keywords This is used to penalize the model, calculating the loss between the outputs obtained from training the model with the analytical descriptive text and the contrasting text, respectively. and the loss of the decoder They participated in the parameter optimization of the model. By replacing the labeled analysis description text Methods for generating comparative text using keywords The process is as follows: Will , Each is used as input to the decoder to generate corresponding descriptive text. and Calculate the loss value of the output probabilities of both. ,Right now: in, ; It is the assigned weight; The preset log-likelihood boundary value; , The decoder outputs feature words respectively and The probability of; Will The loss of the decoder during the training phase The sum is the total loss of the model. ,Right now: based on Perform gradient descent on the model to optimize the model parameters.
9. A computer storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement an automatic generation method for anomaly analysis text in a DHI interpretation report as described in any one of claims 1 to 5.
10. An automatic generation device for anomaly analysis text in a DHI interpretation report, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to implement an automatic generation method for anomaly analysis text in a DHI interpretation report as described in any one of claims 1 to 5.