An intent recognition method and related device and equipment

By combining the similarity between the text to be identified and popular texts, a neural network is used to extract popular features and dynamically update the popular set. This solves the problem of low accuracy in intent recognition in question-answering systems, improves the accuracy and timeliness of intent recognition, and meets users' needs for rapid response.

CN114116991BActive Publication Date: 2026-05-15HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010899495.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-31
Publication Date
2026-05-15
Estimated Expiration
2040-08-31

AI Technical Summary

Technical Problem

In existing question-answering systems, the same information entered by a user may correspond to multiple intents, and these intents may change over time, resulting in low intent recognition accuracy and making it difficult to meet users' needs for quick and accurate information retrieval.

Method used

By combining the similarity between the text to be identified and popular texts, a neural network is used to extract popular features and dynamically update the popular set to improve the timeliness of intent recognition. Encoder and decoder models are used to adjust model parameters to improve the accuracy of intent recognition.

Benefits of technology

It improves the accuracy of intent recognition, reduces the sense of distance in human-computer interaction, meets users' psychological needs, and provides a more intelligent and timely response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116991B_ABST
    Figure CN114116991B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an intent recognition method and device, and equipment. The method comprises: obtaining to-be-recognized text; inputting the to-be-recognized text and hot feature corresponding to the to-be-recognized text into an intent recognizer, and outputting a recognition result, the intent recognizer being a neural network for recognizing multiple intents, the recognition result being used for indicating an intent of the to-be-recognized text, and the hot feature being a feature extracted from target hot text, the target hot text including at least one hot text similar to the to-be-recognized text. It can be known that the intent recognition method considers that hot topics change over time, and the same to-be-recognized text can correspond to different intents. Therefore, in the process of intent recognition, the to-be-recognized text is combined with hot topics, and hot features are extracted from hot text related to the to-be-recognized text, so that the timeliness of the intent can be considered, and the accuracy of intent recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to an intent recognition method and related apparatus and equipment. Background Technology

[0002] Question-answering systems (QA) are widely used in daily life, such as voice assistants, search engines, and search systems. QA systems automatically process input information, identify the intent behind that information, and enable the device to respond accordingly, meeting people's needs for quickly and accurately obtaining information or executing related commands. However, accurate intent recognition remains one of the current technological challenges and pain points in QA systems. Only by accurately discovering or locating the true intent of the user's input can the system provide the feedback the user most wants, thereby improving the user experience.

[0003] In practical applications, the same information entered by a user often corresponds to multiple intentions. For example, if a user enters "P40," their intention might be to "buy a P40 phone," "find out what a P40 is," or "get news related to P40 phones." Furthermore, over time, the intention corresponding to the same information entered by a user may change. For instance, if a user enters "P40," they might want to find information related to "P40 phones," but the device might return information related to "P-40 fighter jets."

[0004] Therefore, how to improve the accuracy of intent recognition and more accurately locate user intent is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This application provides an intent recognition method and related apparatus and equipment, which can improve the accuracy of intent recognition.

[0006] In a first aspect, embodiments of this application provide an intent recognition method, including:

[0007] Obtain the text to be recognized;

[0008] The text to be identified and its corresponding hotspot features are input into an intent recognizer, which outputs a recognition result. The intent recognizer is a neural network used to identify multiple intents. The recognition result is used to indicate the intent of the text to be identified. The hotspot features are features extracted from target hotspot text, which includes at least one hotspot text similar to the text to be identified.

[0009] In the solution provided in this application, the intent recognition method takes into account that hotspots change over time, and the same text to be recognized may correspond to different intents. Therefore, in the process of intent recognition, the text to be recognized is combined with hotspots, and hotspot features are extracted from hotspot texts related to the text to be recognized, so as to focus on the timeliness of intent and improve the accuracy of intent recognition.

[0010] In conjunction with the first aspect, in one possible implementation of the first aspect, the target hotspot text is input into an encoder to obtain the text features corresponding to time step t'. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network. The first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network according to the weights to obtain the text features corresponding to time step t'.

[0011] The text features corresponding to time step t' are input into the decoder to obtain the hidden state corresponding to time step t'. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text based on the hidden state output by the second recurrent neural network.

[0012] In this case, the hidden state output by the second recurrent neural network at the last time step is the hotspot feature.

[0013] In conjunction with the first aspect, in one possible implementation of the first aspect, the hot texts in the target hot text are weighted and summed to obtain the hot feature. The weight of each hot text in the target hot text is determined by the similarity between each hot text and the text to be identified.

[0014] The method described above determines the weight of the text to be identified and the hot text by calculating the similarity between the text to be identified and the hot text. The greater the similarity between the text to be identified and the hot text in the target hot text, the higher the weight of the text to be identified in that hot text. Therefore, the intent corresponding to the text to be identified is more inclined to the hot text with a higher similarity to the text to be identified.

[0015] In conjunction with the first aspect, in one possible implementation of the first aspect, the target hotspot set to which the text to be identified belongs is selected from multiple hotspot sets;

[0016] Calculate the similarity between the text to be identified and each hotspot text in the target hotspot set;

[0017] The target hotspot text is identified as the top N hotspot texts in the target hotspot set that have the highest similarity to the text to be identified.

[0018] In conjunction with the first aspect, in one possible implementation of the first aspect, multiple hot texts are obtained; the multiple hot texts are clustered to obtain multiple hot text sets.

[0019] The above method can acquire multiple hotspot texts in real time or at a certain frequency or period, thereby updating the hotspot texts in the hotspot set, and consequently updating the hotspot texts in the target hotspot set. When the text to be recognized is acquired from the target hotspot set, different target hotspot texts can be acquired at different time stages. Furthermore, as time changes, the samples can be continuously updated at a certain frequency or period, giving the trained encoder, decoder, and intent recognizer high timeliness. Thus, when the intent recognizer identifies the intent of the text to be recognized, because the intent recognized by the intent recognizer changes over time, the intelligence of the device using the intent recognition method can be improved, reducing the sense of distance in human-computer interaction and meeting the user's psychological needs.

[0020] Secondly, embodiments of this application provide a method for training a neural network, including:

[0021] The target hotspot text corresponding to the sample text is input into the encoder to obtain the text features corresponding to time step t'. The target hotspot text includes at least one hotspot text similar to the sample text. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output at time step t'-1 and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output at time step t'. The first output module is used to perform a weighted summation of the hidden states output at time step t' based on the weights to obtain the text features corresponding to time step t'.

[0022] The text features corresponding to time step t' are input into the decoder to obtain the predicted intent corresponding to time step t'. The encoder outputs the intent of one hot text in the target hot text at a time. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text based on the hidden state output by the second recurrent neural network.

[0023] Based on the loss between the predicted intent of all hot texts in the target hot text and the true intent of all hot texts in the target hot text, adjust the model parameters of the encoder and the model parameters of the decoder.

[0024] Thirdly, embodiments of this application provide a method for training a neural network, including:

[0025] The sample text and its corresponding hotspot features are input into the intent recognizer to obtain the predicted intent. The hotspot features are features extracted from the target hotspot text, which includes at least one hotspot text similar to the sample text.

[0026] The model parameters of the intent recognizer are adjusted based on the loss between the predicted intent corresponding to the sample text and the true intent corresponding to the sample text.

[0027] In conjunction with the third aspect, in one possible implementation of the third aspect, the target hotspot text is input into an encoder, which outputs the hotspot feature. The encoder includes a first recurrent neural network, a weight calculation module, and an output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network to obtain the weight of each hidden state in the output hidden state. The output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network based on the weight of each hidden state in the output hidden state to obtain the hotspot feature.

[0028] Fourthly, embodiments of this application provide an execution device for intent recognition, characterized in that the execution device includes: one or more processors and a memory, the memory being coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors being used to invoke the computer instructions to cause the execution device to execute:

[0029] Obtain the text to be recognized;

