Intention recognition method, device and equipment for power dispatching system and storage medium

By using LSTM network model to identify and encode keywords in the NLP system in the field of power system scheduling, and combining sentence embedding vectors for weighting, the shortcomings of existing systems in understanding professional terms and context are solved, and the accuracy of intention recognition is improved.

CN119578418APending Publication Date: 2025-03-07GUANGDONG POWER GRID CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411655176.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Existing NLP systems have difficulty fully understanding the semantics and context of professional terms in the field of power system scheduling, resulting in inaccurate intention recognition.

Method used

By obtaining the user input text, using the preset LSTM network model for keyword recognition, encoding and generating keyword embedding vectors, weighting it with sentence embedding vectors, and inputting it into the intent recognition model for intent recognition.

Benefits of technology

Improves the accuracy of intention recognition, makes the model focus more on the semantic and contextual relationships of keywords, and enhances the understanding of professional terms and specific expressions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119578418A_ABST
    Figure CN119578418A_ABST
Patent Text Reader

Abstract

The invention discloses an intention recognition method, device and equipment for a power dispatching system and a storage medium. The method comprises the steps of obtaining an input text filled by a user and used for querying the dispatching condition of the power system; performing keyword recognition on the input text according to a preset LSTM network model to obtain keywords; encoding the keyword to obtain a keyword encoding vector; performing context prediction on the keyword coding vector according to a preset word embedding model to obtain a word embedding vector; encoding the input text according to a preset sentence encoding model to obtain a text embedding vector; weighting the word embedding vector and the text embedding vector to obtain a target embedding vector; and performing intention recognition on the target embedded vector by using a preset intention recognition model to obtain the probability that the target embedded vector belongs to various intentions, and taking the intention with the maximum probability as an intention recognition result of the input text. By implementing the invention, the intention recognition accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intention recognition, and in particular to an intention recognition method, device, equipment and storage medium for a power dispatching system. Background Art

[0002] In the field of power system dispatching, natural language processing technology (NLP) has begun to be applied to parse dispatcher instructions and requests to automate data query and management tasks. Currently, this technology mainly relies on recurrent neural networks (RNN) and its variants, such as long short-term memory networks (LSTM), to achieve text intent recognition. These technologies can effectively process and recognize users' natural language input by learning time series dependencies in text data.

[0003] However, in the field of power system dispatching, there are many professional terms and specific data processing requirements. Existing NLP systems often cannot fully understand the semantics and context of these terms, resulting in inaccurate intent recognition. Summary of the invention

[0004] The present invention provides an intention recognition method, device, equipment and storage medium for an electric power dispatching system, which can improve the accuracy of intention recognition.

[0005] An embodiment of the present invention provides an intention recognition method for a power dispatching system, comprising:

[0006] Obtaining the input text filled in by the user for querying the power system dispatching situation;

[0007] Perform keyword recognition on the input text according to the preset LSTM network model to obtain keywords in the input text;

[0008] Encode the above keywords to obtain keyword encoding vectors;

[0009] Perform context prediction on the keyword encoding vector according to a preset word embedding model to obtain a word embedding vector corresponding to the keyword; wherein the word embedding vector includes the keyword and the context information corresponding to the keyword;

[0010] Encode the input text according to a preset sentence encoding model to obtain a text embedding vector corresponding to the input text;

[0011] Weight the above word embedding vector and the above text embedding vector to obtain the target embedding vector;

[0012] The target embedding vector is input into a preset intent recognition model so that the preset intent recognition model performs intent recognition on the target embedding vector, obtains the probability that the target embedding vector belongs to each type of intent, and takes the intent with the highest probability as the intent recognition result of the input text.

[0013] Furthermore, the training of the above preset word embedding model includes:

[0014] Obtaining some text data for querying the dispatching status of the power system;

[0015] Input the text data into an n-gram model so that the n-gram model pre-processes the text data to obtain first text data that does not contain special characters, punctuation marks, and capital letters and that normalizes numbers and date representations;

[0016] Extracting the central word of the first text data according to a preset sliding window size;

[0017] Extracting context phrases corresponding to the central word according to a preset number of words, and extracting selected context phrases corresponding to the central word from the context phrases; wherein the selected context phrases are: context phrases that appear no less than a preset threshold in all context phrases, and context phrases that appear less than a preset threshold in all context phrases and appear in a preset professional terminology database;

[0018] Encode the central word and the selected context phrase to obtain a central word encoding vector and a selected word embedding vector;

[0019] Input the above center word encoding vector into the Skip-gram model; wherein the above Skip-gram model includes: a hidden layer and an output layer;

[0020] The above hidden layer maps the above center word encoding vector to a low-dimensional center word vector;

[0021] Predicting the context phrase of the low-dimensional center word vector according to the output layer to obtain a predicted word embedding vector of the predicted context phrase;

