Multi-level semantic intent recognition method and related devices thereof
Patent Information
- Application Number
- CN202211559430.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-06
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2042-12-06
AI Technical Summary
[0004]本申请实施例的目的在于提出一种多级语义意图识别方法及其相关设备,以解决现有技术中不能有效识别出用户的多级语义意图的问题
[0064]The multi-level semantic intent recognition method described in this application involves obtaining the text to be recognized; inputting the text to be recognized into a pre-trained word segmentation model for word segmentation processing, and using the word segmentation result as the feature encoding of the text to be recognized; inputting the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be recognized. This application uses the word segmentation processing result of the ERNIE model to construct a multi-level intent hierarchy tree, and then constructs a graph neural network model through the multi-level intent hierarchy tree, which can effectively obtain the dependency information between multi-level semantic intents, making the prediction results more reasonable, and ultimately improving the overall accuracy of user multi-level intent recognition.
Smart Images

Figure CN115730597B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, and in particular to a multi-level semantic intent recognition method and related equipment. Background Technology
[0002] In scenarios such as intelligent customer service, multi-turn dialogue, and robot outbound calls, the ability to correctly identify the user's semantic intent is related to the quality of the robot's response to the user's questions and also to the user's experience. Only by correctly identifying the user's semantic intent can we construct the script based on the specific semantic intent and improve the accuracy of the response.
[0003] Users' semantic intent is often complex, not just a single semantic intent, but frequently involves multiple levels of semantic intent. For example, in the car insurance sales scenario, phrases like "inquiry-premium-third-party liability insurance" and "inquiry-coverage-commercial insurance-last year" have three or more levels of semantic intent. Currently, user semantic intent recognition mainly involves constructing neural networks for text classification, such as convolutional neural networks, LSTM, and BERT pre-trained language models. These models mostly encode the user's input and use softmax in the last layer of the network to estimate the probability of the categories, taking the category with the highest probability value as the predicted category. This method works well for recognizing single semantic intent, but it cannot effectively recognize users' multi-level semantic intent and does not effectively utilize the dependencies between multi-level semantic intents. Summary of the Invention
[0004] The purpose of this application is to propose a multi-level semantic intent recognition method and related equipment to solve the problem that the prior art cannot effectively recognize the user's multi-level semantic intent.
[0005] To address the aforementioned technical problems, this application provides a multi-level semantic intent recognition method, employing the following technical solution:
[0006] A multi-level semantic intent recognition method includes the following steps:
[0007] Step 201: Obtain the text to be recognized;
[0008] Step 202: Input the text to be identified into the pre-trained word segmentation model, perform word segmentation processing, and use the word segmentation processing result as the feature encoding of the text to be identified;
[0009] Step 203: Obtain a data training set, wherein the data training set consists of texts corresponding to the intent of each word segment in the labeled text, and the texts in the data training set are commonly used dialogue texts in insurance business;
[0010] Step 204: Input the data training set into the initialized graph neural network model to construct a multi-level intent hierarchy tree;
[0011] Step 205: Determine whether the number of nodes in the multi-level intent hierarchy tree is in a stable state according to preset judgment conditions;
[0012] Step 206: If the number of nodes in the multi-level intent hierarchy tree is unstable, obtain a new data training set and repeat steps 204 and 205 to update the multi-level intent hierarchy tree.
[0013] Step 207: If the number of nodes in the multi-level intent hierarchy tree is stable, then the pre-construction of the graph neural network model is completed based on each node in the multi-level intent hierarchy tree and the connection relationship between each node.
[0014] Step 208: Input the feature encoding into a pre-built graph neural network model to identify the multi-level semantic intent contained in the text to be identified.
[0015] Furthermore, the step of inputting the training data set into the initialized graph neural network model to construct a multi-level intent hierarchy tree specifically includes:
[0016] Obtain the intent-tagged word segments from all texts in the training set of the data;
[0017] If any two word segments do not have a sentence construction connection relationship in all texts, and the two word segments are not word segments with the same semantic intent, then there is no hierarchical relationship between the semantic intents corresponding to the two word segments;
[0018] The semantic intents that do not have a hierarchical relationship are set at the same level in the multi-level intent hierarchy tree, and are treated as nodes at the same level in the multi-level intent hierarchy tree;
[0019] If any two word segments have a sentence construction connection relationship in the same text, and the two word segments are not word segments with the same semantic intent, then there is a hierarchical relationship between the semantic intents corresponding to the two word segments;
[0020] The semantic intents that have a hierarchical relationship are set at different levels in the multi-level intent hierarchy tree according to the hierarchical relationship, and serve as hierarchical nodes in the multi-level intent hierarchy tree;
[0021] The hierarchical nodes are connected according to the hierarchical relationship until the connection is completed, thus completing the construction of the multi-level intent hierarchy tree for the current period.
[0022] Furthermore, the step of pre-constructing the graph neural network model based on each node in the multi-level intent hierarchy tree and the connections between nodes specifically includes:
[0023] Based on each node in the multi-level intent hierarchy tree and the connection relationships between each node, construct the adjacency matrix for each node other than the root node.
[0024] The degree matrix of the adjacency matrix is obtained by summing the adjacency matrix.
[0025] Based on the word segmentation results with labeled intents and the preset probability algorithm, the weight values of each word segmentation are calculated in the training set of the data.
[0026] Based on the weight values of each word in the training set, an initial word segmentation weight matrix is constructed;
[0027] According to the graph neural network algorithm formula: Complete the pre-construction of the graph neural network model, where H (l) This represents the output of this layer in a multi-layer graph neural network, where σ is the non-linear mapping function, n is the total number of nodes, and A... i Let D be the adjacency matrix of the i-th node. i W is the degree matrix of the adjacency matrix of the i-th node. (l-1) H represents the word segmentation weight matrix after training through the layer preceding this layer in a multi-layer graph neural network. (l-1) b represents the output of the layer preceding this layer in a multilayer graph neural network. (l-1) This is the bias term after training the previous layer of the neural network in a multilayer graph neural network.
[0028] Furthermore, the step of determining whether the number of nodes in the multi-level intent hierarchy tree is in a stable state based on preset judgment conditions specifically includes:
[0029] The number of nodes in the multi-level intent hierarchy tree changes within the same construction cycle;
[0030] If the number of nodes does not change before and after construction, then the number of nodes in the multi-level intent hierarchy tree is in a stable state.
[0031] If the number of nodes changes before and after construction, the number of nodes in the multi-level intent hierarchy tree is not yet in a stable state.
[0032] Furthermore, before performing the step of pre-constructing the graph neural network model based on each node in the multi-level intent hierarchy tree and the connections between nodes, the method further includes:
[0033] Based on the connection relationship between nodes in the multi-level intent hierarchy tree, non-leaf nodes are filtered out, wherein the leaf nodes are nodes that do not have any lower-level nodes;
[0034] Construct a corresponding local classifier for each non-leaf node, and give the local classifier a distinctive name. The distinctive naming method can be to directly use the semantic intent name corresponding to each non-leaf node as the distinctive name.
[0035] Furthermore, the step of inputting the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be identified specifically includes:
[0036] The feature encoding is input into the pre-constructed graph neural network model to identify the local classifier corresponding to each word segmentation result in the feature encoding;
[0037] Based on the local classifier, obtain the semantic intent corresponding to each word segmentation result in the feature encoding;
[0038] Determine whether there are multiple semantic intents at the same level among the semantic intents corresponding to each word segmentation result in the feature encoding;
[0039] If there are multiple sibling semantic intents, then a contrastive learning training method is used to construct positive and negative sample instances for the multiple sibling semantic intents respectively. The positive sample instance is constructed by randomly selecting several texts that are the same as the current semantic intent from the data training set as positive sample instances. The negative sample instance is constructed by identifying the node corresponding to the current semantic intent as a sibling node, and randomly selecting several texts corresponding to the semantic intent of the sibling node from the data training set as negative sample instances.
[0040] Based on the contrastive learning loss function: Obtain the loss values corresponding to different semantic intentions among the multiple sibling semantic intentions, where z i This represents the feature encoding of the text to be identified. The feature encoding representing a positive sample instance, The feature encoding of the negative sample instance is represented by the sim method, which is a function method used to calculate the similarity between the feature encodings of the positive and negative sample instances and the feature encoding of the text to be identified.
[0041] The semantic intent corresponding to the minimum loss value is obtained and used as the final semantic intent of the multiple sibling semantic intents;
[0042] The different levels of semantic intent corresponding to each word segmentation result in the feature encoding are obtained as the multi-level semantic intent contained in the text to be identified.
[0043] To address the aforementioned technical problems, this application also provides a multi-level semantic intent recognition device, which employs the following technical solution:
[0044] A multi-level semantic intent recognition device, comprising:
[0045] The text acquisition module is used to acquire the text to be recognized.
[0046] The feature encoding acquisition module is used to input the text to be recognized into a pre-trained word segmentation model, perform word segmentation processing, and use the word segmentation processing result as the feature encoding of the text to be recognized.
[0047] The training set acquisition module is used to acquire a data training set, wherein the data training set consists of text corresponding to the intent of each word in the labeled text, and the text in the data training set is commonly used dialogue text in insurance business;
[0048] A multi-level intent hierarchy tree construction module is used to input the data training set into an initialized graph neural network model to construct a multi-level intent hierarchy tree;
[0049] The node stability judgment module is used to determine whether the number of nodes in the multi-level intent hierarchy tree is in a stable state according to preset judgment conditions.
[0050] The multi-level intent hierarchy tree update module is used to obtain a new data training set and update the multi-level intent hierarchy tree if the number of nodes in the multi-level intent hierarchy tree is unstable.
[0051] The graph neural network model construction module is used to pre-build the graph neural network model based on each node in the multi-level intent hierarchy tree and the connection relationship between each node if the number of nodes in the multi-level intent hierarchy tree is in a stable state.
[0052] The semantic intent recognition module is used to input the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be recognized.
[0053] Furthermore, the graph neural network model construction module includes an adjacency matrix construction submodule, a degree matrix acquisition submodule, a weight value acquisition submodule, a word segmentation weight matrix construction submodule, and a graph neural network model construction submodule, wherein:
[0054] The adjacency matrix construction submodule is used to construct the adjacency matrix corresponding to each node except the root node based on each node in the multi-level intent hierarchy tree and the connection relationship between each node.
[0055] The degree matrix acquisition submodule is used to perform a summation operation on the adjacency matrix to obtain the degree matrix of the adjacency matrix;
[0056] The weight value acquisition submodule is used to calculate the weight value of each word in the training data set based on the word segmentation results of the labeled intent and the preset probability algorithm.
[0057] The word segmentation weight matrix construction submodule is used to construct an initialized word segmentation weight matrix based on the weight values of each word in the training data set.
[0058] The graph neural network model construction submodule is used to construct the graph neural network model according to the graph neural network algorithm formula: Complete the pre-construction of the graph neural network model, where H (l) This represents the output of this layer in a multi-layer graph neural network, where σ is the non-linear mapping function, n is the total number of nodes, and A... i Let D be the adjacency matrix of the i-th node. i W is the degree matrix of the adjacency matrix of the i-th node. (l-1) H represents the word segmentation weight matrix after training through the layer preceding this layer in a multi-layer graph neural network. (l-1) b represents the output of the layer preceding this layer in a multilayer graph neural network. (l-1) This is the bias term after training the previous layer of the neural network in a multilayer graph neural network.
[0059] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:
[0060] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the multi-level semantic intent recognition method described above.
[0061] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:
[0062] A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the multi-level semantic intent recognition method described above.
[0063] Compared with the prior art, the embodiments of this application have the following main advantages:
[0064] The multi-level semantic intent recognition method described in this application involves obtaining the text to be recognized; inputting the text to be recognized into a pre-trained word segmentation model for word segmentation processing, and using the word segmentation result as the feature encoding of the text to be recognized; inputting the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be recognized. This application uses the word segmentation processing result of the ERNIE model to construct a multi-level intent hierarchy tree, and then constructs a graph neural network model through the multi-level intent hierarchy tree, which can effectively obtain the dependency information between multi-level semantic intents, making the prediction results more reasonable, and ultimately improving the overall accuracy of user multi-level intent recognition. Attached Figure Description
[0065] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0066] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0067] Figure 2 A flowchart of an embodiment of the multi-level semantic intent recognition method according to this application;
[0068] Figure 3 yes Figure 2 A flowchart of a specific embodiment of step 204 shown;
[0069] Figure 4 yes Figure 2 A flowchart of a specific embodiment of step 205 shown;
[0070] Figure 5 yes Figure 2 A flowchart of a specific embodiment of step 207 shown;
[0071] Figure 6 yes Figure 5 A schematic diagram of a specific embodiment of steps 501 and 502 shown;
[0072] Figure 7 yes Figure 2 A flowchart of a specific embodiment of step 208 shown;
[0073] Figure 8 A schematic diagram of a structure of an embodiment of the multi-level semantic intent recognition device according to this application;
[0074] Figure 9A schematic diagram of the structure of an embodiment of the computer device according to this application. Detailed Implementation
[0075] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0076] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0077] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0078] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0079] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0080] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0081] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0082] It should be noted that the multi-level semantic intent recognition method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the multi-level semantic intent recognition device is generally set in the server / terminal device.
[0083] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0084] Continue to refer to Figure 2 A flowchart of an embodiment of the multi-level semantic intent recognition method according to this application is shown. The multi-level semantic intent recognition method includes the following steps:
[0085] Step 201: Obtain the text to be recognized.
[0086] In this embodiment, the text to be recognized can be the text content input by the insurance business customer through a preset human-computer interaction interface, or it can be the text content converted from the voice of the insurance business customer by the intelligent customer service.
[0087] Step 202: Input the text to be identified into the pre-trained word segmentation model, perform word segmentation processing, and use the word segmentation processing result as the feature encoding of the text to be identified.
[0088] In this embodiment, the pre-trained word segmentation model is the ERNIE model. The ERNIE model is a knowledge-enhanced semantic representation model proposed by Baidu, which has achieved good results in various Chinese tasks. The sentence feature encoding obtained by the ERNIE model has good performance. The BERT model mainly focuses on cloze test learning at the character or English word level, and does not make full use of the lexical structure, grammatical structure, and semantic information in the training data for learning and modeling. ERNIE, on the other hand, greatly enhances the general semantic representation capability by uniformly modeling the lexical structure, grammatical structure, and semantic information in the training data. Compared with the BERT model, the ERNIE model can better combine the lexical structure and grammatical structure for semantic information recognition when predicting personal names, place names, and business proper nouns. Insurance business itself involves a variety of insurance business proper nouns, such as insurance, insurance application, renewal, insurance, and claims. When the above proper nouns appear in the text to be recognized, the ERNIE model can better combine the lexical structure and grammatical structure of the text itself for semantic information recognition than the BERT model.
[0089] Step 203: Obtain a data training set, wherein the data training set consists of texts corresponding to the intent of each word segment in the labeled text, and the texts in the data training set are commonly used dialogue texts in insurance business;
[0090] The training data set uses commonly used dialogue texts in insurance business that correspond to the intent of each word segment in the labeled text. This ensures that the model training can be fully combined with the insurance business scenarios in financial technology, making the trained model more in line with the main business of insurance companies.
[0091] Step 204: Input the data training set into the initialized graph neural network model to construct a multi-level intent hierarchy tree;
[0092] Continue to refer to Figure 3 , Figure 3 yes Figure 2 A flowchart of a specific embodiment of step 204 shown includes:
[0093] Step 301: Obtain the intention-tagged word segments from all texts in the training data set;
[0094] Step 302: If any two word segments do not have a sentence construction connection relationship in all texts, and the two word segments are not word segments with the same semantic intent, then there is no hierarchical relationship between the semantic intents corresponding to the two word segments.
[0095] Step 303: Set the semantic intents that do not have a hierarchical relationship to the same level in the multi-level intent hierarchy tree, as nodes at the same level in the multi-level intent hierarchy tree;
[0096] Step 304: If any two word segments have a sentence construction connection relationship in the same text, and the two word segments are not word segments with the same semantic intent, then there is a hierarchical relationship between the semantic intents corresponding to the two word segments.
[0097] Step 305: Set the semantic intents with hierarchical relationships at different levels of the multi-level intent hierarchy tree according to the hierarchical relationship, as hierarchical nodes in the multi-level intent hierarchy tree;
[0098] Step 306: Connect the hierarchical nodes according to the hierarchical relationship until the connection is completed, then the construction of the multi-level intent hierarchy tree for the current period is completed.
[0099] In this embodiment, the sentence construction connection relationship refers to the absence of any intervening words or characters between two word segments. For example, if the text is "I want to inquire about the car insurance renewal quote in the insurance business", and the marked intent words are "insurance business", "car insurance", "renewal", and "quote", then "car insurance" and "renewal" have a sentence construction connection relationship, and "renewal" and "quote" also have a sentence construction connection relationship. However, there are intervening characters between "insurance business" and "car insurance", "renewal", and "quote", so there is no sentence construction connection relationship.
[0100] Continuing with the example of the text above, "I want to inquire about the car insurance renewal quote," the specific implementation of connecting the hierarchical nodes according to the hierarchical relationship is as follows: Car insurance and renewal have a sentence construction connection relationship, with car insurance being segmented first and renewal being segmented later, and their semantic intents are clearly different. Car insurance refers to a business term, while renewal refers to a business verb. Therefore, when constructing the multi-level intent hierarchy tree, car insurance is placed at the upper level, and renewal is placed at the lower level, with a direct connection between them. Similarly, renewal and quote also have a sentence construction connection relationship, with quote placed at the lower level, and a direct connection between them. Car insurance and quote do not have a sentence construction connection relationship, so there is no need to directly connect them.
[0101] By constructing a multi-level intent hierarchy tree using the labeled intent words in the training dataset and the sentence-structured connections between these words, this approach facilitates the direct construction of a tree-structured graph using commonly used business terms in insurance operations, thus better aligning with insurance business scenarios. Furthermore, the tree-structured graph construction no longer uses the original preset method but instead incorporates the sentence-structured connections between word segments, thereby indirectly constructing a hierarchy between multi-level semantic intents.
[0102] Step 205: Determine whether the number of nodes in the multi-level intent hierarchy tree is in a stable state according to preset judgment conditions;
[0103] Continue to refer to Figure 4 , Figure 4 yes Figure 2 A flowchart of a specific embodiment of step 205 shown includes:
[0104] Step 401: Statistically analyze the changes in the number of nodes in the multi-level intent hierarchy tree within the same construction cycle;
[0105] Step 402: If the number of nodes has not changed before and after construction, then the number of nodes in the multi-level intent hierarchy tree has reached a stable state.
[0106] Step 403: If the number of nodes changes before and after construction, then the number of nodes in the multi-level intent hierarchy tree is not yet in a stable state.
[0107] By determining whether the change in the number of nodes is stable, it can be inferred whether the multi-level intent hierarchy tree has been constructed. If it has not been constructed, new data training sets are obtained, and the multi-level intent hierarchy tree is updated by updating the nodes, thus ensuring the integrity of the construction of the multi-level intent hierarchy tree.
[0108] Step 206: If the number of nodes in the multi-level intent hierarchy tree is unstable, obtain a new data training set and repeat steps 204 and 205 to update the multi-level intent hierarchy tree.
[0109] By using a cyclical approach to update the nodes of the multi-level intent hierarchy tree, we can avoid the situation where the nodes of the multi-level intent hierarchy tree are incomplete due to insufficient training data, and also avoid the situation where there is no node update and blind training due to excessive training data. This allows for the scientific and reasonable training and improvement of the multi-level intent hierarchy tree.
[0110] Step 207: If the number of nodes in the multi-level intent hierarchy tree is stable, then the pre-construction of the graph neural network model is completed based on each node in the multi-level intent hierarchy tree and the connection relationship between each node.
[0111] Continue to refer to Figure 5 , Figure 5 yes Figure 2 A flowchart of a specific embodiment of step 207 shown includes:
[0112] Step 501: Based on each node in the multi-level intent hierarchy tree and the connection relationships between each node, construct the adjacency matrix corresponding to the nodes other than the root node.
[0113] In this embodiment, the root node is generally a preset source node that does not represent any semantic intent corresponding to the word segment. Only the nodes outside the root node represent the semantic intent corresponding to the word segment. Therefore, when obtaining the adjacency matrix corresponding to each word in the multi-level intent hierarchy tree, the root node is removed first.
[0114] In this embodiment, when constructing the adjacency matrix for nodes other than the root node, if two nodes have a connection relationship, it is represented by 1; if two nodes have no connection relationship, it is represented by 0.
[0115] Step 502: Perform a summation operation on the adjacency matrix to obtain the degree matrix of the adjacency matrix;
[0116] refer to Figure 6 , Figure 6 yes Figure 5 The diagram illustrates a specific embodiment of steps 501 and 502. Figure 6a shows the connection relationships between first-layer nodes A, B, and C and second-layer nodes D, E, and F. Node A is connected to nodes D and E, node B is connected to nodes E and F, and node C is connected to nodes D, E, and F. Figure 6b shows the adjacency matrix corresponding to the first-layer nodes A, B, and C and the second-layer nodes D, E, and F. Nodes have no connection to themselves and should be NULL, but to correspond to 1, the NULL value is set to 0, i.e., the values in cells AA, BB, CC, DD, EE, and FF in Figure 6b. Figure 6c shows the degree matrix corresponding to the adjacency matrix 6b. The values in cells AA, BB, CC, DD, EE, and FF in Figure 6c represent the summation results of the adjacency matrix.
[0117] Step 503: Based on the word segmentation results with labeled intents and the preset probability algorithm, calculate the weight value of each word in the data training set;
[0118] Step 504: Construct an initialized word segmentation weight matrix based on the weight values of each word in the training data set;
[0119] Step 505, according to the graph neural network algorithm formula: Complete the pre-construction of the graph neural network model, where H (l) This represents the output of this layer in a multi-layer graph neural network, where σ is the non-linear mapping function, n is the total number of nodes, and A... i Let D be the adjacency matrix of the i-th node. i W is the degree matrix of the adjacency matrix of the i-th node. (l-1) H represents the word segmentation weight matrix after training through the layer preceding this layer in a multi-layer graph neural network. (l-1)b represents the output of the layer preceding this layer in a multilayer graph neural network. (l-1) This is the bias term after training the previous layer of the neural network in a multilayer graph neural network.
[0120] By using the adjacency matrix, degree matrix, weight matrix, and bias term as parameters, a graph neural network model is constructed. Specifically, the initial weight matrix and initial bias term are obtained by processing the word segmentation results of the ERNIE model. The adjacency matrix and degree matrix of each node are obtained by processing the nodes and connections between nodes in the multi-level intent hierarchy tree. Then, a graph neural network model is constructed using a graph neural network algorithm. This application employs a combination of the ERNIE model and a multi-level intent hierarchy tree to construct the graph neural network model, which effectively captures the dependency information between multi-level semantic intents, making the prediction results more reasonable and ultimately improving the overall accuracy of user multi-level intent recognition.
[0121] In this embodiment, before performing the step of pre-constructing the graph neural network model based on the nodes in the multi-level intent hierarchy tree and the connection relationships between the nodes, the method further includes: filtering out non-leaf nodes based on the connection relationships between the nodes in the multi-level intent hierarchy tree, wherein the leaf nodes are nodes that do not have lower-level nodes; constructing a corresponding local classifier for each non-leaf node, and giving the local classifier a distinctive name, wherein the distinctive naming method can be to directly use the semantic intent name corresponding to each non-leaf node as the distinctive name.
[0122] By constructing local classifiers for non-leaf nodes, it is convenient to directly use the corresponding classifiers when performing multi-level semantic intent recognition to identify all semantic intents contained in the input text.
[0123] Step 208: Input the feature encoding into a pre-built graph neural network model to identify the multi-level semantic intent contained in the text to be identified.
[0124] Continue to refer to Figure 7 , Figure 7 yes Figure 2 A flowchart of a specific embodiment of step 208 shown includes:
[0125] Step 701: Input the feature encoding into the pre-constructed graph neural network model to identify the local classifier corresponding to each word segmentation result in the feature encoding;
[0126] Step 702: Based on the local classifier, obtain the semantic intent corresponding to each word segmentation result in the feature encoding;
[0127] Step 703: Determine whether there are multiple semantic intents at the same level among the semantic intents corresponding to each word segmentation result in the feature encoding;
[0128] Step 704: If there are multiple semantic intents at the same level, then use the contrastive learning training method to construct positive and negative sample instances for the multiple semantic intents at the same level respectively;
[0129] In this embodiment, positive sample instances are constructed by randomly selecting several texts with the same semantic intent as the current semantic intent from the data training set as positive sample instances. Negative sample instances are constructed by identifying the node corresponding to the current semantic intent as a sibling node and randomly selecting several texts corresponding to the semantic intent of the sibling node from the data training set as negative sample instances.
[0130] Step 705, learn the loss function based on contrast: Obtain the loss values corresponding to different semantic intentions among the multiple sibling semantic intentions, where z i This represents the feature encoding of the text to be identified. The feature encoding representing a positive sample instance, The feature encoding of the negative sample instance is represented by the sim method, which is a function method used to calculate the similarity between the feature encodings of the positive and negative sample instances and the feature encoding of the text to be identified.
[0131] Step 706: Obtain the semantic intent corresponding to the minimum loss value, and use it as the final semantic intent of the multiple sibling semantic intents;
[0132] Step 707: Obtain the different levels of semantic intent corresponding to each word segmentation result in the feature encoding as the multi-level semantic intent contained in the text to be identified.
[0133] Some intents at the same level have relatively blurred boundaries, such as "premium" and "coverage amount". Both intents refer to monetary amounts, and the corresponding statements involve money. In order to improve the recognition accuracy of such intents, a contrastive learning method is introduced for joint training.
[0134] Contrastive learning is a type of self-supervised learning. It trains a learning model by constructing similar and dissimilar instances. This learning model ensures that similar instances are closer in the projection space, while dissimilar instances are farther apart. By using classifiers and contrastive learning, the classification distance between different classifiers is increased, resulting in more reasonable predictions. Through contrastive learning training, the classification accuracy of difficult-to-distinguish intentions can be improved, ultimately enhancing the overall accuracy of multi-level user intent recognition.
[0135] This application obtains the text to be identified; inputs the text to be identified into a pre-trained word segmentation model for word segmentation processing, and uses the word segmentation result as the feature encoding of the text to be identified; inputs the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be identified. This application uses the word segmentation result of the ERNIE model to construct a multi-level intent hierarchy tree, and then constructs a graph neural network model through the multi-level intent hierarchy tree, which can effectively obtain the dependency information between multi-level semantic intents, making the prediction results more reasonable, and ultimately improving the overall accuracy of user multi-level intent recognition.
[0136] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0137] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0138] In this embodiment, word segmentation is performed using a word segmentation model, and the segmentation result is used as the feature encoding of the text to be identified. The feature encoding is then input into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be identified. This application uses the ERNIE model word segmentation result to construct a multi-level intent hierarchy tree, and then constructs a graph neural network model through the multi-level intent hierarchy tree. This can effectively obtain the dependency information between multi-level semantic intents, making the prediction results more reasonable, and ultimately improving the overall accuracy of user multi-level intent recognition.
[0139] Further reference Figure 8 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a multi-level semantic intent recognition device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0140] like Figure 8As shown, the multi-level semantic intent recognition device 800 described in this embodiment includes: a text acquisition module 801, a feature encoding acquisition module 802, a training set acquisition module 803, a multi-level intent hierarchy tree construction module 804, a node stability judgment module 805, a multi-level intent hierarchy tree update module 806, a graph neural network model construction module 807, and a semantic intent recognition module 808. Wherein:
[0141] The text acquisition module 801 is used to acquire the text to be recognized;
[0142] The feature encoding acquisition module 802 is used to input the text to be recognized into a pre-trained word segmentation model, perform word segmentation processing, and use the word segmentation processing result as the feature encoding of the text to be recognized.
[0143] The training set acquisition module 803 is used to acquire a data training set, wherein the data training set consists of text corresponding to the intent of each word in the labeled text, and the text in the data training set is commonly used dialogue text in insurance business.
[0144] The multi-level intent hierarchy tree construction module 804 is used to input the data training set into the initialized graph neural network model to construct a multi-level intent hierarchy tree;
[0145] The node stability judgment module 805 is used to determine whether the number of nodes in the multi-level intent hierarchy tree is in a stable state according to preset judgment conditions.
[0146] The multi-level intent hierarchy tree update module 806 is used to obtain a new data training set and update the multi-level intent hierarchy tree if the number of nodes in the multi-level intent hierarchy tree is unstable.
[0147] The graph neural network model construction module 807 is used to pre-build the graph neural network model based on each node in the multi-level intent hierarchy tree and the connection relationship between each node if the number of nodes in the multi-level intent hierarchy tree is in a stable state.
[0148] The semantic intent recognition module 808 is used to input the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be recognized.
[0149] In some specific embodiments of this application, the multi-level intent hierarchy tree construction module 804 includes a word segmentation acquisition submodule, a first judgment submodule, a same-level node setting submodule, a second judgment submodule, a hierarchical node setting submodule, and an inter-level connection submodule, wherein,
[0150] The word segmentation acquisition submodule is used to acquire the intention-tagged words in all texts in the data training set;
[0151] The first judgment submodule is used to determine if any two word segments do not have a sentence construction connection relationship in all texts, and the two word segments are not word segments with the same semantic intent, then there is no hierarchical relationship between the semantic intents corresponding to the two word segments;
[0152] The same-level node setting submodule is used to set the semantic intents that do not have a hierarchical relationship at the same level in the multi-level intent hierarchy tree, as same-level nodes in the multi-level intent hierarchy tree;
[0153] The second judgment submodule is used to determine if any two word segments have a sentence construction connection relationship in the same text, and the two word segments are not word segments with the same semantic intent, then there is a hierarchical relationship between the semantic intents corresponding to the two word segments.
[0154] The hierarchical node setting submodule is used to set the semantic intents with hierarchical relationships at different levels of the multi-level intent hierarchy tree according to the hierarchical relationship, as hierarchical nodes in the multi-level intent hierarchy tree;
[0155] The inter-layer connection submodule is used to connect the layered nodes according to the hierarchical relationship until the connection is completed, thus completing the construction of the multi-level intent hierarchy tree in the current cycle.
[0156] In some specific embodiments of this application, the graph neural network model construction module 807 includes an adjacency matrix construction submodule, a degree matrix acquisition submodule, a weight value acquisition submodule, a word segmentation weight matrix construction submodule, and a graph neural network model construction submodule, wherein:
[0157] The adjacency matrix construction submodule is used to construct the adjacency matrix corresponding to each node except the root node based on each node in the multi-level intent hierarchy tree and the connection relationship between each node.
[0158] The degree matrix acquisition submodule is used to perform a summation operation on the adjacency matrix to obtain the degree matrix of the adjacency matrix;
[0159] The weight value acquisition submodule is used to calculate the weight value of each word in the training data set based on the word segmentation results of the labeled intent and the preset probability algorithm.
[0160] The word segmentation weight matrix construction submodule is used to construct an initialized word segmentation weight matrix based on the weight values of each word in the training data set.
[0161] The graph neural network model construction submodule is used to construct the graph neural network model according to the graph neural network algorithm formula: Complete the pre-construction of the graph neural network model.
[0162] In some specific embodiments of this application, the multi-level semantic intent recognition device 800 further includes a classifier construction module. The classifier construction module is used to filter out non-leaf nodes according to the connection relationship between nodes in the multi-level intent hierarchy tree, wherein the leaf node is a node that does not have a lower-level node. The module constructs a corresponding local classifier for each non-leaf node and gives the local classifier a distinguishing name. The distinguishing name can be obtained by directly using the semantic intent name corresponding to each non-leaf node as the distinguishing name.
[0163] This application obtains the text to be identified; inputs the text to be identified into a pre-trained word segmentation model for word segmentation processing, and uses the word segmentation result as the feature encoding of the text to be identified; inputs the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be identified. This application uses the word segmentation result of the ERNIE model to construct a multi-level intent hierarchy tree, and then constructs a graph neural network model through the multi-level intent hierarchy tree, which can effectively obtain the dependency information between multi-level semantic intents, making the prediction results more reasonable, and ultimately improving the overall accuracy of user multi-level intent recognition.
[0164] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0165] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0166] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 9 , Figure 9 This is a basic structural block diagram of the computer device in this embodiment.
[0167] The computer device 9 includes a memory 9a, a processor 9b, and a network interface 9c that are interconnected via a system bus. It should be noted that only the computer device 9 with components 9a-9c is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0168] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0169] The memory 9a includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 9a may be an internal storage unit of the computer device 9, such as the hard disk or memory of the computer device 9. In other embodiments, the memory 9a may also be an external storage device of the computer device 9, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 9. Of course, the memory 9a may include both the internal storage unit and its external storage device of the computer device 9. In this embodiment, the memory 9a is typically used to store the operating system and various application software installed on the computer device 9, such as computer-readable instructions for multi-level semantic intent recognition methods. In addition, the memory 9a can also be used to temporarily store various types of data that have been output or will be output.
[0170] In some embodiments, the processor 9b may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 9b is typically used to control the overall operation of the computer device 9. In this embodiment, the processor 9b is used to execute computer-readable instructions stored in the memory 9a or to process data, for example, to execute computer-readable instructions of the multi-level semantic intent recognition method.
[0171] The network interface 9c may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 9 and other electronic devices.
[0172] The computer device proposed in this embodiment belongs to the field of financial technology. This application acquires the text to be identified; inputs the text to be identified into a pre-trained word segmentation model for word segmentation processing, and uses the word segmentation result as the feature encoding of the text to be identified; inputs the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be identified. This application uses the ERNIE model word segmentation processing result to construct a multi-level intent hierarchy tree, and then constructs a graph neural network model through the multi-level intent hierarchy tree, which can effectively obtain the dependency information between multi-level semantic intents, making the prediction results more reasonable, and ultimately improving the overall accuracy of user multi-level intent recognition.
[0173] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by a processor to cause the processor to perform the steps of the multi-level semantic intent recognition method described above.
[0174] The computer-readable storage medium proposed in this embodiment belongs to the field of financial technology. This application acquires the text to be identified; inputs the text to be identified into a pre-trained word segmentation model for word segmentation processing, and uses the word segmentation result as the feature encoding of the text to be identified; inputs the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be identified. This application uses the ERNIE model word segmentation processing result to construct a multi-level intent hierarchy tree, and then constructs a graph neural network model through the multi-level intent hierarchy tree, which can effectively obtain the dependency information between multi-level semantic intents, making the prediction results more reasonable, and ultimately improving the overall accuracy of user multi-level intent recognition.
[0175] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0176] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A multi-level semantic intent recognition method, characterized in that, Includes the following steps: Step 201: Obtain the text to be recognized; Step 202: Input the text to be identified into the pre-trained word segmentation model, perform word segmentation processing, and use the word segmentation processing result as the feature encoding of the text to be identified; Step 203: Obtain a data training set, wherein the data training set consists of texts corresponding to the intent of each word segment in the labeled text, and the texts in the data training set are commonly used dialogue texts in insurance business; Step 204 involves inputting the training data set into the initialized graph neural network model to construct a multi-level intent hierarchy tree, specifically including: Obtain the intent-tagged word segments from all texts in the training set of the data; If any two word segments do not have a sentence construction connection relationship in all texts, and the two word segments are not word segments with the same semantic intent, then there is no hierarchical relationship between the semantic intents corresponding to the two word segments; The semantic intents that do not have a hierarchical relationship are set at the same level in the multi-level intent hierarchy tree, and are treated as nodes at the same level in the multi-level intent hierarchy tree; If any two word segments have a sentence construction connection relationship in the same text, and the two word segments are not word segments with the same semantic intent, then there is a hierarchical relationship between the semantic intents corresponding to the two word segments; The semantic intents that have a hierarchical relationship are set at different levels in the multi-level intent hierarchy tree according to the hierarchical relationship, and are used as hierarchical nodes in the multi-level intent hierarchy tree; The hierarchical nodes are connected to each other according to the hierarchical relationship until the connection is completed, thus completing the construction of the multi-level intent hierarchy tree for the current period; Step 205: Determine whether the number of nodes in the multi-level intent hierarchy tree is in a stable state according to preset judgment conditions; Step 206: If the number of nodes in the multi-level intent hierarchy tree is unstable, obtain a new data training set and repeat steps 204 and 205 to update the multi-level intent hierarchy tree. Step 207: If the number of nodes in the multi-level intent hierarchy tree is in a stable state, then the pre-construction of the graph neural network model is completed according to each node in the multi-level intent hierarchy tree and the connection relationship between each node. Step 208: Input the feature encoding into a pre-built graph neural network model to identify the multi-level semantic intent contained in the text to be identified.
2. The multi-level semantic intent recognition method according to claim 1, characterized in that, The step of pre-constructing the graph neural network model based on each node in the multi-level intent hierarchy tree and the connections between nodes specifically includes: Based on each node in the multi-level intent hierarchy tree and the connection relationships between each node, construct the adjacency matrix for each node other than the root node. The degree matrix of the adjacency matrix is obtained by summing the adjacency matrix. Based on the word segmentation results with labeled intents and the preset probability algorithm, the weight values of each word segmentation are calculated in the training set of the data. Based on the weight values of each word in the training set, an initial word segmentation weight matrix is constructed; According to the graph neural network algorithm formula: Complete the pre-construction of the graph neural network model, wherein, This is the output of this layer in a multi-layer graph neural network. It is a nonlinear mapping function. The total number of nodes. For the first The adjacency matrix of nodes, For the first The degree matrix of the adjacency matrix of each node. This is the word segmentation weight matrix after training through the layer preceding this layer in a multi-layer graph neural network. This represents the output of the layer preceding this layer in a multilayer graph neural network. This is the bias term after training the previous layer of the neural network in a multilayer graph neural network.
3. The multi-level semantic intent recognition method according to claim 1, characterized in that, The step of determining whether the number of nodes in the multi-level intent hierarchy tree is in a stable state according to preset judgment conditions specifically includes: The number of nodes in the multi-level intent hierarchy tree changes within the same construction cycle; If the number of nodes does not change before and after construction, then the number of nodes in the multi-level intent hierarchy tree is in a stable state. If the number of nodes changes before and after construction, the number of nodes in the multi-level intent hierarchy tree is not yet in a stable state.
4. The multi-level semantic intent recognition method according to claim 1, characterized in that, Before performing the step of pre-constructing the graph neural network model based on each node in the multi-level intent hierarchy tree and the connections between nodes, the method further includes: Based on the connection relationship between nodes in the multi-level intent hierarchy tree, non-leaf nodes are filtered out, wherein the leaf nodes are nodes that do not have any lower-level nodes; For each non-leaf node, a corresponding local classifier is constructed, and the local classifier is given a distinctive name. The distinctive naming method is to directly use the semantic intent name corresponding to each non-leaf node as the distinctive name.
5. The multi-level semantic intent recognition method according to claim 4, characterized in that, The step of inputting the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be identified specifically includes: The feature encoding is input into the pre-constructed graph neural network model to identify the local classifier corresponding to each word segmentation result in the feature encoding; Based on the local classifier, obtain the semantic intent corresponding to each word segmentation result in the feature encoding; Determine whether there are multiple semantic intents at the same level among the semantic intents corresponding to each word segmentation result in the feature encoding; If there are multiple sibling semantic intents, then a contrastive learning training method is used to construct positive and negative sample instances for the multiple sibling semantic intents respectively. The positive sample instance is constructed by randomly selecting several texts that are the same as the current semantic intent from the data training set as positive sample instances. The negative sample instance is constructed by identifying the node corresponding to the current semantic intent as a sibling node, and randomly selecting several texts corresponding to the semantic intent of the sibling node from the data training set as negative sample instances. Based on the contrastive learning loss function: Obtain the loss values corresponding to different semantic intents among the multiple sibling semantic intents, where, This represents the feature encoding of the text to be identified. The feature encoding representing a positive sample instance, The feature encoding representing negative sample instances, The method is a functional method for calculating the similarity between the feature codes of positive and negative sample instances and the feature codes of the text to be identified; The semantic intent corresponding to the minimum loss value is obtained and used as the final semantic intent of the multiple sibling semantic intents; The different levels of semantic intent corresponding to each word segmentation result in the feature encoding are obtained as the multi-level semantic intent contained in the text to be identified.
6. A multi-level semantic intent recognition device, characterized in that, include: The text acquisition module is used to acquire the text to be recognized. The feature encoding acquisition module is used to input the text to be recognized into a pre-trained word segmentation model, perform word segmentation processing, and use the word segmentation processing result as the feature encoding of the text to be recognized. The training set acquisition module is used to acquire a data training set, wherein the data training set consists of text corresponding to the intent of each word in the labeled text, and the text in the data training set is commonly used dialogue text in insurance business; A multi-level intent hierarchy tree construction module is used to input the data training set into an initialized graph neural network model to construct a multi-level intent hierarchy tree. This module includes a word segmentation acquisition submodule, a first judgment submodule, a same-level node setting submodule, a second judgment submodule, a layer node setting submodule, and an inter-layer connection submodule. The word segmentation acquisition submodule is used to acquire the intention-tagged words in all texts in the data training set; The first judgment submodule is used to determine if any two word segments do not have a sentence construction connection relationship in all texts, and the two word segments are not word segments with the same semantic intent, then there is no hierarchical relationship between the semantic intents corresponding to the two word segments; The same-level node setting submodule is used to set the semantic intents that do not have a hierarchical relationship at the same level in the multi-level intent hierarchy tree, as same-level nodes in the multi-level intent hierarchy tree; The second judgment submodule is used to determine if any two word segments have a sentence construction connection relationship in the same text, and the two word segments are not word segments with the same semantic intent, then there is a hierarchical relationship between the semantic intents corresponding to the two word segments. The hierarchical node setting submodule is used to set the semantic intents with hierarchical relationships at different levels of the multi-level intent hierarchy tree according to the hierarchical relationship, as hierarchical nodes in the multi-level intent hierarchy tree; The inter-layer connection submodule is used to connect the layered nodes according to the hierarchical relationship until the connection is completed, thus completing the construction of the multi-level intent hierarchy tree in the current cycle. The node stability judgment module is used to determine whether the number of nodes in the multi-level intent hierarchy tree is in a stable state according to preset judgment conditions. The multi-level intent hierarchy tree update module is used to obtain a new data training set and update the multi-level intent hierarchy tree if the number of nodes in the multi-level intent hierarchy tree is unstable. The graph neural network model construction module is used to pre-build the graph neural network model based on each node in the multi-level intent hierarchy tree and the connection relationship between each node if the number of nodes in the multi-level intent hierarchy tree is in a stable state. The semantic intent recognition module is used to input the feature encoding into a pre-constructed graph neural network model to identify the multi-level semantic intent contained in the text to be recognized.
7. The multi-level semantic intent recognition device according to claim 6, characterized in that, The graph neural network model construction module includes an adjacency matrix construction submodule, a degree matrix acquisition submodule, a weight value acquisition submodule, a word segmentation weight matrix construction submodule, and a graph neural network model construction submodule, wherein: The adjacency matrix construction submodule is used to construct the adjacency matrix corresponding to each node except the root node based on each node in the multi-level intent hierarchy tree and the connection relationship between each node. The degree matrix acquisition submodule is used to perform a summation operation on the adjacency matrix to obtain the degree matrix of the adjacency matrix; The weight value acquisition submodule is used to calculate the weight value of each word in the training data set based on the word segmentation results of the labeled intent and the preset probability algorithm. The word segmentation weight matrix construction submodule is used to construct an initialized word segmentation weight matrix based on the weight values of each word in the training data set. The graph neural network model construction submodule is used to construct the graph neural network model according to the graph neural network algorithm formula: Complete the pre-construction of the graph neural network model, wherein, This is the output of this layer in a multi-layer graph neural network. It is a nonlinear mapping function. The total number of nodes. For the first The adjacency matrix of nodes, For the first The degree matrix of the adjacency matrix of each node. This is the word segmentation weight matrix after training through the layer preceding this layer in a multi-layer graph neural network. This represents the output of the layer preceding this layer in a multilayer graph neural network. This is the bias term after training the previous layer of the neural network in a multilayer graph neural network.
8. A computer device comprising a memory and a processor, the memory storing computer-readable instructions, wherein the processor, when executing the computer-readable instructions, implements the steps of the multi-level semantic intent recognition method as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the multi-level semantic intent recognition method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data receiving method and device, data sending method and device, testing system and storage medium
CN108255727A
Semantic recognition method and device, computer equipment and storage medium
CN112149410A