[0030] The text to be identified and its corresponding hotspot features are input into an intent recognizer, which outputs a recognition result. The intent recognizer is a neural network used to identify multiple intents. The recognition result is used to indicate the intent of the text to be identified. The hotspot features are features extracted from target hotspot text, which includes at least one hotspot text similar to the text to be identified.

[0031] In conjunction with the fourth aspect, in one implementation of the fourth aspect, the target hotspot text is input into an encoder to obtain the text features corresponding to time step t'. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network. The first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network based on the weights to obtain the text features corresponding to time step t'.

[0032] The text features corresponding to time step t' are input into the decoder to obtain the hidden state corresponding to time step t'. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text based on the hidden state output by the second recurrent neural network.

[0033] In this case, the hidden state output by the second recurrent neural network at the last time step is the hotspot feature.

[0034] In conjunction with the fourth aspect, in one implementation of the fourth aspect, the hot texts in the target hot text are weighted and summed to obtain the hot text feature. The weight of each hot text in the target hot text is determined by the similarity between each hot text and the text to be identified.

[0035] In conjunction with the fourth aspect, in one implementation of the fourth aspect, the target hotspot set to which the text to be identified belongs is selected from multiple hotspot sets;

[0036] Calculate the similarity between the text to be identified and each hotspot text in the target hotspot set;

[0037] The target hotspot text is identified as the top N hotspot texts in the target hotspot set that have the highest similarity to the text to be identified.

[0038] In conjunction with the fourth aspect, in one implementation of the fourth aspect, multiple hot texts are obtained;

[0039] Clustering these multiple hot texts yields multiple hotspot sets.

[0040] Fifthly, embodiments of this application provide a training device, characterized in that the training device includes: one or more processors and a memory, the memory being coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors being used to call the computer instructions to cause the training device to execute:

[0041] The target hotspot text corresponding to the sample text is input into the encoder to obtain the text features corresponding to time step t'. The target hotspot text includes at least one hotspot text similar to the sample text. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network. The first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network according to the weight to obtain the text features corresponding to time step t'.

[0042] The text features corresponding to time step t' are input into the decoder to obtain the predicted intent corresponding to time step t'. The encoder outputs the intent of one hot text in the target hot text at a time. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text based on the hidden state output by the second recurrent neural network.

[0043] Based on the loss between the predicted intent of all hot texts in the target hot text and the true intent of all hot texts in the target hot text, adjust the model parameters of the encoder and the model parameters of the decoder.

[0044] Sixthly, embodiments of this application provide a training device, characterized in that the training device includes: one or more processors and a memory, the memory being coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors being used to call the computer instructions to cause the training device to execute:

[0045] The sample text and its corresponding hotspot features are input into the intent recognizer to obtain the predicted intent. The hotspot features are features extracted from the target hotspot text, which includes at least one hotspot text similar to the sample text.

[0046] The model parameters of the intent recognizer are adjusted based on the loss between the predicted intent corresponding to the sample text and the true intent corresponding to the sample text.

[0047] In conjunction with the sixth aspect, in one implementation of the sixth aspect, the target hotspot text is input into an encoder, which outputs the hotspot feature. The encoder includes a first recurrent neural network, a weight calculation module, and an output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network to obtain the weight of each hidden state in the output hidden state. The output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network based on the weight of each hidden state in the output hidden state to obtain the hotspot feature.

[0048] In a seventh aspect, embodiments of this application provide a computer-readable storage medium, characterized in that the computer-readable medium is used to store program code, the program code including methods for performing the method described in the first aspect.

[0049] Eighthly, embodiments of this application provide a computer-readable storage medium, characterized in that the computer-readable medium is used to store program code, the program code including methods for performing the method described in the second aspect.

[0050] In a ninth aspect, embodiments of this application provide a computer-readable storage medium, characterized in that the computer-readable medium is used to store program code, the program code including methods for performing the method described in the third aspect. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a schematic diagram of an attention mechanism provided in an embodiment of this application;

[0053] Figure 2 This is a schematic diagram of the system architecture provided in an embodiment of this application;

[0054] Figures 3A-3C These are schematic diagrams of some user interfaces provided in the embodiments of this application;

[0055] Figure 4 This is a flowchart of a method for obtaining target hotspot text provided in an embodiment of this application;

[0056] Figure 5 This is a flowchart illustrating a neural network training method provided in an embodiment of this application;

[0057] Figure 6 This is a schematic diagram of a neural network structure provided in an embodiment of this application;

[0058] Figure 7 This is a flowchart illustrating another neural network training method provided in an embodiment of this application;

[0059] Figure 8 This is a schematic diagram of another neural network structure provided in the embodiments of this application;

[0060] Figure 9 This is a flowchart illustrating another neural network training method provided in this application embodiment.

[0061] Figure 10A This is a flowchart of an intent recognition method provided in an embodiment of this application;

[0062] Figure 10B This is a flowchart of another intent recognition method provided in the embodiments of this application;

[0063] Figure 10C This is a flowchart of another intent recognition method provided in the embodiments of this application;

[0064] Figure 11 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application;

[0065] Figure 12 This is a schematic diagram of the structure of an electronic device 200 provided in an embodiment of this application. Detailed Implementation

[0066] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.

[0067] First, let's introduce the technical terms and concepts involved in the embodiments of this application.

[0068] (1) Intent and Intent Recognition

[0069] Intent refers to identifying what the text being identified specifically expresses a desire to do. Intent recognition can be understood as a semantic expression classification problem; in other words, intent recognition is a classifier (also referred to as an intent recognizer in this embodiment) that determines which intent the text to be identified represents. Commonly used intent classifiers for intent recognition include Support Vector Machines (SVM), Decision Trees, and Deep Neural Networks (DNNs). Among these, neural networks can be Deep Neural Networks (DNNs), Recurrent Neural Networks (RNNs), etc. RNNs can include Long Short-Term Memory (LSTM) networks, Stacked Recurrent Neural Networks (SRNNs), etc.

[0070] The general process of intent recognition includes: first, preprocessing the text to be recognized, such as removing stop words; second, converting the corpus into word embeddings, for example, using word embedding algorithms such as word2vec to generate word vectors from the preprocessed corpus; and then, using an intent recognizer (e.g., a DNN) to perform feature extraction and intent classification. In this embodiment, the intent recognizer is used to identify the most likely intent of the user-inputted text.

[0071] (2) Attention mechanism

[0072] The attention mechanism simulates the attention of the human brain. For example, when we appreciate a painting, although we can see the whole picture, when we observe it in detail, our eyes focus on only a small part. At this time, the human brain mainly focuses on this small part of the picture. In other words, the human brain's attention to the whole picture is not balanced, but has a certain weighting.

[0073] Generally, attention mechanisms exist within the encoder-decoder framework. They can be applied to image captioning, translation, speech recognition, summarization, and more. For example, in machine translation, such as translating "machine learning," when translating the output "machine," we want the model to focus on "machine" rather than "learning." How is this attention mechanism implemented?

[0074] Taking recurrent neural networks as an example, the attention mechanism obtains the background variables by weighted summation of the hidden states of the encoder at all time steps. The decoder adjusts these weights, i.e., the attention weights, at each time step, thereby enabling it to focus on different parts of the input sequence at different time steps and encode them into the background variables of the corresponding time steps.

[0075] Please see Figure 1 This is a schematic diagram of an attention mechanism provided in an embodiment of this application. Figure 1 As shown, the encoder's time step is denoted by t, and the total time step is T, i.e., t = 1, 2, ..., T; the decoder's time step is denoted by t', and the total time step is T', i.e., t' = 1, 2, ..., T'. Specifically, let the encoder's hidden state at time step t be h. t Then, the background variable of the decoder at time step t' is a weighted sum of all encoder hidden states, which can be expressed in the following form:

[0076]

[0077] For example, such as Figure 1 As shown, the background variable c2 of the decoder at time step 2 can be expressed as: c2 = a 21 h1+a 22 h2+a 23 h3.

[0078] Given t', the weight a t't The values ​​at t = 1, ..., T represent a probability distribution. To obtain this probability distribution, we can use the softmax operation:

