Intention recognition method and device based on hidden factor attention mechanism, equipment and medium

The intent recognition method based on latent factor attention mechanism improves the accuracy of intent recognition by utilizing vector transformation and attention model, solving the problem of low intent recognition performance in the field of traditional Chinese medicine and achieving more efficient understanding of user intent.

CN116431811BActive Publication Date: 2026-04-17PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2023-04-12
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing intent recognition technologies have low recognition efficiency in the field of traditional Chinese medicine, failing to accurately understand the patient's intentions and resulting in inaccurate recognition.

Method used

An intent recognition method based on latent factor attention mechanism is adopted, which improves the accuracy of intent recognition through vector transformation, decomposition, feature encoding and weighted averaging of attention model.

Benefits of technology

It improves the accuracy of intent recognition, enables a better understanding of the intent in user corpora, and enhances the performance of multi-intent recognition tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116431811B_ABST
    Figure CN116431811B_ABST
Patent Text Reader

Abstract

This invention relates to artificial intelligence technology and discloses an intent recognition method based on a latent factor attention mechanism, comprising: vector transformation of user corpus; decomposition of the corpus vectors to obtain latent factor vectors and a first corpus vector; encoding the first corpus vectors to obtain a vector space, and extracting feature vectors from the vector space; inputting the latent factor vectors and feature vectors into an attention model to obtain attention weights, and performing a weighted average of the feature vectors and attention weights to obtain a weighted average vector; inputting the weighted average vector into an intent classifier to obtain an intent recognition probability, and determining the weighted average vector whose intent recognition probability is greater than or equal to a threshold as the intent corresponding to the user corpus. Furthermore, this invention also relates to blockchain technology, where user corpus can be stored on blockchain nodes. This invention also proposes an intent recognition device, apparatus, and medium based on a latent factor attention mechanism. This invention can improve the effectiveness of intent recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to an intent recognition method, apparatus, electronic device, and computer-readable storage medium based on latent factor attention mechanism. Background Technology

[0002] With the development of artificial intelligence, machine learning technology is being successfully applied in more and more scenarios in the field of traditional Chinese medicine, such as telemedicine, intelligent diagnosis, and robotic consultation. However, in order to accurately identify user intent and improve the effectiveness of user intent recognition, it is necessary to identify user intent based on user corpus in order to respond to user intent.

[0003] Existing intent recognition technologies mostly utilize multi-classification methods, where each intent corresponds to a binary classifier to categorize user intents and thus achieve intent recognition. For example, in the field of smart TCM, during patient interaction with the intelligent system, it is necessary to correctly understand the patient's speaking intent. In practical applications, different intents are more relevant to specific words in a sentence than to other words. Treating all words in a sentence equally may lead to inaccurate intent recognition, resulting in low accuracy in identifying user intent. Summary of the Invention

[0004] This invention provides an intent recognition method, apparatus, and computer-readable storage medium based on latent factor attention mechanism, the main purpose of which is to solve the problem of low recognition performance when performing intent recognition.

[0005] To achieve the above objectives, the present invention provides an intent recognition method based on latent factor attention mechanism, comprising:

[0006] Obtain a preset user corpus, and perform vector transformation on the user corpus to obtain a corpus vector;

[0007] The corpus vectors are decomposed to obtain latent factor vectors and the first corpus vector;

[0008] The first corpus vector is feature-encoded using a preset deep network to obtain a corpus vector space, and the feature vector corresponding to the first corpus vector in the corpus vector space is extracted.

[0009] The latent factor vector and the feature vector are input into a preset attention model to obtain attention weights. The feature vector and the attention weights are then weighted and averaged to obtain a weighted average vector.

[0010] The weighted average vector is input into a preset intent classifier to obtain the intent recognition probability. The weighted average vector with the intent recognition probability greater than or equal to a preset threshold is determined as the intent corresponding to the user corpus.

[0011] Optionally, the step of decomposing the corpus vector to obtain the latent factor vector and the first corpus vector includes:

[0012] Obtain the vector matrix corresponding to the corpus vector;

[0013] Perform matrix decomposition on the vector matrix to obtain a first matrix and a second matrix;

[0014] The first matrix is ​​adjusted using a preset root mean square error to obtain a first optimal matrix, and the second matrix is ​​adjusted using the root mean square error to obtain a second optimal matrix;

[0015] The vector corresponding to the first optimal matrix is ​​used as the latent factor vector, and the vector corresponding to the second optimal matrix is ​​used as the first corpus vector.

[0016] Optionally, the step of using a preset deep network to perform feature encoding on the first corpus vector to obtain the corpus vector space includes:

[0017] The first corpus vectors are selected one by one and input into the hidden layer of the deep network for feature encoding to obtain the encoded vector;

[0018] The encoded vector output from the top layer of the deep network is used as the output vector corresponding to the first corpus vector;

[0019] The output vectors are aggregated into a corpus vector space.

[0020] Optionally, the step of inputting the latent factor vector and the feature vector into a preset attention model to obtain attention weights includes:

[0021] The attention weights are calculated using the attention model based on the latent factor vector and the feature vector:

[0022] (a1,a2,a3,…,a n )=softmax(v*h1,v*h2,v*h3,…,v*h n )

[0023] Where v represents the latent factor vector, h n a represents the feature vector output by the top layer of the deep network after passing through the nth first semantic vector in the sentence. n This represents the normalized attention weight corresponding to the nth first semantic vector.

[0024] Optionally, the step of taking a weighted average of the feature vector and the attention weights to obtain a weighted average vector includes:

[0025] The weighted average vector is obtained by averaging the corpus feature encoding vector and the attention weight using the following weighted average formula:

[0026] V s = a1*h1 + a2*h2 + ... + a n *h n

[0027] Among them, V s Let a be the weighted average vector. n h represents the normalized attention weight corresponding to the nth first semantic vector. n This represents the feature vector output by the top layer of the deep network for the nth first semantic vector.

[0028] Optionally, inputting the weighted average vector into a preset intent classifier to obtain the intent recognition probability includes:

[0029] The weighted average vector is input into the intent classifier for classification to obtain the intent distribution;

[0030] The intent recognition probability is determined based on the intent distribution.

[0031] Optionally, determining the intent recognition probability based on the intent distribution includes:

[0032] Extract the intent semantics from the intent distribution;

[0033] Calculate the matching degree between the stated intent semantics and the intent semantics in a preset intent database;

[0034] The matching degree is used as the probability of intent recognition.

[0035] To address the above problems, the present invention also provides an intent recognition device based on a latent factor attention mechanism, the device comprising:

[0036] The corpus vector conversion module is used to acquire a preset user corpus, perform vector conversion on the user corpus, and obtain a corpus vector.

[0037] The corpus vector decomposition module is used to decompose the corpus vector to obtain the latent factor vector and the first corpus vector;

[0038] The vector encoding module is used to perform feature encoding on the first corpus vector using a preset deep network to obtain a corpus vector space, and extract the feature vector corresponding to the first corpus vector in the corpus vector space.

[0039] The weighted average vector calculation module is used to input the latent factor vector and the feature vector into a preset attention model to obtain attention weights, and to perform a weighted average of the feature vector and the attention weights to obtain a weighted average vector.

[0040] The user intent determination module is used to input the weighted average vector into a preset intent classifier to obtain the intent recognition probability, and to determine the weighted average vector whose intent recognition probability is greater than or equal to a preset threshold as the intent corresponding to the user corpus.

[0041] The second recommendation module is used to recommend the product to be recommended to the second target user group.

[0042] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:

[0043] At least one processor; and,

[0044] A memory communicatively connected to the at least one processor; wherein,

[0045] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the intent recognition method based on latent factor attention mechanism described above.

[0046] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the aforementioned intent recognition method based on latent factor attention mechanism.