[0022] Every time a predicted word embedding vector is obtained, the first loss function of the predicted word embedding vector and the selected word embedding vector is calculated to determine whether the first loss function converges. If so, the training of the Skip-gram model is completed, and then the training of the preset word embedding model is completed; if not, the parameters of the Skip-gram model are updated through the stochastic gradient descent algorithm, and the Skip-gram model continues to be trained.

[0023] Furthermore, the above word embedding vector and the above text embedding vector are weighted to obtain a target embedding vector, including:

[0024] Obtaining weighting coefficients for weighting the word embedding vector and the text embedding vector;

[0025] The target embedding vector is calculated based on the weighted coefficient, the word embedding vector and the text embedding vector;

[0026] Among them, the above target embedding vector is calculated according to the following formula:

[0027] E finanal =αE entity +(1-α)E sentence

[0028] In the formula, E finanal represents the target embedding vector, α represents the weighting coefficient, E entity Represents the word embedding vector, E sentence Represents a text embedding vector.

[0029] Furthermore, the training of the above preset intent recognition model includes:

[0030] Acquire a plurality of second text data with first real labels for querying the dispatching status of the power system; wherein the first real labels are used to indicate the intention of the second text data;

[0031] Encode the second text data to obtain a second text encoding vector corresponding to the second text data;

[0032] Inputting the second text encoding vector into the preset intention recognition model, so that the preset intention recognition model captures the bidirectional dependency of the second text encoding vector through forward propagation and backward propagation, and obtains the semantic vector of the second text data;

[0033] Mapping the above semantic vectors to a preset intention space to obtain a mapping result between the above semantic vectors and each intention;

[0034] The above mapping results are converted through an activation function to obtain the intent probabilities of various intents corresponding to the above semantic vectors, and the intent corresponding to the maximum intent probability is taken as the predicted intent;

[0035] Every time a predicted intent is obtained, the second loss function of the predicted intent and the first true label is calculated, and it is determined whether the second loss function converges; if so, the training of the preset intent recognition model is completed; if not, the network parameters of the preset intent recognition model are adjusted through the back propagation algorithm, and the preset intent recognition model is continued to be trained.

[0036] Furthermore, after obtaining the above intention recognition result, it also includes:

[0037] According to the above intention recognition results, construct SQL query statements;

[0038] According to the above SQL query statement, the user's intended query result is obtained from the power dispatching system database.

[0039] Based on the above method embodiment, the present invention provides a corresponding device embodiment;

[0040] The present invention provides an intention recognition device for a power dispatching system, comprising:

[0041] Input text acquisition module, keyword recognition module, keyword encoding module, word embedding vector generation module, text embedding vector generation module, embedding vector weighting module and intent recognition module;

[0042] The input text acquisition module is used to acquire the input text filled in by the user for querying the power system dispatching situation;

[0043] The keyword recognition module is used to perform keyword recognition on the input text according to a preset LSTM network model to obtain keywords in the input text;

[0044] The keyword encoding module is used to encode the keyword to obtain a keyword encoding vector;

[0045] The above-mentioned word embedding vector generation module is used to perform context prediction on the above-mentioned keyword encoding vector according to a preset word embedding model to obtain the word embedding vector corresponding to the above-mentioned keyword; wherein the above-mentioned word embedding vector contains the above-mentioned keyword and the context information corresponding to the above-mentioned keyword;

[0046] The text embedding vector generation module is used to encode the input text according to a preset sentence encoding model to obtain a text embedding vector corresponding to the input text;

[0047] The embedding vector weighting module is used to weight the word embedding vector and the text embedding vector to obtain a target embedding vector;

[0048] The above-mentioned intention recognition module is used to input the above-mentioned target embedding vector into a preset intention recognition model, so that the above-mentioned preset intention recognition model performs intent recognition on the above-mentioned target embedding vector, obtains the probability that the above-mentioned target embedding vector belongs to each type of intention, and takes the intention with the largest probability as the intention recognition result of the above-mentioned input text.

[0049] Furthermore, the above-mentioned word embedding vector generation module includes:

[0050] A text data acquisition unit, a first text data generation unit, a center word extraction unit, a selected context phrase extraction unit, an encoding unit, an encoding vector input unit, a vector mapping unit, a word embedding vector prediction unit, and a loss function calculation unit;

[0051] The text data acquisition unit is used to acquire a number of text data for querying the power system dispatching situation;

[0052] The first text data generating unit is used to input the text data into an n-gram model so that the n-gram model pre-processes the text data to obtain first text data that does not contain special characters, punctuation marks, and capital letters and that normalizes numbers and date representations;

[0053] The central word extraction unit is used to extract the central word of the first text data according to a preset sliding window size;

[0054] The selected context phrase extraction unit is used to extract the context phrases corresponding to the central word according to a preset number of words, and extract the selected context phrases corresponding to the central word from the context phrases; wherein the selected context phrases are: context phrases that appear no less than a preset threshold in all context phrases, and context phrases that appear less than a preset threshold in all context phrases and appear in a preset professional terminology database;