[0079]

[0080] Now, we need to define how to compute the input e of the softmax operation in the above formula. t't Because of e t't Since it depends on both the decoder's time step t' and the encoder's time step t, we might as well consider the decoder's hidden state s at time step t'-1. t'-1 With the encoder's hidden state h at time step t tAs input, e is calculated using the function a(). t't :

[0081] e t't =a(s t'-1 h t )

[0082] Here, the function a() has several options. If the two input vectors have the same length, a simple choice is to calculate their inner product a(s,h) = s. T h. For example, the earliest paper to propose the attention mechanism transformed the concatenated inputs using a multilayer perceptron with a single hidden layer:

[0083] a(s,h)=v T tanh(w s s+w h h)

[0084] Where v, w s w h These are all model parameters that can be learned.

[0085] During the decoder stage, for time step t', the decoder outputs y. t' The conditional probability is based on the previous output sequence y1, y2, ..., y of the decoder. t'-1 and the background variable c output by the encoder t' What is obtained is P(y) t' |y1,...,y t'-1 ,c t' ).

[0086] At time step t', the decoder will output y from the previous time step. t'-1 and background variable c t' As input, and combined with the hidden state s from the previous time step t'-1 Transform into the hidden state s of the current time step t' Therefore, we can use the function g() to express the transformation of the decoder's hidden layer:

[0087] s t' =g(y t'-1 ,c t' ,s t'-1 )

[0088] With the hidden state of the decoder, P(y) can be calculated using the output layer and the softmax function. t' |y1,...,y t'-1 ,c t' For example, based on the hidden state s of the decoder at the current time step t'. t' The output y of the decoder at the previous time stept'-1 and background variable c t' To calculate the decoder output y at the current time step t' t' The probability distribution.

[0089] (3) Deep Neural Networks

[0090] Deep neural networks (DNNs), also known as multilayer neural networks, can be understood as neural networks with many hidden layers, though there's no specific metric for "many." DNNs can be categorized into three layers based on their position: input layers, hidden layers, and output layers. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. All layers are fully connected, meaning that any neuron in the i-th layer is connected to any neuron in the (i+1)-th layer. Although DNNs appear complex, the operation of each layer is actually quite simple, resembling a linear relationship as follows: in, It is the input vector. is the output vector, b is the offset vector, W is the weight matrix (also called coefficients), and α() is the activation function. Each layer is simply a change in the input vector. The output vector is obtained through such a simple operation. Because DNNs have many layers, the number of coefficients W and offset vectors b is also large. These parameters are defined in DNNs as follows: Taking coefficient W as an example: Suppose in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as... The superscript 3 represents the layer number where coefficient W resides, while the subscript corresponds to the output third layer index 2 and the input second layer index 4. In summary, the coefficients from the k-th neuron in layer L-1 to the j-th neuron in layer L are defined as follows: It's important to note that the input layer does not have a W parameter. In deep neural networks, more hidden layers allow the network to better represent complex real-world situations. Theoretically, the more parameters a model has, the higher its complexity and "capacity," meaning it can perform more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, with the ultimate goal of obtaining the weight matrix of all layers in the trained deep neural network (a weight matrix formed by the vectors W from many layers).

[0091] First, the system architecture of the embodiments of this application will be introduced.

[0092] Please see Figure 2 This is a schematic diagram of the system architecture provided in an embodiment of this application. Figure 2As shown, the system includes a terminal 100, an execution device 200, a first training device 300, a second training device 400, a response device 500, a database 600, and a data acquisition device 700. Among them:

[0093] Database 600 is used to store hot text and training data. Hot text can be collected by data acquisition device 700 from a third-party platform at a certain frequency or period.

[0094] The first training device 300 can obtain first training data from the database 600 for training a first model, which includes an encoder and a decoder. In one implementation, the first training data includes multiple samples, each sample including a target hotspot text corresponding to the sample text and the true intent corresponding to each hotspot text in the target hotspot text, wherein the target hotspot text is at least one hotspot text similar to the sample text. The first training device 300 inputs the target hotspot text into the encoder to obtain the text features corresponding to time step t'. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t; the weight calculation module is used to process the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network; the first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network according to the weights corresponding to each hidden state to obtain the text features corresponding to time step t'. Further, the text features corresponding to time step t' are input into the decoder to obtain the hidden state corresponding to time step t'. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network processes the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module outputs the predicted intent for each hotspot text in the target hotspot text based on the hidden states output by the second recurrent neural network. The hidden state output by the second recurrent neural network at the last time step represents the hotspot features.

[0095] In another implementation, the first training data includes multiple samples, each sample including the target hotspot text corresponding to the sample text and the true intent corresponding to the sample text. The first training device 300 inputs the target hotspot text corresponding to the sample text into the encoder to obtain predicted hotspot features; then, the predicted hotspot features are input into the decoder to obtain the predicted intent; and the model parameters of the encoder and decoder are adjusted according to the loss between the predicted intent and the true intent.

[0096] Furthermore, the first training device 300 can send the trained first model to the execution device 200 and the second training device 400.

[0097] The second training device 400 can obtain second training data from the database 600 to train an intent recognizer, which is a deep neural network. The second training data includes multiple samples, each sample including sample text, corresponding hotspot features, and the true intent. The second training device 400 inputs the sample text and its corresponding hotspot features into the intent recognizer to obtain the predicted intent, and adjusts the model parameters of the intent recognizer based on the loss between the predicted intent and the true intent.

[0098] Furthermore, the second training device 400 can send the trained intent recognizer to the execution device 200.

[0099] It should be understood that obtaining the hotspot features corresponding to the sample text depends on the first model. That is, the target hotspot text corresponding to the sample text needs to be input into the first model, and the output is the hotspot features corresponding to the sample text. In one implementation, the hotspot features can be the hidden state output by the decoder at the last time step; in another implementation, the target hotspot text corresponding to the sample text is input into the encoder of the first model, and the output is the hotspot features corresponding to the sample text, which are the output of the encoder.

[0100] It should be understood that the first training device 300 and the second training device 400 can be calculators, servers, cloud servers, etc.

[0101] After the execution device 200 acquires the trained first model and intent recognizer, it can recognize the intent of the text to be recognized. The text to be recognized can be text input by the user sent by the terminal 100 to the execution device 200. For example, the terminal 100 can receive text input by the user on the terminal 100 via an input device (e.g., a soft keyboard, an external keyboard, a touch panel, etc.), which is the text to be recognized; the terminal 100 can also receive the user's voice captured by a voice acquisition device (e.g., a microphone), which is the voice to be recognized, and then the terminal 100 can convert the voice to be recognized into text to be recognized.

[0102] It should be understood that terminal 100 may include, but is not limited to, devices such as mobile phones, tablets, computers, smartwatches, smart speakers, and televisions.

[0103] After receiving the text to be identified sent by the terminal 100 through the I / O interface 201, the execution device 200 can input the text to be identified into the target hotspot text acquisition module 202. The target hotspot text acquisition module 202 can calculate the target hotspot text corresponding to the text to be identified, which is at least one hotspot text similar to the text to be identified. Then, the execution device 200 inputs the target hotspot text corresponding to the text to be identified into the first model 203 to obtain the hotspot features of the text to be identified. Finally, the execution device 200 inputs the text to be identified and the corresponding hotspot features into the intent recognizer 204. The intent recognizer 204 recognizes the intent of the text to be identified and outputs the intent of the text to be identified.

[0104] In this process, the execution device 200 inputs the text to be identified into the target hotspot text acquisition module 202. One implementation of the target hotspot text acquisition module 202 calculating the target hotspot text corresponding to the text to be identified can be as follows: Calculate the similarity between the text to be identified and each hotspot text in the target hotspot set; then, determine the N hotspot texts in the target hotspot set with the highest similarity to the text to be identified as the target hotspot texts, where N is a positive integer. It should be understood that the target hotspot text acquisition module 202 can retrieve multiple hotspot texts from the database 600 at a certain frequency or period, and obtain multiple hotspot sets through clustering. The target hotspot set is one of these multiple hotspot sets. In one implementation, the sum of the similarities between the hotspot texts in the target hotspot set and the text to be identified is greater than the sum of the similarities between the hotspot texts in any one of the multiple hotspot sets and the text to be identified.

