Intention recognition method, intention recognition neural network training method, and electronic device

By extracting and fusing the phonetic, glyphic, and semantic features of the question text, typos are corrected and intent vectors are generated. This solves the problem of intent recognition errors caused by typos in user input and improves the accuracy of the chatbot's responses.

CN119761367BActive Publication Date: 2026-04-14KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In AI chatbots, errors in user input can lead to incorrect intent recognition, negatively impacting the user experience.

Method used

By acquiring the phonetic, glyphic, and semantic features of the question text, feature fusion is performed, a semantic vector library is queried to correct misspelled words, an intent vector is generated, and it is decoded into natural language text.

Benefits of technology

Accurately identifying user intent even in the presence of typos improves the accuracy of responses from AI chatbots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761367B_ABST
    Figure CN119761367B_ABST
Patent Text Reader

Abstract

The present disclosure provides an intention recognition method, a training method of an intention recognition neural network, an electronic device, a readable storage medium and a computer program product. The intention recognition method of the present disclosure comprises: obtaining a question text, the question text containing a wrong word; performing feature extraction on the question text to obtain phonetic features, orthographic features and semantic features of the question text; performing feature fusion on the phonetic features, the orthographic features and the semantic features of the question text to obtain a fusion feature vector; and querying a semantic vector library for a semantic vector with the highest similarity to the fusion feature vector, and determining the queried semantic vector as an intention vector, the intention vector representing an intention expressed by the question text on the basis of the wrong word being corrected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to an intent recognition method, a training method for an intent recognition neural network, an electronic device, a storage medium, and a program product. Background Technology

[0002] In AI-powered chatbot question-and-answer tasks, it's crucial to accurately identify the user's intent based on the Chinese input sequence and determine which chatbot capabilities to utilize in response. However, user input often contains misspelled words, confused words, and pinyin not converted into Chinese characters, leading to errors in the intent recognition task and ultimately causing incorrect chatbot responses, thus impacting user experience. Summary of the Invention

[0003] This disclosure provides an intent recognition method, an intent recognition neural network training method, an electronic device, a storage medium, and a program product.

[0004] According to one aspect of this disclosure, an intent recognition method is provided, comprising:

[0005] Obtain the question text, which contains misspelled words;

[0006] Feature extraction is performed on the question text to obtain the phonetic features, glyph features, and semantic features of the question text;

[0007] The phonetic features, glyph features, and semantic features of the question text are fused to obtain a fused feature vector;

[0008] The semantic vector with the highest similarity to the fused feature vector is queried from the semantic vector library. The queried semantic vector is determined as the intent vector, which represents the intent expressed by the question text after the misspelled words in it have been corrected.

[0009] The intent recognition method according to at least one embodiment of this disclosure further includes:

[0010] The intent vector is decoded into natural language text, and the decoded natural language text is determined as corrected text. The corrected text represents the text obtained by correcting the misspelled words in the question text to the correct words.

[0011] According to the intent recognition method of at least one embodiment of this disclosure, feature extraction is performed on the question text to obtain the phonetic features, glyph features, and semantic features of the question text, including:

[0012] The semantic features of the question text are obtained by performing word segmentation, word embedding, and position embedding on the question text.

[0013] The question text is converted into a pinyin sequence, and the pinyin sequence is processed by word segmentation, word embedding, and position embedding to obtain the phonetic features of the question text;

[0014] Edge detection processing is performed on the question text to obtain the glyph features of the question text.

[0015] According to at least one embodiment of the intent recognition method of this disclosure, feature fusion is performed on the phonetic features, glyph features, and semantic features of the question text to obtain a fused feature vector, including:

[0016] The phonetic features, glyph features, and semantic features of the question text are each used as a sub-feature in the comprehensive embedding vector and concatenated into the comprehensive embedding vector;

[0017] The attention score among the multiple sub-features is calculated based on a multi-head self-attention algorithm;

[0018] Obtain the feature weight value corresponding to each sub-feature, and calculate the weighted sum value of the sub-feature based on the feature weight value corresponding to each sub-feature and the attention score of the sub-feature;

[0019] The fused feature vector is obtained by encoding the weighted sum of each sub-feature of the integrated embedding vector.

[0020] According to another aspect of this disclosure, a method for training an intent recognition neural network is provided, the intent recognition neural network being used to perform the intent recognition method of this disclosure, the training method of the intent recognition neural network comprising:

[0021] Obtain a training set of misspelled words, wherein the training set of misspelled words includes multiple text sequences of misspelled words, and each text sequence of misspelled words includes at least one misspelled word;

[0022] Obtain the correct word text sequence corresponding to each of the multiple misspelled word text sequences, wherein the correct word text sequence is a text sequence obtained by replacing the misspelled words in the misspelled word text sequence with the correct words;

[0023] The correct word text sequence is subjected to intent recognition processing to obtain a prototype intent vector, and the prototype intent vector is stored in a semantic vector library;

[0024] The misspelled word text sequence is subjected to intent recognition processing to obtain a predicted intent vector;

[0025] The prototype intent vector with the highest similarity to the predicted intent vector in the semantic vector library is queried, and the queried prototype intent vector is determined as the target intent vector.

[0026] The target intent vector is decoded into natural language text, and the decoded natural language text is determined as the target text sequence.

[0027] The cross-entropy loss is calculated based on the prototype intent vector corresponding to the misspelled word text sequence, the target intent vector, the correct word text sequence corresponding to the misspelled word text sequence, and the target text sequence to obtain the target cross-entropy loss;

[0028] When the target cross-entropy loss is less than the loss threshold, the training of the intent recognition neural network is determined to be complete.

[0029] According to the training method of the intent recognition neural network according to at least one embodiment of the present disclosure, intent recognition processing is performed on the correct word text sequence to obtain a prototype intent vector, including:

[0030] Feature extraction is performed on the correct word text sequence to obtain prototype phonetic features, prototype glyph features, and prototype semantic features;

[0031] The prototype phonetic features, prototype glyph features, and prototype semantic features are fused to obtain the prototype intent vector.