[0055] The encoding unit is used to encode the central word and the selected context phrase to obtain a central word encoding vector and a selected word embedding vector;

[0056] The encoding vector input unit is used to input the central word encoding vector into the Skip-gram model; wherein the Skip-gram model includes: a hidden layer and an output layer;

[0057] The vector mapping unit is used for the hidden layer to map the central word encoding vector into a low-dimensional central word vector;

[0058] The word embedding vector prediction unit is used to predict the context word group of the low-dimensional central word vector according to the output layer to obtain a predicted word embedding vector of the predicted context word group;

[0059] The above-mentioned loss function calculation unit is used to calculate the first loss function of the above-mentioned predicted word embedding vector and the selected word embedding vector every time a predicted word embedding vector is obtained, and determine whether the above-mentioned first loss function converges. If so, the training of the above-mentioned Skip-gram model is completed, and then the training of the above-mentioned preset word embedding model is completed; if not, the parameters of the above-mentioned Skip-gram model are updated through the stochastic gradient descent algorithm, and the above-mentioned Skip-gram model continues to be trained.

[0060] Furthermore, the above embedding vector weighting module includes:

[0061] A weight coefficient acquisition unit and a target embedding amount calculation unit;

[0062] The weighting coefficient acquisition unit is used to acquire the weighting coefficients used to weight the word embedding vector and the text embedding vector;

[0063] The target embedding amount calculation unit is used to calculate the target embedding vector according to the weighting coefficient, the word embedding vector and the text embedding vector;

[0064] Among them, the above target embedding vector is calculated according to the following formula:

[0065] E finanal =αE entity +(1-α)E sentence

[0066] In the formula, E finanal represents the target embedding vector, α represents the weighting coefficient, E entity Represents the word embedding vector, E sentence Represents a text embedding vector.

[0067] Based on the above method embodiment, the present invention provides a terminal device embodiment;

[0068] The present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the intention recognition method for a power dispatching system described in any embodiment of the present invention.

[0069] Based on the above method embodiment, the present invention provides a storage medium embodiment;

[0070] The present invention provides a storage medium, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the intention recognition method for a power dispatching system described in any embodiment of the present invention.

[0071] The embodiments of the present invention have the following beneficial effects:

[0072] The present invention provides an intention recognition method, device, equipment and storage medium for an electric power dispatching system. The method comprises: first obtaining an input text filled in by a user for querying the dispatching status of an electric power system; performing keyword recognition on the input text according to a preset LSTM network model to obtain keywords in the input text; then encoding the keywords to obtain keyword encoding vectors; then performing context prediction on the keyword encoding vectors according to a preset word embedding model to obtain word embedding vectors corresponding to the keywords; wherein the word embedding vectors contain the keywords and context information corresponding to the keywords; then encoding the input text according to a preset sentence encoding model to obtain a text embedding vector corresponding to the input text; then weighting the word embedding vector and the text embedding vector to obtain a target embedding vector; finally, inputting the target embedding vector into a preset intention recognition model so that the preset intention recognition model performs intention recognition on the target embedding vector to obtain the probability that the target embedding vector belongs to each type of intention, and taking the intention with the largest probability as the intention recognition result of the input text. Therefore, the present invention introduces a weighting mechanism to weight the word embedding vector containing the contextual information of the keyword and the sentence embedding vector corresponding to the original input text, so that the intent recognition model pays more attention to the semantics and contextual relationship of the keywords when performing intent recognition, thereby improving the accuracy of intent recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 It is a flowchart of an intention recognition method for a power dispatching system provided by an embodiment of the present invention.

[0074] Figure 2 This is an intention recognition demonstration diagram provided by an embodiment of the present invention.

[0075] Figure 3 It is a structural diagram of an intention device for a power dispatching system provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0076] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0077] like Figure 1As shown, an embodiment of the present invention provides an intention recognition method for a power dispatching system, comprising:

[0078] Step S101: obtaining the input text filled in by the user for querying the power system dispatching situation;

[0079] Specifically, the input text is a query requirement described by the user in natural language, such as "display the power generation of all wind power stations today" or "compare the load data of the same period last month". The above-mentioned power system dispatching situation includes power equipment, dispatching instructions, historical load and power generation, etc.

[0080] Step S102: performing keyword recognition on the input text according to a preset LSTM network model to obtain keywords in the input text;

[0081] Specifically, the LSTM network model processes the input text entered by the user word by word, captures the context information of each word, and retains or forgets the information through its memory unit and gating mechanism, thereby identifying keywords. In the process of training the LSTM network model, the annotation information in the training data is used to learn which words are important in a specific context, that is, keywords. For example, in a large amount of training data related to power system dispatch, words such as "wind power" frequently appear in specific contexts and are associated with specific operations. By learning these patterns, the LSTM network model can identify similar keywords in new inputs.

[0082] Step S103: Encode the above keywords to obtain keyword encoding vectors;