[0105] Furthermore, after the execution device 200 obtains the intent corresponding to the text to be recognized, it can send the intent to the response device 500. The response device 500 responds to the intent and returns response information to the execution device 200 or the terminal 100. The response information can be in the form of text, images, links, audio, video, or a combination of one or more such forms. The response information can also be a command instructing the terminal 100 to perform a corresponding operation.

[0106] It should be understood that the response device 500 can be a server, cloud server, etc.

[0107] In one implementation, the execution device 200 sends the response information to the terminal 100 via the I / O interface 201. After receiving the response information, the terminal 100 can output the response information. In some implementations, if the response information is in text form, the terminal 201 can display the response information on a screen or play the response information as speech through a speaker; if the response information is a command instructing the terminal 100 to perform a corresponding operation, such as the command "Open Link A", the terminal 100 can execute the command, open Link A, and jump to the user interface corresponding to Link A.

[0108] It should be understood that the execution device 200 and the response device 500 can be the same device.

[0109] It should also be understood that, over time, trending texts are constantly updated, as are the first and second training data. The first training device 300 can periodically train the first model based on the updated first training data. Similarly, the second training device 400 can periodically train the intent recognizer based on the updated first training data. Therefore, the recognition results of the intent recognizer will change over time, and its recognition results are time-sensitive. It can be understood that the intent recognizer may obtain different recognition results (or intents) for the same text to be recognized, and thus, different response information can be obtained. For example, for the text "P40", at the time point "2018-05-04", intent recognizer 2 recognizes the intent of the text "P40" as "find out what a P-40 fighter jet is"; at the time point "2020-06-04", the intent recognizer recognizes the intent of the text "P40" as "find a P40 mobile phone".

[0110] It should be understood that Figure 2 The system architecture diagram shown is merely an exemplary architecture provided in this application embodiment, and the system architecture included in this application embodiment is not limited to... Figure 2 The equipment shown may also include more or fewer devices, and Figure 2 The implementation methods described herein are only some of the implementation methods of the embodiments of this application, and may include other implementations, which are not limited here.

[0111] Below, in conjunction with Figure 2 The system architecture shown illustrates some user interfaces involved in the embodiments of this application.

[0112] The terminal may include a processor, memory, and a display, the display of which may be a touch screen for displaying a user interface, which may include at least one control.

[0113] Please see Figures 3A-3C These are schematic diagrams of some user interfaces provided in embodiments of this application. Figure 3A As shown, the user interface may include at least one of a text input control 302, a voice input control 303, and an image input control 304.

[0114] In response to the detected text input to the text input control 302, the terminal can send the text to the execution device; in response to the detected speech input to the voice input control 303, the terminal can convert the speech into text and send the text to the execution device; in response to the detected image input to the image input control 304, the terminal can extract the features of the image (e.g., text in the image), convert the image into text, and then send the text to the execution device.

[0115] like Figure 3B As shown, the user interface may also include a display container 301 for displaying information about the interaction between the device and the terminal.

[0116] In one implementation, the user can click the voice input control 303. The terminal detects this operation, activates the microphone, and captures the user's voice "P40" through the microphone. This voice is then converted into text and displayed in the display container 301. Figure 3B As shown in (1), the terminal displays “P40” in display container 301.

[0117] Furthermore, the terminal sends the text to be recognized to the execution device. The execution device is used to recognize the intent of the received text to be recognized and sends the recognition result to the response device. The response device responds to the recognition result, obtains the response information corresponding to the recognition result, and then sends the response information to the execution device. The execution device then returns the response information to the terminal, and the terminal can output the response information.

[0118] In one implementation, for example, if the time point is "2018-05-04", the terminal sends "P40" as the text to be recognized to the execution device. The execution device recognizes the intent corresponding to the text "P40" as "find out what a P-40 fighter jet is". The execution device can then send this intent to the response device. The response device can retrieve relevant encyclopedia entries about "P-40 fighter jet" from a third-party website or database and send them as response information to the execution device. The execution device then sends this response information to the terminal, and the terminal outputs and displays the response information. Figure 3B As shown in (2), the terminal displays “P40” and “P40-fighter” to the user in the display container 301 as the corresponding response information at this time.

[0119] In one implementation, for example, if the time point is "2020-06-04", the terminal sends "P40" as the text to be recognized to the execution device. At this time, the execution device recognizes the intent corresponding to the text "P40" as "find P40 phone". The execution device can then send this intent to the response device. The response device can obtain relevant encyclopedia entries about "P40 phone" from a third-party website or database and send them as response information to the execution device. The execution device then sends this response information to the terminal, and the terminal outputs and displays the response information. Figure 3B As shown in (3), the terminal displays “P40” and “P40 mobile phone” to the user in the display container 301.

[0120] In some implementations, the response information is a command used to instruct the terminal to perform a corresponding operation. In this case, the terminal can directly execute the command after receiving the response information.

[0121] like Figure 3C As shown, after receiving the input user command, the terminal displays the input text "P40" to be recognized on the right side of the display container 301. In one scenario, the executing device recognizes that the intent corresponding to the text "P40" is "Buy a P40 phone". The executing device sends this intent to the responding device, which responds to the intent, obtains "P40 phone purchase link: http: / / ..." as response information, and sends this response information to the executing device, which then sends it to the terminal. When the terminal receives this response information, it can directly jump to the user interface corresponding to "P40 phone purchase link: http: / / ...", as shown below. Figure 3C As shown, the terminal's display screen redirects to the user interface for purchasing a P40 phone.

[0122] It should be understood that this is not limited to the above. Figures 3A-3C The user interface shown is the interface between the terminal and the execution device. Figures 3A-3C The user interface and its displayed content shown are merely exemplary descriptions of this application. The user interface may have other design methods and may include more or fewer controls and information. The above are merely exemplary descriptions of the embodiments of this application and should not be construed as limiting the embodiments of this application.

[0123] Below, in conjunction with Figure 2 The system architecture is described, and the various embodiments included in this application are introduced.

[0124] Example 1:

[0125] Please see Figure 4 , Figure 4 This is a flowchart of a method for obtaining target hotspot text provided in an embodiment of this application. This method can be achieved by the above... Figure 2The method is executed by the execution device 200, the first training device 300, the second training device 400, and the target hotspot text acquisition module 202 in the execution device 200. This embodiment of the application uses the execution device as an example for illustration. The method may include, but is not limited to, the following steps:

[0126] S100: The execution device selects the target hotspot set to which the target text belongs from multiple hotspot sets.

[0127] In one implementation, the similarity between the target text and each hotspot text in the first hotspot set can be calculated. Then, the similarity scores between the target text and each hotspot text in the first set are summed to obtain the similarity score of the target text on that hotspot set. Here, the first set is any one of the multiple hotspot sets. Further, the execution device determines the hotspot set with the highest similarity score of the target text on the multiple hotspot sets as the target hotspot set.

[0128] It should be understood that the formation of the target hotspot set is not limited to the implementation method in step S100. Step S100 may also include other implementation methods, which are not limited here.

[0129] S102: The execution device calculates the similarity between each hotspot text in the target hotspot set and the target text.

[0130] The similarity between hot text and target text can be calculated using methods such as cosine similarity, Jaccard similarity coefficient, simhash algorithm, etc., and no specific method is specified here.

[0131] In this embodiment, the target hotspot set includes multiple hotspot texts. The implementation method for obtaining the target hotspot set can be found in the detailed description of steps S202-S206 below.

[0132] S104: The executing device determines the top N hotspot texts in the target hotspot set that have the highest similarity to the target text as the target hotspot texts.