[0047] This invention, through vector transformation of user corpora, yields corpus vectors. The corpus is then decomposed to obtain latent factor vectors and a first corpus vector. Attention is calculated using the latent factor vectors, causing the intent classifier to focus on highly relevant words. The first corpus vector is input into a deep network for feature encoding, resulting in a corpus vector space, thus achieving a low-dimensional to high-dimensional vector transformation. The latent factor vectors and feature vectors are input into an attention model to obtain attention weights. A weighted average of the attention weights and feature vectors helps identify keywords with higher weights in the user's semantics. Based on the intent classifier, the intent recognition probability is obtained. The intent recognition probability is used to determine whether the original user's semantics contain the corresponding intent, thereby improving the performance of multi-intent recognition tasks. Therefore, the intent recognition method, device, electronic device, and computer-readable storage medium based on the latent factor attention mechanism proposed in this invention can solve the problem of low recognition performance during intent recognition. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating an intent recognition method based on latent factor attention mechanism according to an embodiment of the present invention.

[0049] Figure 2 This is a schematic diagram of the process of decomposing corpus vectors according to an embodiment of the present invention;

[0050] Figure 3 A schematic diagram of the process for encoding a first corpus vector according to an embodiment of the present invention;

[0051] Figure 4 This is a functional block diagram of an intent recognition device based on latent factor attention mechanism provided in an embodiment of the present invention;

[0052] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the intent recognition method based on latent factor attention mechanism according to an embodiment of the present invention.

[0053] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0054] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0055] This application provides an intent recognition method based on latent factor attention mechanism. The execution subject of the latent factor attention mechanism-based intent recognition method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the latent factor attention mechanism-based intent recognition method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0056] Reference Figure 1 The diagram shown is a flowchart illustrating an intent recognition method based on a latent factor attention mechanism according to an embodiment of the present invention. In this embodiment, the intent recognition method based on a latent factor attention mechanism includes:

[0057] S1. Obtain a preset user corpus, and perform vector transformation on the user corpus to obtain a corpus vector;

[0058] In this embodiment of the invention, the user corpus refers to what the user says or the user asks questions. For example, in the field of smart TCM, robot-assisted diagnosis is a common business scenario. The robot collects patient information by talking to the patient, replacing human experts. For example, if the user asks, "How should I take this medicine? Will taking too much of it harm my body?", it is necessary to first obtain the user's question, i.e., the user corpus, and then identify the user's intent so that the intelligent robot can accurately answer the user's question.

[0059] Specifically, user corpora can be retrieved from a pre-determined storage area using computer statements (such as Java statements, Python statements, etc.) that have data retrieval capabilities. The storage area includes, but is not limited to, databases, blockchain nodes, and network caches.

[0060] In this embodiment of the invention, the user corpus can be vectorized using a preset vector conversion model to obtain corpus vectors. The vector conversion model includes, but is not limited to, the word2vec model and the Bert model.

[0061] In detail, the user corpus is vectorized, that is, the entire sentence and its semantic information corresponding to the corpus are represented as vectors, enabling the machine to understand the context, intent, and other subtle differences hidden in the text. For example, if the embedding matrix is ​​8000*732, where the dictionary capacity is 8000 and the embedding vector dimension is 732, then a sentence of length s is represented as an s*732 matrix. Therefore, the vector matrix allows the machine to understand the sentence context and thus identify the user's intent.

[0062] S2. Decompose the corpus vector to obtain the latent factor vector and the first corpus vector;

[0063] In this embodiment of the invention, the corpus vector is represented by a vector matrix, and the latent factor vector refers to the features hidden in the corpus vector. These latent features are mined out through vector matrix decomposition. The first corpus vector refers to the corpus vector after matrix decomposition, which is partly a latent factor vector. The other part of the decomposition is the first corpus vector.

[0064] In this embodiment of the invention, the reference Figure 2 As shown, the decomposition of the corpus vector to obtain the latent factor vector and the first corpus vector includes:

[0065] S21. Obtain the vector matrix corresponding to the corpus vector;

[0066] S22. Perform matrix decomposition on the vector matrix to obtain a first matrix and a second matrix;

[0067] S23. Adjust the first matrix using a preset root mean square error to obtain a first optimal matrix, and adjust the second matrix using the root mean square error to obtain a second optimal matrix;

[0068] S24. The vector corresponding to the first optimal matrix is ​​used as the latent factor vector, and the vector corresponding to the second optimal matrix is ​​used as the first corpus vector.

[0069] In detail, matrix factorization can effectively capture latent factors. When the dimension of the latent factor vector is k, the smaller the value of k, the less information the latent factor vector contains, the weaker its expressive power, and the higher the generalization of the model; the larger the value of k, the more information the latent factor vector contains, the stronger its expressive power, and the lower the generalization of the model.

[0070] Specifically, for probabilistic prediction, accuracy usually refers to root mean square error or mean absolute error. The root mean square error is used to adjust the parameter dimensions of the first matrix and the second matrix to optimize the parameter dimensions of the first matrix and the second matrix, so that the prediction ability of the matrix based on the latent factor vector can reach the optimal level.

[0071] For example, when the dimension of the vector matrix of the corpus vector is 300*732, the vector matrix corresponding to the corpus vector can be decomposed into a first matrix of 300*500 and a second matrix of 500*732. The matrix dimensions of the first matrix and the second matrix are adjusted by the root mean square error. After adjustment, the vector matrix is ​​decomposed into a first optimal matrix of 300*512 and a second optimal matrix of 512*732. That is, the vector corresponding to the first optimal matrix is ​​the latent factor vector, and the vector corresponding to the second optimal matrix is ​​the first corpus vector.

[0072] Furthermore, after matrix decomposition of the corpus vectors, latent factor vectors and first corpus vectors are obtained. The first corpus vector is then input into a deep network to encode sentence features.

[0073] S3. Use a preset deep network to perform feature encoding on the first corpus vector to obtain a corpus vector space, and extract the feature vector corresponding to the first corpus vector in the corpus vector space.

[0074] In this embodiment of the invention, feature encoding of the first corpus vector means not only encoding the first corpus vector itself, but also encoding the context information of the first corpus vector, so that each first corpus vector acquires a hidden state containing its context information. The corpus feature encoding vector refers to encoding the vector position of the first corpus vector, and then outputting a sentence vector space representation through the top layer of the deep network.

[0075] In this embodiment of the invention, the reference Figure 3 As shown, the step of using a preset deep network to perform feature encoding on the first corpus vector to obtain the corpus vector space includes:

[0076] S31. Select the first corpus vectors one by one and input them into the hidden layer of the deep network for feature encoding to obtain the encoded vector;

[0077] S32. The encoding vector output from the top layer of the deep network is used as the output vector corresponding to the first corpus vector;

[0078] S33. The output vectors are aggregated into a corpus vector space.

[0079] In detail, the deep network is a technique in the field of machine learning, in which the input layer neurons of the deep neural network receive external input, the hidden layer and output layer neurons process the signals, and the final result is output by the output layer neurons. The deep network encodes the contextual information of each first semantic vector, that is, it uses the deep network to encode sentence features. Specifically, it inputs the embedded sentence vector into the deep network to extract sentence features, and the top layer of the deep network outputs a sentence vector space representation.

[0080] In this embodiment of the invention, feature vectors corresponding to the first corpus vectors in the corpus vector space are extracted. These feature vectors are composed of output vectors from the output layers of a deep network in the corpus vector space. The first semantic vectors are input one by one into the output layer of the deep network, and feature encoding is performed through the hidden layers of the deep network. Then, the feature vectors corresponding to each first semantic vector are output from the output layer of the deep network. The feature vectors are the output vectors corresponding to each first semantic vector output by the output layer of the deep network.