[0083] Specifically, the keyword can be encoded by one-hot encoding to obtain a keyword encoding vector.

[0084] Step S104: performing context prediction on the keyword encoding vector according to a preset word embedding model to obtain a word embedding vector corresponding to the keyword; wherein the word embedding vector includes the keyword and context information corresponding to the keyword;

[0085] In a preferred embodiment, the training of the preset word embedding model includes:

[0086] Obtaining some text data for querying the dispatching status of the power system;

[0087] Input the text data into an n-gram model so that the n-gram model pre-processes the text data to obtain first text data that does not contain special characters, punctuation marks, and capital letters and that normalizes numbers and date representations;

[0088] Extracting the central word of the first text data according to a preset sliding window size;

[0089] Extracting context phrases corresponding to the central word according to a preset number of words, and extracting selected context phrases corresponding to the central word from the context phrases; wherein the selected context phrases are: context phrases that appear no less than a preset threshold in all context phrases, and context phrases that appear less than a preset threshold in all context phrases and appear in a preset professional terminology database;

[0090] Encode the central word and the selected context phrase to obtain a central word encoding vector and a selected word embedding vector;

[0091] Specifically, it can be encoded using one-hot encoding.

[0092] Input the above center word encoding vector into the Skip-gram model; wherein the above Skip-gram model includes: a hidden layer and an output layer;

[0093] The above hidden layer maps the above center word encoding vector to a low-dimensional center word vector;

[0094] Predicting the context phrase of the low-dimensional center word vector according to the output layer to obtain a predicted word embedding vector of the predicted context phrase;

[0095] Every time a predicted word embedding vector is obtained, the first loss function of the predicted word embedding vector and the selected word embedding vector is calculated to determine whether the first loss function converges. If so, the training of the Skip-gram model is completed, and then the training of the preset word embedding model is completed; if not, the parameters of the Skip-gram model are updated through the stochastic gradient descent algorithm, and the Skip-gram model continues to be trained.

[0096] Specifically, the above preset word embedding model is a Word embedding model.

[0097] Preferably, when preprocessing the above text data, noise and irrelevant information can be removed.

[0098] Specifically, the preset sliding window size is set to 3-5, that is, 3-gram, 4-gram and 5-gram features are considered at the same time, and the preset number of words is n-1 words before and after the central word. Schematically, for the sentence "check the status of wind turbine generator set", when using 3-gram, phrases such as "check wind power", "wind power generation", "generator set", and "unit status" will be obtained.

[0099] Specifically, the preset threshold is 5, that is, phrases that appear no less than 5 times are retained.

[0100] Preferably, a preset threshold is set to retain context phrases that appear no less than the preset threshold. At the same time, for context phrases that appear less than the preset threshold, it is determined whether they appear in a preset professional terminology database, and the context phrases that appear in the preset professional terminology database are also retained, so that the selected context phrases finally obtained can filter out low-frequency noise while retaining professional terminology.

[0101] Specifically, when the above low-dimensional center word vector is obtained, a low-dimensional dense vector is obtained, usually with a dimension of 100-300.

[0102] Specifically, during the training process of the Skip-gram model, negative sampling technology is used to optimize the training process, that is, for each positive sample, 5 negative samples are randomly sampled. In each iteration, the Skip-gram model updates parameters through the stochastic gradient descent algorithm to minimize the prediction error. The training process continues until the first loss function on the validation set converges. The final word embedding vector can accurately capture the semantic relationship between words in the power field. The training of the entire Skip-gram model is carried out by maximizing the probability of the occurrence of context words.

[0103] In this preferred embodiment, the preset word embedding model is trained until the loss function converges to obtain a trained preset word embedding model.

[0104] Step S105: Encode the input text according to a preset sentence encoding model to obtain a text embedding vector corresponding to the input text;

[0105] Specifically, the above sentence encoding model is a Sentence embedding model.

[0106] Step S106: weighting the above word embedding vector and the above text embedding vector to obtain a target embedding vector;

[0107] In a preferred embodiment, the weighting of the word embedding vector and the text embedding vector to obtain a target embedding vector includes:

[0108] Obtaining weighting coefficients for weighting the word embedding vector and the text embedding vector;

[0109] The target embedding vector is calculated based on the weighted coefficient, the word embedding vector and the text embedding vector;

[0110] Among them, the above target embedding vector is calculated according to the following formula:

[0111] E finanal =αE entity +(1-α)E sentence

[0112] In the formula, E finanal represents the target embedding vector, α represents the weighting coefficient, E entity Represents the word embedding vector, E sentence Represents a text embedding vector.

[0113] Preferably, the weighting coefficient is used to adjust the impact of keywords on the final result. The weighted calculation process gives keywords a higher weight, so that the subsequent intent recognition model can pay more attention to the semantics and contextual relationship of these keywords when processing and understanding user queries, thereby enhancing the sensitivity and accuracy of the intent recognition model to key information. This method not only improves the accuracy of intent recognition, but also ensures the accurate understanding of professional terms and specific expressions in the field of power system dispatching.