[0133] It should be understood that target hotspot text is one or more hotspot texts derived from the target hotspot set, and is hotspot text related to the target text. Here, N is a positive integer, such as 4, 6, 3, etc.

[0134] In another implementation, the execution device can further determine the target hotspot texts as target hotspot texts whose similarity to the target text is greater than a first threshold. The first threshold can be a preset value, a positive number less than 1, such as 0.8 or 0.5. A similarity of 0 indicates that the two are unrelated, and a similarity of 1 indicates that they are identical. This preset value can also be a value that ensures the target hotspot text includes N hotspot texts; in this case, the target hotspot text includes the N hotspot texts in the hotspot set that have the highest similarity to the target text.

[0135] The execution device may also use other methods to determine target hotspot text similar to the target text, which are not limited here.

[0136] It should be understood that the multiple hotspot sets in step S100 above can be obtained from other devices or generated by the execution device. The following example illustrates one implementation method for obtaining hotspot sets, which may include, but is not limited to, the following steps:

[0137] S202: The execution device acquires multiple hot texts.

[0138] In one possible implementation, the execution device can retrieve multiple hot texts from a database.

[0139] In one possible implementation, the execution device can obtain a list of trending topics from at least one third-party platform. Each trending topic list includes at least one trending text. The execution device then preprocesses the trending texts from all the obtained trending topic lists, such as by deduplication, to obtain the multiple trending texts. The third-party platform can be a platform like Weibo, Zhihu, or Baidu, and its corresponding trending topic lists can be Weibo's trending searches, Zhihu's hot topics list, Baidu's Baidu hot topics list, etc.

[0140] S204: The execution device will cluster the multiple hot texts it has acquired to obtain multiple hot text sets.

[0141] Each hotspot set has a cluster center. The sum of the similarities between the cluster center of each hotspot set and other hotspot texts in that hotspot set is greater than the sum of the similarities between any hotspot text in that hotspot set and other hotspot texts in that hotspot set. The similarity between a hotspot text in each hotspot set and the cluster center of that hotspot set is not less than the similarity between the hotspot text and the cluster center of any other hotspot set among the multiple hotspot sets.

[0142] In one implementation, for the multiple hot texts, the execution device divides the multiple hot texts into multiple hot text sets through clustering. Taking the execution device dividing the multiple hot texts into K hot text sets as an example, the following explanation is provided. Specifically: ① For the multiple hot texts, the execution device randomly selects K hot texts from the multiple hot texts, which are used as the initial cluster centers of K hot text sets; ② Calculate the similarity between each hot text and each of the K cluster centers, and assign each hot text to the hot text set containing the cluster center with the highest similarity, so that the multiple hot texts are divided into K hot text sets, with each hot text belonging to one hot text set; ③ Based on the divided K hot text sets, redetermine the cluster center of each hot text set, where the sum of the similarities between the cluster center and each hot text in the set is greater than the sum of the similarities between any hot text in the set and the other hot texts in the set; ④ Based on the redetermined cluster centers, iteratively calculate steps ② and ③ until the cluster centers no longer change, indicating that the execution device has completed the division of the multiple hot texts into K hot text sets.

[0143] It should be understood that K can be a value randomly selected by the execution device during the clustering operation, or it can be a pre-set value. K is a positive integer greater than 1.

[0144] It should be understood that the method for calculating the similarity between two trending texts can be Euclidean distance, cosine similarity, etc., and no limitation is made here.

[0145] It should be understood that the implementation of dividing multiple hot texts into multiple sets in step S204 is not limited to the above implementation method. It can also be implemented by other clustering algorithms, such as K-centroid clustering algorithm, DBSCAN clustering algorithm, etc., which are not limited here.

[0146] Example (II):

[0147] Please see Figure 5 This is a flowchart illustrating a neural network training method provided in an embodiment of this application. Specifically, this method can be... Figure 2 The method is executed by the first training device 300 shown. Optionally, the method can also be processed by the CPU in the first training device 300, or it can be processed jointly by the CPU and a processor suitable for neural network computation; this application does not impose any limitations. The method may include some or all of the following steps:

[0148] S202: The first training device acquires multiple samples, each of which includes the target hotspot text corresponding to the sample text and the true intent corresponding to the sample text.

[0149] By using the implementation method for obtaining the target hotspot text corresponding to the target text as described in the above embodiment (I), the target hotspot text corresponding to the sample text can be obtained. At this time, the sample text is the target text mentioned above.

[0150] S204: The first training device establishes an initialized first model, which includes an encoder and a decoder. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The decoder includes a second recurrent neural network and a second output module.

[0151] S206: The first training device inputs the target hotspot text corresponding to the sample text into the first model, and obtains the predicted intents of the target hotspot text corresponding to the sample text.

[0152] It should be understood that the time step of the first recurrent network is denoted by t, and the time step of the second recurrent neural network is denoted by t'.

[0153] Please see Figure 6 This is a schematic diagram of a neural network structure provided in an embodiment of this application.

[0154] like Figure 6 As shown, the specific implementation of step S206 may include: the first training device inputs multiple hotspot texts, including the target hotspot text, into the encoder to obtain the text features corresponding to time step t'. Specifically, the first recurrent neural network processes the hidden state output at the previous time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t; the weight calculation module processes the hidden state output by the first recurrent neural network and the hidden state of the second recurrent neural network at time step t'-1 to obtain the weight of each hidden state output by the first recurrent neural network; and the first output module performs a weighted summation of the hidden states output by the first recurrent neural network based on these weights to obtain the text features input by the second recurrent neural network at time step t'.

[0155] The text features corresponding to time step t' are input into the decoder to obtain the hidden state corresponding to time step t'. The second recurrent neural network processes the hidden state output from the previous time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module outputs the predicted intent for each hotspot text in the target hotspot text based on the hidden states output by the second recurrent neural network.

[0156] S208: The first training device constructs a loss function based on the predicted intent obtained from the target hotspot text corresponding to the sample text and the true intent of the target hotspot text corresponding to the sample text, and optimizes the model parameters in the first model through the loss function.

[0157] In one implementation, the loss function can be constructed using cross-entropy, and can be expressed in the following form:

[0158]

[0159] Among them, y t It is the true intent corresponding to the hot text input at time step t of the first recurrent neural network. t' This refers to the predicted intent corresponding to the hotspot text output at time step t' of the second recurrent neural network. The predicted intent output by the hidden state of the second recurrent neural network at time step t' is the predicted intent corresponding to the hotspot text input by the first recurrent neural network at time step t. P represents P time steps, where P is a positive integer.

[0160] The samples are sequentially input into the first model, and the loss is calculated using the aforementioned loss function. All model parameters in the first model are optimized until the first model converges. After training the first model, the target hotspot text corresponding to the text to be identified can be input into the first model to obtain the hidden state of the decoder and obtain the hotspot features of the text to be identified.

[0161] Example (3):

[0162] Please see Figure 7 This is a flowchart illustrating another neural network training method provided in this application embodiment. Specifically, this method can be... Figure 2 The method is executed by the first training device 300 shown. Optionally, the method can also be processed by the CPU in the first training device 300, or it can be processed jointly by the CPU and a processor suitable for neural network computation; this application does not impose any limitations. The method may include some or all of the following steps:

[0163] S302: The first training device acquires multiple samples, each of which includes the target hotspot text corresponding to the sample text and the true intent corresponding to the sample text.

[0164] The implementation of step S302 can be found in the detailed description of step S202 above, and is not limited here.

[0165] S304: The first training device establishes an initialized first model, which includes an encoder and a decoder. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The decoder includes a second recurrent neural network and a second output module.

[0166] S306: The first training device inputs the target hotspot text corresponding to the sample text into the first model to obtain the predicted intent of the sample text.

[0167] Please see Figure 8 This is a schematic diagram of another neural network structure provided in an embodiment of this application. Figure 8 As shown, the specific implementation of step S306 may include: the first training device inputs the target hotspot text corresponding to the sample text into the encoder to obtain predicted hotspot features. Specifically, the first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t; the weight calculation module is used to process the hidden state output by the first recurrent neural network to obtain the weight of each hidden state in the output hidden state; the first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network according to the weight of each hidden state in the output hidden state to obtain the predicted hotspot features.