[0081] For example, when the first semantic vector is represented as V = (v1, v2, ..., v n The first semantic vector is used as the input vector of the deep network one by one. The deep neural network encodes the context information of the first semantic vector, and the first semantic vector is passed through the output layer of the deep network to obtain the corresponding output vector H = (h1, h2, ..., h...). n That is, the top output layer of the deep neural network outputs the feature vector H = (h1, h2, ..., h) corresponding to the first semantic vector. n ).

[0082] S4. Input the latent factor vector and the feature vector into a preset attention model to obtain attention weights, and perform a weighted average on the feature vector and the attention weights to obtain a weighted average vector.

[0083] In this embodiment of the invention, the attention model is widely used in various types of deep learning tasks such as natural language processing, image recognition and speech recognition, and is one of the core technologies in deep learning that deserves the most attention and in-depth understanding.

[0084] In this embodiment of the invention, the step of inputting the latent factor vector and the feature vector into a preset attention model to obtain attention weights includes:

[0085] The attention weights are calculated using the attention model based on the latent factor vector and the feature vector:

[0086] (a1,a2,a3,…,a n )=softmax(v*h1,v*h2,v*h3,…,v*h n )

[0087] Where v represents the latent factor vector, h n a represents the feature vector output by the top layer of the deep network after passing through the nth first semantic vector in the sentence. n This represents the normalized attention weight corresponding to the nth first semantic vector.

[0088] In detail, the attention mechanism dynamically generates weights for different connections. The specific calculation process of the attention mechanism consists of two steps: first, calculating the weight coefficients corresponding to the first semantic vector based on the query and key; second, performing a weighted summation of the value based on these weight coefficients. The attention model then yields a list of attention weights corresponding to the first semantic vector.

[0089] In this embodiment of the invention, the attention weight corresponding to the first semantic vector is obtained, and a weighted average is performed based on the attention weight and the feature vector to obtain the representation of the first corpus vector in the corpus vector space.

[0090] In this embodiment of the invention, the step of performing a weighted average of the feature vector and the attention weights to obtain a weighted average vector includes:

[0091] The weighted average vector is obtained by averaging the corpus feature encoding vector and the attention weight using the following weighted average formula:

[0092] V s = a1*h1 + a2*h2 + ... + a n *h n

[0093] Among them, V s Let a be the weighted average vector. n h represents the normalized attention weight corresponding to the nth first semantic vector.n This represents the feature vector output by the top layer of the deep network for the nth first semantic vector.

[0094] In detail, the attention weight of each first semantic vector can be determined based on the weighted average vector. The importance of words in the user's corpus can be determined by the attention weight, so as to infer the user's intention with the highest probability.

[0095] For example, when the attention weight a1 is 0.3, the attention weight a2 is 0.5, the attention weight a3 is 0.6, the feature vectors output by the top layer of the deep network for the first semantic vector are h1 = {3,6,5}, h2 = {4,6,7}, and h3 = {2,5,5}, then the weighted average vector corresponding to the first corpus vector can be calculated using the weighted average formula.

[0096] S5. Input the weighted average vector into a preset intent classifier to obtain the intent recognition probability, and determine the weighted average vector whose intent recognition probability is greater than or equal to a preset threshold as the intent corresponding to the user's speech corpus. In this embodiment of the invention, the weighted average vector is output to the intent classifier to determine whether it belongs to the current intent, wherein the intent classifier classifies according to the user's speaking intent, and then combines the historical context to give the user an answer.

[0097] In this embodiment of the invention, the step of inputting the weighted average vector into a preset intent classifier to obtain the intent recognition probability includes:

[0098] The weighted average vector is input into the intent classifier for classification to obtain the intent distribution;

[0099] The intent recognition probability is determined based on the intent distribution.

[0100] In detail, by inputting the weighted average vector into the intent classifier for classification, it can be determined which intent distribution the user corpus corresponding to the weighted average vector belongs to. For example, in the context of traditional Chinese medicine, the intent distribution includes drug intent, hospitalization intent, drug precautions, etc.