[0114] In this preferred embodiment, a weighted target embedding vector is obtained by weighting the word embedding vector and the text embedding vector.

[0115] Step S107: Input the above target embedding vector into a preset intention recognition model so that the above preset intention recognition model performs intention recognition on the above target embedding vector, obtains the probability that the above target embedding vector belongs to each type of intention, and takes the intention with the highest probability as the intention recognition result of the above input text.

[0116] Specifically, the above-mentioned preset intent recognition model can be a bidirectional LSTM network model or a GRU network model. After the target embedding vector is input into the preset intent recognition model, the target embedding vector is processed through each hierarchical structure in the model, and information is extracted and integrated layer by layer. In each layer, the model captures the bidirectional dependency of the input target embedding vector through forward and backward propagation, so as to more comprehensively understand the semantics of the user's input text. Then, the last layer of the network outputs a high-dimensional vector, which represents the comprehensive semantic information of the user's input text. In order to classify intent, this high-dimensional vector will be input into a fully connected layer (or dense layer), which maps the high-dimensional vector to a predefined intent category space through a series of weights and bias parameters. Finally, the output of the fully connected layer is converted into a probability distribution through the softmax activation function, indicating the probability that the input text belongs to each intent category.

[0117] In a preferred embodiment, the training of the preset intent recognition model includes:

[0118] Acquire a plurality of second text data with first real labels for querying the dispatching status of the power system; wherein the first real labels are used to indicate the intention of the second text data;

[0119] Encode the second text data to obtain a second text encoding vector corresponding to the second text data;

[0120] Inputting the second text encoding vector into the preset intention recognition model, so that the preset intention recognition model captures the bidirectional dependency of the second text encoding vector through forward propagation and backward propagation, and obtains the semantic vector of the second text data;

[0121] Mapping the above semantic vectors to a preset intention space to obtain a mapping result between the above semantic vectors and each intention;

[0122] The above mapping results are converted through an activation function to obtain the intent probabilities of various intents corresponding to the above semantic vectors, and the intent corresponding to the maximum intent probability is taken as the predicted intent;

[0123] Every time a predicted intent is obtained, the second loss function of the predicted intent and the first true label is calculated, and it is determined whether the second loss function converges; if so, the training of the preset intent recognition model is completed; if not, the network parameters of the preset intent recognition model are adjusted through the back propagation algorithm, and the preset intent recognition model is continued to be trained.

[0124] Preferably, the second text data should cover all intents as much as possible. During the model training process, the parameters in the model are continuously adjusted through the back propagation algorithm to minimize the cross entropy loss of intent classification, and the performance of the model is monitored using the validation set to prevent overfitting. After the intent recognition model is trained, user input can be processed in real time in actual applications, user intent can be quickly and accurately identified, and the results can be used for subsequent data query and processing operations.

[0125] Preferably, the second loss function is a cross entropy loss function.

[0126] Schematically, the intent recognition demonstration diagram after the intent recognition of the text input by the user by the intent recognition method in this solution is as follows: Figure 2 The user enters the input text for querying the power system dispatching situation in the input area "input" box, and the system performs intent recognition based on the input text, and displays the input text and the intent recognition result corresponding to the input text above the "input" input area.

[0127] In this preferred embodiment, a trained intent recognition model is obtained by training a preset intent recognition model.

[0128] In another preferred embodiment, after obtaining the above intention recognition result, the method further includes:

[0129] According to the above intention recognition results, construct SQL query statements;

[0130] According to the above SQL query statement, the user's intended query result is obtained from the power dispatching system database.

[0131] Specifically, according to the intent recognition result obtained by the preset intent recognition model, an SQL query statement is constructed, and the SQL query statement is executed to obtain the query result that the user wants to obtain from the database.

[0132] Preferably, after obtaining the desired query results, more valuable analysis results can be obtained by further parsing and processing the query result data. For example, in the dispatch of the power system, the dispatcher may need to understand the power generation change trend of different power stations in a certain period of time, the fluctuation of load data, the abnormal detection of equipment status, etc. By inputting the obtained query result data into the relevant data processing big model, the powerful computing power and complex algorithms of the data processing big model can be used to analyze and mine the data in multiple dimensions. The data processing big model can identify the potential patterns and associations in the data, generate detailed reports and visual charts, and help the dispatcher understand the information behind the data more intuitively. In addition, the data processing big model can also perform predictive analysis, such as predicting future load demand, power generation change trend, etc., so as to provide a scientific basis for dispatching decisions. Through this in-depth analysis, the dispatcher can more accurately grasp the operating status of the power system, optimize the dispatching strategy, and improve the operating efficiency and reliability of the power system.

[0133] In this preferred embodiment, an SQL query statement is constructed based on the intent recognition result, and then the query result is obtained from the database based on the query statement.