[0168] The predicted hotspot features are input into the decoder to obtain the predicted intent of the sample text. Specifically, the second recurrent neural network processes the hidden state output from the previous time step t'-1 and the input predicted hotspot features to obtain the hidden state at time step t'. The second output module outputs the predicted intent of the sample text based on the hidden state output by the second recurrent neural network.

[0169] S308: The first training device constructs a loss function based on the predicted intent and the true intent of the sample text, and optimizes the model parameters in the first model through the loss function.

[0170] The samples are sequentially input into the first model, and the loss is calculated using the loss function. All model parameters in the first model are optimized until the first model converges. After the first model is trained, the target hotspot text corresponding to the text to be identified can be input into the encoder of the first model. The encoder outputs the hotspot features of the text to be identified.

[0171] Example (4):

[0172] Please see Figure 9 This is a flowchart illustrating another neural network training method provided in an embodiment of this application. Specifically, this method can be... Figure 2 The method is executed by the second training device 400 shown. Optionally, the method can also be processed by the CPU in the second training device 500, or by a combination of the CPU and a processor suitable for neural network computation; this application does not impose any limitations. The method may include some or all of the following steps:

[0173] S402: The second training device acquires multiple samples, each of which includes sample text, hotspot features corresponding to the sample text, and the true intent of the sample text.

[0174] The hotspot features corresponding to the sample text are extracted from the target hotspot text corresponding to the sample text. By using the implementation method for obtaining the target hotspot text corresponding to the target text described in Example (I) above, the target hotspot text corresponding to the sample text can be obtained. At this time, the sample text is the target text mentioned above.

[0175] In one implementation, the target hotspot text corresponding to the sample text can be input into the first model trained through the above embodiment (II) to obtain the hidden state of the decoder and obtain the hotspot features of the sample text.

[0176] In another implementation, the target hotspot text corresponding to the sample text can be input into the encoder of the first model trained through the above embodiment (iii), and the output of the encoder can be obtained to obtain the hotspot features of the sample text.

[0177] It should be understood that the implementation methods of hotspot features corresponding to sample texts are not limited to the above-mentioned methods. The acquisition of hotspot texts corresponding to sample texts may also include other implementation methods, which are not limited here.

[0178] S404: The second training device establishes an initial intent recognizer, which is a deep neural network.

[0179] The intent recognizer consists of an input layer, a hidden layer, and an output layer.

[0180] S406: The second training device inputs the sample text and the hotspot features corresponding to the sample text into the intent recognizer to obtain the predicted intent obtained from the sample text.

[0181] S408: The second training device optimizes the model parameters of the intent recognizer based on the predicted intent obtained from the sample text and the real intent corresponding to the sample text.

[0182] The model parameters of the intent recognizer are all contained in the weight matrix w1 of the hidden layer and the weight matrix w2 of the output layer. The essence of neural network training is to update the parameters in w1 and w2. When training the neural network, w1 and w2 must first be initialized. During the initialization process, the parameters contained in w1 and w2 can be randomly selected. Then, through subsequent training processes, the randomly selected parameters are continuously updated. For example, the backpropagation algorithm is used to correct the weight matrices w1 and w2.

[0183] It should be noted that the above-described methods for training neural networks are not limited to the methods provided above. The above methods are merely illustrative examples of this application and should not be construed as limiting this application. Other implementation methods may also be included, which are not limited here.

[0184] Optionally, in one possible implementation, each sample may further include historical intent features corresponding to the sample text. In this case, during the training of the intent recognizer, the training device takes the sample text, the hotspot features corresponding to the sample text, and the historical intent features corresponding to the sample text as input, outputs the predicted intent, compares the predicted intent with the intent corresponding to the sample text to determine the loss, and thus continuously updates the parameters in the intent recognizer. One implementation for obtaining the historical intent features corresponding to the sample text can be: first, obtaining the historical intents corresponding to the sample text, where each sample text can correspond to at least one historical intent; second, determining the weight of each historical intent, where the more frequently a historical intent appears, the higher its weight; and then, calculating the historical intent features corresponding to the sample text. In one implementation, the historical intent features corresponding to the sample text can be a weighted sum of all historical intents.

[0185] Example (5):

[0186] Please see Figure 10A This is a flowchart of an intent recognition method provided in an embodiment of this application. The method can be derived from the above... Figure 2 The intent recognition method, executed jointly by the terminal 100 and the execution device 200, may include some or all of the following steps:

[0187] S502: The terminal acquires the text to be recognized.

[0188] The text to be recognized can be text input by the user, text obtained through speech recognition from speech collected by a microphone, or text obtained through image recognition from an input image.

[0189] S504: The terminal sends the text to be recognized to the execution device.

[0190] S506: The execution device obtains the hotspot features corresponding to the received text to be identified.

[0191] The hotspot feature is a feature extracted from the target hotspot text corresponding to the text to be identified. The target hotspot text corresponding to the text to be identified can be obtained by the method described in the above embodiment (I). At this time, the target text is the text to be identified.

[0192] The methods for extracting hotspot features from the target hotspot text corresponding to the text to be identified can include, but are not limited to, the following two implementation methods.

[0193] Implementation method 1:

[0194] In one possible implementation, the method for extracting hotspot features from the target hotspot text corresponding to the text to be identified may include the following steps:

[0195] S5061: The execution device determines the weight of the text to be identified on the first hotspot text as the similarity between the text to be identified and the first hotspot text, where the first hotspot text is any hotspot text in the target hotspot text corresponding to the text to be identified.

[0196] It should be understood that the greater the similarity between the first hot text and the text to be identified, the higher the weight of the first hot text and the text to be identified.

[0197] S5062: The execution device performs a weighted summation of the hotspot text in the target hotspot text to obtain hotspot features.

[0198] Implementation Method 2:

[0199] In one possible implementation, hotspot features can be extracted from the target hotspot text corresponding to the text to be identified using a trained first model. Specifically, corresponding to the two implementations of the first model trained in embodiments (II) and (III) above, the extraction of hotspot features includes the following implementations (A) and (B):

[0200] Implementation method (A):

[0201] The execution device can input the target hotspot text corresponding to the text to be identified into the first model trained through the above embodiment (II), obtain the final hidden state of the decoder, and obtain the hotspot features of the text to be identified.

[0202] In the specific implementation: the target hotspot text is input into an encoder to obtain the text features corresponding to time step t'. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. Specifically, the first recurrent neural network processes the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t; the weight calculation module processes the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network; and the first output module performs a weighted summation of the hidden states output by the first recurrent neural network according to the weights to obtain the text features corresponding to time step t'.

[0203] The text features corresponding to time step t' are input into the decoder to obtain the hidden state corresponding to time step t'. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output from the previous time step t'-1 and the text features input from time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text based on the hidden state output by the second recurrent neural network.

[0204] The hidden state output by the second recurrent neural network at the last time step is the final hidden state, which is the hotspot feature extracted from the target hotspot text.

[0205] Implementation method (B):

[0206] The execution device can input the target hotspot text corresponding to the text to be identified into the encoder of the first model trained through the above embodiment (III), obtain the output of the encoder, and obtain the hotspot features of the text to be identified.

[0207] In the specific implementation: the target hotspot text is input into an encoder to obtain the hotspot features of the text to be identified. The encoder includes a first recurrent neural network, a weight calculation module, and an output module. Specifically, the first recurrent neural network processes the hidden states output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t; the weight calculation module processes the hidden states output by the first recurrent neural network to obtain the weight of each hidden state in the output hidden states; and the output module performs a weighted summation of the hidden states output by the first recurrent neural network based on the weight of each hidden state in the output hidden states to obtain the hotspot feature.