[0032] According to the training method of the intent recognition neural network according to at least one embodiment of the present disclosure, the misspelled word text sequence is subjected to intent recognition processing to obtain a predicted intent vector, including:

[0033] Feature extraction is performed on the misspelled word text sequence to obtain predicted phonetic features, predicted character shape features, and predicted semantic features;

[0034] The predicted phonetic features, predicted glyph features, and predicted semantic features are fused to obtain the predicted intent vector.

[0035] According to a training method for an intent recognition neural network according to at least one embodiment of the present disclosure, a cross-entropy loss is calculated based on the prototype intent vector corresponding to the misspelled word text sequence, the target intent vector, the correct word text sequence corresponding to the misspelled word text sequence, and the target text sequence to obtain a target cross-entropy loss, including:

[0036] The first cross-entropy loss is calculated based on the prototype intent vector and the target intent vector corresponding to the misspelled word text sequence;

[0037] The second cross-entropy loss is calculated based on the correct word text sequence corresponding to the misspelled word text sequence and the target text sequence corresponding to the misspelled word text sequence.

[0038] The target cross-entropy loss is calculated based on the sum of the first cross-entropy loss and the second cross-entropy loss.

[0039] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, causing the processor to execute an intent recognition method according to any embodiment of this disclosure and / or execute a training method for an intent recognition neural network according to any embodiment of this disclosure.

[0040] According to another aspect of this disclosure, a readable storage medium is provided, wherein executable instructions are stored therein, which, when executed by a processor, are used to implement the intent recognition method of any embodiment of this disclosure and / or to execute the training method of the intent recognition neural network of any embodiment of this disclosure.

[0041] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements an intent recognition method according to any embodiment of this disclosure and / or implements a training method for an intent recognition neural network according to any embodiment of this disclosure. Attached Figure Description

[0042] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0043] Figure 1 This is a flowchart illustrating an intent recognition method according to one embodiment of the present disclosure.

[0044] Figure 2 This is a schematic diagram of the process of an intent recognition method according to one embodiment of the present disclosure.

[0045] Figure 3 This is a flowchart illustrating an intent recognition method according to one embodiment of the present disclosure.

[0046] Figure 4 This is a flowchart illustrating an intent recognition method according to one embodiment of the present disclosure.

[0047] Figure 5 This is a flowchart illustrating an intent recognition method according to one embodiment of the present disclosure.

[0048] Figure 6This is a flowchart illustrating a method for training an intent recognition neural network according to one embodiment of the present disclosure.

[0049] Figure 7 This is a schematic diagram illustrating the training process of an intent recognition neural network according to one embodiment of this disclosure.

[0050] Figure 8 This is a flowchart illustrating a method for training an intent recognition neural network according to one embodiment of the present disclosure.

[0051] Figure 9 This is a flowchart illustrating a method for training an intent recognition neural network according to one embodiment of the present disclosure.

[0052] Figure 10 This is a flowchart illustrating a method for training an intent recognition neural network according to one embodiment of the present disclosure.

[0053] Figure 11 This is a schematic block diagram of the structure of an intent recognition device according to one embodiment of the present disclosure.

[0054] Figure 12 This is a schematic block diagram of another intent recognition device according to one embodiment of the present disclosure.

[0055] Figure 13 This is a schematic block diagram of an electronic device according to one embodiment of the present disclosure. Detailed Implementation

[0056] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.

[0057] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0058] In AI chatbot dialogue scenarios, user-input questions are often in natural language. Natural language processing (NLP) is required to convert these questions into machine-understandable language so the AI ​​can interpret the user's intent and provide an accurate response. However, NLP cannot detect typos entered by the user. It simply translates the user's input into machine language according to strict character conversion rules. This can lead to the AI ​​interpreting the user's intent based on typos and responding incorrectly.

[0059] Embodiments of the present disclosure provide an intention recognition method, which can be executed by an electronic device such as a server and is used to recognize the intention of the question text input by the user terminal to obtain an intention vector that can be understood by a machine.

[0060] Figure 1 FIG. 4 shows a schematic diagram of the overall process of the intention recognition method M100 according to an embodiment of the present disclosure. As Figure 1 shown, the method includes steps S110 to S140.

[0061] Specifically, Figure 1 the method shown includes:

[0062] S110. Obtain the question text, where the question text contains misspelled words.

[0063] The question text is the text input by the user on the client side for asking questions to an artificial intelligence robot. An artificial intelligence robot is a software or program that can answer according to the text input by the user, such as ChatGPT, etc.

[0064] The target permission refers to the permission that the permission application request wants to apply for authorization. For example, when an image optimization software applies for the access permission of the local photo album, the access permission of the local photo album is the target permission.

[0065] Misspelled words include words composed of single or multiple characters, usually caused by incorrect input of the glyph or pronunciation of the correct word. For example, if the question text that the user wants to input is "What is the effective online store caliber?", but the actual input question text is "What thing is the effective online store caliber?", in this case, the user inputs the correct word "is" as the misspelled word "thing" with the same pronunciation, usually an input error when using the pinyin input method. Another example is that the actual input question text by the user is "What foot is the effective online store caliber?", in this case, the user inputs the correct word "is" as the misspelled word "foot" with the same spelling in the Wubi input method, which is an input error caused by the similar glyphs of "is" and "foot" in the Wubi input method.

[0066] It should be noted that the intention recognition method of the present disclosure does not recognize whether the question text contains misspelled words. If it contains misspelled words, the intention recognition method of the present disclosure can obtain the correct user intention after correcting the misspelled words. If it does not contain misspelled words, the intention recognition method of the present disclosure can still be normally executed to obtain the user's intention based on the question text.

[0067] S120. Extract features from the question text to obtain the phonetic feature, glyph feature and semantic feature of the question text.