[0134] Based on the above method embodiment, the present invention provides a corresponding device embodiment.

[0135] like Figure 3 As shown, an embodiment of the present invention provides an intention recognition device for a power dispatching system, comprising: an input text acquisition module, a keyword recognition module, a keyword encoding module, a word embedding vector generation module, a text embedding vector generation module, an embedding vector weighting module and an intention recognition module;

[0136] The input text acquisition module is used to acquire the input text filled in by the user for querying the power system dispatching situation;

[0137] The keyword recognition module is used to perform keyword recognition on the input text according to a preset LSTM network model to obtain keywords in the input text;

[0138] The keyword encoding module is used to encode the keyword to obtain a keyword encoding vector;

[0139] The above-mentioned word embedding vector generation module is used to perform context prediction on the above-mentioned keyword encoding vector according to a preset word embedding model to obtain the word embedding vector corresponding to the above-mentioned keyword; wherein the above-mentioned word embedding vector contains the above-mentioned keyword and the context information corresponding to the above-mentioned keyword;

[0140] The text embedding vector generation module is used to encode the input text according to a preset sentence encoding model to obtain a text embedding vector corresponding to the input text;

[0141] The embedding vector weighting module is used to weight the word embedding vector and the text embedding vector to obtain a target embedding vector;

[0142] The above-mentioned intention recognition module is used to input the above-mentioned target embedding vector into a preset intention recognition model, so that the above-mentioned preset intention recognition model performs intent recognition on the above-mentioned target embedding vector, obtains the probability that the above-mentioned target embedding vector belongs to each type of intention, and takes the intention with the largest probability as the intention recognition result of the above-mentioned input text.

[0143] In a preferred embodiment, the above-mentioned word embedding vector generation module includes:

[0144] A text data acquisition unit, a first text data generation unit, a center word extraction unit, a selected context phrase extraction unit, an encoding unit, an encoding vector input unit, a vector mapping unit, a word embedding vector prediction unit, and a loss function calculation unit;

[0145] The text data acquisition unit is used to acquire a number of text data for querying the power system dispatching situation;

[0146] The first text data generating unit is used to input the text data into an n-gram model so that the n-gram model pre-processes the text data to obtain first text data that does not contain special characters, punctuation marks, and capital letters and that normalizes numbers and date representations;

[0147] The central word extraction unit is used to extract the central word of the first text data according to a preset sliding window size;

[0148] The selected context phrase extraction unit is used to extract the context phrases corresponding to the central word according to a preset number of words, and extract the selected context phrases corresponding to the central word from the context phrases; wherein the selected context phrases are: context phrases that appear no less than a preset threshold in all context phrases, and context phrases that appear less than a preset threshold in all context phrases and appear in a preset professional terminology database;

[0149] The encoding unit is used to encode the central word and the selected context phrase to obtain a central word encoding vector and a selected word embedding vector;

[0150] The encoding vector input unit is used to input the central word encoding vector into the Skip-gram model; wherein the Skip-gram model includes: a hidden layer and an output layer;

[0151] The vector mapping unit is used for the hidden layer to map the central word encoding vector into a low-dimensional central word vector;

[0152] The word embedding vector prediction unit is used to predict the context word group of the low-dimensional central word vector according to the output layer to obtain a predicted word embedding vector of the predicted context word group;

[0153] The above-mentioned loss function calculation unit is used to calculate the first loss function of the above-mentioned predicted word embedding vector and the selected word embedding vector every time a predicted word embedding vector is obtained, and determine whether the above-mentioned first loss function converges. If so, the training of the above-mentioned Skip-gram model is completed, and then the training of the above-mentioned preset word embedding model is completed; if not, the parameters of the above-mentioned Skip-gram model are updated through the stochastic gradient descent algorithm, and the above-mentioned Skip-gram model continues to be trained.

[0154] In another preferred embodiment, the above embedding vector weighting module includes:

[0155] A weight coefficient acquisition unit and a target embedding amount calculation unit;

[0156] The weighting coefficient acquisition unit is used to acquire the weighting coefficients used to weight the word embedding vector and the text embedding vector;

[0157] The target embedding amount calculation unit is used to calculate the target embedding vector according to the weighting coefficient, the word embedding vector and the text embedding vector;

[0158] Among them, the above target embedding vector is calculated according to the following formula:

[0159] E finanal =αE entity+(1-α)E sentence

[0160] In the formula, E finanal represents the target embedding vector, α represents the weighting coefficient, E entity Represents the word embedding vector, E sentence Represents a text embedding vector.

[0161] It should be noted that the device embodiments described above are merely schematic, wherein the modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines. Ordinary technicians in this field can understand and implement it without creative work. The above schematic diagram is only an example of an intention recognition device for a power dispatching system, and does not constitute a limitation on an intention recognition device for a power dispatching system, and may include more or fewer components than shown in the figure, or combine certain components, or different components.

[0162] Based on the above method item embodiments, the present invention provides corresponding terminal device item embodiments.