[0101] Specifically, the intent recognition probability of each intent distribution is determined, and the content with the highest intent recognition probability is selected as the response content. Different intent recognition probabilities correspond to different intent recognition results. For example, when the intent recognition probability is very low, the intent recognition result may be an unrecognizable prompt message; when the intent recognition probability is very high, the intent recognition result may be the response content corresponding to the conversation content; when the intent recognition probability is moderate, the intent recognition result may be a similar statement similar to the conversation content.

[0102] In this embodiment of the invention, determining the intent recognition probability based on the intent distribution includes:

[0103] Extract the intent semantics from the intent distribution;

[0104] Calculate the matching degree between the stated intent semantics and the intent semantics in a preset intent database;

[0105] The matching degree is used as the probability of intent recognition.

[0106] In detail, the intent semantics corresponding to the intent distribution can be matched with the intent semantics in the intent database. The probability of each intent distribution is determined based on the matching degree. The intent distribution with the highest probability is selected as the user intent, that is, the user is responded to through the intent database.

[0107] Specifically, a matching algorithm can be used to calculate the matching degree between the intent semantics and the intent semantics in a preset intent database. The matching algorithm includes, but is not limited to, the cosine distance algorithm and the Euclidean distance algorithm.

[0108] In this embodiment of the invention, the threshold is set to 0.85. When the intent recognition probability is greater than or equal to 0.85, it means that the original user corpus contains the corresponding user intent. When the intent recognition probability is less than 0.85, it means that the original user corpus does not contain the corresponding user intent.

[0109] This invention, through vector transformation of user corpora, yields corpus vectors. The corpus is then decomposed to obtain latent factor vectors and a first corpus vector. Attention is calculated using the latent factor vectors, causing the intent classifier to focus on highly relevant words. The first corpus vector is input into a deep network for feature encoding, resulting in a corpus vector space, thus achieving a low-dimensional to high-dimensional vector transformation. The latent factor vectors and feature vectors are input into an attention model to obtain attention weights. A weighted average of the attention weights and feature vectors helps identify keywords with higher weights in the user's semantics. Based on the intent classifier, the intent recognition probability is obtained. The intent recognition probability is used to determine whether the original user's semantics contain the corresponding intent, thereby improving the performance of multi-intent recognition tasks. Therefore, the intent recognition method, device, electronic device, and computer-readable storage medium based on the latent factor attention mechanism proposed in this invention can solve the problem of low recognition performance during intent recognition.

[0110] like Figure 4 The diagram shown is a functional block diagram of an intent recognition device based on a latent factor attention mechanism provided in an embodiment of the present invention.

[0111] The latent factor attention mechanism-based intent recognition device 100 of this invention can be installed in an electronic device. Depending on the functions implemented, the latent factor attention mechanism-based intent recognition device 100 may include a corpus vector conversion module 101, a corpus vector decomposition module 102, a vector encoding module 103, a weighted average vector calculation module 104, and a user intent determination module 105. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and are stored in the memory of the electronic device.

[0112] In this embodiment, the functions of each module / unit are as follows:

[0113] The corpus vector conversion module 101 is used to acquire a preset user corpus, perform vector conversion on the user corpus, and obtain a corpus vector.

[0114] The corpus vector decomposition module 102 is used to decompose the corpus vector to obtain the latent factor vector and the first corpus vector.

[0115] The vector encoding module 103 is used to perform feature encoding on the first corpus vector using a preset deep network to obtain a corpus vector space, and extract the feature vector corresponding to the first corpus vector in the corpus vector space.

[0116] The weighted average vector calculation module 104 is used to input the latent factor vector and the feature vector into a preset attention model to obtain attention weights, and to perform a weighted average of the feature vector and the attention weights to obtain a weighted average vector.