[0068] Feature extraction from the query text involves converting the meaning and attributes of the characters into a machine-understandable format, typically represented as vector features. Phonetic features represent the pronunciation of characters. For Chinese characters, these can be converted into Pinyin representation, then encoded to convert the Pinyin of each word into a single phonetic feature, representing the pronunciation (Pinyin) of that word. For glyph features, image feature extraction techniques can be used to extract the shape and outline of each word and encode it as a glyph feature, representing the glyph structure of that word. For semantic features, the query text can be segmented and then encoded using normal natural language processing methods, encoding each word as a semantic feature, representing the meaning of that word.

[0069] In other words, for a single word segment in the question text, we can obtain its corresponding phonetic feature, glyph feature, and semantic feature. Since the question text contains multiple words, feature extraction from the question text can yield multiple phonetic features, multiple glyph features, and multiple semantic features.

[0070] S130. Perform feature fusion on the phonetic features, glyph features, and semantic features of the question text to obtain a fused feature vector.

[0071] The phonetic features, glyph features, and semantic features obtained in step S120 are features in vector form. Feature fusion of the above different features of the question text is to represent the phonetic, glyph, and semantic features of each word in the question text with a single vector for use in subsequent intent recognition steps.

[0072] S140. Query the semantic vector in the semantic vector library that has the highest similarity to the fused feature vector, and determine the queried semantic vector as the intent vector.

[0073] Among them, the intent vector represents the intent expressed in the question text after the typos have been corrected, which is the original intent that the user wanted to express.

[0074] A semantic vector library can be a memory matrix used to store a large number of predefined or pre-learned prototype features of user expressions (text input by the user). Each prototype feature is a high-dimensional vector called a semantic vector, representing a specific user expression. Specifically, it can represent a combination of phonetic, glyphic, and semantic features of a user expression, such as the meaning of a sentence, the pronunciation of each word in the sentence, and the glyphic features of each character in the sentence. When predefining the semantic vector library, common user expression patterns can be collected from a large amount of dialogue data and stored as semantic vectors. During the use of the semantic vector library, the memory matrix can be dynamically updated based on new user input to add new semantic vectors to the library.

[0075] The fused feature vector obtained in step S130 is a high-dimensional vector abstracted from the combination of phonetic, glyphic, and semantic features of the question text. If there are misspelled words in the question text, these are referred to as noise. The semantic vectors in the semantic vector library are all high-dimensional vectors generated from noise-free text conversion. Therefore, the semantic vector with the highest similarity to the fused feature vector is the high-dimensional vector that is closest to the combination of phonetic, glyphic, and semantic features expressed by the fused feature vector and is noise-free. Thus, the semantic vector with the highest similarity to the fused feature vector is determined as the intent vector, enabling the obtained intent vector to restore the user's noise-free expression as much as possible. This is the user's expression obtained after the misspellings in the question text have been corrected, allowing the user's actual intended intent to be restored from the question text containing misspellings.

[0076] In summary, the embodiments of this disclosure, even when the user-input question text contains typos and noise, can convert the question text into a fused feature vector representing the three dimensions of pronunciation, character form, and semantics. Then, the noise-free semantic vector with the highest similarity to the fused feature vector is retrieved as the vector representing the user's true intent. Thus, even with typos and noise in the question text, the AI ​​robot can understand the true intent of the question text based on the intent vector and provide a correct answer.

[0077] Please see Figure 2 , Figure 2 This is a schematic diagram illustrating an application scenario of the intent recognition method according to some embodiments of this disclosure.

[0078] exist Figure 2In the illustrated application scenario, the intent recognition method M100 of this disclosure can be implemented using an intent recognition neural network (neural network model). The intent recognition neural network includes a preprocessing module, an encoder, a memory module, and a decoder. The preprocessing module implements the methods in steps S110 to S120, namely, acquiring the user-inputted question text and extracting features from the question text to obtain its phonetic features, glyph features, and semantic features. The encoder implements the method in step S130, namely, fusing the phonetic features, glyph features, and semantic features of the question text to obtain a fused feature vector. The memory module stores a semantic vector library and implements the method in step S140, namely, querying the semantic vector library for the semantic vector with the highest similarity to the fused feature vector to obtain the intent vector. The decoder decodes the intent vector into natural language text.

[0079] In some embodiments of this disclosure, the intent recognition method further includes, for example: Figure 3 The step S150 shown.

[0080] S150. Decode the intent vector into natural language text, and identify the decoded natural language text as the corrected text.

[0081] The corrected text representation is the text obtained by correcting typos in the query text to correct words. In other words, the function of step S150 is to convert the machine language representation of the intent vector into a natural language representation of the corrected text for viewing by users or other personnel.

[0082] Typically, the intent vector obtained in step S140 can be used as input to the AI ​​robot, enabling it to understand the user's question intent. In some use cases, it may be necessary to manually verify whether the intent vector correctly expresses the content of the question text. In this case, the corrected text in natural language can be obtained through step S150 for manual verification.

[0083] In one example, suppose a dialogue system implements intelligent dialogue functionality. The dialogue system includes an intent recognition neural network and an AI chatbot. The intent recognition neural network generates an intent vector based on the user's input question text and decodes the intent vector into corrected text. Upon obtaining the corrected text, backend staff are notified to verify both the corrected text and the original question text, determining whether the corrected text correctly expresses the intent of the question. If the corrected text correctly expresses the intent of the question, the backend staff, through relevant instructions, controls the intent recognition neural network to transmit the generated intent vector to the AI ​​chatbot, enabling the AI ​​chatbot to generate a response.

[0084] In another example, upon receiving corrected text, the intent recognition neural network transmits the corrected text to an AI robot. The AI ​​robot displays the content of the corrected text to the user and asks if the user understands it correctly, while awaiting the user's subsequent input. If the user's subsequent input indicates that the corrected text is understood correctly, the AI ​​robot generates a response to the question text based on the intent vector. If the user's subsequent input indicates that the corrected text is misunderstood, the AI ​​robot can further prompt the user to input the correct understanding, allowing the user to correct typos and re-enter the question text.

[0085] Regarding step S120, in some embodiments of this disclosure, it may include, for example... Figure 4 Steps S1201 to S1203 are shown below. Please refer to... Figure 2 Steps S1201 to S1203 are used to extract semantic features, phonetic features and glyph features from the query text, respectively.

