Intention recognition method and device, computer equipment and storage medium
Through the combination of time series clustering algorithm and intention correlation network, combined with the pre-trained intention recognition model, the problem of intention change recognition and prediction in task-based dialogue systems is solved, and the accurate identification and prediction of user interaction behavior is achieved, which improves the User experience.
Patent Information
- Application Number
- CN202411554551.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-07
AI Technical Summary
In a task-based dialogue system, the prior art is difficult to accurately identify changes in intentions in user interaction behavior, and cannot effectively predict the user's subsequent intention direction.
The time series clustering algorithm is used to identify the intent changes in user interaction behavior data, build an intent association network for trend prediction, and fuse user dialogue characteristics and intent flow trend information through the pre-trained intent recognition model to obtain intent recognition results.
It realizes accurate identification and prediction of changes in intentions in user interaction behavior, and improves the user's experience when interacting with the system.
Smart Images

Figure CN119397241A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, specifically to the field of financial technology, and in particular to an intent recognition method, apparatus, computer equipment and storage medium. Background Art
[0002] In task-based dialogue systems, intent recognition is a critical and complex issue. During multiple rounds of interaction between users and the system, their intentions often change dynamically and have certain relevance and continuity. How to accurately capture the evolution of user intentions in complex and ever-changing dialogue scenarios is a technical problem that needs to be solved urgently.
[0003] Specifically, the user's conversational intention may change slightly as the interaction deepens, such as from consulting product information to purchasing intention, and then to after-sales service consultation. The boundaries of these intention conversions are often vague, requiring the system to be able to keenly perceive and respond in a timely manner. In addition, the intention change patterns of different users may also vary from person to person, which requires the intent recognition model to fully consider the user's historical interaction behavior and personal characteristics.
[0004] On the other hand, task-based dialogue systems also need to have the ability to predict intent, that is, to infer the possible subsequent intention direction of the user based on the user's current intention state. This requires the system to not only grasp the causal relationship of intent in the vertical time dimension, but also to summarize the general rules of intent migration between different users horizontally. How to ensure the accuracy of current intent recognition while taking into account the prediction of future intent is a technical contradiction that requires careful balance. Summary of the invention
[0005] The purpose of the embodiments of the present application is to propose an intent recognition method, apparatus, computer device and storage medium to solve the problem of being unable to effectively and accurately recognize the intent in user interaction behavior.
[0006] In order to solve the above technical problems, the present application provides an intention recognition method, which adopts the following technical solutions:
[0007] Obtain user interaction behavior data;
[0008] Based on a time series clustering algorithm, the user interaction behavior data is subjected to intention change identification to obtain intention change information;
[0009] Extracting association rules from the intention change information, and constructing an intention association network according to the extracted intention association rules;
[0010] Perform trend prediction based on the intention association network to obtain intention flow trend information;
[0011] Extracting user conversation features from the user interaction behavior data, and inputting the user conversation features and the intention flow trend information into a pre-trained first intention recognition model and a second intention recognition model to obtain a first intention recognition result and a second intention recognition result;
[0012] The first intent recognition result and the second intent recognition result are fused to obtain an intent recognition result.
[0013] Furthermore, the step of identifying intention changes on the user interaction behavior data based on a time series clustering algorithm to obtain intention change information specifically includes:
[0014] Dividing the user interaction behavior data into time periods to obtain a user behavior time series;
[0015] Preprocessing the user behavior time series, and extracting features from the preprocessed user behavior time series to obtain user behavior time series features;
[0016] Clustering the user behavior time series features based on a time series clustering algorithm to obtain user behavior clusters;
[0017] The user behavior clusters are subjected to an intention change pattern analysis to obtain the intention change information.
[0018] Furthermore, the step of extracting association rules from the intention change information and constructing an intention association network according to the extracted intention association rules specifically includes:
[0019] Parsing the intention change information to obtain an intention sequence and an intention conversion record;
[0020] Calculate the intent support, intent confidence, and intent promotion between different intents in the intent sequence and the intent conversion record based on an association rule mining algorithm;
[0021] Arranging initial intention association rules according to the intention support, the intention confidence, and the intention enhancement;
[0022] The initial intention association rules are screened according to a preset minimum support threshold and a preset minimum confidence threshold to obtain the intention association rules, and the intention association network is constructed according to the intention association rules.
[0023] Furthermore, the step of performing trend prediction based on the intention association network to obtain intention flow trend information specifically includes:
[0024] Based on the hidden Markov model, the transition probability between the intention nodes in the intention association network is learned to obtain the intention transition probability matrix;
[0025] Intention flow prediction is performed based on the intention transfer probability matrix to obtain the intention flow trend information.
[0026] Furthermore, the step of extracting user dialogue features from the user interaction behavior data, and inputting the user dialogue features and the intention flow trend information into the pre-trained first intention recognition model and the second intention recognition model to obtain the first intention recognition result and the second intention recognition result specifically includes:
[0027] Identifying user conversation data in the user interaction behavior data, and extracting the user conversation features from the user conversation data;
[0028] Inputting the user conversation features and the intention flow trend information into the first intention recognition model to perform context information fusion prediction to obtain the first intention recognition result;
[0029] The user conversation features and the intention flow trend information are input into the second intention recognition model to perform local semantic intent classification to obtain the second intention recognition result.
[0030] Furthermore, before the step of inputting the user conversation features and the intention flow trend information into the first intention recognition model for context information fusion prediction to obtain the first intention recognition result, the following steps are also included:
[0031] Get the intent label dataset;
[0032] Training the intent label data set based on a recurrent neural network to obtain a first initial intent recognition model;
[0033] The first initial intent recognition model is optimized according to the context perception unit to obtain the first intent recognition model.
[0034] Furthermore, before the step of inputting the user conversation features and the intention flow trend information into the second intention recognition model to perform local semantic intention classification to obtain the second intention recognition result, the following steps are also included:
[0035] Get the conversation text dataset;
[0036] Preprocessing the conversation text dataset to obtain a standard conversation text dataset;
[0037] The second initial intent recognition model is constructed by using the long short-term memory network as the top layer and the convolutional neural network as the bottom layer, and introducing the attention mechanism in the middle layer;
[0038] The second initial intent recognition model is trained according to the standard conversation text data set to obtain the second intent recognition model.
[0039] In order to solve the above technical problems, the embodiment of the present application further provides an intention recognition device, which adopts the following technical solution:
[0040] A data acquisition module is used to acquire user interaction behavior data;
[0041] A change identification module, used to identify intention changes of the user interaction behavior data based on a time series clustering algorithm to obtain intention change information;
[0042] A rule extraction module, used to extract association rules from the intention change information and construct an intention association network according to the extracted intention association rules;
[0043] A trend prediction module, used to perform trend prediction based on the intention association network to obtain intention flow trend information;
[0044] A model recognition module, used to extract user dialogue features from the user interaction behavior data, and input the user dialogue features and the intention flow trend information into a pre-trained first intention recognition model and a second intention recognition model to obtain a first intention recognition result and a second intention recognition result;
[0045] A result fusion module is used to fuse the first intent recognition result and the second intent recognition result to obtain an intent recognition result.
[0046] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0047] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the intent recognition method as described in any one of the above when executing the computer-readable instructions.
[0048] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0049] A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the steps of the intent recognition method as described in any one of the above items.
[0050] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments obtain user interaction behavior data; identify intention changes on the user interaction behavior data based on a time series clustering algorithm to obtain intention change information; extract association rules on the intention change information, and construct an intention association network based on the extracted intention association rules; perform trend prediction based on the intention association network to obtain intention flow trend information; extract user conversation features from the user interaction behavior data, and input the user conversation features and the intention flow trend information into the pre-trained first intention recognition model and the second intention recognition model to obtain the first intention recognition result and the second intention recognition result; fuse the first intention recognition result and the second intention recognition result to obtain the intention recognition result. This effectively realizes accurate recognition of the intention in the user interaction behavior to improve the user experience when interacting with the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. 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 paying any creative work.
[0052] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0053] Figure 2 A flowchart of an embodiment of the method for identifying intent according to the present application;
[0054] Figure 3 yes Figure 2 A flowchart of a specific implementation of step S20;
[0055] Figure 4 yes Figure 2 A flowchart of a specific implementation of step S30;
[0056] Figure 5 yes Figure 2 A flowchart of a specific implementation of step S40;
[0057] Figure 6 yes Figure 2 A flowchart of a specific implementation of step S50;
[0058] Figure 7 is a schematic structural diagram of an embodiment of an intention recognition device according to the present application;
[0059] Figure 8It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0061] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor does it refer to non-related or alternative embodiments that are mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0062] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0063] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0064] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0065] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0066] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0067] It should be noted that the intent recognition method provided in the embodiments of the present application is generally executed by a server / terminal device, and accordingly, the intent recognition device is generally arranged in the server / terminal device.
[0068] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0069] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for intention recognition according to the present application. The method for intention recognition comprises the following steps:
[0070] Step S10, obtaining user interaction behavior data;
[0071] In this embodiment, user interaction behavior data refers to the record of the user's interaction behavior with the system in different time periods. The user interaction behavior data includes user interaction dialogues and user interaction actions. The user interaction dialogue includes dialogue content: the specific text or voice content of the user input and the system response. Dialogue time: the timestamp of each dialogue, which helps to analyze the user's activity in different time periods. Dialogue rounds: the number of rounds of dialogue, which reflects the depth of the dialogue and the user's participation. Dialogue topic: the dialogue topic identified by natural language processing technology, which helps to understand the user's needs and interests. User interaction actions include action type: the specific type of operation performed by the user, such as clicking a button, sliding the screen, entering text, etc. Action object: the target element of the user's operation, such as a button, link, input box, etc. Action time: the timestamp of the user's operation, which helps to analyze the time distribution of user behavior. Action result: system feedback after the operation, such as page jump, data update, etc.
[0072] Step S20, identifying intention changes on the user interaction behavior data based on a time series clustering algorithm to obtain intention change information;
[0073] In this embodiment, the time series clustering algorithm can adopt time series dynamic time warping (DTW) clustering. The DTW algorithm is a method for calculating the similarity between two time series. It allows time series to be flexibly aligned on the time axis, so that it can handle time series of different lengths or with time offsets. The DTW algorithm finds an optimal path through dynamic programming so that the sum of the distances between the two time series on the path is minimized, thereby reflecting their similarity. Clustering is then performed based on the similarity, and finally the intent change information is obtained through intent change pattern analysis. The above intent change pattern analysis is to draw an intent change pattern diagram based on the intent changes of user behavior clusters in different time periods to obtain intent change information that effectively reflects the distribution of user behavior intention changes.
[0074] Step S30, extracting association rules from the intention change information, and constructing an intention association network according to the extracted intention association rules;
[0075] In this embodiment, the intent association rules are rules used to describe the association relationship between different intents, the intent association network is a graph structure used to visualize the intent association rules, and the association rule extraction of intent change information is based on the association rule mining algorithm. The association rule mining algorithm is used to discover the association relationship between different items in the data set. In this embodiment, the association rule mining algorithm can adopt the Apriori algorithm to generate frequent item sets through the Apriori algorithm, and then generate association rules from the frequent item sets, thereby realizing the extraction of intent association rules.
[0076] Step S40, performing trend prediction based on the intention association network to obtain intention flow trend information;
[0077] In this embodiment, the intention node transition probability learning of the intention association network is performed based on the hidden Markov model to realize the intention flow trend prediction. The hidden Markov model consists of the following elements: state set: the set of all possible states, usually expressed as Q, observation set: the set of all possible observations, usually expressed as V, initial state probability vector: represents the probability of being in each hidden state at the beginning of the model, usually expressed as π, state transition probability matrix: describes the probability of transitioning from one state to another, usually expressed as A, observation probability matrix (also called emission probability matrix): describes the probability of generating observations in a given state, usually expressed as B. The above elements are used to learn the transition probability between intention nodes in the intention association network.
[0078] Step S50, extracting user dialogue features from the user interaction behavior data, and inputting the user dialogue features and the intention flow trend information into a pre-trained first intention recognition model and a second intention recognition model to obtain a first intention recognition result and a second intention recognition result;
[0079] In this embodiment, the user dialogue features include dialogue vocabulary features, dialogue syntactic features, dialogue semantic features, dialogue structure features, user behavior features, context features, etc., wherein dialogue vocabulary features include vocabulary frequency, part of speech, stem, word form changes, etc., dialogue syntactic features include sentence length, sentence type (declarative sentence, interrogative sentence, exclamatory sentence, etc.), syntax tree, etc., dialogue semantic features include the topic, emotion, viewpoint, entity relationship, etc. in the dialogue, dialogue structure features include dialogue turn and turn content, dialogue role, etc., user behavior features include response time, interaction mode, etc., context features include dialogue background, dialogue environment, etc. The first intent recognition model can adopt a recurrent neural network model, and the second intent recognition model can adopt a hierarchical model combining a long short-term memory network (LSTM) and a convolutional neural network (CNN) and an attention mechanism, wherein the long short-term memory network (LSTM) is the top layer, the convolutional neural network (CNN) is the bottom layer, and the attention mechanism is the middle layer.
[0080] Step S60: fusing the first intent recognition result and the second intent recognition result to obtain an intent recognition result.
[0081] In this embodiment, the first intention recognition result and the second intention recognition result can be fused in a weighted fusion manner, by setting the first weight and the second weight corresponding to the first intention recognition result and the second intention recognition result, so as to weight the first intention recognition result and the second intention recognition result by their respective weights, and finally sum them up to obtain an intention recognition result that accurately reflects the user's intention. In this embodiment, the first weight and the second weight are both preset to 0.5, and can be adjusted accordingly according to actual conditions. After obtaining the intention recognition result, the time scale to which the user interaction behavior data belongs can also be determined based on the time dimension information in the intention recognition result; if the user interaction behavior data belongs to multiple time scales, the intention recognition results under multiple time scales are weighted fused to obtain the final multi-time scale intention recognition result.
[0082] This embodiment obtains user interaction behavior data; identifies intention changes on the user interaction behavior data based on a time series clustering algorithm to obtain intention change information; extracts association rules from the intention change information, and constructs an intention association network based on the extracted intention association rules; performs trend prediction based on the intention association network to obtain intention flow trend information; extracts user conversation features from the user interaction behavior data, and inputs the user conversation features and the intention flow trend information into a pre-trained first intention recognition model and a second intention recognition model to obtain a first intention recognition result and a second intention recognition result; and fuses the first intention recognition result and the second intention recognition result to obtain an intention recognition result. This effectively realizes accurate recognition of the intention in the user interaction behavior to improve the user experience when interacting with the system.
[0083] In this embodiment, the above-mentioned intention recognition method can be applied to a task-based dialogue system, which can be a dialogue question-answering robot in the financial insurance industry, and the dialogue question-answering robot is used to answer questions related to insurance business.
[0084] Continue to refer Figure 3 In some optional implementations of this embodiment, step S20 includes the following steps:
[0085] S201, dividing the user interaction behavior data into time periods to obtain a user behavior time series;
[0086] In this embodiment, the user interaction behavior data may be divided into time periods according to different time granularities such as hours, days, weeks, months or years to obtain user behavior time series of corresponding time granularities.
[0087] S202, preprocessing the user behavior time series, and extracting features from the preprocessed user behavior time series to obtain user behavior time series features;
[0088] In this embodiment, preprocessing includes data cleaning, data normalization / standardization, time alignment, etc. Data cleaning includes removing missing values, outlier processing, and data smoothing. Data normalization / standardization includes converting the user behavior time series into a unified scale. Methods such as minimum-maximum normalization and Z-score standardization can be used. Time alignment ensures that the user behavior time series is aligned in time, that is, the data at each time point is corresponding. The user behavior time series with mismatched time can be processed by time difference or time synchronization processing to ensure the time alignment of the user behavior time series.
[0089] S203, clustering the user behavior time series features based on a time series clustering algorithm to obtain user behavior clusters;
[0090] In this embodiment, the time series clustering algorithm adopts time series dynamic time warping (DTW) clustering, and the steps of applying the DTW algorithm to perform time series clustering include: constructing a distance matrix: calculating the DTW distance between all user behavior time series features and constructing a distance matrix. Selecting a clustering algorithm: based on the distance matrix, select a suitable clustering algorithm for clustering. Commonly used clustering algorithms include K-means, hierarchical clustering, DBSCAN, etc. However, it should be noted that since the DTW distance does not satisfy the triangle inequality, some traditional distance-based clustering algorithms (such as K-means) may not be directly applied to the DTW distance matrix. Therefore, it may be necessary to use a specific clustering algorithm or technique to process the DTW distance matrix, such as using the K-medoids algorithm or a hierarchical clustering method based on DTW. Execute clustering: According to the selected clustering algorithm and parameter settings, perform the clustering operation to obtain the result of user behavior clustering.
[0091] S204, performing intention change pattern analysis on the user behavior clustering to obtain the intention change information.
[0092] In this embodiment, the step of analyzing the intention change pattern includes time series trend analysis: performing trend analysis on the user behavior time series in each user behavior cluster to identify long-term trends, seasonal changes or periodic fluctuations. Behavioral pattern recognition: using pattern recognition technology (such as machine learning algorithms, rule mining, etc.) to identify common patterns or abnormal patterns in user behavior. Intent change detection: based on the recognition results of the behavioral pattern, detecting the change point of the user's intention can be achieved by comparing the behavioral patterns in different time periods and calculating the similarity or difference between the patterns. The user intention transfer path is identified in the above manner, and the user intention transfer path is the intention change information.
[0093] This embodiment obtains a user behavior time series by dividing the user interaction behavior data into time periods; preprocesses the user behavior time series and extracts features from the preprocessed user behavior time series to obtain user behavior time series features; clusters the user behavior time series features based on a time series clustering algorithm to obtain user behavior clusters; and performs intention change pattern analysis on the user behavior clusters, thereby effectively obtaining intention change information that characterizes the intention change of the interaction behavior in the user interaction behavior data, so as to facilitate subsequent extraction of association rules.
[0094] Continue to refer Figure 4 In some optional implementations of this embodiment, step S30 includes the following steps:
[0095] Step S301, parsing the intention change information to obtain an intention sequence and an intention conversion record;
[0096] In this embodiment, extracting the intent sequence is to parse the user's intent sequence from the intent change information, that is, the set of intents expressed by the user at different time points or time periods. The intent sequence may include the complete path from the user's initial intent to the final intent, and may also include the intermediate intent conversion points. The intent conversion record is the intent conversion event recorded in each intent sequence, including the intent before and after the conversion, the conversion time, the conversion frequency, etc.
[0097] Step S302, calculating the intent support, intent confidence, and intent promotion between different intents in the intent sequence and the intent conversion record based on an association rule mining algorithm;
[0098] In this embodiment, the association rule mining algorithm adopts the Apriori algorithm. The Apriori algorithm generates frequent item sets according to the intention sequence and the intention conversion record, and then the generated frequent item sets are split into two subsets A and B (precursor and backward). The intention support is calculated as follows: for each association rule A=>B, its support is equal to the proportion of the number of transactions containing both A and B to the total number of transactions, which can be obtained by calculating the support of the frequent item set {A,B}. The intention confidence is calculated as follows: for each association rule A=>B, its confidence is equal to the proportion of the number of transactions containing A and B to the number of transactions containing A, which can be obtained by calculating the support of {A,B} divided by the support of {A}. The intention lift is calculated as follows: for each association rule A=>B, its lift is equal to the confidence of A=>B divided by the probability of B appearing independently (i.e., the support of B). If the lift is greater than 1, it means that A has a positive impact on B; if it is equal to 1, it means that there is no association between A and B; if it is less than 1, it means that A has a negative impact on B.
[0099] Step S303, sorting out the initial intention association rules according to the intention support, the intention confidence, and the intention enhancement;
[0100] In this embodiment, the initial intention association rules for associating intentions are formed by recording the preceding intention, the succeeding intention, the intention support, the intention confidence, and the intention enhancement.
[0101] Step S304, screening the initial intent association rules according to a preset minimum support threshold and a preset minimum confidence threshold to obtain the intent association rules, and constructing the intent association network according to the intent association rules.
[0102] In this embodiment, the preset minimum support threshold and the preset minimum confidence threshold are preset values corresponding to the intent support and intent confidence settings, which are used to screen out intent association rules with sufficient importance and reliability. The intent association network is constructed by taking each intent as a node, the intent pairs in the intent association rules as edges in the network, and the intent confidence as the weight of the edge.
[0103] This embodiment parses the intention change information to obtain the intention sequence and intention conversion record; calculates the intention support, intention confidence, and intention enhancement between different intentions in the intention sequence and the intention conversion record based on the association rule mining algorithm; sorts out the initial intention association rules according to the intention support, the intention confidence, and the intention enhancement; screens the initial intention association rules according to the preset minimum support threshold and the preset minimum confidence threshold to obtain the intention association rules, and constructs the intention association network according to the intention association rules. This achieves effective and reliable intention association network construction to facilitate the subsequent prediction of intention flow trends.
[0104] Continue to refer Figure 5 In some optional implementations of this embodiment, step S40 includes the following steps:
[0105] Step S401, learning the transition probability between intention nodes in the intention association network based on the hidden Markov model to obtain an intention transition probability matrix;
[0106] In this embodiment, it is necessary to define a hidden Markov model first. The definition of the hidden Markov model includes: in the intention association network, each intention node is regarded as a hidden state in the HMM, and the transition between intentions is regarded as the transition between states. It is assumed that there is an initial state distribution (i.e., the probability distribution of the starting intention) and a state transition probability matrix (i.e., the intention transition probability matrix). The intention sequence data set corresponding to the intention nodes in the intention association network is input into the hidden Markov model to obtain the intention transition probability matrix that identifies the transition probability between intention nodes.
[0107] Step S402: perform intention flow prediction based on the intention transfer probability matrix to obtain the intention flow trend information.
[0108] In this embodiment, the intention flow prediction includes determining the initial intention: determining the current initial intention (i.e., the initial state of the HMM) based on the user's historical behavior. Predicting the intention flow: using the intention transition probability matrix, predicting the next possible intention (state) based on the current intention (state), the probability of each possible intention can be calculated based on the transition probability, and then the intention with the highest probability is selected as the prediction result. Generate intention flow trend information: based on the prediction results, generate intention flow trend information, which may include the probability distribution of intention flow, the most likely flow path, etc.
[0109] This embodiment obtains an intention transfer probability matrix by learning the transition probability between intention nodes in the intention association network based on the hidden Markov model; intention flow prediction is performed according to the intention transfer probability matrix, so as to effectively obtain intention flow trend information representing the intention change trend in user interaction behavior, so as to facilitate subsequent intention recognition processing.
[0110] Continue to refer Figure 6 In some optional implementations of this embodiment, step S50 includes the following steps:
[0111] Step S501, identifying user conversation data in the user interaction behavior data, and extracting the user conversation features from the user conversation data;
[0112] In this embodiment, before identifying the user conversation data in the user interaction behavior data, the user interaction behavior data needs to be preprocessed, and the preprocessing includes data cleaning, text conversion, text segmentation, and stop word removal. The identification of user conversation data includes conversation identification: based on information such as timestamps and speaker identification, identify which data belongs to the conversation content between users, and the boundaries of the conversation can be determined by analyzing the structure of the data, such as the time sequence of message sending and receiving, the alternation of speakers, etc. Conversation content extraction: extract specific conversation content from the identified conversation data, ensure that the extracted content is complete and accurate, and retain the context information of the conversation. User conversation features include conversation vocabulary features, conversation syntactic features, conversation semantic features, conversation structure features, user behavior features, context features, etc., and the BERT model can be used to extract user conversation features.
[0113] Step S502, inputting the user conversation features and the intention flow trend information into the first intention recognition model to perform context information fusion prediction to obtain the first intention recognition result;
[0114] In this embodiment, the identifier can be extracted by the first model to perform a matching query in the database to extract the first intent recognition model for prediction. The first intent recognition model uses a pre-trained recurrent neural network model, which uses the intent label data set as a training data set, and then uses the recurrent neural network as the basic architecture of the first intent recognition model. The attention mechanism is introduced into the recurrent neural network, and the recurrent neural network is trained by the training data set to obtain the first intent recognition model.
[0115] Step S503: Input the user conversation features and the intention flow trend information into the second intention recognition model to perform local semantic intent classification to obtain the second intention recognition result.
[0116] In this embodiment, the second model can be used to extract identifiers and perform matching queries in the database to extract the second intent recognition model for intent classification. The second intent recognition model is a hierarchical model, in which the top layer uses a long short-term memory network to capture long-term intent changes, the bottom layer uses a convolutional neural network to extract local features of the conversation, and the middle layer uses an attention mechanism to achieve the fusion of intents of different granularities, thereby effectively obtaining the second intent recognition result.
[0117] This embodiment identifies the user conversation data in the user interaction behavior data, extracts the user conversation features from the user conversation data; inputs the user conversation features and the intention flow trend information into the first intention recognition model for context information fusion prediction, and obtains the first intention recognition result; inputs the user conversation features and the intention flow trend information into the second intention recognition model for local semantic intent classification, and obtains the second intention recognition result. This effectively implements intent prediction for the user conversation features extracted from the user interaction behavior data and the corresponding intention flow trend information, and obtains the corresponding first intention recognition result and second intention recognition result, so as to facilitate the subsequent fusion of the intention recognition results and obtain the intention recognition result combining local semantics and global context.
[0118] In some optional implementations of this embodiment, before step S502, the following steps are further included:
[0119] Get the intent label dataset;
[0120] In this embodiment, the intent label data set includes user portraits and multi-dimensional feature data of conversation history, wherein the multi-dimensional feature data of conversation history includes multiple conversation texts and their conversation features, and each conversation text has corresponding intent notes and intent change trend information. The intent label data set can be obtained by matching query in the database through the intent data extraction identifier.
[0121] Training the intent label data set based on a recurrent neural network to obtain a first initial intent recognition model;
[0122] In this embodiment, the training steps of the first preliminary intent recognition model include: calculating the correlation between the hidden state and the final hidden state of each time step through the attention mechanism of the recurrent neural network to generate an attention weight distribution; performing weighted summation on the hidden state of each time step according to the attention weight distribution to obtain a context vector containing key feature information; concatenating the context vector with the final hidden state, and mapping them to the intent label space through a fully connected layer; using a cross entropy loss function to calculate the difference between the predicted intent label and the true label, and updating the parameters of the intent recognition model through a back propagation algorithm; repeating the training process until the performance indicator of the intent recognition model on the validation set reaches a preset threshold or reaches a preset maximum number of iterations, thereby obtaining a first preliminary intent recognition model.
[0123] The first initial intent recognition model is optimized according to the context perception unit to obtain the first intent recognition model.
[0124] In this embodiment, the step of optimizing the first initial intent recognition model includes: obtaining current dialogue state information of the dialogue text and determining the context environment of the dialogue; for the current dialogue state, obtaining a weight adjustment scheme for each dimensional feature from a pre-built feature weight adjustment strategy library; dynamically adjusting the weight value of each dimensional feature in the intent recognition model according to the feature weight adjustment scheme; extracting the most valuable key information for judging intent in the current dialogue state, and assigning a feature weight higher than a preset threshold; obtaining context information in the dialogue state, and further optimizing the weight of the key information through a context perception unit; inputting the features of each dimensionality after the weight is dynamically adjusted into the intent recognition model to obtain a context-enhanced intent recognition result; if the confidence of the intent recognition result is lower than the preset threshold, re-obtaining the dialogue state and iteratively optimizing the intent recognition process; if the confidence meets the requirements, outputting the final intent recognition result, and using the first initial intent recognition model that meets the confidence requirements as the first intent recognition model.
[0125] This embodiment obtains an intent label data set; trains the intent label data set based on a recurrent neural network to obtain a first initial intent recognition model; and optimizes the first initial intent recognition model according to a context perception unit to obtain the first intent recognition model. This effectively trains the first intent recognition model that can accurately integrate context information for intent prediction, so as to facilitate the acquisition of the first intent recognition result.
[0126] In some optional implementations of this embodiment, before step S503, the following steps are further included:
[0127] Get the conversation text dataset;
[0128] In this embodiment, the conversation text data set includes multiple conversation texts and their corresponding intention labels and intention change trend information. The conversation text data set can be obtained by performing a matching query in a database through conversation text extraction identifiers.
[0129] Preprocessing the conversation text dataset to obtain a standard conversation text dataset;
[0130] In this embodiment, preprocessing includes data cleaning (removing irrelevant information, spelling check and correction, format unification), text processing (word segmentation, removal of stop words, text normalization, special character processing), dialogue structure processing (turn division, topic transition detection, sentence segmentation), data set optimization (deduplication, data enhancement), etc.
[0131] The second initial intent recognition model is constructed by using the long short-term memory network as the top layer and the convolutional neural network as the bottom layer, and introducing the attention mechanism in the middle layer;
[0132] In this embodiment, the model architecture design of the second initial intent recognition model includes the bottom layer: a convolutional neural network (CNN), which includes an input layer: receiving the conversation text in the standard conversation text dataset, usually represented in the form of word embeddings. Convolution layer: applying multiple convolution kernels of different sizes to extract local features in the text. Pooling layer: using max pooling or average pooling to reduce the feature dimension while retaining important information. Middle layer: attention mechanism, which includes an attention layer: applying the attention mechanism on the features extracted by CNN to calculate the importance weight of each feature. This usually involves one or more fully connected layers, and a softmax function to normalize the weights. Weighted summation: according to the calculated weights, the features extracted by CNN are weighted summed to obtain a weighted feature representation. Top layer: long short-term memory network (LSTM), which includes an LSTM layer: receiving the weighted feature representation as input, and using the loop structure of LSTM to capture the temporal dependencies in the text. Output layer: A fully connected layer and a softmax function are applied on the output of the LSTM layer to predict the intent category of the standard conversation text dataset.
[0133] The second initial intent recognition model is trained according to the standard conversation text data set to obtain the second intent recognition model.
[0134] In this embodiment, the above model architecture is defined by using a deep learning framework (such as TensorFlow, PyTorch, etc.), and then the model parameters such as the convolution kernel size, the number of LSTM units, the number of fully connected layers in the attention mechanism, etc. are set to form a model definition. Then, by dividing the standard dialogue text data set into a training set, a validation set, and a test set, the training set is used to train the defined second initial intent recognition model, the validation set is used to monitor the model performance of the trained second initial intent recognition model, and the test set is used to test the second initial intent recognition model after the model performance is verified, so as to obtain indicators such as accuracy, recall rate, and F1 score, and then the model architecture is adjusted and optimized according to indicators such as accuracy, recall rate, and F1 score, so as to obtain a second intent recognition model that can effectively classify intent.
[0135] This embodiment obtains a dialogue text dataset; preprocesses the dialogue text dataset to obtain a standard dialogue text dataset; uses a long short-term memory network as the top layer, a convolutional neural network as the bottom layer, and introduces an attention mechanism in the middle layer to construct a second initial intent recognition model; trains the second initial intent recognition model according to the standard dialogue text dataset, thereby effectively obtaining a second intent recognition model that performs local semantic intent classification at the levels of different language units such as vocabulary, phrases, and sentences, so as to facilitate the acquisition of the second intent recognition result.
[0136] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the 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 above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0137] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0138] Further references Figure 7 , as a response to the above Figure 1 The present application provides an embodiment of an intention recognition device, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0139] like Figure 7 As shown, the intention recognition device 700 described in this embodiment includes: a data acquisition module 701, a change recognition module 702, a rule extraction module 703, a trend prediction module 704, a model recognition module 705, and a result fusion module 706. Among them:
[0140] Data acquisition module 701, used to acquire user interaction behavior data;
[0141] A change identification module 702 is used to identify intention changes of the user interaction behavior data based on a time series clustering algorithm to obtain intention change information;
[0142] A rule extraction module 703 is used to extract association rules from the intention change information and construct an intention association network according to the extracted intention association rules;
[0143] A trend prediction module 704 is used to perform trend prediction based on the intention association network to obtain intention flow trend information;
[0144] A model recognition module 705 is used to extract user dialogue features from the user interaction behavior data, and input the user dialogue features and the intention flow trend information into a pre-trained first intention recognition model and a second intention recognition model to obtain a first intention recognition result and a second intention recognition result;
[0145] The result fusion module 706 is used to fuse the first intent recognition result and the second intent recognition result to obtain an intent recognition result.
[0146] This embodiment can obtain user interaction behavior data by adopting the above-mentioned intention recognition device; recognize the intention change of the user interaction behavior data based on the time series clustering algorithm to obtain the intention change information; extract the association rules of the intention change information, and build the intention association network according to the extracted intention association rules; perform trend prediction based on the intention association network to obtain the intention flow trend information; extract user dialogue features from the user interaction behavior data, and input the user dialogue features and the intention flow trend information into the pre-trained first intention recognition model and the second intention recognition model to obtain the first intention recognition result and the second intention recognition result; fuse the first intention recognition result and the second intention recognition result to obtain the intention recognition result. This effectively realizes the accurate recognition of the intention in the user interaction behavior to improve the user experience when interacting with the system.
[0147] To solve the above technical problems, the present application also provides a computer device. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.
[0148] The computer device 8 includes a memory 81, a processor 82, and a network interface 83 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 8 with components 81-83, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform 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 (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0149] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0150] The memory 81 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), 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, disk, optical disk, etc. In some embodiments, the memory 81 can be an internal storage unit of the computer device 8, such as a hard disk or memory of the computer device 8. In other embodiments, the memory 81 can also be an external storage device of the computer device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 8. Of course, the memory 81 can also include both the internal storage unit of the computer device 8 and its external storage device. In this embodiment, the memory 81 is generally used to store the operating system and various application software installed on the computer device 8, such as computer-readable instructions of the intention recognition method, etc. In addition, the memory 81 can also be used to temporarily store various types of data that have been output or are to be output.
[0151] The processor 82 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 82 is generally used to control the overall operation of the computer device 8. In this embodiment, the processor 82 is used to run computer-readable instructions or process data stored in the memory 81, such as computer-readable instructions for running the intention recognition method.
[0152] The network interface 83 may include a wireless network interface or a wired network interface. The network interface 83 is generally used to establish a communication connection between the computer device 8 and other electronic devices.
[0153] By adopting the above-mentioned computer device, this embodiment can obtain user interaction behavior data; identify intention changes on the user interaction behavior data based on the time series clustering algorithm to obtain intention change information; extract association rules from the intention change information, and build an intention association network based on the extracted intention association rules; perform trend prediction based on the intention association network to obtain intention flow trend information; extract user conversation features from the user interaction behavior data, and input the user conversation features and the intention flow trend information into the pre-trained first intention recognition model and the second intention recognition model to obtain the first intention recognition result and the second intention recognition result; fuse the first intention recognition result and the second intention recognition result to obtain the intention recognition result. This effectively realizes accurate recognition of the intention in the user interaction behavior to improve the user experience when interacting with the system.
[0154] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the intention recognition method as described above.
[0155] This embodiment can obtain user interaction behavior data by using the above-mentioned computer-readable storage medium; identify intention changes on the user interaction behavior data based on a time series clustering algorithm to obtain intention change information; extract association rules on the intention change information, and build an intention association network based on the extracted intention association rules; perform trend prediction based on the intention association network to obtain intention flow trend information; extract user conversation features from the user interaction behavior data, and input the user conversation features and the intention flow trend information into the pre-trained first intention recognition model and the second intention recognition model to obtain the first intention recognition result and the second intention recognition result; fuse the first intention recognition result and the second intention recognition result to obtain the intention recognition result. This effectively realizes accurate recognition of the intention in the user interaction behavior to improve the user experience when interacting with the system.
[0156] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0157] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for intention recognition, characterized in that: The steps include: Obtain user interaction behavior data; Identifying intention changes on the user interaction behavior data based on a time series clustering algorithm to obtain intention change information; Extracting association rules from the intention change information, and constructing an intention association network according to the extracted intention association rules; Perform trend prediction based on the intention association network to obtain intention flow trend information; Extracting user conversation features from the user interaction behavior data, and inputting the user conversation features and the intention flow trend information into a pre-trained first intention recognition model and a second intention recognition model to obtain a first intention recognition result and a second intention recognition result; The first intent recognition result and the second intent recognition result are fused to obtain an intent recognition result.
2. The method for intention recognition according to claim 1, characterized in that: The step of identifying intention changes on the user interaction behavior data based on a time series clustering algorithm to obtain intention change information specifically includes: Dividing the user interaction behavior data into time periods to obtain a user behavior time series; Preprocessing the user behavior time series, and extracting features from the preprocessed user behavior time series to obtain user behavior time series features; Clustering the user behavior time series features based on a time series clustering algorithm to obtain user behavior clusters; The user behavior clusters are subjected to an intention change pattern analysis to obtain the intention change information.
3. The method for identifying intention according to claim 1, characterized in that: The step of extracting association rules from the intention change information and constructing an intention association network according to the extracted intention association rules specifically includes: Parsing the intention change information to obtain an intention sequence and an intention conversion record; Calculate the intent support, intent confidence, and intent promotion between different intents in the intent sequence and the intent conversion record based on an association rule mining algorithm; Arranging initial intention association rules according to the intention support, the intention confidence, and the intention enhancement; The initial intention association rules are screened according to a preset minimum support threshold and a preset minimum confidence threshold to obtain the intention association rules, and the intention association network is constructed according to the intention association rules.
4. The method for identifying intention according to claim 1, characterized in that: The step of performing trend prediction based on the intention association network to obtain intention flow trend information specifically includes: Based on the hidden Markov model, the transition probability between the intention nodes in the intention association network is learned to obtain the intention transition probability matrix; Intention flow prediction is performed based on the intention transfer probability matrix to obtain the intention flow trend information.
5. The method for intention recognition according to claim 1, characterized in that: The step of extracting user dialogue features from the user interaction behavior data, and inputting the user dialogue features and the intention flow trend information into the pre-trained first intention recognition model and the second intention recognition model to obtain the first intention recognition result and the second intention recognition result specifically includes: Identifying user conversation data in the user interaction behavior data, and extracting the user conversation features from the user conversation data; Inputting the user conversation features and the intention flow trend information into the first intention recognition model to perform context information fusion prediction to obtain the first intention recognition result; The user conversation features and the intention flow trend information are input into the second intention recognition model to perform local semantic intent classification to obtain the second intention recognition result.
6. The method for intention recognition according to claim 5, characterized in that: Before the step of inputting the user conversation features and the intention flow trend information into the first intention recognition model for context information fusion prediction to obtain the first intention recognition result, the following steps are also included: Get the intent label dataset; Training the intent label data set based on a recurrent neural network to obtain a first initial intent recognition model; The first initial intent recognition model is optimized according to the context perception unit to obtain the first intent recognition model.
7. The method for identifying intention according to claim 5, characterized in that: Before the step of inputting the user conversation features and the intention flow trend information into the second intention recognition model to perform local semantic intention classification to obtain the second intention recognition result, the following steps are also included: Get the conversation text dataset; Preprocessing the conversation text dataset to obtain a standard conversation text dataset; The second initial intent recognition model is constructed by using the long short-term memory network as the top layer and the convolutional neural network as the bottom layer, and introducing the attention mechanism in the middle layer; The second initial intent recognition model is trained according to the standard conversation text data set to obtain the second intent recognition model.
8. An intention recognition device, characterized in that: include: A data acquisition module is used to acquire user interaction behavior data; A change identification module, used to identify intention changes of the user interaction behavior data based on a time series clustering algorithm to obtain intention change information; A rule extraction module, used to extract association rules from the intention change information and construct an intention association network according to the extracted intention association rules; A trend prediction module, used to perform trend prediction based on the intention association network to obtain intention flow trend information; A model recognition module, used to extract user dialogue features from the user interaction behavior data, and input the user dialogue features and the intention flow trend information into a pre-trained first intention recognition model and a second intention recognition model to obtain a first intention recognition result and a second intention recognition result; A result fusion module is used to fuse the first intent recognition result and the second intent recognition result to obtain an intent recognition result.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the intention recognition method as described in any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the intent recognition method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Data center intelligent monitoring method and system
CN121333690A
Visual communication design element presentation mode self-adaptive adjustment method based on user behavior data
CN122240930A