[0208] It should be understood that the methods for extracting hotspot features from target hotspot texts are not limited to those described in Implementation Method 1 and Implementation Method 2 above, and may include other implementation methods, which are not limited here.

[0209] S508: Input the text to be identified and the hotspot features corresponding to the text to the intent recognizer to obtain the recognition result. The intent recognizer is a model trained by the method described in the above embodiment (iv).

[0210] It should be understood that the recognition result is used to indicate the intent of the text to be recognized. The granularity of the intent can be set based on the actual application. The more labels on the training samples used to train the intent recognizer, the finer the granularity, and the more intents the trained intent recognizer can identify. For example, for the user-inputted text "P40", the intent could include "search for encyclopedia information about the P40 phone", "search for news information about the P40 phone", "search for purchase links for the P40 phone", "search for pictures of the P40 phone", etc. Combining the hot topic features extracted from the target hot topic texts corresponding to "P40", such as "P40 phone is currently on hot pre-sale" and "P40 phone sales have exceeded 100,000 units", after inputting "P40" and these hot topic features into the intent recognizer, the recognition result could be "search for purchase links for the P40 phone".

[0211] Alternatively, the above-described intent recognition method can also be composed of the above-described... Figure 2 The terminal 100 shown is executing. Please refer to [link / reference]. Figure 10B This is a flowchart of another intent recognition method provided in an embodiment of this application. The intent recognition method may include, but is not limited to, the following steps:

[0212] S602: The terminal obtains a first model, which is trained by the method described in embodiment (II) or embodiment (III) above. The second model is used to extract hotspot features from the target hotspot text.

[0213] S604: The terminal obtains an intent recognizer, which is trained by the method described in the above embodiment (iv) and is used to recognize the intent of the text to be recognized.

[0214] S606: The terminal acquires the text to be recognized.

[0215] The specific implementation of step S606 can be found in the description of step S502 above, and will not be repeated here.

[0216] S608: The terminal obtains the hotspot features corresponding to the received text to be identified.

[0217] The specific implementation of step S608 can be found in the detailed description of step S506 above, and will not be repeated here.

[0218] S610: The terminal inputs the text to be recognized and the hotspot features corresponding to the text to be recognized into the intent recognizer to obtain the recognition result.

[0219] The specific implementation of step S610 can be found in the detailed description of step S608 above, and will not be repeated here.

[0220] It should be understood that steps S602 and S604 are not necessarily required during the execution of the intent recognition method.

[0221] It should be understood that the execution method of this intent recognition method is not limited to the implementation methods described in steps S502-S508 and S602-610 above. The above two implementation methods are only some implementation methods of this application, and other implementation methods may also be included. For example, the intent recognition method may also be executed by the execution device alone, which is not limited here.

[0222] Optionally, after the execution device obtains the recognition result corresponding to the text to be recognized, the intent recognition method may further include obtaining the response information corresponding to the recognition result. The following explanation uses the example of the terminal and the execution device jointly executing the intent recognition method; please refer to [link to relevant documentation]. Figure 10C This is a flowchart of another intent recognition method provided in an embodiment of this application. In this case, the device performing the intent recognition method may further include the aforementioned... Figure 2 In the response device 500, the above intent recognition method may further include some or all of the following steps:

[0223] S702: The executing device sends the identification result to the responding device.

[0224] S704: The responding device receives the identification result and obtains response information based on the identification result.

[0225] The response information can take the form of one or more of the following: text, images, links, audio, video, or audio-visual combinations. The response information can also be a command used to instruct the terminal to perform a corresponding operation, such as the command "Open the purchase link for the P40 phone: https: / / www....".

[0226] S706: The responding device sends the response information to the executing device.

[0227] S708: The executing device sends the response information to the terminal.

[0228] S710: The terminal receives and outputs the response information.

[0229] If the response information is in the form of text, voice, or image, the terminal can display the response information through a display device (such as a screen) or play the response information to the user in the form of audio through an audio device (speaker, loudspeaker, etc.). If the response information is a command, the terminal can execute the operation corresponding to the response information, such as jumping to the user interface corresponding to the response information, or controlling other electronic devices (such as smart bulbs, air conditioners, etc.) to perform corresponding operations, such as turning down the volume of the speakers.

[0230] It should be understood that the execution device and the response device can be the same device, in which case steps S702 and S706 may not be necessary.

[0231] In this embodiment, the method acquires the text to be identified; inputs the text to be identified and its corresponding hotspot features into an intent recognizer, and outputs a recognition result. The intent recognizer is a neural network used to identify multiple intents. The recognition result indicates the intent of the text to be identified. The hotspot features are features extracted from target hotspot text, which includes at least one hotspot text similar to the text to be identified. Therefore, this intent recognition method considers that hotspots change over time, and the same text to be identified may correspond to different intents. Thus, in the intent recognition process, the text to be identified is combined with hotspots, and hotspot features are extracted from related hotspot texts, thereby focusing on the timeliness of the intent and improving the accuracy of intent recognition.

[0232] Based on the above description, an electronic device 100 provided in the embodiments of this application is described below, which can correspond to the above-described... Figure 2 The terminal 100 in the device can be used to perform the method described in embodiment (v) above.

[0233] Figure 11 A structural schematic diagram of terminal 100 is shown. For example... Figure 11 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0234] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0235] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0236] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0237] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0238] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0239] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0240] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0241] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0242] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0243] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0244] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0245] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0246] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0247] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0248] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0249] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0250] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0251] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0252] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0253] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0254] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0255] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0256] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0257] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0258] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0259] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0260] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0261] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0262] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0263] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0264] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.

[0265] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0266] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0267] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.

[0268] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0269] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0270] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0271] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0272] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0273] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0274] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0275] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0276] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0277] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0278] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0279] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0280] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0281] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0282] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.

[0283] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0284] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0285] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0286] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0287] Below, we present a schematic diagram of another electronic device 200 provided in an embodiment of this application. For example... Figure 12 As shown, the electronic device 200 can specifically correspond to Figure 2 The electronic device 200 includes an execution device 200, a first training device 300, a second training device 400, or a response device 500. The electronic device 200 can execute the methods described in embodiments (I) to (V). The electronic device 200 may include a processor 201, a bus 202, a network interface 203, and a memory 204. The communication bus 202 is used to implement communication between these components. The network interface 203 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). Figure 12 As shown, the memory 204, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program. When the device 200 is running, the aforementioned operating system, network communication module, user interface module, and device control application program can be stored.

[0288] Furthermore, it should be noted that this application embodiment also provides a computer storage medium, which stores the computer program executed by the electronic device 100 and electronic device 200 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the methods mentioned in embodiments (I) to (V) above, which will not be described again here.

[0289] Furthermore, the beneficial effects of using the same method will not be repeated here. For technical details not disclosed in the embodiments of the computer storage medium involved in this application, please refer to the description of the method embodiments of this application.

[0290] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. An intent recognition method, characterized in that, include: Obtain the text to be recognized; The text to be identified and its corresponding hotspot features are input into an intent recognizer, and the recognition result is output. The intent recognizer is a neural network for recognizing multiple intents. The recognition result is used to indicate the intent of the text to be identified. The hotspot features are features extracted from target hotspot texts. The target hotspot texts include at least one hotspot text similar to the text to be identified. The hotspot texts are updated over time. If at least one hotspot text included in the target hotspot text at the first time is different from at least one hotspot text included in the target hotspot text at the second time, the identification result identified at the first time is the first result, and the identification result identified at the second time is the second result.

2. The method according to claim 1, characterized in that, The method further includes: The target hotspot text is input into an encoder to obtain the text features corresponding to time step t'. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network. The first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network according to the weights to obtain the text features corresponding to time step t'. The text features corresponding to time step t' are input into the decoder to obtain the hidden state corresponding to time step t'. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text according to the hidden state output by the second recurrent neural network. The hidden state output by the second recurrent neural network at the last time step is the hotspot feature.