[0086] S1201. Perform word segmentation, word embedding, and position embedding on the question text to obtain its semantic features.

[0087] The process involves word segmentation of the question text, dividing the sentence into multiple words, each of which is called a word segment. For Chinese text segmentation, Chinese word segmentation tools such as Jieba, THULAC, and PKUSeg can be used.

[0088] In one example, during word segmentation, in addition to obtaining the segmented words, we can also obtain part-of-speech tags for the segmented words. Part-of-speech tags can be used to classify the segmented words and help the machine understand the meaning of the segmented words.

[0089] Word embedding is the process of mapping individual word segments to a continuous vector space, so that semantically similar word segments are closer together in this vector space, thus helping the machine understand the semantics of the word segments. Word embedding can be performed using word embedding tools. Commonly used word embedding tools include Word2Vec, GloVe, and BERT.

[0090] Positional embedding is used to represent the relative or absolute position of each word in a sentence, that is, the order of the words in the sentence, so that each word can retain the structural information of the sentence. In one example, positional embedding can be implemented by encoding the position of the word segments after word embedding based on sine and cosine functions, for example, by using the following formulas one and two.

[0091] Formula 1: ;

[0092] Formula 2: .

[0093] in, Indicates position code, This indicates the position of the word segment in the sentence. i is the dimension index of the word embedding vector of the word segment, and d is the total dimension of the word embedding vector of the word segment. i and d can be obtained by performing word embedding processing on the word segment.

[0094] Finally, by superimposing the word embedding and position embedding results of the same word segmentation, a word vector containing positional information can be obtained. This word vector based on a word segmentation is called the semantic feature of that word segmentation.

[0095] Step S1201 can obtain the semantic features corresponding to each word in the question text. The semantic features of the question text include the semantic features corresponding to each word in the question text.

[0096] S1202. Convert the question text into a pinyin sequence, and perform word segmentation, word embedding, and position embedding on the pinyin sequence to obtain the phonetic features of the question text.

[0097] In one example, the query text can be converted into a pinyin sequence by calling a pinyin word segmenter. Then, the pinyin sequence is sequentially processed through word segmentation, word embedding, and position embedding to obtain a word vector containing positional information. This word vector based on pinyin word segmentation is called the phonetic feature of that pinyin word segmentation. Specifically, word segmentation based on the pinyin sequence can divide the pinyin sequence into multiple pinyin words, each corresponding to a word in the query text, which is equivalent to a Chinese character word obtained in step S1201. Pinyin word segmentation does not represent the meaning of a word, but it can represent its pronunciation. The processes of word segmentation, word embedding, and position embedding are basically the same as those in step S1201, and will not be repeated here. Compared to word vectors obtained based on Chinese character word segmentation, word vectors obtained based on pinyin word segmentation express pronunciation but not semantics; therefore, they are called phonetic features.

[0098] Step S1202 can obtain the phonetic features of each word in the question text. The phonetic features of the question text include the phonetic features of each word in the question text corresponding to the pinyin word segment.

[0099] S1203. Perform edge detection processing on the question text to obtain the glyph features of the question text.

[0100] Edge detection processing is used to detect the edges of Chinese characters to extract their outlines, and then express the glyph features of the characters based on these outlines. Edge detection processing can be implemented by calling edge detection tools such as Canny, Sobel, and VitTransformer.

[0101] In one example, edge detection is performed on the query text, including edge detection for each Chinese character within the text. When performing edge detection on the Chinese characters in the query text, the characters are first converted into images, and then edge detection is performed on the corresponding images to obtain the glyph features of the character. For example, images of all Chinese characters are pre-collected, their sizes are standardized, and they are stored in a Chinese character image set. For each Chinese character in the query text, its corresponding image is queried from the image set, and this image is used for edge detection.

[0102] Edge detection is performed on the Chinese character images corresponding to the Chinese characters. The result is a high-dimensional vector that represents the global and local structural features of the Chinese characters, which becomes the glyph features of the Chinese characters. The glyph features of the question text include the glyph features corresponding to each Chinese character in the question text.

[0103] Regarding step S130, in some embodiments of this disclosure, it may include, for example... Figure 5 Steps S1301 to S1304 are shown.

[0104] S1301. The phonetic features, glyph features, and semantic features of the question text are each taken as a sub-feature in the comprehensive embedding vector and concatenated into the comprehensive embedding vector.

[0105] The purpose of step S1301 is to fuse the different features of the question text—phonetic, glyphic, and semantic—so that the resulting integrated embedding vector can express the phonetic, glyphic, and semantic information of the question text. Specifically, when generating the integrated embedding vector, the phonetic, glyphic, and semantic features of the question text are each used as a sub-feature within the integrated embedding vector. That is, the sub-features of the integrated embedding vector can include the phonetic, glyphic, and semantic features of the question text.

[0106] Please combine Figure 2, in one example, a linear transformation layer can be used to concatenate the phonetic features, grapheme features, and semantic features of the question text. The role of the linear transformation layer is to concatenate the phonetic features, grapheme features, and semantic features along the last dimension of these feature vectors to obtain a comprehensive embedding vector, and to map the concatenated comprehensive embedding vector to a lower-dimensional space to be able to assign weights to different types of sub-features (i.e., phonetic features, grapheme features, and semantic features).

[0107] S1302. Calculate the attention scores between multiple sub-features based on the multi-head self-attention algorithm.

[0108] In the multi-head self-attention mechanism, the representation of each token will be updated according to the dependencies between this token and other tokens, and these dependencies can be quantitatively represented by the attention scores. For example, for adjacent or close tokens, the attention scores between them are usually higher, indicating a stronger dependency. In contrast, for tokens that are far apart, the attention scores between them are usually lower, indicating a weaker dependency.