[0163] Another embodiment of the present invention provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the intention recognition method for a power dispatching system described in any embodiment of the present invention.

[0164] Exemplarily, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more module elements may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the device;

[0165] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The device may include, but is not limited to, a processor, a memory;

[0166] The processor referred to herein may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The above-mentioned processor is the control center of the above-mentioned device, and uses various interfaces and lines to connect various parts of the entire device;

[0167] The above-mentioned memory can be used to store the above-mentioned computer programs and / or modules. The above-mentioned processor realizes various functions of the above-mentioned device by running or executing the computer programs and / or modules stored in the above-mentioned memory, and calling the data stored in the memory. The above-mentioned memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; in addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0168] Based on the above method item embodiments, the present invention provides a corresponding storage medium item embodiment.

[0169] Another embodiment of the present invention provides a storage medium, the storage medium includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the intention recognition method for a power dispatching system described in any embodiment of the present invention.

[0170] In this embodiment, the storage medium is a computer-readable storage medium, the computer program includes computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0171] Compared with the prior art, the accuracy of intent recognition can be improved by implementing the above-mentioned embodiments of the present invention.

[0172] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for identifying intentions in a power dispatching system, characterized in that: include: Obtaining the input text filled in by the user for querying the power system dispatching situation; Perform keyword recognition on the input text according to a preset LSTM network model to obtain keywords in the input text; Encode the keyword to obtain a keyword encoding vector; Perform context prediction on the keyword encoding vector according to a preset word embedding model to obtain a word embedding vector corresponding to the keyword; wherein the word embedding vector contains the keyword and context information corresponding to the keyword; Encode the input text according to a preset sentence encoding model to obtain a text embedding vector corresponding to the input text; Weighting the word embedding vector and the text embedding vector to obtain a target embedding vector; The target embedding vector is input into a preset intent recognition model so that the preset intent recognition model performs intent recognition on the target embedding vector, obtains the probability that the target embedding vector belongs to each type of intent, and takes the intent with the highest probability as the intent recognition result of the input text.

2. The intention recognition method for a power dispatching system according to claim 1, characterized in that: The training of the preset word embedding model includes: Obtaining some text data for querying the dispatching status of the power system; Inputting the text data into an n-gram model so that the n-gram model pre-processes the text data to obtain first text data that does not contain special characters, punctuation marks, and capital letters and that normalizes numbers and date representations; Extracting the central word of the first text data according to a preset sliding window size; Extracting context phrases corresponding to the central word according to a preset number of words, and extracting selected context phrases corresponding to the central word from the context phrases; wherein the selected context phrases are: context phrases that appear no less than a preset threshold in all context phrases, and context phrases that appear less than a preset threshold in all context phrases and appear in a preset professional terminology database; Encode the central word and the selected context phrase to obtain a central word encoding vector and a selected word embedding vector; Inputting the central word encoding vector into a Skip-gram model; wherein the Skip-gram model includes: a hidden layer and an output layer; The hidden layer maps the central word encoding vector to a low-dimensional central word vector; Predicting the context phrase of the low-dimensional central word vector according to the output layer to obtain a predicted word embedding vector of the predicted context phrase; Every time a predicted word embedding vector is obtained, the first loss function of the predicted word embedding vector and the selected word embedding vector is calculated to determine whether the first loss function converges. If so, the Skip-gram model training is completed, and then the preset word embedding model training is completed; if not, the parameters of the Skip-gram model are updated by the stochastic gradient descent algorithm, and the Skip-gram model continues to be trained.

3. The intention recognition method for a power dispatching system according to claim 2, characterized in that: The step of weighting the word embedding vector and the text embedding vector to obtain a target embedding vector includes: Obtaining weighting coefficients for weighting the word embedding vector and the text embedding vector; Calculating the target embedding vector according to the weighting coefficient, the word embedding vector and the text embedding vector; The target embedding vector is calculated according to the following formula: E finanal =αE entity +(1-a)E sentence In the formula, E finanal represents the target embedding vector, α represents the weighting coefficient, E entity Represents the word embedding vector, E sentence Represents a text embedding vector.

4. The intention recognition method for a power dispatching system according to claim 3, characterized in that: The training of the preset intent recognition model includes: Acquire a plurality of second text data with first real labels for querying the dispatching status of the power system; wherein the first real labels are used to represent the intention of the second text data; Encode the second text data to obtain a second text encoding vector corresponding to the second text data; Inputting the second text encoding vector into the preset intention recognition model, so that the preset intention recognition model captures the bidirectional dependency of the second text encoding vector through forward propagation and backward propagation, and obtains the semantic vector of the second text data; Mapping the semantic vector to a preset intention space to obtain a mapping result between the semantic vector and each intention; The mapping result is converted by an activation function to obtain the intent probabilities of various intents corresponding to the semantic vector, and the intent corresponding to the maximum intent probability is used as the predicted intent; Every time a predicted intent is obtained, the second loss function of the predicted intent and the first true label is calculated, and it is determined whether the second loss function converges; if so, the training of the preset intent recognition model is completed; if not, the network parameters of the preset intent recognition model are adjusted through the back propagation algorithm, and the preset intent recognition model continues to be trained.

