An electric energy data analysis intention recognition method based on prompt learning
Patent Information
- Application Number
- CN202611030016.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]然而,在现有的电能量数据意图识别过程中,仅依托固定模板的槽位匹配与无上下文感知的独立序列标注开展意图分类与实体定位,未结合意图特征向量与字符级上下文的深度融合广播拼接,难以精确定位复杂查询语句中的实体边界偏移并保障意图要素抽取的全局语义一致性
获取电能量数据对应的意图查询文本;构建数据意图分析时要素掩码槽位对应的提示模板,将所述意图查询文本填充至所述提示模板后输入意图识别模型,分别提取所述意图查询文本的全局语义特征和所述提示模板的要素先验特征;通过交叉注意力机制将所述全局语义特征和所述要素先验特征进行融合,得到意图特征向量,并对所述意图特征向量执行分类预测,得到意图识别结果;基于所述意图特征向量定位候选实体跨度,根据所述意图识别结果确定候选实体类型集合,并根据所述候选实体跨度和所述候选实体类型集合中的语义原型确定所述候选实体跨度在意图识别时的实体类型。
Smart Images

Figure CN123012520A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power data analysis technology, and more specifically, to a method for identifying the intent of power energy data analysis based on cue learning. Background Technology
[0002] Power data analysis refers to the process of using data mining, machine learning, and statistical analysis techniques to deeply process and extract features from the massive amounts of electrical energy data generated during power grid operation. Its core lies in mining potential electricity consumption patterns, equipment status, and energy consumption characteristics from multi-dimensional and multi-time-scale power operation data, thereby providing accurate data support and decision-making basis for business scenarios such as power load forecasting, line loss anomaly diagnosis, user profile construction, and power grid dispatch optimization. It is an important foundation for realizing intelligent operation and refined management of the power grid.
[0003] However, in existing processes for identifying intent in electrical energy data, relying solely on slot matching with fixed templates and context-aware independent sequence labeling for intent classification and entity localization, without combining deep fusion broadcast splicing of intent feature vectors and character-level context, makes it difficult to accurately locate entity boundary offsets in complex query statements and ensure global semantic consistency in intent element extraction. Therefore, how to achieve accurate entity span localization based on intent features to improve the accuracy of intent recognition in electrical energy data analysis scenarios is a key challenge facing the industry. Summary of the Invention
[0004] This application provides a method for intent recognition in electrical energy data analysis based on prompting learning, which can achieve accurate entity span positioning based on intent features to improve the accuracy of intent recognition in electrical energy data analysis scenarios.
[0005] Firstly, this application provides a method for identifying intent in electrical energy data analysis based on cue learning, wherein the method: Obtain the intent query text corresponding to the electrical energy data; When constructing a prompt template corresponding to the feature mask slot during data intent analysis, the intent query text is filled into the prompt template and then input into the intent recognition model to extract the global semantic features of the intent query text and the feature prior features of the prompt template respectively. The global semantic features and the prior features of the elements are fused by a cross-attention mechanism to obtain an intent feature vector, and classification prediction is performed on the intent feature vector to obtain the intent recognition result. Based on the intent feature vector, the candidate entity span is located, the candidate entity type set is determined according to the intent recognition result, and the entity type of the candidate entity span in the intent recognition is determined according to the semantic prototype in the candidate entity type set.
[0006] In this embodiment, the prompt template corresponding to the feature mask slot when constructing data intent analysis specifically includes: Extract data dimension features from the target data source and map the data dimension features to feature mask slots with variable placeholders; Assemble the initial template framework based on the element mask slots and preset data analysis instructions, and inject business constraint rules to generate a prompt template.
[0007] In this embodiment, filling the intent query text into the prompt template and then inputting it into the intent recognition model specifically includes: The intent query text is feature-encoded to obtain a text feature sequence, and the text feature sequence is filled into the feature mask slot to generate instantiated prompt text; The instantiated prompt text, combined with the business constraint rules, is input into the intent recognition model, and the intent recognition result is output through inference.
[0008] In this embodiment, extracting the global semantic features of the intent query text and the prior feature features of the prompt template specifically includes: The intent query text is lexically encoded to obtain a text sequence, and the contextual information of the text sequence is aggregated using a self-attention mechanism to extract global semantic features; Extract the slot structure topology from the prompt template and combine it with the slot type identifier to perform position encoding to determine the prior features of the elements.
[0009] In this embodiment, the intention feature vector is obtained by fusing the global semantic features and the prior features of the elements through a cross-attention mechanism, specifically including: The global semantic features are mapped to a query matrix, and the prior features of the elements are mapped to a key matrix and a value matrix. The cross-attention weight between the query matrix and the key matrix is calculated. The value matrix is weighted and aggregated based on the cross-attention weights to obtain the contextual interaction features of the fused element prior information; Perform residual connections on the context interaction features to generate an intent feature vector.
[0010] In this embodiment, the weighted summation and aggregation of the value matrix based on the cross-attention weights to obtain the contextual interaction features of the fused element prior information specifically includes: Perform matrix multiplication on the cross-attention weights and the value matrix to obtain the weighted feature component sequence corresponding to the prior information attention of the elements; The weighted feature component sequences are aggregated to obtain contextual interaction features of fused element prior information.
[0011] In this embodiment, performing classification prediction on the intent feature vector to obtain the intent recognition result specifically includes: The intent feature vector is input into the fully connected layer for dimensional mapping to obtain the classification logic value, and feature masking is performed in conjunction with the business constraint rules to filter invalid categories; The filtered classification logic values are activated to obtain the intent probability sequence; The intent recognition result is determined based on the intent probability sequence.
[0012] In this embodiment, activating the filtered classification logic values to obtain the intent probability sequence specifically includes: Based on a preset temperature scaling factor, an exponential mapping operation is performed on the filtered classification logic values, and the exponential activation features are determined. The intention probability sequence is determined based on the exponential activation features.
[0013] In this embodiment, locating the candidate entity span based on the intent feature vector and determining the candidate entity type set based on the intent recognition result specifically includes: Concatenate the intent feature vector with the character features of the intent query text to construct a context representation matrix, and predict entity boundary positions only within the sequence range of the intent query text to locate the span of candidate entities; Based on the intent recognition result, query the preset intent element mapping map to perform type constraint matching and obtain a set of candidate entity types.
[0014] In this embodiment, determining the entity type of the candidate entity span during intent recognition based on the candidate entity span and the semantic prototype in the candidate entity type set specifically includes: Context encoding is performed on the text segments corresponding to the span of the candidate entities to extract the span feature vector; Calculate the cosine similarity between the span feature vector and each semantic prototype in the candidate entity type set to obtain the type matching score sequence; Based on the mapping relationship between each similarity score and the semantic prototype in the type matching score sequence, a target score that meets the preset conditions is selected, and the semantic prototype corresponding to the target score is determined as the entity type when the intent is recognized.
[0015] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: The process involves: acquiring the intent query text corresponding to the electrical energy data; constructing a prompt template corresponding to the feature mask slot during data intent analysis; filling the prompt template with the intent query text and inputting it into the intent recognition model; extracting the global semantic features of the intent query text and the feature prior features of the prompt template; fusing the global semantic features and the feature prior features through a cross-attention mechanism to obtain an intent feature vector; performing classification prediction on the intent feature vector to obtain the intent recognition result; locating the candidate entity span based on the intent feature vector; determining the candidate entity type set based on the intent recognition result; and determining the entity type of the candidate entity span during intent recognition based on the candidate entity span and the semantic prototype in the candidate entity type set.
[0016] Therefore, this application demonstrates that the entity type of the candidate entity span during intent recognition can be determined. Specifically, determining the prior features of the elements yields a structured constraint mapping relationship between intent categories and entity types. This embeds prior knowledge of the business domain into the model inference chain as hard constraints during intent recognition, ensuring that intent classification decisions are no longer isolated but guided and verified by legitimate combinations of entity types. This constraint mechanism effectively compresses the candidate solution space for intent classification, suppresses cross-category misjudgments caused by semantic ambiguity or feature vagueness, and enables the model to quickly eliminate unreasonable intent branches based on the compliance of element types when facing highly similar business query statements in an energy data analysis scenario. This improves the discriminative power and decision confidence of intent recognition in fine-grained category division. Once the intent recognition result is determined, a high-dimensional intent feature vector carrying the global semantic context can be obtained. This feature vector is then used as a contextual guidance signal and broadcast down to the entity span localization stage. This allows the local features of each candidate character position to be integrated with complete intent semantic information. This intent feature guidance mechanism makes entity boundary prediction no longer rely solely on local character context, but is subject to directional modulation by the global intent context. This solves the problem of span truncation and misalignment caused by complex query structure, entity nesting, or ambiguous boundaries in the scenario of electric energy data analysis. It ensures that the entity extraction results are highly aligned with the intent semantics, thus guaranteeing the semantic consistency of intent element extraction as a whole.
[0017] In summary, the technical solution adopted in this application can achieve precise positioning of entity span based on intent features, thereby improving the accuracy of intent recognition in the context of electrical energy data analysis. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this embodiment of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is an exemplary flowchart of an intention recognition method for electrical energy data analysis based on cue learning provided in this application; Figure 2 This is a flowchart illustrating the process of determining the intent identification result based on the information provided in this application. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] This application provides a method for identifying intent in electrical energy data analysis based on prompting learning. The core of this method is to obtain the intent query text corresponding to the electrical energy data; construct a prompt template corresponding to the feature mask slot during data intent analysis; fill the prompt template with the intent query text and input it into an intent recognition model; extract the global semantic features of the intent query text and the prior feature features of the prompt template; fuse the global semantic features and the prior feature features through a cross-attention mechanism to obtain an intent feature vector; perform classification prediction on the intent feature vector to obtain an intent recognition result; locate the candidate entity span based on the intent feature vector; determine the candidate entity type set according to the intent recognition result; and determine the entity type of the candidate entity span during intent recognition based on the candidate entity span and the semantic prototypes in the candidate entity type set.
[0022] To better understand the above technical solutions, a detailed description of the technical solutions will be provided below in conjunction with the accompanying drawings and specific embodiments. (Refer to...) Figure 1 As shown in the figure, this is an exemplary flowchart of an intention recognition method for electrical energy data analysis based on cue learning, according to an embodiment of this application. The method includes the following steps: In step S1, the intent query text corresponding to the electrical energy data is obtained.
[0023] In practice, the intent query text corresponding to the electrical energy data can be obtained in the following way: deploy a natural language receiving interface at the interactive front end of the power marketing or electrical energy collection system. When a user initiates a data query request, the system captures the user's original interactive signal in real time. If the original signal is a character sequence entered from the keyboard, it is directly encoded and denoised to extract the plain text string. If the original signal is a voice audio stream collected by the microphone, a preset automatic speech recognition engine is called to convert the audio stream into the corresponding text sequence, and domain dictionary error correction and sentence smoothing are performed. The final generated natural language string is used as the intent query text.
[0024] It should be noted that, in this application, electrical energy data refers to structured numerical values that record electrical energy metering and operating status; intent query text refers to natural language strings that carry the user's data retrieval needs.
[0025] In step S2, a prompt template corresponding to the feature mask slot is constructed during data intent analysis. The intent query text is filled into the prompt template and then input into the intent recognition model to extract the global semantic features of the intent query text and the feature prior features of the prompt template.
[0026] In this embodiment, the prompt template corresponding to the feature mask slot during data intent analysis can be constructed in the following manner: Extract data dimension features from the target data source and map the data dimension features to feature mask slots with variable placeholders; Assemble the initial template framework based on the element mask slots and preset data analysis instructions, and inject business constraint rules to generate a prompt template.
[0027] In practice, the system first connects to the electricity database and reads the metadata information from the data tables, including field names, data types, and value ranges. For each field, the system extracts its data dimension features. Specifically, for timestamp fields, the system extracts their time granularity attribute, recording it as daily, monthly, or yearly granularity; for numerical fields, it extracts their dimensional attributes and numerical ranges, recording them as units of measurement such as kilowatt-hours and megawatt-hours, as well as minimum and maximum values; for enumerated fields, it extracts their category value list, recording it as the set of all legal values for that field. After completing the data dimension feature extraction, the system creates a corresponding feature mask slot for each data dimension feature. Each feature mask slot consists of a fixed prefix identifier and a variable placeholder. The variable placeholder is marked by enclosing the field name in double curly braces. For example, the element mask slot corresponding to the time dimension is labeled "Time Range: {{time_range}}", the element mask slot corresponding to the region dimension is labeled "Region: {{region}}", and the element mask slot corresponding to the electricity type dimension is labeled "Power Category: {{power_category}}". The system aggregates all generated element mask slots into a slot set and outputs it to the next step. Then, it loads the preset data analysis instructions, which are pre-written task description statements used to declare the type of analysis task to be performed to the intent recognition model, such as "Please parse the intent elements in the following electricity query request". The system places the data analysis instructions at the beginning of the template as a task guidance paragraph, and appends the output element mask slots to the data analysis instructions in a preset order, with each element mask slot separated by a newline character, forming the initial template framework. The order follows the conventional query logic of electricity business, namely time range, region, electricity category, voltage level, and statistical indicators. After the initial template framework is built, the system reads the preset business constraint rule file. Business constraint rules are stored in key-value pairs, where the key is the constraint description statement and the value is the name of the associated slot that triggers the constraint. The system iterates through all business constraint rules, appending each constraint description statement to the end paragraph of the initial template framework, and annotating the constraint with the name of its associated variable placeholder. For example, appending "Constraint: When the electricity category is residential electricity, the voltage level is only allowed to be 220 volts or 380 volts, and the associated slots are {{power_category}} and {{voltage_level}}". After all constraint rules have been injected, the final generated complete text sequence is output as a prompt template.
[0028] It should be noted that, in this application, data intent analysis refers to the process of parsing a user's natural language query request for electrical energy data to identify their analysis purpose and key elements; element mask slots refer to placeholder structures in the prompt template that identify the positions to be filled for specific data dimensions; data dimension features are metadata describing the field attributes of the electrical energy database; variable placeholders are symbols embedded in the element mask slots to mark the names of the data fields to be filled; data analysis instructions are task description statements preset at the beginning of the prompt template; the initial template framework is the intermediate structure of the prompt template formed by sequentially splicing data analysis instructions and element mask slots; business constraint rules are conditional statements describing the logical constraint relationships between various dimensions of electrical energy data; and the prompt template is a structured text framework that integrates task instructions, element slots, and business constraints.
[0029] In this embodiment, the process of filling the intent query text into the prompt template and then inputting it into the intent recognition model can be achieved through the following steps: The intent query text is feature-encoded to obtain a text feature sequence, and the text feature sequence is filled into the feature mask slot to generate instantiated prompt text; The instantiated prompt text, combined with the business constraint rules, is input into the intent recognition model, and the intent recognition result is output through inference.
[0030] In practice, the process begins by loading a pre-trained word segmenter to perform word segmentation on the intent query text. The segmenter uses a byte-pair encoding algorithm to break down the intent query text into several word units, and assigns a corresponding integer number to each word unit by consulting a vocabulary list, forming a numbered sequence. The system then inputs this numbered sequence into the embedding layer, where a lookup operation maps each integer number to a dense vector of fixed dimensions. A positional encoding vector is then superimposed on the embedding layer output. This positional encoding vector is calculated using sine and cosine functions based on the word unit's position index in the sequence, representing the sequential order of the word units. After element-wise addition of the embedding vector and the position encoding vector, the input is given to a multi-layer Transformer encoder (a deep learning model architecture based on self-attention mechanism) for self-attention calculation and feedforward network transformation. The final output is the hidden state vector corresponding to the position of each word unit. All hidden state vectors are arranged in order to form a text feature sequence. After generating the text feature sequence, the system traverses each element mask slot in the prompt template, identifies the field name of the variable placeholder in each element mask slot, and then retrieves the hidden state vector fragment with the highest semantic matching degree with the field name in the text feature sequence. The hidden state vector fragment is written into the corresponding element mask slot, replacing the original variable placeholder. After all element mask slots are filled, the complete template sequence is used as the prompt text. Then, the instantiated prompt text and business constraint rules are sequentially concatenated into a complete input sequence, with separators inserted between them to distinguish paragraph boundaries. The concatenated input sequence is then fed into the intent recognition model, which is built on a Transformer architecture and contains twelve encoder layers. Each encoder layer performs multi-head self-attention computation. The intent recognition model is a deep learning model that has been pre-trained and converged on the electrical energy business corpus. During the inference phase, the intent recognition model is used to extract features and perform classification prediction on the input query text and prompt template. Specifically, the input sequence is first transformed linearly to generate a query matrix, a key matrix, and a value matrix. The attention score matrix is obtained by multiplying the transpose of the query matrix and the key matrix. Then, the attention weight distribution is calculated by normalizing with a scaling factor and using the Softmax (multi-class normalization exponential function). The self-attention output is obtained by weighted summation of the value matrix using this weight distribution. After the output is processed by residual connection and layer normalization, it is fed into the feedforward neural network for nonlinear transformation. After a second residual connection and layer normalization, the output of the current encoder layer is obtained. The twelve encoder layers are stacked sequentially to perform the above calculations. Finally, the hidden state vector corresponding to the first tag bit of the final layer output is sent to the classification head.The classification head consists of two fully connected layers. The first fully connected layer maps the hidden state vector to the intermediate dimension and applies the ReLU (Modified Linear Unit) activation function. The second fully connected layer maps the intermediate dimension vector to the dimension corresponding to the total number of intent categories, outputs the logical value of each intent category, performs Softmax normalization on the logical value to obtain the probability distribution of each category, and selects the category with the highest probability as the intent recognition result.
[0031] It should be noted that in this application, the intent recognition model refers to a language model built on the Transformer architecture and fine-tuned by the electricity business corpus; feature encoding refers to the computational process of converting discrete text symbols into continuous dense vectors containing contextual semantic information; text feature sequence refers to the ordered set of latent state vectors generated after the intent query text is feature encoded; instantiated prompt text refers to the complete template sequence formed after the element mask slots are filled with the text feature sequence; and intent recognition result refers to the final category determination made by the intent recognition model for the purpose of the user's query request.
[0032] In this embodiment, the extraction of the global semantic features of the intent query text and the prior feature of the prompt template can be achieved through the following steps: The intent query text is lexically encoded to obtain a text sequence, and the contextual information of the text sequence is aggregated using a self-attention mechanism to extract global semantic features; Extract the slot structure topology from the prompt template and combine it with the slot type identifier to perform position encoding to determine the prior features of the elements.
[0033] In specific implementation, firstly, a pre-trained word segmenter is loaded to perform sub-word-level segmentation on the intent query text. The word segmenter uses a byte-pair encoding algorithm to merge the intent query text layer by layer into a sequence of sub-word units according to the merging rules in the vocabulary. Then, for each sub-word unit, the vocabulary is consulted to obtain the corresponding integer index. All integer indices are arranged in order and input into the embedding layer. Through a lookup operation, each integer index is mapped to a dense vector of fixed dimensions. The dense vector output by the embedding layer is element-wise superimposed with sinusoidal positional encoding. The sinusoidal positional encoding calculates the sine and cosine components according to the position index of the sub-word unit in the sequence to inject order information. The superimposed vector sequence is input into a six-layer Transformer encoder. Each encoder layer performs multi-head self-attention operation, linearly projecting the input vector into a query matrix, a key matrix, and a value matrix, respectively. The dot product of the transpose of the query matrix and the key matrix is calculated and divided by a scaling factor. After Softmax normalization, the attention weights are obtained. Then, the value matrix is weighted and summed. The six encoder layers are stacked layer by layer to output the final hidden state. Average pooling is performed on all positional hidden states to obtain global semantic features. Then, the complete text of the prompt template is scanned to identify the start and end positions of all feature mask slots. The start and end indices of each feature mask slot in the template sequence are recorded, and all feature mask slots are arranged in ascending order of the start index, forming an ordered list of position indices. This list is the slot structure topology. The slot type identifier corresponding to each feature mask slot is read. The slot type identifier is a pre-labeled category label, such as time, region, electricity category, etc. The system assigns a unique integer number to each category label, and then maps the integer number to a fixed-dimensional type vector through an embedding layer. At the same time, the system calculates the position encoding vector according to the arrangement number of each feature mask slot in the slot structure topology. The calculation method of the position encoding vector is consistent with the sinusoidal position encoding, that is, a sine function is applied to the even-numbered dimensions of the arrangement number and a cosine function is applied to the odd-numbered dimensions. The type vector and the position encoding vector are added element by element, and then the dimensions are aligned by a fully connected network layer to output the prior vector corresponding to each feature mask slot. All prior vectors are arranged in order to form the feature prior features.
[0034] It should be noted that, in this application, global semantic features refer to dense vectors that condense the overall semantic information of the intent query text; element prior features refer to vector sets of category attributes and arrangement structures of each slot in the encoding prompt template; lexical encoding refers to the process of segmenting natural language text into sub-word units and mapping them to integer index sequences; text sequence refers to the ordered index set generated after the intent query text is lexically encoded; self-attention mechanism refers to the network structure that calculates the correlation strength between each position within the sequence through query-key-value matching; contextual information refers to the semantic association relationship established between each lexical in the text sequence and its surrounding lexical through attention weights; slot structure topology refers to the ordered position index list of all element mask slots in the prompt template; position encoding refers to the sine and cosine function vectors calculated based on the sequence position index; and element prior features refer to the labels that annotate the business element category corresponding to each element mask slot.
[0035] In step S3, the global semantic features and the prior features of the elements are fused through a cross-attention mechanism to obtain an intent feature vector, and classification prediction is performed on the intent feature vector to obtain the intent recognition result.
[0036] In this embodiment, the intention feature vector is obtained by fusing the global semantic features and the prior features of the elements through a cross-attention mechanism, which can be achieved through the following steps: The global semantic features are mapped to a query matrix, and the prior features of the elements are mapped to a key matrix and a value matrix. The cross-attention weight between the query matrix and the key matrix is calculated. The value matrix is weighted and aggregated based on the cross-attention weights to obtain the contextual interaction features of the fused element prior information; Perform residual connections on the context interaction features to generate an intent feature vector.
[0037] In the specific implementation, firstly, three independent sets of learnable weight matrices are loaded, denoted as the query projection matrix, key projection matrix, and value projection matrix, respectively. The dimension of each weight matrix is the feature dimension multiplied by the feature dimension. The global semantic features are multiplied by the query projection matrix to obtain the query matrix. The prior features of the elements are multiplied by the key projection matrix and the value projection matrix respectively to obtain the key matrix and the value matrix. Then, the system calculates the dot product between the transpose of the query matrix and the key matrix to obtain the original attention score matrix. Each element in the original attention score matrix represents the similarity between a query vector and a key vector. The system divides each element of the original attention score matrix by a scaling factor, which is the square root of the feature dimension of the key matrix. This operation prevents the dot product value from being too large, causing the Softmax function to enter the gradient saturation region. The scaled score matrix is input into the Softmax function, which performs exponential normalization on each row, making the sum of each row equal to one, and outputs the normalized probability distribution matrix, which is the cross-attention weight. Finally, the cross-attention weight and value matrix is read. The number of rows in the cross-attention weights equals the number of query vectors, and the number of columns equals the number of key vectors. Each row represents the probability distribution of attention from a query position to all key positions. The system performs matrix multiplication on the cross-attention weights and the value matrix. Specifically, each row of the cross-attention weights is used as a weight coefficient, and a weighted linear combination is performed on the value vectors of the corresponding row in the value matrix. The vector at each output position is equal to the sum of all value vectors according to the attention weight ratio corresponding to that position. After the matrix multiplication, the system outputs an aggregated feature matrix. The number of rows in this aggregated feature matrix is the same as the number of query vectors, and each row vector is an enhanced representation that incorporates prior feature information of the elements. The aggregated feature matrix is used as the context interaction feature. Finally, the system receives the context interaction features and uses the original global semantic features to perform layer normalization on the context interaction features. Specifically, the mean and variance of the context interaction features are calculated along the feature dimension. Each element is subtracted from the mean, divided by the square root of the variance, multiplied by a learnable scaling parameter, and then a learnable offset parameter is added to obtain the normalized features. Subsequently, the system adds the normalized features element-wise to the original global semantic features, completing the residual connection operation. The result of the addition is fed into a feedforward neural network, which consists of two fully connected layers. The first fully connected layer expands the feature dimension to four times the original dimension and applies the GELU (Gaussian Error Linear Unit) activation function. The second fully connected layer compresses the dimension back to the original feature dimension. The output of the feedforward neural network is then normalized again and added element-wise to the input before the residual connection, finally outputting the intended feature vector.
[0038] It should be noted that in this application, the cross-attention mechanism refers to constructing the attention network structure of the query end and the key-value end with features from different sources; the query matrix refers to the matrix generated by linear projection of global semantic features; the key matrix refers to the matrix generated by linear projection of prior feature features; the value matrix refers to the matrix generated by linear projection of prior feature features; the cross-attention weight is a probability distribution matrix describing the normalized similarity between the query vector and the key vector; the weighted summation aggregation is a matrix operation that performs linear combination of value vectors with attention weights as coefficients; the fusion of prior feature information refers to the calculation process of embedding the category attributes and structural knowledge of template slots into user semantic features; the context interaction feature refers to the enhanced feature matrix generated after weighted aggregation; the residual connection refers to the skip connection operation that directly superimposes the network layer input to its output; and the intent feature vector refers to the feature representation that fuses user query semantics and prior knowledge of template elements.
[0039] Furthermore, in this embodiment, the weighted summation and aggregation of the value matrix based on the cross-attention weights to obtain the contextual interaction features of the fused element prior information can be achieved through the following steps: Perform matrix multiplication on the cross-attention weights and the value matrix to obtain the weighted feature component sequence corresponding to the prior information attention of the elements; The weighted feature component sequences are aggregated to obtain contextual interaction features of fused element prior information.
[0040] In the specific implementation, firstly, the cross-attention weight and value matrix are read. The cross-attention weight is a two-dimensional matrix, with the number of rows equal to the number of words in the user's query text and the number of columns equal to the number of element mask slots in the prompt template. Each element in the matrix represents the normalized attention probability of the corresponding word to the corresponding slot. The matrix is also a two-dimensional matrix, with the number of rows equal to the number of element mask slots and the number of columns being the feature dimension. Each row corresponds to the prior knowledge vector representation of a slot. Matrix multiplication is performed on the two. The operation process is as follows: take the i-th row of the cross-attention weight as the weight coefficient vector, multiply each element in this vector with each dimension component of the corresponding row vector of the value matrix one by one, and then sum them to obtain the feature vector of the i-th output position. Traverse all rows and perform the above multiplication and addition operations one by one. The number of rows in the output matrix is equal to the number of words and the number of columns is equal to the feature dimension. Each row of this output matrix represents a feature vector of a word position after fusing the prior knowledge of each slot according to its attention ratio. All row vectors are arranged in order to form a weighted feature component sequence. Then, the system receives a weighted feature component sequence, which contains a set of feature vectors of the same length as the number of words. Max pooling is performed on this sequence: all feature vectors are traversed dimension-wise along the sequence dimension. For each dimension, the maximum value at each word position is selected, and these maximum values are concatenated in dimensional order to form a fixed-length vector, denoted as the max pooling output vector. Simultaneously, average pooling is performed on the weighted feature component sequence: the feature vectors at all word positions are summed element-wise and divided by the total number of words to obtain the average pooling output vector. The system concatenates the max pooling output vector and the average pooling output vector along the feature dimension. The concatenated vector has twice the dimension of the original feature vector. This concatenated vector is then input into a fully connected network, which compresses the dimension back to the original feature dimension and applies the GELU activation function, outputting context interaction features.
[0041] It should be noted that, in this application, matrix multiplication refers to the numerical calculation operation of performing a weighted linear combination of the vectors in each row of the value matrix using each row of the cross-attention weight as coefficients; the prior information attention of the elements refers to the quantified value of each element in the cross-attention weight matrix; and the weighted feature component sequence refers to the ordered set of feature vectors output by the matrix multiplication operation.
[0042] Preferably, in this embodiment, classification prediction is performed on the intent feature vector to obtain the intent recognition result, with reference to... Figure 2 As shown in the figure, this is a flowchart illustrating the process of determining the intent recognition result in some embodiments of this application. In this embodiment, determining the intent recognition result can be achieved using the following steps: In step S31, the intent feature vector is input into the fully connected layer for dimensional mapping to obtain the classification logic value, and feature masking is performed in conjunction with the business constraint rules to filter invalid categories; In step S32, the filtered classification logic values are activated to obtain the intent probability sequence; In step S33, the intent recognition result is determined based on the intent probability sequence.
[0043] In the specific implementation, firstly, the intent feature vector is input into the fully connected layer. The fully connected layer is a single-layer linear transformation network. The number of rows in its weight matrix equals the total number of intent categories, the number of columns equals the dimension of the intent feature vector, and the length of the bias vector equals the total number of intent categories. Then, matrix multiplication is performed between the intent feature vector and the weight matrix of the fully connected layer, and the bias vector is added to obtain the classification logical value. This classification logical value is a one-dimensional vector with a length equal to the total number of intent categories. Each element in the vector represents the unnormalized confidence score of the corresponding intent category. Next, business constraint rules are loaded. These business constraint rules are stored in the form of a Boolean mask vector, the length of which is also equal to the total number of intent categories. Positions with a true value represent legal intent categories allowed in the current business scenario, while positions with a false value represent invalid intent categories that conflict with the current business scenario. The elements in the classification logical value corresponding to the false positions in the Boolean mask vector are assigned negative infinity, while the positions with true values remain unchanged. This completes the feature masking operation, and the classification logical value after filtering out invalid categories is output. Then, the classification logic value after feature masking is received. In this classification logic value, the values corresponding to the positions of the masked invalid categories have been set to negative infinity, while the positions corresponding to the retained legal categories maintain their original scores. Softmax activation is performed on this classification logic value. The specific process is as follows: First, each element in the classification logic value is traversed, and the natural exponential function is performed on each element to obtain the exponential value of each element; then, the exponential values of all elements are summed to obtain the normalized denominator; finally, the exponential value of each element is divided by the normalized denominator to obtain the normalized probability value corresponding to each element. Since the exponential value of negative infinity approaches zero, the probability value corresponding to the masked invalid categories automatically drops to zero, while the sum of the probability values of the retained legal categories is one. All normalized probability values are arranged in order of category index to form an intent probability sequence. Finally, the intent probability sequence is read, which contains normalized probability values corresponding to all intent categories. Each probability value in the intent probability sequence is traversed, and their values are compared one by one. The maximum probability value and its corresponding category index are recorded. The intent category label corresponding to the category index is output as the intent recognition result. The maximum probability value is compared with a preset confidence threshold. If the maximum probability value is lower than the confidence threshold, the intent recognition result is marked as low confidence and a manual review process is triggered, transferring the query request to the manual review queue. If the maximum probability value is not lower than the confidence threshold, the system confirms that the intent recognition result is valid.
[0044] It should be noted that, in this application, a fully connected layer refers to a linear transformation network layer that establishes a weighted connection relationship between each dimension of the input vector and each node of the output layer; dimensionality mapping refers to the numerical operation process of projecting the feature vector from the original high-dimensional space to a target space with the same dimensions as the total number of intent categories through linear transformation; classification logical value refers to the unnormalized score vector output after the intent feature vector is linearly transformed by the fully connected layer; feature masking refers to the operation of constructing a Boolean vector according to business constraint rules and masking the invalid category positions in the classification logical value; filtering invalid categories refers to the process of setting the classification logical value corresponding to the intent category prohibited by the business constraint rules to negative infinity; intent probability sequence refers to the normalized probability distribution vector output after the classification logical value is activated by Softmax; and intent recognition result refers to the final category determination made on the user request purpose expressed by the intent query text.
[0045] In addition, in this embodiment, activating the filtered classification logic values to obtain the intent probability sequence can be achieved through the following steps: Based on a preset temperature scaling factor, an exponential mapping operation is performed on the filtered classification logic values, and the exponential activation features are determined. The intention probability sequence is determined based on the exponential activation features.
[0046] In practice, firstly, a preset temperature scaling factor is loaded. This factor is a positive real constant pre-calibrated using a validation set, ranging from 0.1 to 10.0, used to control the smoothness of the probability distribution. Then, filtered classification logic values are read. These are one-dimensional vectors where invalid categories are set to negative infinity, while valid categories retain their original scores. Each element in the filtered classification logic values is divided by the temperature scaling factor to obtain a scaled logic value vector. This division by the temperature scaling factor amplifies or reduces the relative differences between the original scores: when the scaling factor is greater than 1.0, the differences between category scores are compressed, and the probability distribution tends to be flatter; when the scaling factor is less than 1.0, the differences between category scores are widened, and the probability distribution tends to be sharper. Next, a natural exponential function operation is performed on each element in the scaled logic value vector. This involves using the natural constant e as the base and raising each scaled logic value to an exponent to obtain the exponent value for each element. All exponent values are arranged in category index order to form the exponential activation feature. Since the exponent value of negative infinity approaches zero, the exponent values corresponding to the masked invalid categories automatically drop to zero, while the exponent values corresponding to the valid categories are all positive real numbers. Then, the exponential activation feature is read. This exponential activation feature is a one-dimensional vector, where each element is a positive real exponent value obtained by operating on the corresponding intent category using temperature scaling and the natural exponent. The position corresponding to the invalid category is zero. All elements in the exponential activation feature are iterated through, and all elements are summed one by one to obtain a normalized denominator. Subsequently, each element in the exponential activation feature is divided one by one by this normalized denominator to obtain the normalized probability value corresponding to each element. Since the exponent value corresponding to the invalid category is zero, its normalized probability value is also zero. The normalized probability values corresponding to the valid categories are all greater than zero, and the sum of all normalized probability values is strictly equal to one. All normalized probability values are arranged in the original order of the category indices to form a one-dimensional probability vector, which is the intent probability sequence.
[0047] It should be noted that, in this application, the temperature scaling factor refers to a positive real number hyperparameter that controls the smoothness of the probability distribution of the classification logic value after exponential operation; the exponential mapping operation refers to the numerical operation of performing exponential operation on each element of the scaled classification logic value with the natural constant as the base; and the exponential activation feature refers to the positive real number vector output after the classification logic value is scaled by temperature and the natural exponential operation.
[0048] In step S4, the candidate entity span is located based on the intent feature vector, the candidate entity type set is determined according to the intent recognition result, and the entity type of the candidate entity span in intent recognition is determined according to the candidate entity span and the semantic prototype in the candidate entity type set.
[0049] In this embodiment, locating the candidate entity span based on the intent feature vector and determining the candidate entity type set based on the intent recognition result can be achieved through the following steps: Concatenate the intent feature vector with the character features of the intent query text to construct a context representation matrix, and predict entity boundary positions only within the sequence range of the intent query text to locate the span of candidate entities; Based on the intent recognition result, query the preset intent element mapping map to perform type constraint matching and obtain a set of candidate entity types.
[0050] In specific implementation, firstly, the character features of the input sequence are obtained. These character features are a sequence of character-by-character vectors output after the input text is encoded by a pre-trained language model. The number of rows in the vector sequence equals the number of characters in the input text, and the number of columns is the character encoding dimension. Each row represents the semantic representation of a character in the context. Simultaneously, the system obtains the intent feature vector, a fixed-dimensional vector output from the previous step that integrates the user query semantics and prior knowledge of template elements. The intent feature vector is broadcast and copied along the sequence dimension, with the number of copies equal to the number of characters in the input text, expanding it into a two-dimensional matrix with the same number of rows as the character features of the input sequence. The expanded intent feature matrix is then concatenated with the character features of the input sequence along the feature dimension. The dimension of each row after concatenation equals the sum of the character encoding dimension and the intent feature dimension. This concatenated two-dimensional matrix is the context representation matrix. This context representation matrix is then input into the boundary prediction network, which consists of two fully connected layers. The first fully connected layer compresses the concatenated feature dimensions to the original character encoding dimensions and applies a ReLU activation function. The second fully connected layer further compresses the dimensions to a two-dimensional output, corresponding to the start boundary score and the end boundary score, respectively. Softmax normalization is performed on the start boundary score and the end boundary score to obtain the probability distribution of each character position as the entity's start and end positions. The character position with the highest start probability is selected as the entity's start boundary, and the character position with the highest end probability is selected as the entity's end boundary. If the end position is earlier than the start position, it is set as the start position. The character interval covered from the entity's start boundary to the entity's end boundary is recorded as the candidate entity span. Then, a pre-set intent element mapping map is loaded. This intent element mapping map is stored in the configuration file in a key-value pair structure. The key is the intent category label, and the value is a list of entity types associated with that intent category. This intent element mapping map is pre-constructed by domain experts according to business needs. Each mapping record is reviewed by business logic to ensure that the intent category and its associated entity type have a strict hierarchical relationship in business semantics. Read the intent recognition result output from the previous steps, use the intent category label corresponding to the intent recognition result as the query key, perform exact matching retrieval in the intent element mapping graph, find the list of entity types corresponding to the intent category label, and use the found list of entity types as the candidate entity type set.
[0051] It should be noted that, in this application, the candidate entity span refers to the continuous character range defined by the entity start boundary and the entity end boundary in the input text; the character features of the input sequence refer to the vector sequence output after the input text is encoded character by character by a pre-trained language model; the context representation matrix refers to the two-dimensional feature matrix constructed by broadcasting and concatenating the intent feature vectors to each character position; the entity boundary position refers to the start character index and end character index of the entity segment in the input text; the intent element mapping graph refers to the configuration structure with the intent category label as the key and the list of associated entity types as the value; type constraint matching refers to the operation of retrieving the corresponding entity type list in the intent element mapping graph with the intent recognition result as the query key; and the candidate entity type set refers to the entity type list output after type constraint matching.
[0052] In this embodiment, determining the entity type of the candidate entity span during intent recognition based on the candidate entity span and the semantic prototype in the candidate entity type set can be achieved through the following steps: Context encoding is performed on the text segments corresponding to the span of the candidate entities to extract the span feature vector; Calculate the cosine similarity between the span feature vector and each semantic prototype in the candidate entity type set to obtain the type matching score sequence; Based on the mapping relationship between each similarity score and the semantic prototype in the type matching score sequence, a target score that meets the preset conditions is selected, and the semantic prototype corresponding to the target score is determined as the entity type when the intent is recognized.
[0053] In practice, firstly, based on the start and end character indices defined by the candidate entity span, corresponding continuous character segments are extracted from the original input text. These continuous character segments are the text segments corresponding to the candidate entity span. The extracted text segments are then input into a pre-trained context encoder, which is a bidirectional language model based on the Transformer architecture, containing multi-layer self-attention mechanisms and feedforward neural networks. The text segments are first transformed into an initial character vector sequence through a word embedding layer. Subsequently, the long-distance dependencies between characters are captured layer by layer through the self-attention mechanism, and non-linear feature transformation is performed through the feedforward neural network. All character vectors output from the last layer of the context encoder are taken, and average pooling is performed on the character vectors in the sequence dimension. That is, all character vectors are added element by element and then divided by the total number of characters to obtain a dense vector of fixed dimensions. This dense vector is the span feature vector. Then, a candidate entity type set is loaded, which contains several semantic prototypes. The generation and storage of the semantic prototypes are as follows: During the model training phase, the system acquires pre-annotated electrical energy domain corpus, which uses the BIO (Begin, Inside, Outside) sequence annotation system to annotate the boundaries and types of various business entities (such as time, region, electricity category, voltage level, etc.). The annotated corpus is input into the context encoder for forward propagation to extract the span feature vectors corresponding to all text fragments annotated as the same entity type. For each entity type, the system calculates the arithmetic mean of all its corresponding span feature vectors in the feature space, and uses this average vector as the initial semantic prototype of the entity type. To ensure that the dimension of the semantic prototype is strictly consistent with the dimension of the span feature vectors dynamically extracted during the inference phase, the system concatenates a linear projection layer after the average pooling layer of the context encoder. The dimension of the weight matrix of the linear projection layer is set to Dspan×Dproto (where Dspan is the original feature dimension output by the context encoder, and Dproto is the preset standard prototype dimension, both of which are set to 768 dimensions in this embodiment). Through this linear projection layer, all initial semantic prototypes and span feature vectors during inference are uniformly mapped to the same 768-dimensional standardized semantic space, and finally the dimension-reduced / aligned vectors are used as the fixed semantic prototypes.
[0054] Furthermore, the semantic prototype supports a dynamic update mechanism: when the power energy business system adds new entity types or accumulates sufficient new labeled corpus, the system triggers a prototype update task, extracts the span feature vector of the corresponding entity type using the new corpus, and iteratively updates the original semantic prototype stored in the fixed storage using the momentum moving average strategy. The update formula is Pnew=α⋅Pold+(1−α)⋅Pbatch, where Pold is the original semantic prototype, Pbatch is the average feature vector calculated from the new batch of corpus, and α is the preset momentum decay coefficient. The algorithm iterates through each semantic prototype in the candidate entity type set, calculating its cosine similarity to the span feature vector. The specific calculation process for cosine similarity is as follows: The inner product of the span feature vector and the current semantic prototype vector is calculated by multiplying corresponding elements of the two vectors and summing the results to obtain a scalar product. The magnitudes of the span feature vector and the current semantic prototype vector are calculated separately, using the square root of the sum of the squares of the vector elements. The scalar product is then divided by the product of the two magnitudes to obtain the cosine similarity value, which ranges from -1 to +1. A larger value indicates a more consistent direction between the two vectors in the semantic space. All cosine similarity values corresponding to the semantic prototypes are arranged into a one-dimensional vector according to their original order in the candidate entity type set. This one-dimensional vector is the type matching score sequence. Finally, the type matching score sequence is read, where each element is the cosine similarity value between the span feature vector and its corresponding semantic prototype. All elements in the type matching score sequence are iterated through, and the numerical values of each element are compared to locate the element with the largest value and its index position in the sequence. The system maps the index position back to the candidate entity type set, determines the semantic prototype corresponding to the index position, and then obtains the entity type label represented by the semantic prototype. This entity type label is used as the entity type output for the candidate entity span during intent recognition. Simultaneously, the maximum cosine similarity value is compared with a preset matching threshold, which is a positive real constant obtained through validation set calibration. If the maximum cosine similarity value is lower than the matching threshold, the system marks the entity type as low-confidence and triggers a manual review process; if the maximum cosine similarity value is not lower than the matching threshold, the entity type is confirmed as valid and directly passed to the downstream data retrieval module for processing.
[0055] It should be noted that, in this application, semantic prototype refers to a fixed-dimensional dense vector that has been pre-trained and stored using domain corpus; context encoding refers to performing multi-layer self-attention operations and feedforward transformations on text segments using a bidirectional language model based on the Transformer architecture; span feature vector refers to a fixed-dimensional dense vector output after context encoding and average pooling of the text segment corresponding to the span of the candidate entity; cosine similarity refers to the scalar value obtained by dividing the inner product of two vectors by the product of their respective magnitudes; type matching score sequence refers to a one-dimensional score vector composed of the span feature vector and each semantic prototype in the candidate entity type set after calculating the cosine similarity one by one and arranging them in their original order; entity type refers to the category label to which the text segment corresponding to the span of the candidate entity belongs in terms of business semantics.
[0056] Therefore, this application demonstrates that the entity type of the candidate entity span during intent recognition can be determined. Specifically, determining the prior features of the elements yields a structured constraint mapping relationship between intent categories and entity types. This embeds prior knowledge of the business domain into the model inference chain as hard constraints during intent recognition, ensuring that intent classification decisions are no longer isolated but guided and verified by legitimate combinations of entity types. This constraint mechanism effectively compresses the candidate solution space for intent classification, suppresses cross-category misjudgments caused by semantic ambiguity or feature vagueness, and enables the model to quickly eliminate unreasonable intent branches based on the compliance of element types when facing highly similar business query statements in an energy data analysis scenario. This improves the discriminative power and decision confidence of intent recognition in fine-grained category division. Once the intent recognition result is determined, a high-dimensional intent feature vector carrying the global semantic context can be obtained. This feature vector is then used as a contextual guidance signal and broadcast down to the entity span localization stage. This allows the local features of each candidate character position to be integrated with complete intent semantic information. This intent feature guidance mechanism makes entity boundary prediction no longer rely solely on local character context, but is subject to directional modulation by the global intent context. This solves the problem of span truncation and misalignment caused by complex query structure, entity nesting, or ambiguous boundaries in the scenario of electric energy data analysis. It ensures that the entity extraction results are highly aligned with the intent semantics, thus guaranteeing the semantic consistency of intent element extraction as a whole.
[0057] In summary, the technical solution adopted in this application can achieve precise positioning of entity span based on intent features, thereby improving the accuracy of intent recognition in the context of electrical energy data analysis.
[0058] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0059] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compactdisc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0060] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
Claims
1. A method for identifying intent in electrical energy data analysis based on cue learning, characterized in that, The method includes: Obtain the intent query text corresponding to the electrical energy data; When constructing a prompt template corresponding to the feature mask slot during data intent analysis, the intent query text is filled into the prompt template and then input into the intent recognition model to extract the global semantic features of the intent query text and the feature prior features of the prompt template respectively. The global semantic features and the prior features of the elements are fused by a cross-attention mechanism to obtain an intent feature vector, and classification prediction is performed on the intent feature vector to obtain the intent recognition result. Based on the intent feature vector, the candidate entity span is located, the candidate entity type set is determined according to the intent recognition result, and the entity type of the candidate entity span in the intent recognition is determined according to the semantic prototype in the candidate entity type set.
2. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 1, characterized in that, The specific prompt templates corresponding to the feature mask slots when constructing data intent analysis include: Extract data dimension features from the target data source and map the data dimension features to feature mask slots with variable placeholders; Assemble the initial template framework based on the element mask slots and preset data analysis instructions, and inject business constraint rules to generate a prompt template.
3. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 1, characterized in that, The specific steps of filling the intent query text into the prompt template and then inputting it into the intent recognition model include: The intent query text is feature-encoded to obtain a text feature sequence, and the text feature sequence is filled into the feature mask slot to generate instantiated prompt text; The instantiated prompt text, combined with the business constraint rules, is input into the intent recognition model, and the intent recognition result is output through inference.
4. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 1, characterized in that, Extracting the global semantic features of the intent query text and the prior feature features of the prompt template specifically includes: The intent query text is lexically encoded to obtain a text sequence, and the contextual information of the text sequence is aggregated using a self-attention mechanism to extract global semantic features; Extract the slot structure topology from the prompt template and combine it with the slot type identifier to perform position encoding to determine the prior features of the elements.
5. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 1, characterized in that, The intention feature vector is obtained by fusing the global semantic features and the prior features of the elements through a cross-attention mechanism, specifically including: The global semantic features are mapped to a query matrix, and the prior features of the elements are mapped to a key matrix and a value matrix. The cross-attention weight between the query matrix and the key matrix is calculated. The value matrix is weighted and aggregated based on the cross-attention weights to obtain the contextual interaction features of the fused element prior information; Perform residual connections on the context interaction features to generate an intent feature vector.
6. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 5, characterized in that, The contextual interaction features obtained by weighting and aggregating the value matrix based on the cross-attention weights to obtain the prior information of the fused elements specifically include: Perform matrix multiplication on the cross-attention weights and the value matrix to obtain the weighted feature component sequence corresponding to the prior information attention of the elements; The weighted feature component sequences are aggregated to obtain contextual interaction features of fused element prior information.
7. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 1, characterized in that, Performing classification prediction on the intent feature vector to obtain the intent recognition result specifically includes: The intent feature vector is input into the fully connected layer for dimensional mapping to obtain the classification logic value, and feature masking is performed in conjunction with the business constraint rules to filter out invalid categories; The filtered classification logic values are activated to obtain the intent probability sequence; The intent recognition result is determined based on the intent probability sequence.
8. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 7, characterized in that, Activating the filtered classification logic values yields the intent probability sequence, specifically including: Based on a preset temperature scaling factor, an exponential mapping operation is performed on the filtered classification logic values, and the exponential activation features are determined. The intention probability sequence is determined based on the exponential activation features.
9. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 1, characterized in that, Based on the intent feature vector, the span of candidate entities is located, and the set of candidate entity types is determined according to the intent recognition result, specifically including: The intent feature vector is concatenated with the character features of the intent query text to construct a context representation matrix, and the entity boundary position is predicted only within the sequence range of the intent query text to locate the span of candidate entities; Based on the intent recognition result, query the preset intent element mapping map to perform type constraint matching and obtain a set of candidate entity types.
10. The method for identifying intent in electrical energy data analysis based on cue learning as described in claim 1, characterized in that, Determining the entity type of the candidate entity span during intent recognition based on the candidate entity span and the semantic prototype in the candidate entity type set specifically includes: Context encoding is performed on the text segments corresponding to the span of the candidate entities to extract the span feature vector; Calculate the cosine similarity between the span feature vector and each semantic prototype in the candidate entity type set to obtain the type matching score sequence; Based on the mapping relationship between each similarity score and the semantic prototype in the type matching score sequence, a target score that meets the preset conditions is selected, and the semantic prototype corresponding to the target score is determined as the entity type when the intent is recognized.