[0109] The dependencies between multiple sub-features in the comprehensive embedding vector include local dependencies, global dependencies, semantic dependencies, phonetic dependencies, and grapheme dependencies, etc., and each dependency is represented as an attention score. Among them, local dependencies refer to the relationships between adjacent or relatively close tokens in the sequence. For example, in the sentence "The weather is nice today", "天 (tiān)" and "气 (qì)" are adjacent tokens, and there is an obvious semantic association between them. This type of dependency usually manifests as short-distance interactions between tokens, especially in terms of grammatical structure, lexical collocation, etc. Global dependencies refer to the relationships between tokens that are far apart in the sequence. For example, in the sentence "I like to take a walk in the park on weekends", although "喜欢 (xǐ huān)" and "散步 (sàn bù)" are not adjacent, there is a semantic connection between them, jointly expressing the user's interests and hobbies. This type of dependency spans a relatively long distance and involves the understanding of the entire sentence. Semantic dependencies refer to the semantic associations between tokens, rather than just their positional relationships. For example, in the sentence "I bought a book yesterday", there is a semantic connection between "买 (mǎi)" and "书 (shū)", even though they are not adjacent tokens. This type of dependency helps the model understand the overall meaning of the sentence. Phonetic dependencies refer to the fact that tokens with similar pronunciations may have similar pronunciation patterns, such as "天 (tiān)" and "田 (tián)". Grapheme dependencies refer to the fact that tokens with similar graphemes may have similar writing structures, such as "日 (rì)" and "目 (mù)".

[0110] In multi-head self-attention mechanisms, each computation based on a multi-head self-attention algorithm is called an attention head, and different attention heads can focus on computing different types of dependencies. For example, some attention heads can focus on computing attention scores for sub-features representing pronunciation.

[0111] S1303. Obtain the feature weight value corresponding to each sub-feature, and calculate the weighted sum of the sub-features based on the feature weight value corresponding to each sub-feature and the attention score of the sub-feature.

[0112] Based on the above description, for each word segment in the query text, there are three corresponding sub-features in the comprehensive embedding vector: phonetic features concatenated to the comprehensive embedding vector, glyphic features concatenated to the comprehensive embedding vector, and semantic features concatenated to the comprehensive embedding vector. Building upon the use of a linear transformation layer to concatenate sub-features, a weight matrix can be used to assign weights to each different sub-feature, and these weights can be adjusted using a multi-head global self-attention mechanism.

[0113] Please combine Figure 2 Specifically, step S1302 can be implemented by the encoder of the intent recognition neural network. During the pre-training of the intent recognition neural network, the network is trained to assign weights to different sub-features. Thus, when using the trained intent recognition neural network, its encoder can assign weights to different sub-features.

[0114] An attention score can be calculated between every two sub-features. Multiple attention scores corresponding to the same sub-feature can be combined into a unified attention score matrix, representing the attention distribution of that sub-feature. Based on this, a weighted sum is then calculated using the attention score matrix of the sub-features and their feature weights. The resulting weighted sum is the updated representation of the sub-feature. This weighted sum not only includes the attribute features of the word segmentation itself represented by the sub-feature but also incorporates the dependencies between this sub-feature and other sub-features.

[0115] S1304. Encode the weighted sum of each sub-feature of the integrated embedding vector to obtain the fused feature vector.

[0116] In one example, the weighted sum of each sub-feature in the integrated embedding vector is encoded. This involves using a feedforward extension network to perform a non-linear transformation on the weighted sum, converting the linear sum into a non-linear feature (denoted as the non-linear feature). Residual connections and layer normalization are then applied, followed by stacked encoding through a six-layer encoder, enabling each non-linear feature to express longer-range dependencies. The final output of the sixth encoder layer is the fused feature vector, representing not only the phonetic, glyphic, and semantic features of each word in the query text, but also the role of each word in the entire sentence and its dependencies with other words.

[0117] Please combine Figure 2 The semantic vectors stored in the semantic vector library are pre-stored vectors obtained using the same scheme as steps S1301 to S1304. A semantic vector also includes the phonetic, glyphic, and semantic features of each word in a text, as well as the role of each word in the entire sentence and its dependencies on other words. The difference is that the semantic vectors stored in the semantic vector library come from text that does not contain misspelled words. Based on this, the semantic vector with the highest similarity to the fused feature vector is the semantic vector that best reconstructs the intent representation of the question text, considering the noise of phonetic and glyphic features. Thus, by determining the retrieved semantic vector as the intent vector, even when processing question text containing misspelled words, the user's true intent can still be expressed through the intent vector, allowing the AI ​​robot to understand the user's true intent and generate a correct response based on the intent vector.

[0118] In some embodiments of this disclosure, a training method M200 for an intent recognition neural network is also provided. The intent recognition neural network is used to execute the intent recognition method M100 of this disclosure.

[0119] Specifically, the training method M200 for the intent recognition neural network includes, for example: Figure 6 Steps S210 to S280 are shown.

[0120] S210. Obtain the training set of misspelled words.

[0121] The misspelled word training set includes multiple misspelled word text sequences, each containing at least one misspelled word. These misspelled word text sequences are used to provide training samples containing misspelled words, enabling the intent recognition neural network to learn its error correction capabilities.

[0122] S220. Obtain the correct word text sequence corresponding to each of the multiple misspelled word text sequences.

[0123] Among them, the correct word text sequence is the text sequence obtained by replacing the misspelled words in the misspelled word text sequence with the correct words, which is the text sequence that serves as the standard answer after error correction.

[0124] In one example, a sequence of misspelled words can be collected, and misspelled words in the misspelled word text sequence can be replaced with correct words through manual annotation to obtain the correct word text sequence corresponding to the misspelled word text sequence.

[0125] S230. Perform intent recognition processing on the correct word text sequence to obtain the prototype intent vector, and store the prototype intent vector in the semantic vector library.

[0126] Please combine Figure 2 The intent recognition process for the correct word text sequence involves using the correct word text sequence as input to the intent recognition neural network. This input is processed sequentially by a preprocessing module and an encoder to generate a prototype intent vector. The specific functions of the preprocessing module and encoder have been described previously and will not be repeated here. The resulting prototype intent vector is a high-dimensional vector containing the phonetic, glyphic, and semantic features of each word segment in the correct word text sequence, as well as representing the role of each segment in the entire sentence and its dependencies on other words.