5. The intention recognition method for a power dispatching system according to claim 4, characterized in that: After obtaining the intention recognition result, the method further includes: Constructing a SQL query statement according to the intent recognition result; According to the SQL query statement, the user's intended query result is obtained from the power dispatching system database.

6. An intention recognition device for a power dispatching system, characterized in that: include: Input text acquisition module, keyword recognition module, keyword encoding module, word embedding vector generation module, text embedding vector generation module, embedding vector weighting module and intent recognition module; The input text acquisition module is used to acquire the input text filled in by the user for querying the power system dispatching situation; The keyword recognition module is used to perform keyword recognition on the input text according to a preset LSTM network model to obtain keywords in the input text; The keyword encoding module is used to encode the keyword to obtain a keyword encoding vector; The word embedding vector generation module is used to perform context prediction on the keyword encoding vector according to a preset word embedding model to obtain a word embedding vector corresponding to the keyword; wherein the word embedding vector contains the keyword and the context information corresponding to the keyword; The text embedding vector generation module is used to encode the input text according to a preset sentence encoding model to obtain a text embedding vector corresponding to the input text; The embedding vector weighting module is used to weight the word embedding vector and the text embedding vector to obtain a target embedding vector; The intention recognition module is used to input the target embedding vector into a preset intention recognition model so that the preset intention recognition model performs intent recognition on the target embedding vector, obtains the probability that the target embedding vector belongs to each type of intention, and takes the intention with the highest probability as the intention recognition result of the input text.

7. The intention recognition device for a power dispatching system according to claim 6, characterized in that: The word embedding vector generation module includes: A text data acquisition unit, a first text data generation unit, a center word extraction unit, a selected context phrase extraction unit, an encoding unit, an encoding vector input unit, a vector mapping unit, a word embedding vector prediction unit, and a loss function calculation unit; The text data acquisition unit is used to acquire a number of text data for querying the power system dispatching situation; The first text data generating unit is used to input the text data into an n-gram model so that the n-gram model pre-processes the text data to obtain first text data that does not contain special characters, punctuation marks, and capital letters and that normalizes numbers and date representations; The core word extraction unit is used to extract the core word of the first text data according to a preset sliding window size; The selected context phrase extraction unit is used to extract the context phrases corresponding to the central word according to a preset number of words, and extract the selected context phrases corresponding to the central word from the context phrases; wherein the selected context phrases are: context phrases that appear no less than a preset threshold in all context phrases, and context phrases that appear less than a preset threshold in all context phrases and appear in a preset professional terminology database; The encoding unit is used to encode the central word and the selected context phrase to obtain a central word encoding vector and a selected word embedding vector; The encoding vector input unit is used to input the central word encoding vector into the Skip-gram model; wherein the Skip-gram model includes: a hidden layer and an output layer; The vector mapping unit is used for the hidden layer to map the central word encoding vector to a low-dimensional central word vector; The word embedding vector prediction unit is used to predict the context word group of the low-dimensional central word vector according to the output layer to obtain a predicted word embedding vector of the predicted context word group; The loss function calculation unit is used to calculate the first loss function of the predicted word embedding vector and the selected word embedding vector each time a predicted word embedding vector is obtained, and determine whether the first loss function converges. If so, the Skip-gram model training is completed, and then the preset word embedding model training is completed; if not, the parameters of the Skip-gram model are updated through the stochastic gradient descent algorithm, and the Skip-gram model continues to be trained.

8. The intention recognition device for a power dispatching system according to claim 7, characterized in that: The embedding vector weighting module comprises: A weight coefficient acquisition unit and a target embedding amount calculation unit; The weighting coefficient acquisition unit is used to acquire the weighting coefficients used to weight the word embedding vector and the text embedding vector; The target embedding amount calculation unit is used to calculate the target embedding vector according to the weighting coefficient, the word embedding vector and the text embedding vector; The target embedding vector is calculated according to the following formula: E finanal =αE entity +(1-a)E sentence In the formula, E finanal represents the target embedding vector, α represents the weighting coefficient, E entity Represents the word embedding vector, E sentence Represents a text embedding vector.

9. A terminal device, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements an intention recognition method for a power dispatching system as described in any one of claims 1 to 5.

10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute the intention recognition method for a power dispatching system as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Intention recognition method and device, electronic equipment and readable storage medium

    CN110928997A

  • Natural language understanding method and device fusing dialogue context information

    CN116542256A

  • Input data processing method, detection model construction method and data detection method

    CN117459272A

  • NLP-based industry data analysis method and system

    CN118070812A

  • Intention classification method and apparatus, electronic device, and computer-readable storage medium

    WO2023065544A1