[0117] The user intent determination module 105 is used to input the weighted average vector into a preset intent classifier to obtain the intent recognition probability, and determine the weighted average vector whose intent recognition probability is greater than or equal to a preset threshold as the intent corresponding to the user corpus.

[0118] In detail, the modules in the latent factor attention mechanism-based intent recognition device 100 described in this embodiment of the invention employ the same methods as described above during use. Figures 1 to 3 The technique used is the same as the latent factor attention mechanism-based intent recognition method described in the previous article, and can produce the same technical effect, so it will not be repeated here.

[0119] like Figure 5 The diagram shown is a structural schematic of an electronic device that implements an intent recognition method based on a latent factor attention mechanism according to an embodiment of the present invention.

[0120] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13. It may also include a computer program stored in the memory 11 and capable of running on the processor 10, such as an intent recognition program based on latent factor attention mechanism.

[0121] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., executing an intent recognition program based on latent factor attention mechanism) and calls data stored in the memory 11 to perform various functions of the electronic device and process data.

[0122] The memory 11 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory 11 can include both internal and external storage units of the electronic device. The memory 11 can be used not only to store application software and various types of data installed on the electronic device, such as code for an intent recognition program based on latent factor attention mechanisms, but also to temporarily store data that has been output or will be output.

[0123] The communication bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.

[0124] The communication interface 13 is used for communication between the aforementioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), or, optionally, a standard wired or wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.

[0125] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0126] For example, although not shown, the electronic device may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0127] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0128] The intent recognition program based on the latent factor attention mechanism stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, which, when run in the processor 10, can achieve the following:

[0129] Obtain a preset user corpus, and perform vector transformation on the user corpus to obtain a corpus vector;

[0130] The corpus vectors are decomposed to obtain latent factor vectors and the first corpus vector;

[0131] The first corpus vector is feature-encoded using a preset deep network to obtain a corpus vector space, and the feature vector corresponding to the first corpus vector in the corpus vector space is extracted.

[0132] The latent factor vector and the feature vector are input into a preset attention model to obtain attention weights. The feature vector and the attention weights are then weighted and averaged to obtain a weighted average vector.

[0133] The weighted average vector is input into a preset intent classifier to obtain the intent recognition probability. The weighted average vector with the intent recognition probability greater than or equal to a preset threshold is determined as the intent corresponding to the user corpus.

[0134] Specifically, the specific implementation method of the processor 10 for the above instructions can be referred to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, and will not be repeated here.

[0135] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0136] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:

[0137] Obtain a preset user corpus, and perform vector transformation on the user corpus to obtain a corpus vector;

[0138] The corpus vectors are decomposed to obtain latent factor vectors and the first corpus vector;

[0139] The first corpus vector is feature-encoded using a preset deep network to obtain a corpus vector space, and the feature vector corresponding to the first corpus vector in the corpus vector space is extracted.

[0140] The latent factor vector and the feature vector are input into a preset attention model to obtain attention weights. The feature vector and the attention weights are then weighted and averaged to obtain a weighted average vector.

[0141] The weighted average vector is input into a preset intent classifier to obtain the intent recognition probability. The weighted average vector with the intent recognition probability greater than or equal to a preset threshold is determined as the intent corresponding to the user corpus.