[0127] A corresponding prototype intent vector is generated for each correct word text sequence using the same method, and the generated prototype intent vectors are stored in the semantic vector library.

[0128] S240. Perform intent recognition processing on the misspelled word text sequence to obtain the predicted intent vector.

[0129] Step S240 is similar to step S230, except that it uses the incorrect word text sequence to replace the correct word text sequence in step S230 as the input to the intent recognition neural network. This input is then processed by the preprocessing module and the encoder, with the encoder output being the predicted intent vector. Thus, the generated predicted intent vector is a high-dimensional vector containing the phonetic, glyphic, and semantic features of each segment in the incorrect word text sequence, as well as representing the role of each segment in the entire sentence and its dependencies on other segments.

[0130] S250. Query the prototype intent vector in the semantic vector library that has the highest similarity to the predicted intent vector, and determine the queried prototype intent vector as the target intent vector.

[0131] The prototype intent vector in the semantic vector library is equivalent to the correct answer for error correction. The purpose of step S250 is to train the intent recognition neural network to find the correct answer for error correction. If the target intent vector determined by the intent recognition neural network is a prototype vector generated based on the correct word text sequence corresponding to the misspelled word text sequence, then it means that the intent recognition neural network has successfully found the correct answer for error correction. In other words, whether the intent recognition neural network can successfully determine the correct prototype intent vector can be used as an optimization condition for whether the intent recognition neural network has completed training.

[0132] S260. Decode the target intent vector into natural language text, and determine the decoded natural language text as the target text sequence.

[0133] While the prototype intent vector in the semantic vector library serves as the correct answer for error correction, the correct word text sequence corresponding to the misspelled word text sequence can also serve as the correct answer. The higher the similarity and stronger the correlation between the target text sequence decoded from the target intent vector and the correct word text sequence corresponding to the misspelled word text sequence, the stronger the error correction capability of the intent recognition neural network. Therefore, whether the target text sequence is similar to or correlated with the correct word text sequence corresponding to the misspelled word text sequence can be used as an optimization condition for whether the intent recognition neural network has completed training.

[0134] S270. Calculate the cross-entropy loss based on the prototype intent vector, target intent vector, correct word text sequence, and target text sequence corresponding to the misspelled word text sequence, and obtain the target cross-entropy loss.

[0135] The cross-entropy loss can represent the difference between the probability distribution of the predicted result of the intent recognition neural network and the probability distribution of the true result. The smaller the cross-entropy, the closer the predicted result of the intent recognition neural network is to the true probability distribution. In the embodiments of this disclosure, the predicted result of the intent recognition neural network includes a target intent vector and a target text sequence. The true result corresponding to the target intent vector is the prototype intent vector corresponding to the misspelled word text sequence, and the true result corresponding to the target text sequence is the correct word text sequence corresponding to the misspelled word text sequence. Thus, the target cross-entropy loss obtained based on the prototype intent vector corresponding to the misspelled word text sequence, the target intent vector, the correct word text sequence corresponding to the misspelled word text sequence, and the target text sequence can represent a measure of the accuracy of the predicted result of the intent recognition neural network.

[0136] S280. In response to the target cross-entropy loss being less than the loss threshold, the training of the intention recognition neural network is completed.

[0137] When the target cross-entropy loss is less than the loss threshold, it indicates that the prediction result of the intention recognition neural network is accurate enough. Based on this, it can be determined that the training of the intention recognition neural network is complete.

[0138] Furthermore, the target intent vector is the result of the intent recognition task of the intent recognition neural network, while the target text sequence is the result of the error correction task of the intent recognition neural network. Thus, training the intent recognition neural network based on target cross-entropy loss can simultaneously optimize both the intent recognition and error correction tasks. Moreover, the optimization of these two tasks can share the weights of the encoder and decoder of the intent recognition neural network, thereby improving the accuracy and generalization ability of the intent recognition function.

[0139] Please see Figure 7 , Figure 7 This is a schematic diagram of the training process of an intent recognition neural network in some embodiments of this disclosure.

[0140] like Figure 7 As shown, during the training process of the intent recognition neural network, the processing method for misspelled word text sequences is different from... Figure 2 The application scenario for processing question text is similar. A preprocessing module and an encoder are used to perform intent recognition on the misspelled text sequence and generate a predicted intent vector. The intent vector is used as the input of the memory module, and the target intent vector output by the memory module is used as the first prediction result of the intent recognition neural network. The target intent vector is used as the input of the decoder, and the target text sequence output by the decoder is used as the second prediction result of the intent recognition neural network.

[0141] In one example, for a correct word text sequence, the decoder first learns how to correctly generate the text sequence. Then, the correct word text sequence corresponding to the misspelled word text sequence itself serves as the second true result corresponding to the second prediction. Furthermore, the prototype intent vector generated by performing intent recognition on the correct word text sequence is the first true result corresponding to the first prediction. Thus, we can obtain the first prediction, the first true result corresponding to the first prediction, the second prediction, and the second true result corresponding to the second prediction for optimizing the intent recognition neural network. This optimization training of the intent recognition neural network is achieved by calculating the cross-entropy loss of the aforementioned predictions and true results.

[0142] Regarding step S230, in some embodiments of this disclosure, it may include, for example... Figure 8 Steps S2301 to S2302 are shown.

[0143] S2301. Extract features from the correct word text sequence to obtain the prototype phonetic features, prototype glyph features, and prototype semantic features.

[0144] S2302. Perform feature fusion on the prototype phonetic features, prototype glyph features and prototype semantic features to obtain the prototype intent vector.

[0145] The feature extraction and feature fusion schemes in steps S2301 to S2302 are basically the same as those in the steps of the intent recognition method M100, and will not be described again here.

[0146] Regarding step S240, in some embodiments of this disclosure, it may include, for example... Figure 9 Steps S2401 to S2402 are shown.

[0147] S2401. Extract features from the misspelled word text sequence to obtain predicted pronunciation features, predicted character shape features, and predicted semantic features.

