User intention recognition method, device and equipment and computer readable storage medium
By combining the preset intent classification model and the intent knowledge graph, the problem of insufficient accuracy in intent recognition in existing technologies is solved, and efficient and accurate intent recognition under complex voice input is achieved.
Patent Information
- Application Number
- CN202011631344.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2040-12-30
AI Technical Summary
Existing intent recognition methods do not perform well when faced with less contextual input and large-scale training corpus, and are prone to intention recognition errors due to speech recognition errors, resulting in insufficient accuracy.
The text information of the voice data is obtained through the preset intent classification model, the output probability of multiple preset intent labels is calculated, and the conversation success rate of the intent nodes in the preset intent knowledge graph is combined to determine the conversation success rate of the candidate intent labels, and finally the user's target intent label is determined.
The accuracy and efficiency of intent recognition are improved, ensuring that the user's intent can be accurately identified when faced with complex voice input.
Smart Images

Figure CN112732882B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent decision-making technology, and in particular to a method, apparatus, device, and computer-readable storage medium for identifying user intent. Background Art
[0002] Dialogue systems are human-computer interaction systems based on natural language. Intent recognition is a crucial component of these systems. It converts the content of user conversations into a form that computers can understand. Recognizing intent directly influences whether the robot's next utterance is relevant to the user's expression and satisfies the user. Intent recognition primarily involves two components: intent detection and semantic slot extraction. Traditional intent recognition methods, ranging from Hidden Markov Models (HMMs), Conditional Random Fields (CRFs), and Support Vector Machines (SVMs), to the convolutional neural networks and recurrent neural networks that have become popular in the past decade, have all demonstrated promising experimental results. However, these models only achieve good results with limited contextual input and large-scale training data. Furthermore, traditional intent recognition relies on a classifier to select the intent with the highest probability as the final intent. In real-world applications, this approach can lead to misidentification of intent due to occasional speech recognition errors. Therefore, accurately determining the user's target intent based on speech data is a pressing issue. Summary of the Invention
[0003] The main purpose of this application is to provide a user intention recognition method, device, equipment and computer-readable storage medium, aiming to accurately determine the intention of the voice data input by the user.
[0004] In a first aspect, the present application provides a method for identifying user intent, comprising:
[0005] Obtaining text information corresponding to the voice data input by the user, and inputting the text information into a preset intent classification model to obtain output probabilities of multiple preset intent labels for representing the voice intent;
[0006] Determining a preset number of candidate intent labels from the plurality of preset intent labels according to the output probability of each of the preset intent labels;
[0007] Determine the conversation success rate for each intent node in a preset intent knowledge graph, where the preset intent knowledge graph is generated based on historical conversation data;
[0008] Determine the conversation success rate of each candidate intent tag according to the conversation success rate of each intent node;
[0009] The candidate intent tag with the highest dialogue success rate is determined as the intent tag of the voice data input by the user.
[0010] In a second aspect, the present application further provides a user intention recognition device, the user intention recognition device comprising an acquisition module, a generation module, a screening module, a first determination module, a second determination module, and a third determination module, wherein:
[0011] The acquisition module is used to acquire text information corresponding to the voice data input by the user;
[0012] The generation module is used to input the text information into a preset intent classification model to obtain output probabilities of multiple preset intent labels for representing speech intent;
[0013] The screening module is configured to determine a preset number of candidate intent labels from the plurality of preset intent labels according to the output probability of each of the preset intent labels;
[0014] The first determination module is used to determine the conversation success rate of each intent node in a preset intent knowledge graph, wherein the preset intent knowledge graph is generated based on historical conversation data;
[0015] The second determination module is used to determine the conversation success rate of each candidate intent tag according to the conversation success rate of each intent node;
[0016] The third determination module is used to determine the candidate intent tag with the highest dialogue success rate as the intent tag of the voice data input by the user.
[0017] In a third aspect, the present application also provides a computer device comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the user intent recognition method as described above are implemented.
[0018] In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the user intent recognition method as described above are implemented.
[0019] The present application provides a method, apparatus, device and computer-readable storage medium for identifying user intentions. The present application obtains text information corresponding to the voice data input by the user and inputs the text information into a preset intention classification model to obtain the output probabilities of multiple preset intention labels for representing the voice intention; then, based on the output probability of each preset intention label, a preset number of candidate intention labels are determined from the multiple preset intention labels; then, the conversation success rate of each intention node in the preset intention knowledge graph is determined; then, the conversation success rate of each candidate intention label is determined based on the conversation success rate of each intention node; and the candidate intention label with the highest conversation success rate is determined as the intention label for the voice data input by the user. The present method can obtain the output probabilities of multiple preset intention labels through the preset intention classification model. By combining the output probabilities of multiple preset intention labels and the conversation success rate of each intention node in the preset intention knowledge graph, the user's target intention label can be accurately determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 A schematic diagram of a process flow of a method for identifying user intent provided in an embodiment of the present application;
[0022] Figure 2 A schematic block diagram of a preset intent classification model provided in an embodiment of the present application;
[0023] Figure 3 for Figure 1 A flowchart of the sub-steps of the user intent recognition method in FIG.
[0024] Figure 4 A schematic diagram of a scenario of a preset intention knowledge graph provided in an embodiment of the present application;
[0025] Figure 5 A schematic block diagram of a user intention recognition device provided in an embodiment of the present application;
[0026] Figure 6 for Figure 5 A schematic block diagram of the submodules of the user intention recognition device in FIG.
[0027] Figure 7 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[0028] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0030] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0031] The present invention provides a method, apparatus, device, and computer-readable storage medium for identifying user intent. The method can be applied to a terminal device, such as a mobile phone, tablet computer, laptop computer, desktop computer, personal digital assistant, or wearable device.
[0032] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0033] Please refer to Figure 1 , Figure 1 A flowchart illustrating the steps of a method for identifying user intent provided in an embodiment of the present application.
[0034] like Figure 1 As shown, the user intention recognition method includes steps S101 to S105.
[0035] Step S101: Obtain text information corresponding to the voice data input by the user, and input the text information into a preset intent classification model to obtain output probabilities of multiple preset intent labels for representing the voice intent.
[0036] Among them, the preset intent classification model is a pre-trained model, which includes multiple neural network layers, and the neural network layer includes at least one of the following: vector extraction layer, time delay neural network layer, ReLU layer, residual network layer, summation layer, recurrent neural network layer, dropout layer and Solfmaxlayer layer.
[0037] Specifically, if Figure 2As shown, the text information corresponding to the voice data input by the user is obtained, the text information is input into the vector extraction layer to obtain multiple word vectors, the multiple word vectors are input into the time delay neural network layer to extract multiple word vector features, the multiple word vector features are input into the ReLU layer to process the multiple word vector features, reduce the gradient disappearance of the word vector features, and obtain a semantic label vector, the semantic label vector and the multiple word vectors are input into the sum layer to obtain multiple preliminary intention label vectors, the multiple preliminary intention label vectors are input into the recurrent neural network layer to obtain multiple candidate intention label vectors, the multiple candidate intention label vectors are input into the dropout layer to obtain multiple preset intention label vectors, the multiple intention label vectors are input into the Solfmaxlayer layer to obtain the output probability of the preset intention label.
[0038] It should be noted that the vector extraction layer can be selected according to actual conditions. For example, the vector extraction layer is a Word2Vec model, and the time-delay neural network layer and the ReLU layer also include a residual network layer. The residual network layer makes the parameter processing of the time-delay neural network layer and the ReLU layer more accurate. The dropout layer can prevent the candidate intent label vector from overfitting, thereby improving the accuracy of the output intent label vector.
[0039] The training method of the preset intent classification model can be: obtaining sample text information, labeling the sample text information according to the category identifier corresponding to the output probability of the preset intent label to construct sample data, and iteratively training the neural network model based on the sample data until the neural network model converges, thereby obtaining the preset intent classification model. The above-mentioned neural network models include convolutional neural network models, recurrent neural network models, and recurrent convolutional neural network models. Of course, other network models can also be used to train the preset intent classification model, and this application does not specifically limit this.
[0040] In one embodiment, text information corresponding to user-input voice data is obtained and fed into a pre-set intent classification model to obtain output probabilities for multiple pre-set intent labels. This pre-set intent classification model accurately and quickly determines the output probabilities for multiple pre-set intent labels, significantly improving the user experience.
[0041] In one embodiment, the text information corresponding to the voice data input by the user is obtained by obtaining the voice input by the user and inputting the voice into a preset voice recognition model to obtain the text information. The preset voice recognition model is a pre-trained neural network model, which is not specifically limited in this application. In other embodiments, the text information corresponding to the voice data transmitted by other devices is obtained to obtain the text information corresponding to the voice data input by the user. It is understood that there are other ways to obtain text information corresponding to user voice data, which are not specifically limited in this application.
[0042] Step S102: Determine a preset number of candidate intent tags from the plurality of preset intent tags according to the output probability of each of the preset intent tags.
[0043] Among them, the candidate intent label is the intent label whose intent is closer to the user's intent.
[0044] In one embodiment, a plurality of the preset intent tags are sorted from large to small according to the output probability to obtain an intent tag queue; the preset intent tags are selected from the intent tag queue in sequence until a preset number of candidate intent tags are obtained. The preset intent tags can be set according to actual conditions, and this application does not make specific restrictions on this. For example, the preset intent tags can be set to 5. By arranging the intent tag queue of the preset intent tags and then selecting the candidate intent tags according to the probability, the accuracy and efficiency of selecting the candidate intent tags can be improved.
[0045] For example, the output probability of preset intention label 1 is 10%, the output probability of preset intention label 2 is 20%, the output probability of preset intention label 3 is 5%, the output probability of preset intention label 4 is 12%, the output probability of preset intention label 5 is 7%, the output probability of preset intention label 6 is 18%, the output probability of preset intention label 7 is 25%, the output probability of preset intention label 8 is 14%, the output probability of preset intention label 9 is 4% and the output probability of preset intention label 10 is 28%. According to the probability of each preset intention label, the 10 intention labels are sorted from large to small, and the intention label queue is obtained as [preset intention label 10, preset intention label 7, preset intention label 2, preset intention label 6, preset intention label 8, preset intention label 4, preset intention label 1, preset intention label 5, preset intention label 3, preset intention label 9]. The number of preset intention labels is 5. The top 5 candidate intention labels are selected from the intention label queue, and the candidate intention labels are preset intention label 10, preset intention label 7, preset intention label 2, preset intention label 6 and preset intention label 8. By sorting the preset intent tags, candidate intent tags can be quickly selected.
[0046] Step S103: Determine the conversation success rate of each intent node in the preset intent knowledge graph, wherein the preset intent knowledge graph is generated based on historical conversation data.
[0047] Among them, the preset intention knowledge graph is generated based on historical conversation data. Specifically, all historical conversation data is collected, the historical conversation data is classified, and the related conversation data is associated to obtain the preset intention knowledge graph.
[0048] In one embodiment, a preset intent knowledge graph is obtained, where the preset intent knowledge graph is generated based on historical conversation data; and the success rate of the intent nodes corresponding to each intent node in the preset intent knowledge graph is used as the conversation success rate for each intent node. The preset intent knowledge graph can accurately determine the conversation success rate for each intent node.
[0049] In one embodiment, if Figure 3 As shown, step S103 includes sub-steps S1031 to S1034.
[0050] Sub-step S1031: obtain multiple flow paths for each intent node from the preset intent knowledge graph, and count the number of the multiple flow paths, wherein each flow path includes multiple intent nodes.
[0051] Among them, each flow path includes multiple intention nodes.
[0052] For example, Figure 4As shown, the preset intention knowledge graph includes intention node a, intention node b, intention node c, intention node d, intention node e, intention node f and intention node g, and the flow path of intention node a includes the flow path of intention node a connecting intention node b connecting intention node c, the flow path of intention node a connecting intention node b connecting intention node e connecting intention node f, the flow path of intention node a connecting intention node b connecting intention node e connecting intention node a, the flow path of intention node a connecting intention node b connecting intention node e connecting intention node g, the flow path of intention node a connecting intention node b connecting intention node e connecting intention node f and the flow path of intention node a connecting intention node b connecting intention node e connecting intention node f. Point d connects the flow path of intention node g, the flow path of intention node b includes the flow path of intention node b connecting intention node c, the flow path of intention node b connecting intention node e connecting intention node f, the flow path of intention node b connecting intention node e connecting intention node g, and the flow path of intention node b connecting intention node e connecting intention node a, the flow path of intention node e connecting intention node f, and the flow path of intention node e connecting intention node g, the flow path of intention node d includes the flow path of intention node connecting intention node g, and intention node c and intention node f have no flow paths.
[0053] For example, Figure 4 As shown, the number of paths in the flow path of intention node a is 5, the number of paths in the flow path of intention node b is 4, the number of paths in the flow path of intention node c is 0, the number of paths in the flow path of intention node d is 1, the number of paths in the flow path of intention node e is 3, the number of paths in the flow path of intention node f is 0, and the number of paths in the flow path of intention node g is 0.
[0054] Sub-step S1032: Determine the flow path with the attribute identifier of the last intention node as the preset attribute identifier as the successful flow path.
[0055] Among them, the attribute identifier of the intent node is a keyword set according to the actual situation, for example, time, place, event and other keywords.
[0056] In one embodiment, a flow path whose last intention node in the flow path has a preset attribute identifier is determined as a successful flow path. For example, if the preset attribute identifier is time, and the last intention node in the flow path has a time identifier, then the flow path is a successful flow path.
[0057] Sub-step S1033: Count the number of successful flow paths in the multiple flow paths of each intention node.
[0058] Specifically, the number of paths of multiple flow paths of each intent node is determined based on the preset intent knowledge graph.
[0059] For example, Figure 4 As shown, when the preset attribute identifier of the intent node is g, the number of the last intent node with the attribute identifier g in the multiple flow paths of each intent node is queried from the preset intent knowledge graph, wherein the number of the last intent node with the attribute identifier g in the multiple flow paths of intent node a is 2, the number of the last intent node with the attribute identifier g in the multiple flow paths of intent node b is 1, the number of the last intent node with the attribute identifier g in the multiple flow paths of intent node c is 0, the number of the last intent node with the attribute identifier g in the multiple flow paths of intent node d is 1, and the number of the last intent node with the attribute identifier g in the multiple flow paths of intent node e is 0. The number of attribute identifiers of the last intention node with g as the attribute identifier is 1, the number of attribute identifiers of the last intention node in multiple flow paths of intention node f is 0, and the number of attribute identifiers of the last intention node in multiple flow paths of intention node g is 1. Therefore, the number of successful flows of intention node a is 2 times, the number of successful flows of intention node b is 1 time, the number of successful flows of intention node c is 0 times, the number of successful flows of intention node d is 1 time, the number of successful flows of intention node e is 1 time, the number of successful flows of intention node f is 0 times, and the number of successful flows of intention node f is 1 time.
[0060] Sub-step S1034: Calculate the percentage of the number of successful flow paths in the multiple flow paths of each intention node to the total number of flow paths, and use the calculated percentage as the conversation success rate of each intention node.
[0061] In one embodiment, the percentage of successful flow times of each intent node to the corresponding number of paths is determined; the percentage of successful flow times of each intent node to the corresponding number of paths is determined as the conversation success rate of each intent node in the preset intent knowledge graph.
[0062] For example, the number of successful flows of intention node a is 2, the number of successful flows of intention node b is 1, the number of successful flows of intention node c is 0, the number of successful flows of intention node d is 1, the number of successful flows of intention node e1 is 2, the number of successful flows of intention node f is 0, the number of successful flows of intention node g is 0, the number of paths of the flow path of intention node a is 5, the number of paths of the flow path of intention node b is 4, the number of paths of the flow path of intention node c is 0, the number of paths of the flow path of intention node d is 1, the number of paths of the flow path of intention node e is 3, the number of paths of the flow path of intention node f is 0, and the number of paths of the flow path of intention node g is 0. It is obtained that the number of successful flows of intention node a accounts for 40% of the corresponding number of paths, and the number of successful flows of intention node b accounts for 2 of the corresponding number of paths. 5%, the number of successful transfers of intention node c accounts for 0% of the corresponding number of paths, the number of successful transfers of intention node d accounts for 100% of the corresponding number of paths, the number of successful transfers of intention node e accounts for 33.3% of the corresponding number of paths, the number of successful transfers of intention node f accounts for 0% of the corresponding number of paths, and the number of successful transfers of intention node g accounts for 100% of the corresponding number of paths. According to the number of successful transfers of intention nodes a, b, c, d, e, f and g accounting for the corresponding number of paths, the conversation success rate of intention node a is determined to be 40%, the conversation success rate of intention node b is determined to be 25%, the conversation success rate of intention node c is determined to be 0%, the conversation success rate of intention node d is determined to be 100%, the conversation success rate of intention node e is determined to be 33.3%, the conversation success rate of intention node f is determined to be 0%, and the conversation success rate of intention node g is determined to be 100%.
[0063] Step S104: Determine the conversation success rate of each candidate intent tag based on the conversation success rate of each intent node.
[0064] Among them, the success rate of the candidate intent tag is between 0 and 100%. The larger the candidate intent tag is, the higher the probability of successful dialogue of the candidate intent tag is.
[0065] In one embodiment, the conversation success rate of each intention node is mapped to the preset intention label corresponding to each intention node to obtain the conversation success rate of each preset intention label; the candidate intention label is mapped to the preset intention label, and the conversation success rate of the mapped preset intention label is used as the conversation success rate of the candidate intention label.
[0066] Step S105: Determine the candidate intent tag with the highest dialogue success rate as the intent tag of the voice data input by the user.
[0067] Among them, the target intent label is the intent label that is closest to the user's intent.
[0068] In one embodiment, multiple candidate intent tags are sorted based on their conversation success rate to create a candidate intent tag queue. From this candidate intent tag queue, the candidate intent tag with the highest conversation success rate is selected as the user's target intent tag. Sorting candidate intent tags by success rate and selecting the candidate intent tag with the highest success rate as the user's target intent tag greatly improves the accuracy of determining user intent.
[0069] For example, the conversation success rate of candidate intent label 1 is 50%, the conversation success rate of candidate intent label 2 is 25%, the conversation success rate of candidate intent label 3 is 15%, the conversation success rate of candidate intent label 4 is 60%, and the conversation success rate of candidate intent label 5 is 40%. Candidate intent label 1, candidate intent label 2, candidate intent label 3, candidate intent label 4 and candidate intent label 5 are sorted according to the candidate intent label conversation success rate, and the candidate intent label queue is [candidate intent label 4, candidate intent label 1, candidate intent label 5, candidate intent label 2, candidate intent label 3]. Candidate intent label 4 with the highest conversation success rate is selected from the candidate intent label queue as the user's target intent label.
[0070] The user intention recognition method provided by the above embodiment obtains the text information corresponding to the voice data input by the user, and inputs the text information into a preset intention classification model to obtain the output probabilities of multiple preset intention labels for representing the voice intention; then, based on the output probability of each preset intention label, a preset number of candidate intention labels are determined from the multiple preset intention labels; then, the conversation success rate of each intention node in the preset intention knowledge graph is determined; then, the conversation success rate of each candidate intention label is determined based on the conversation success rate of each intention node; and the candidate intention label with the highest conversation success rate is determined as the intention label for the voice data input by the user. This method can obtain the output probabilities of multiple preset intention labels through the preset intention classification model, and can accurately determine the user's target intention label by combining the output probabilities of multiple preset intention labels and the conversation success rate of each intention node in the preset intention knowledge graph.
[0071] See also Figure 5 , Figure 5 A schematic block diagram of a user intent recognition device provided in an embodiment of the present application.
[0072] like Figure 5 As shown, the user intention recognition device 200 includes an acquisition module 210, a generation module 220, a screening module 230, a first determination module 240, a second determination module 250 and a third determination module 260, wherein:
[0073] The acquisition module 210 is used to acquire text information corresponding to the voice data input by the user;
[0074] The generating module 220 is configured to input the text information into a preset intent classification model to obtain output probabilities of a plurality of preset intent labels for representing speech intent;
[0075] The screening module 230 is configured to determine a preset number of candidate intent tags from the plurality of preset intent tags based on the output probability of each preset intent tag;
[0076] The first determination module 240 is used to determine the conversation success rate of each intent node in the preset intent knowledge graph, wherein the preset intent knowledge graph is generated based on historical conversation data;
[0077] The second determination module 250 is used to determine the conversation success rate of each candidate intent tag according to the conversation success rate of each intent node;
[0078] The third determination module 260 is configured to determine the candidate intent tag with the highest dialogue success rate as the intent tag of the voice data input by the user.
[0079] In one embodiment, the screening module 230 is further configured to:
[0080] Sort the plurality of preset intent tags according to output probability from large to small to obtain an intent tag queue;
[0081] The preset intent tags are selected from the intent tag queue in sequence until a preset number of candidate intent tags are obtained.
[0082] In one embodiment, the first determining module 240 is further configured to:
[0083] Obtaining the preset intention knowledge graph;
[0084] The success rate of the intent nodes corresponding to each intent node in the preset intent knowledge graph is used as the conversation success rate of each intent node.
[0085] In one embodiment, if Figure 6 As shown, the first determination module 240 includes an acquisition submodule 241, a statistics module 242, a determination submodule 243 and a calculation module 244, wherein:
[0086] The acquisition submodule 241 is used to obtain multiple flow paths of each intent node from the preset intent knowledge graph;
[0087] The statistical module 242 is configured to count the number of the plurality of flow paths, wherein each flow path includes a plurality of intent nodes;
[0088] The determining submodule 243 is configured to determine the flow path with the attribute identifier of the last intention node being the preset attribute identifier as the flow successful path;
[0089] The statistical module 242 is further configured to count the number of successful flow paths among the multiple flow paths of each intention node;
[0090] The calculation module 244 is used to calculate the percentage of the number of successful flow paths in the multiple flow paths of each intention node to the total number of flow paths, and use the calculated percentage as the conversation success rate of each intention node.
[0091] In one embodiment, the second determining module 250 is further configured to:
[0092] Mapping the conversation success rate of each intention node with the preset intention label corresponding to each intention node to obtain the conversation success rate of each preset intention label;
[0093] The candidate intent tag is mapped to the preset intent tag, and the conversation success rate of the mapped preset intent tag is used as the conversation success rate of the candidate intent tag.
[0094] In one embodiment, the generating module 220 is further configured to:
[0095] Inputting the text information into the vector extraction layer to obtain multiple word vectors;
[0096] Inputting the plurality of word vectors into the time-delay neural network layer to extract a plurality of word vector features;
[0097] Inputting the plurality of word vector features into the ReLU layer to obtain a semantic label vector;
[0098] Inputting the semantic label vector and the multiple word vectors into the summing layer to obtain multiple preliminary intent label vectors;
[0099] Inputting the plurality of preliminary intent label vectors into the recurrent neural network layer to obtain a plurality of candidate intent label vectors;
[0100] Inputting the plurality of candidate intent label vectors into the dropout layer to obtain a plurality of preset intent label vectors;
[0101] Input the multiple intent label vectors into the Solfmaxlayer layer to obtain the output probability of the preset intent label.
[0102] The apparatus provided in the above embodiment can be implemented in the form of a computer program. The computer program can be used in Figure 7 Runs on the computer equipment shown.
[0103] See also Figure 7 , Figure 7 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[0104] like Figure 7 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0105] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, can cause the processor to perform any one of the user intention recognition methods.
[0106] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0107] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any user intention recognition method.
[0108] The network interface is used for communication. Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0109] It should be understood that the bus is, for example, an I2C (Inter-integrated Circuit) bus, the memory may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk, etc., and the processor may be a central processing unit (CPU), or the processor may also be 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. Among them, the general-purpose processor may be a microprocessor, or the processor may also be any conventional processor, etc.
[0110] In one embodiment, the processor is configured to execute a computer program stored in the memory to implement the following steps:
[0111] Obtaining text information corresponding to the voice data input by the user, and inputting the text information into a preset intent classification model to obtain output probabilities of multiple preset intent labels for representing the voice intent;
[0112] Determining a preset number of candidate intent labels from the plurality of preset intent labels according to the output probability of each of the preset intent labels;
[0113] Determine the conversation success rate for each intent node in a preset intent knowledge graph, where the preset intent knowledge graph is generated based on historical conversation data;
[0114] Determine the conversation success rate of each candidate intent tag according to the conversation success rate of each intent node;
[0115] The candidate intent tag with the highest dialogue success rate is determined as the intent tag of the voice data input by the user.
[0116] In one embodiment, when determining a preset number of candidate intent tags from a plurality of preset intent tags based on the output probability of each preset intent tag, the processor is configured to implement:
[0117] Sort the plurality of preset intent tags according to output probability from large to small to obtain an intent tag queue;
[0118] The preset intent tags are selected from the intent tag queue in sequence until a preset number of candidate intent tags are obtained.
[0119] In one embodiment, when determining the conversation success rate of each intent node in the preset intent knowledge graph, the processor is configured to implement:
[0120] Obtaining the preset intention knowledge graph;
[0121] The success rate of the intent nodes corresponding to each intent node in the preset intent knowledge graph is used as the conversation success rate of each intent node.
[0122] In one embodiment, when determining the conversation success rate of each intent node in the preset intent knowledge graph, the processor is configured to implement:
[0123] Obtaining multiple flow paths for each intent node from the preset intent knowledge graph, and counting the number of the multiple flow paths, wherein each flow path includes multiple intent nodes;
[0124] Determine the flow path with the attribute identifier of the last intention node as the preset attribute identifier as the successful flow path;
[0125] Counting the number of successful flow paths among the multiple flow paths of each of the intention nodes;
[0126] Calculate the percentage of the number of successful flow paths in the multiple flow paths of each intention node to the total number of flow paths, and use the calculated percentage as the conversation success rate of each intention node.
[0127] In one embodiment, when determining the conversation success rate of each candidate intent tag based on the conversation success rate of each intent node, the processor is configured to implement:
[0128] Mapping the conversation success rate of each intention node with the preset intention label corresponding to each intention node to obtain the conversation success rate of each preset intention label;
[0129] The candidate intent tag is mapped to the preset intent tag, and the conversation success rate of the mapped preset intent tag is used as the conversation success rate of the candidate intent tag.
[0130] In one embodiment, the processor implements the preset intent classification model including a vector extraction layer, a time delay neural network layer, a ReLU layer, a residual network layer, a summation layer, a recurrent neural network layer, a dropout layer, and a Solfmaxlayer layer; when the text information is input into the preset intent classification model to obtain the output probabilities of N preset intent labels, it is used to implement:
[0131] Inputting the text information into the vector extraction layer to obtain multiple word vectors;
[0132] Inputting the plurality of word vectors into the time-delay neural network layer to extract a plurality of word vector features;
[0133] Inputting the plurality of word vector features into the ReLU layer to obtain a semantic label vector;
[0134] Inputting the semantic label vector and the multiple word vectors into the summing layer to obtain multiple preliminary intent label vectors;
[0135] Inputting the plurality of preliminary intent label vectors into the recurrent neural network layer to obtain a plurality of candidate intent label vectors;
[0136] Inputting the plurality of candidate intent label vectors into the dropout layer to obtain a plurality of preset intent label vectors;
[0137] Input the multiple intent label vectors into the Solfmaxlayer layer to obtain the output probability of the preset intent label.
[0138] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the computer device described above can refer to the corresponding process in the aforementioned user intention recognition method embodiment, and will not be repeated here.
[0139] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the user intent recognition method of the present application.
[0140] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a flash memory card, etc., equipped on the computer device.
[0141] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0142] It should also be understood that the term "and / or" used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system that includes the element.
[0143] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments. The above description is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for identifying user intention, characterized in that: include: Obtaining text information corresponding to the voice data input by the user, and inputting the text information into a preset intent classification model to obtain output probabilities of multiple preset intent labels for representing the voice intent; Determining a preset number of candidate intent labels from the plurality of preset intent labels according to the output probability of each of the preset intent labels; Determine the conversation success rate for each intent node in a preset intent knowledge graph, where the preset intent knowledge graph is generated based on historical conversation data; Determine the conversation success rate of each candidate intent tag according to the conversation success rate of each intent node; Determining the candidate intent tag with the highest dialogue success rate as the intent tag of the voice data input by the user; Determining the conversation success rate of each intent node in the preset intent knowledge graph includes: Obtain multiple flow paths for each intent node from the preset intent knowledge graph, and count the number of the multiple flow paths, wherein each flow path includes multiple intent nodes; determine the flow path whose attribute identifier is the preset attribute identifier as the successful flow path; count the number of successful flow paths in the multiple flow paths of each intent node; calculate the percentage of the number of successful flow paths in the multiple flow paths of each intent node to the number of all flow paths, and use the calculated percentage as the conversation success rate of each intent node.
2. The user intention recognition method according to claim 1, wherein: The step of determining a preset number of candidate intent labels from the plurality of preset intent labels according to the output probability of each preset intent label includes: Sort the plurality of preset intent tags according to output probability from large to small to obtain an intent tag queue; The preset intent tags are selected from the intent tag queue in sequence until a preset number of candidate intent tags are obtained.
3. The method for identifying user intention according to any one of claims 1 to 2, wherein: Determining the conversation success rate of each candidate intent tag according to the conversation success rate of each intent node includes: Mapping the conversation success rate of each intention node with the preset intention label corresponding to each intention node to obtain the conversation success rate of each preset intention label; The candidate intent tag is mapped to the preset intent tag, and the conversation success rate of the mapped preset intent tag is used as the conversation success rate of the candidate intent tag.
4. The method for identifying user intention according to any one of claims 1 to 2, wherein: The preset intent classification model includes a vector extraction layer, a time-delay neural network layer, a ReLU layer, a residual network layer, a summation layer, a recurrent neural network layer, a dropout layer, and a Solfmax layer layer; the text information is input into the preset intent classification model to obtain output probabilities of multiple preset intent labels, including: Inputting the text information into the vector extraction layer to obtain multiple word vectors; Inputting the plurality of word vectors into the time-delay neural network layer to extract a plurality of word vector features; Inputting the plurality of word vector features into the ReLU layer to obtain a semantic label vector; Inputting the semantic label vector and the multiple word vectors into the summing layer to obtain multiple preliminary intent label vectors; Inputting the plurality of preliminary intent label vectors into the recurrent neural network layer to obtain a plurality of candidate intent label vectors; Inputting the plurality of candidate intent label vectors into the dropout layer to obtain a plurality of preset intent label vectors; Input the multiple intent label vectors into the Solfmaxlayer layer to obtain the output probability of the preset intent label.
5. A user intention recognition device, characterized in that: The user intention recognition device includes an acquisition module, a generation module, a screening module, a first determination module, a second determination module and a third determination module, wherein: The acquisition module is used to acquire text information corresponding to the voice data input by the user; The generation module is used to input the text information into a preset intent classification model to obtain output probabilities of multiple preset intent labels for representing speech intent; The screening module is configured to determine a preset number of candidate intent labels from the plurality of preset intent labels according to the output probability of each of the preset intent labels; The first determination module is configured to obtain multiple flow paths for each intent node from a preset intent knowledge graph and count the number of the multiple flow paths, wherein the preset intent knowledge graph is generated based on historical conversation data and each flow path includes multiple intent nodes; determine the flow path whose attribute identifier is the preset attribute identifier as the successful flow path; count the number of successful flow paths in the multiple flow paths of each intent node; calculate the percentage of the number of successful flow paths in the multiple flow paths of each intent node to the total number of flow paths, and use the calculated percentage as the conversation success rate of each intent node; The second determination module is used to determine the conversation success rate of each candidate intent tag according to the conversation success rate of each intent node; The third determination module is used to determine the candidate intent tag with the highest dialogue success rate as the intent tag of the voice data input by the user.
6. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the user intention recognition method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the user intention recognition method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Dialogue intention recognition method and device, electronic equipment and storage medium
CN111368085A
Automatic question and answer method, device and equipment based on knowledge graph, and storage medium
CN111949787A