3. The method according to claim 1, characterized in that, The method further includes: The hotspot features are obtained by weighted summation of the hotspot texts in the target hotspot text. The weight of each hotspot text in the target hotspot text is determined by the similarity between each hotspot text and the text to be identified.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: Select the target hotspot set to which the text to be identified belongs from multiple hotspot sets; Calculate the similarity between the text to be identified and each hotspot text in the target hotspot set; The target hotspot texts are determined as the top N hotspot texts in the target hotspot set that have the highest similarity to the text to be identified.

5. The method according to claim 4, characterized in that, Before selecting the target hotspot set to which the text to be identified belongs from multiple hotspot sets, the method further includes: Retrieve multiple trending texts; Clustering the multiple hot texts yields multiple hot text sets.

6. A method for training a neural network, characterized in that, include: The target hotspot text corresponding to the sample text is input into the encoder to obtain the text features corresponding to time step t'. The target hotspot text includes at least one hotspot text similar to the sample text. The hotspot text is updated over time. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network. The first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network according to the weights to obtain the text features corresponding to time step t'. The text features corresponding to time step t' are input into the decoder to obtain the predicted intent corresponding to time step t'. The encoder outputs the intent of one hot text in the target hot text at a certain time. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text according to the hidden state output by the second recurrent neural network. Based on the loss between the predicted intent of all hot texts in the target hot text and the true intent of the sample text, adjust the model parameters of the encoder and the model parameters of the decoder. The target hot text includes at least one hot text that is different from the target hot text included at least one hot text that is different in the second time. The true intent of the sample text in the first time is the first intent, and the true intent of the sample text in the second time is the second intent.

7. A method for training a neural network, characterized in that, include: The sample text and the hotspot features corresponding to the sample text are input into the intent recognizer to obtain the predicted intent. The hotspot features are features extracted from the target hotspot text, which includes at least one hotspot text similar to the sample text. The hotspot text is updated over time. The model parameters of the intent recognizer are adjusted based on the loss between the predicted intent corresponding to the sample text and the true intent corresponding to the sample text. The target hot text includes at least one hot text that is different from the target hot text included at least one hot text that is different in the second time. The true intent of the sample text in the first time is the first intent, and the true intent of the sample text in the second time is the second intent.

8. The method according to claim 7, characterized in that, The method further includes: The target hotspot text is input into an encoder, which outputs the hotspot features. The encoder includes a first recurrent neural network, a weight calculation module, and an output module. The first recurrent neural network processes the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module processes the hidden state output by the first recurrent neural network to obtain the weight of each hidden state in the output hidden state. The output module performs a weighted summation of the hidden states output by the first recurrent neural network based on the weight of each hidden state in the output hidden state to obtain the hotspot features.

9. An execution device for intent recognition, characterized in that, The execution device includes: one or more processors and a memory, the memory being coupled to the one or more processors, the memory storing computer program code, the computer program code including computer instructions, and the one or more processors being configured to invoke the computer instructions to cause the execution device to execute: Obtain the text to be recognized; The text to be identified and its corresponding hotspot features are input into an intent recognizer, and the recognition result is output. The intent recognizer is a neural network for recognizing multiple intents. The recognition result is used to indicate the intent of the text to be identified. The hotspot features are features extracted from target hotspot texts. The target hotspot texts include at least one hotspot text similar to the text to be identified. The hotspot texts are updated over time. If at least one hotspot text included in the target hotspot text at the first time is different from at least one hotspot text included in the target hotspot text at the second time, the identification result identified at the first time is the first result, and the identification result identified at the second time is the second result.

10. The execution device according to claim 9, characterized in that, The execution device is also used to perform: The target hotspot text is input into an encoder to obtain the text features corresponding to time step t'. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network. The first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network according to the weights to obtain the text features corresponding to time step t'. The text features corresponding to time step t' are input into the decoder to obtain the hidden state corresponding to time step t'. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text according to the hidden state output by the second recurrent neural network. The hidden state output by the second recurrent neural network at the last time step is the hotspot feature.

11. The execution device according to claim 9, characterized in that, The execution device is also used to perform: The hotspot features are obtained by weighted summation of the hotspot texts in the target hotspot text. The weight of each hotspot text in the target hotspot text is determined by the similarity between each hotspot text and the text to be identified.

12. The execution device according to any one of claims 9-11, characterized in that, The execution device is also used to perform: Select the target hotspot set to which the text to be identified belongs from multiple hotspot sets; Calculate the similarity between the text to be identified and each hotspot text in the target hotspot set; The target hotspot texts are determined as the top N hotspot texts in the target hotspot set that have the highest similarity to the text to be identified.

13. The execution device according to claim 12, characterized in that, Before selecting the target hotspot set to which the text to be identified belongs from multiple hotspot sets, the execution device is further configured to perform: Retrieve multiple trending texts; Clustering the multiple hot texts yields multiple hot text sets.

14. A training device, characterized in that, The training device includes: one or more processors and a memory, the memory being coupled to the one or more processors, the memory storing computer program code, the computer program code including computer instructions, and the one or more processors being used to invoke the computer instructions to cause the training device to execute: The target hotspot text corresponding to the sample text is input into the encoder to obtain the text features corresponding to time step t'. The target hotspot text includes at least one hotspot text similar to the sample text. The hotspot text is updated over time. The encoder includes a first recurrent neural network, a weight calculation module, and a first output module. The first recurrent neural network is used to process the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module is used to process the hidden state output by the first recurrent neural network and the hidden state at time step t'-1 to obtain the weight of each hidden state in the hidden state output by the first recurrent neural network. The first output module is used to perform a weighted summation of the hidden states output by the first recurrent neural network according to the weights to obtain the text features corresponding to time step t'. The text features corresponding to time step t' are input into the decoder to obtain the predicted intent corresponding to time step t'. The encoder outputs the intent of one hot text in the target hot text at a certain time. The decoder includes a second recurrent neural network and a second output module. The second recurrent neural network is used to process the hidden state output at time step t'-1 and the text features input at time step t' to obtain the hidden state at time step t'. The second output module is used to output the predicted intent of each hot text in the target hot text according to the hidden state output by the second recurrent neural network. Based on the loss between the predicted intent of all hot texts in the target hot text and the true intent of the sample text, adjust the model parameters of the encoder and the model parameters of the decoder. The target hot text includes at least one hot text that is different from the target hot text included at least one hot text that is different in the second time. The true intent of the sample text in the first time is the first intent, and the true intent of the sample text in the second time is the second intent.

15. A training device, characterized in that, The training device includes: one or more processors and a memory, the memory being coupled to the one or more processors, the memory storing computer program code, the computer program code including computer instructions, and the one or more processors being used to invoke the computer instructions to cause the training device to execute: The sample text and the hotspot features corresponding to the sample text are input into the intent recognizer to obtain the predicted intent. The hotspot features are features extracted from the target hotspot text, which includes at least one hotspot text similar to the sample text. The hotspot text is updated over time. The model parameters of the intent recognizer are adjusted based on the loss between the predicted intent corresponding to the sample text and the true intent corresponding to the sample text. The target hot text includes at least one hot text that is different from the target hot text included at least one hot text that is different in the second time. The true intent of the sample text in the first time is the first intent, and the true intent of the sample text in the second time is the second intent.

16. The training device according to claim 15, characterized in that, The training device is also used to perform: The target hotspot text is input into an encoder, which outputs the hotspot features. The encoder includes a first recurrent neural network, a weight calculation module, and an output module. The first recurrent neural network processes the hidden state output at time step t-1 and the hotspot text input at time step t to obtain the hidden state at time step t. The weight calculation module processes the hidden state output by the first recurrent neural network to obtain the weight of each hidden state in the output hidden state. The output module performs a weighted summation of the hidden states output by the first recurrent neural network based on the weight of each hidden state in the output hidden state to obtain the hotspot features.

17. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an execution device, cause the execution device to perform any one of the methods as described in claims 1-5.

18. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on a training device, cause the training device to perform the method as described in claim 6.

19. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on a training device, cause the training device to perform any of the methods described in claim 7 or 8.