[0148] S2402. Perform feature fusion on the predicted phonetic features, predicted glyph features, and predicted semantic features to obtain the predicted intent vector.

[0149] The feature extraction and feature fusion schemes in steps S2401 to S2402 are basically the same as those in the steps of the intent recognition method M100, and will not be described again here.

[0150] Regarding step S270, in some embodiments of this disclosure, it may include, for example... Figure 10 Steps S2701 to S2703 are shown.

[0151] S2701. Calculate the first cross-entropy loss based on the prototype intent vector and target intent vector corresponding to the misspelled word text sequence.

[0152] The first cross-entropy loss represents the loss of the intent recognition task and is used to measure the accuracy of the intent recognition function of the intent recognition neural network.

[0153] S2702. Calculate the second cross-entropy loss based on the correct word text sequence corresponding to the misspelled word text sequence and the target text sequence corresponding to the misspelled word text sequence.

[0154] The second cross-entropy loss, representing the loss of the text correction task, is used to measure the accuracy of the text correction function of the intent recognition neural network.

[0155] S2703. Calculate the target cross-entropy loss based on the sum of the first cross-entropy loss and the second cross-entropy loss.

[0156] In one example, the arithmetic sum of the first cross-entropy loss and the second cross-entropy loss can be used as the target cross-entropy loss. In another example, corresponding first cross-entropy weights and second cross-entropy weights can be assigned to the first cross-entropy loss and the second cross-entropy loss respectively, and the weighted sum can be calculated as the target cross-entropy loss based on the product of the first cross-entropy loss and the first cross-entropy weight and the second cross-entropy loss and the second cross-entropy weight.

[0157] Based on any of the above embodiments, this disclosure also provides an intent recognition device. Figure 11 This is a schematic block diagram of the structure of an intent recognition device according to one embodiment of the present disclosure.

[0158] like Figure 11 As shown, the intent recognition device includes:

[0159] The preprocessing module 110 is used to obtain the question text, which contains typos.

[0160] The preprocessing module 110 is also used to extract features from the question text to obtain the phonetic features, glyph features and semantic features of the question text.

[0161] Encoder 120 is used to fuse the phonetic features, glyph features, and semantic features of the query text to obtain a fused feature vector.

[0162] The memory module 130 is used to query the semantic vector in the semantic vector library that has the highest similarity to the fused feature vector, and to determine the queried semantic vector as the intent vector. The intent vector represents the intent expressed by the question text after the misspellings in it have been corrected.

[0163] The aforementioned intent recognition device can be computer software, and its various modules can be computer software modules. For details on the implementation process of the functions and roles of each module in the aforementioned intent recognition device, please refer to the implementation process of the corresponding steps in the aforementioned method, which will not be repeated here.

[0164] The execution subject of the intent recognition method in the specific embodiments of this disclosure can be an electronic device such as a server.

[0165] Based on any of the above embodiments, this disclosure also provides another intent recognition device. Figure 11 This is a schematic block diagram of the structure of an intent recognition device according to one embodiment of the present disclosure.

[0166] like Figure 12 As shown, the intent recognition device includes:

[0167] Preprocessing module 110 is used to implement Figure 11 The preprocessing module 110 shown has all the functions and can be used for:

[0168] Obtain a training set of misspelled words, which includes multiple text sequences of misspelled words, and each text sequence of misspelled words includes at least one misspelled word;

[0169] Obtain the correct word text sequence corresponding to each of the multiple misspelled word text sequences. The correct word text sequence is the text sequence obtained by replacing the misspelled words in the misspelled word text sequence with the correct words.

[0170] Encoder 120, used to implement Figure 11 The encoder 120 shown has all the functions and can be used for:

[0171] The correct word text sequence is processed for intent recognition to obtain the prototype intent vector, and the prototype intent vector is stored in the semantic vector library;

[0172] Intent recognition processing is performed on the misspelled word text sequence to obtain the predicted intent vector.

[0173] Memory module 130 is used to implement Figure 11 The memory module 130 shown has all the functions and can be used for:

[0174] The system queries the semantic vector library for the prototype intent vector that has the highest similarity to the predicted intent vector, and then identifies the target intent vector as the target intent vector.

[0175] The decoding module 140 is used to decode the target intent vector into natural language text and determine the decoded natural language text as the target text sequence.

[0176] The optimization module 150 is used to calculate the cross-entropy loss based on the prototype intent vector, target intent vector, correct word text sequence, and target text sequence corresponding to the misspelled word text sequence, and to obtain the target cross-entropy loss.

[0177] The optimization module 150 is also used to determine that the training of the intent recognition neural network is complete in response to the target cross-entropy loss being less than the loss threshold.

[0178] The aforementioned intent recognition device can be computer software, and its various modules can be computer software modules. For details on the implementation process of the functions and roles of each module in the aforementioned intent recognition device, please refer to the implementation process of the corresponding steps in the aforementioned method, which will not be repeated here.

[0179] The execution entity of the training method for the intent recognition neural network in the specific embodiments of this disclosure can be an electronic device such as a server.

[0180] Based on any of the above embodiments, this disclosure also provides an electronic device that can execute the intent recognition method of any of the embodiments described above and / or the intent recognition neural network training method of any of the embodiments.

[0181] Figure 13 This is a schematic block diagram of an electronic device 1000 according to one embodiment of the present disclosure.

[0182] The hardware architecture of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application of the hardware and overall design constraints. Bus 1100 connects various circuits, including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400, such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.

[0183] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this diagram, but this does not imply that there is only one bus or only one type of bus.

[0184] This disclosure also provides a readable storage medium storing a computer program that, when executed by a processor, is used to implement the methods described above. A "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples of a readable storage medium include: an electrical connection with one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM), etc.

[0185] This disclosure also provides a computer program product, the methods of which can be implemented wholly or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially as a computer program product. A computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, all or part of the processes or functions of this disclosure are performed.