[0142] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0143] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0144] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0145] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0146] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0147] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0148] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0149] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in the system claims may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for intent recognition based on hidden factor attention mechanism, characterized in that, The method includes: Obtain a preset user corpus, and perform vector transformation on the user corpus to obtain a corpus vector; Obtain the vector matrix corresponding to the corpus vector, perform matrix decomposition on the vector matrix to obtain a first matrix and a second matrix, adjust the parameter dimension of the first matrix using a preset root mean square error to obtain a first optimal matrix, and adjust the parameter dimension of the second matrix using the root mean square error to obtain a second optimal matrix, use the vector corresponding to the first optimal matrix as the latent factor vector, and use the vector corresponding to the second optimal matrix as the first corpus vector. The first corpus vector is feature-encoded using a preset deep network to obtain a corpus vector space, and the feature vector corresponding to the first corpus vector in the corpus vector space is extracted. The latent factor vector and the feature vector are input into a preset attention model to obtain attention weights. The feature vector and the attention weights are then weighted and averaged to obtain a weighted average vector. The weighted average vector is input into a preset intent classifier to obtain the intent recognition probability. The weighted average vector with the intent recognition probability greater than or equal to a preset threshold is determined as the intent corresponding to the user corpus. 2.The method of claim 1, wherein, The step of using a preset deep network to perform feature encoding on the first corpus vector to obtain the corpus vector space includes: The first corpus vectors are selected one by one and input into the hidden layer of the deep network for feature encoding to obtain the encoded vector; The encoded vector output from the top layer of the deep network is used as the output vector corresponding to the first corpus vector; The output vectors are aggregated into a corpus vector space. 3.The method of claim 1, wherein, The step of inputting the latent factor vector and the feature vector into a preset attention model to obtain attention weights includes: The attention weights are calculated using the attention model based on the latent factor vector and the feature vector: in, Represents the latent factor vector. Indicates the first in the sentence The first semantic vector is used to output the feature vector from the top layer of the deep network. Indicates the first The normalized attention weights corresponding to the first semantic vector. 4.The method of claim 1, wherein, The step of performing a weighted average of the feature vector and the attention weights to obtain a weighted average vector includes: The feature vector and the attention weights are weighted and averaged using the following weighted average formula to obtain the weighted average vector: in, Let be the weighted average vector. Indicates the first The normalized attention weights corresponding to the first semantic vector Indicates the first The first semantic vector is the feature vector output by the top layer of the deep network.

5. The implicit factor attention mechanism based intent recognition method according to any one of claims 1 to 4, characterized in that, The step of inputting the weighted average vector into a preset intent classifier to obtain the intent recognition probability includes: The weighted average vector is input into the intent classifier for classification to obtain the intent distribution; The intent recognition probability is determined based on the intent distribution. 6.The method of claim 5, wherein, Determining the intent recognition probability based on the intent distribution includes: Extract the intent semantics from the intent distribution; Calculate the matching degree between the stated intent semantics and the intent semantics in a preset intent database; The matching degree is used as the probability of intent recognition.

7. An apparatus for intent recognition based on hidden factor attention mechanism, characterized in that, The device includes: The corpus vector conversion module is used to acquire a preset user corpus, perform vector conversion on the user corpus, and obtain a corpus vector. The corpus vector decomposition module is used to obtain the vector matrix corresponding to the corpus vector, perform matrix decomposition on the vector matrix to obtain a first matrix and a second matrix, adjust the parameter dimension of the first matrix using a preset root mean square error to obtain a first optimal matrix, and adjust the parameter dimension of the second matrix using the root mean square error to obtain a second optimal matrix, and use the vector corresponding to the first optimal matrix as the latent factor vector, and use the vector corresponding to the second optimal matrix as the first corpus vector. The vector encoding module is used to perform feature encoding on the first corpus vector using a preset deep network to obtain a corpus vector space, and extract the feature vector corresponding to the first corpus vector in the corpus vector space. The weighted average vector calculation module is used to input the latent factor vector and the feature vector into a preset attention model to obtain attention weights, and to perform a weighted average of the feature vector and the attention weights to obtain a weighted average vector. The user intent determination module is used to input the weighted average vector into a preset intent classifier to obtain the intent recognition probability, and to determine the weighted average vector whose intent recognition probability is greater than or equal to a preset threshold as the intent corresponding to the user corpus.

8. An electronic device, comprising: The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the intent recognition method based on latent factor attention mechanism as described in any one of claims 1 to 6.

9. A computer readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the intent recognition method based on the latent factor attention mechanism as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Time-sensitive personalized recommendation method based on probability matrix decomposition

    CN108763515A

  • Information identification method and device based on semantic enhancement, equipment and storage medium

    CN113204618A