[0186] Computer programs or instructions can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, a computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. A readable storage medium can be any accessible medium or a data storage device such as a server or data center that integrates one or more accessible media. The accessible medium can be magnetic media, such as floppy disks, hard disks, and magnetic tapes; optical media, such as digital video discs; or semiconductor media, such as solid-state drives. The computer-readable storage medium can be volatile or non-volatile, or it can include both types of storage media.

[0187] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0188] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable intent-recognition device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable intent-recognition device, produce a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0189] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable intent-recognizing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0190] These computer program instructions can also be loaded onto a computer or other programmable intent-recognizing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0191] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., refer to specific features, structures, or characteristics described in connection with that embodiment / mode or example, which are included in at least one embodiment / mode or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.

[0192] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0193] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.

Claims

1. An intent recognition method, characterized in that, include: Obtain the question text, which contains misspelled words; Feature extraction is performed on the question text to obtain the phonetic features, glyph features, and semantic features of the question text; The phonetic features, glyph features, and semantic features of the question text are fused to obtain a fused feature vector; as well as The semantic vector with the highest similarity to the fused feature vector is queried from the semantic vector library, and the queried semantic vector is determined as the intent vector. The intent vector represents the intent expressed by the question text after the misspelled words in it have been corrected. The intent vector is decoded into natural language text, and the decoded natural language text is determined as corrected text. The corrected text represents the text obtained by correcting the misspelled words in the question text to the correct words.

2. The intent recognition method according to claim 1, characterized in that, Feature extraction is performed on the question text to obtain its phonetic features, glyph features, and semantic features, including: The semantic features of the question text are obtained by performing word segmentation, word embedding, and position embedding on the question text. The question text is converted into a pinyin sequence, and the pinyin sequence is then processed by word segmentation, word embedding, and positional embedding to obtain the phonetic features of the question text; and Edge detection processing is performed on the question text to obtain the glyph features of the question text.

3. The intent recognition method according to claim 1, characterized in that, The phonetic features, glyph features, and semantic features of the question text are fused to obtain a fused feature vector, including: The phonetic features, glyph features, and semantic features of the question text are each used as a sub-feature in the comprehensive embedding vector and concatenated into the comprehensive embedding vector; The attention score among the multiple sub-features is calculated based on a multi-head self-attention algorithm; Obtain the feature weight value corresponding to each sub-feature, and calculate the weighted sum of the sub-features based on the feature weight value corresponding to each sub-feature and the attention score of the sub-feature; and The fused feature vector is obtained by encoding the weighted sum of each sub-feature of the integrated embedding vector.

4. A training method for an intent recognition neural network, characterized in that, The intent recognition neural network is used to execute the intent recognition method of claim 1, and the training method of the intent recognition neural network includes: Obtain a training set of misspelled words, wherein the training set of misspelled words includes multiple text sequences of misspelled words, and each text sequence of misspelled words includes at least one misspelled word; Obtain the correct word text sequence corresponding to each of the multiple misspelled word text sequences, wherein the correct word text sequence is a text sequence obtained by replacing the misspelled words in the misspelled word text sequence with the correct words; The correct word text sequence is subjected to intent recognition processing to obtain a prototype intent vector, and the prototype intent vector is stored in a semantic vector library; The misspelled word text sequence is subjected to intent recognition processing to obtain a predicted intent vector; The prototype intent vector with the highest similarity to the predicted intent vector in the semantic vector library is queried, and the queried prototype intent vector is determined as the target intent vector. The target intent vector is decoded into natural language text, and the decoded natural language text is determined as the target text sequence. Based on the prototype intent vector corresponding to the misspelled word text sequence, the target intent vector, the correct word text sequence corresponding to the misspelled word text sequence, and the target text sequence, a cross-entropy loss is calculated to obtain the target cross-entropy loss; and When the target cross-entropy loss is less than the loss threshold, the training of the intent recognition neural network is determined to be complete.

5. The training method for the intent recognition neural network according to claim 4, characterized in that, The correct word text sequence is subjected to intent recognition processing to obtain a prototype intent vector, including: Feature extraction is performed on the correct word text sequence to obtain prototype phonetic features, prototype glyph features, and prototype semantic features; and The prototype phonetic features, prototype glyph features, and prototype semantic features are fused to obtain the prototype intent vector.

6. The training method for the intent recognition neural network according to claim 4, characterized in that, The misspelled word text sequence is subjected to intent recognition processing to obtain a predicted intent vector, including: Feature extraction is performed on the misspelled word text sequence to obtain predicted phonetic features, predicted glyph features, and predicted semantic features; and The predicted phonetic features, predicted glyph features, and predicted semantic features are fused to obtain the predicted intent vector.

7. The training method for the intent recognition neural network according to claim 4, characterized in that, Based on the prototype intent vector corresponding to the misspelled word text sequence, the target intent vector, the correct word text sequence corresponding to the misspelled word text sequence, and the target text sequence, the cross-entropy loss is calculated to obtain the target cross-entropy loss, including: The first cross-entropy loss is calculated based on the prototype intent vector and the target intent vector corresponding to the misspelled word text sequence; The second cross-entropy loss is calculated based on the correct word text sequence corresponding to the misspelled word text sequence and the target text sequence corresponding to the misspelled word text sequence; and The target cross-entropy loss is calculated based on the sum of the first cross-entropy loss and the second cross-entropy loss.

8. An electronic device, characterized in that, include: The memory stores execution instructions; as well as A processor that executes execution instructions stored in the memory, causing the processor to perform the intent recognition method according to any one of claims 1 to 3; and / or the training method for the intent recognition neural network according to any one of claims 4 to 7.

9. A readable storage medium, characterized in that, The readable storage medium stores execution instructions, which, when executed by a processor, are used to implement the intent recognition method of any one of claims 1 to 3; and / or the training method of the intent recognition neural network of any one of claims 4 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the intent recognition method according to any one of claims 1 to 3; and / or the training method of the intent recognition neural network according to any one of claims 4 to 7.

Citation Information

Patent Citations

  • Intention recognizing method based on text similarity

    CN110136699A

  • Deep learning-based Chinese spelling error correction method and system

    CN118278392A