Intention recognition method, training method of intention recognition neural network and electronic equipment

By extracting and fusing the pronunciation, glyph and semantic features of the question text, the semantic vector library is queried to correct typos, solving the intent recognition error caused by typos in user input, and improving the accuracy and user experience of intent recognition.

CN119761367AActive Publication Date: 2025-04-04KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411942387.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-04
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

In the question and answer tasks of artificial intelligence dialogue robots, the Chinese sequences entered by the user often contain typos, confusing words, and pinyin that are not converted into Chinese characters, resulting in intent recognition tasks that are performed incorrectly and affecting the user experience.

Method used

Provide an intent recognition method, which obtains the question text, extracts its pronunciation features, glyph features and semantic features, and performs feature fusion to obtain a fusion feature vector. Then, the semantic vector with the highest similarity to the fusion feature vector in the semantic vector library is queryed, and it is determined as an intention vector, corrects typos, and represents the user's true intention.

Benefits of technology

Effectively identify and correct typos in user input, improve the accuracy of intention recognition, improve the understanding of user intentions by artificial intelligence robots, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761367A_ABST
    Figure CN119761367A_ABST
Patent Text Reader

Abstract

The invention provides an intention recognition method, a training method of an intention recognition neural network, electronic equipment, a readable storage medium and a computer program product. The intention recognition method disclosed by the invention comprises the following steps: acquiring a question text, wherein the question text comprises wrong words; performing feature extraction on the question text to obtain character and pronunciation features, font features and semantic features of the question text; carrying out feature fusion on character and pronunciation features, font features and semantic features of the question text to obtain a fusion feature vector; and querying a semantic vector with the highest similarity with the fusion feature vector in a semantic vector library, and determining the queried semantic vector as an intention vector which represents the intention expressed on the basis that the wrong words in the question text are corrected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 Art

[0002] In the question-answering task of an AI conversational robot, it is necessary to accurately identify the user's intention based on the Chinese sequence input by the user, and decide which ability of the conversational robot to call for a reply based on the user's intention. However, since the user's input often contains typos, confusing words, and pinyin that has not been converted into Chinese characters, the intention recognition task of understanding the user's input intention is performed incorrectly, which ultimately causes the conversational robot to answer incorrectly, affecting the user experience. Summary of the invention

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

[0004] According to one aspect of the present disclosure, there is provided a method for identifying intent, comprising: Obtaining a question text, wherein the question text contains a wrong word; Extracting features of the question text to obtain phonetic features, glyph features and semantic features of the question text; Performing feature fusion on the phonetic feature, the glyph feature and the semantic feature of the question text to obtain a fused feature vector; The semantic vector library is queried for the semantic vector with the highest similarity to the fused feature vector, and the queried semantic vector is determined as an intention vector, wherein the intention vector represents the intention expressed by the question text based on the correction of the wrong words therein.

[0005] According to at least one embodiment of the present disclosure, the intention recognition method further includes: The intention vector is decoded into a natural language text, and the decoded natural language text is determined as a corrected text, wherein the corrected text represents a text obtained by correcting the incorrect words in the question text into correct words.

[0006] According to the intention recognition method of at least one embodiment of the present disclosure, feature extraction is performed on the question text to obtain the phonetic features, glyph features and semantic features of the question text, including: Performing word segmentation processing, word embedding processing and position embedding processing on the question text to obtain the semantic features of the question text; 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; Perform edge detection processing on the question text to obtain the glyph features of the question text.

[0007] According to the intention recognition method of at least one embodiment of the present disclosure, the phonetic feature, the glyph feature and the semantic feature of the question text are subjected to feature fusion to obtain a fused feature vector, including: The phonetic feature, the glyph feature and the semantic feature of the question text are respectively used as a sub-feature in a comprehensive embedding vector and are concatenated into the comprehensive embedding vector; Calculate the attention scores between the multiple sub-features based on the multi-head self-attention algorithm; Obtaining a feature weight value corresponding to each of the sub-features, and calculating a weighted sum of the sub-features based on the feature weight value corresponding to each of the sub-features and the attention score of the sub-feature; The weighted sum value of each of the sub-features of the comprehensive embedding vector is encoded to obtain the fused feature vector.

[0008] According to another aspect of the present disclosure, a training method for an intent recognition neural network is provided, wherein the intent recognition neural network is used to execute the intent recognition method of the present disclosure, and the training method for the intent recognition neural network includes: Acquire a wrong character training set, wherein the wrong character training set includes a plurality of wrong character text sequences, and each of the wrong character text sequences includes at least one wrong character; Obtaining a correct word text sequence corresponding to each of the plurality of incorrect word text sequences, wherein the correct word text sequence is a text sequence obtained by replacing incorrect words in the incorrect word text sequence with correct words; Performing intent recognition processing on the correct word text sequence to obtain a prototype intent vector, and storing the prototype intent vector in a semantic vector library; Performing intent recognition processing on the misspelled word text sequence to obtain a predicted intent vector; Querying the semantic vector library for a prototype intent vector with the highest similarity to the predicted intent vector, and determining the queried prototype intent vector as a target intent vector; Decoding the target intent vector into a natural language text, and determining the decoded natural language text as a target text sequence; Calculate the cross entropy loss based on the prototype intention vector corresponding to the incorrect word text sequence, the target intention vector, the correct word text sequence corresponding to the incorrect word text sequence, and the target text sequence to obtain a target cross entropy loss; In response to the target cross entropy loss being less than a loss threshold, it is determined that the intent recognition neural network training is completed.

[0009] According to at least one embodiment of the present disclosure, the training method of the intention recognition neural network performs intention recognition processing on the correct word text sequence to obtain a prototype intention vector, including: Extracting features from the correct word text sequence to obtain prototype pronunciation features, prototype shape features, and prototype semantic features; The prototype pronunciation feature, the prototype shape feature and the prototype semantic feature are subjected to feature fusion to obtain the prototype intention vector.

[0010] According to at least one embodiment of the present disclosure, the training method of the intention recognition neural network performs intention recognition processing on the wrong word text sequence to obtain a predicted intention vector, including: Extracting features from the misspelled word text sequence to obtain predicted pronunciation features, predicted shape features, and predicted semantic features; The predicted pronunciation feature, the predicted character shape feature and the predicted semantic feature are subjected to feature fusion to obtain the predicted intention vector.

[0011] According to at least one embodiment of the present disclosure, the training method of the intention recognition neural network calculates the cross entropy loss based on the prototype intention vector corresponding to the wrong word text sequence, the target intention vector, the correct word text sequence corresponding to the wrong word text sequence, and the target text sequence to obtain the target cross entropy loss, including: Calculate a first cross entropy loss based on the prototype intention vector and the target intention vector corresponding to the misspelled word text sequence; Calculate a second cross entropy loss based on the correct word text sequence corresponding to the incorrect word text sequence and the target text sequence corresponding to the incorrect word text sequence; The target cross entropy loss is calculated based on the sum of the first cross entropy loss and the second cross entropy loss.

[0012] According to another aspect of the present disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the intent recognition method of any embodiment of the present disclosure and / or executes the training method of the intent recognition neural network of any embodiment of the present disclosure.

[0013] According to another aspect of the present disclosure, a readable storage medium is provided, in which execution instructions are stored. When the execution instructions are executed by a processor, they are used to implement the intent recognition method of any embodiment of the present disclosure and / or execute the training method of the intent recognition neural network of any embodiment of the present disclosure.

[0014] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the intent recognition method of any embodiment of the present disclosure and / or executes the training method of the intent recognition neural network of any embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description 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.

[0016] Figure 1 It is a flowchart of an intent recognition method according to an embodiment of the present invention.

[0017] Figure 2 It is a process diagram of an intent recognition method according to an embodiment of the present invention.

[0018] Figure 3 It is a flowchart of an intent recognition method according to an embodiment of the present invention.

[0019] Figure 4 It is a flowchart of an intent recognition method according to an embodiment of the present invention.

[0020] Figure 5 It is a flowchart of an intent recognition method according to an embodiment of the present invention.

[0021] Figure 6 It is a flowchart of a method for training an intent recognition neural network according to an embodiment of the present disclosure.

[0022] Figure 7 It is a schematic diagram of the training process of the intention recognition neural network according to one embodiment of the present disclosure.

[0023] Figure 8 It is a flowchart of a method for training an intent recognition neural network according to an embodiment of the present disclosure.

[0024] Fig. 9 It is a flowchart of a method for training an intent recognition neural network according to an embodiment of the present disclosure.

[0025] Fig.10It is a flowchart of a method for training an intent recognition neural network according to an embodiment of the present disclosure.

[0026] Fig.11 It is a schematic block diagram of the structure of an intention recognition device according to an embodiment of the present disclosure.

[0027] Fig.12 It is a schematic block diagram of the structure of another intention recognition device according to an embodiment of the present disclosure.

[0028] Fig.13 It is a schematic block diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.

[0030] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0031] In the dialogue scenario of artificial intelligence robots, the question texts input by the user are often natural language texts, which need to be processed by natural language and converted into a language that the machine can understand, so that the artificial intelligence robot can understand the user's intention and give the correct answer. However, natural language processing cannot identify the wrong words entered by the user when entering the question text, and can only strictly copy the text entered by the user according to the character conversion rules and convert it into machine language. This will cause the artificial intelligence robot to understand the user's intention and answer according to the wrong words, resulting in the artificial intelligence robot giving the wrong answer.

[0032] An embodiment of the present disclosure provides an intent recognition method, which can be executed by an electronic device such as a server, and is used to perform intent recognition on a question text input by a user terminal to obtain a machine-understandable intent vector.

[0033] Figure 1 FIG. 1 is a schematic diagram showing the overall process of an intention recognition method M100 according to an embodiment of the present disclosure. Figure 1 The method shown includes steps S110 to S140.

[0034] Specifically, Figure 1 The methods shown include: S110: Obtain a question text, wherein the question text contains wrong words.

[0035] Among them, the question text is the text input by the user on the client side for asking questions to the artificial intelligence robot. The artificial intelligence robot is a software or program that can answer according to the text input by the user, such as ChatGPT and so on.

[0036] 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.

[0037] Misspelled words include words composed of single or multiple characters, usually caused by input errors in the glyph or pronunciation of the correct word. For example, if the question text that the user wants to input is "May I ask what is the effective online store caliber", but the actually input question text is "May I ask 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 actually input question text by the user is "May I ask 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 due to the similar glyphs of "is" and "foot" in the Wubi input method.

[0038] 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.

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

[0040] Among them, extracting features from the question text is to convert the characteristics such as the meaning and attributes of the characters in the question text into a format that can be understood by the machine, usually represented as features in vector form. The pronunciation feature is the feature that characterizes the pronunciation of the character. For the pronunciation feature of Chinese characters, the Chinese characters can be first converted into the form of Chinese pinyin for representation, and then encoded based on the Chinese pinyin. The pinyin of each word segment is converted into a pronunciation feature, and a pronunciation feature characterizes the pronunciation (pinyin) of a word segment. For the glyph feature of Chinese characters, based on the technology of image feature extraction, the shape, contour and other graphic structures of Chinese characters are extracted for each word segment and encoded into a glyph feature, and a glyph feature characterizes the glyph structure of a word segment. For the semantic feature of Chinese characters, after the question text is segmented, it is encoded in the normal natural language processing manner, and each word segment is encoded into a semantic feature, and a semantic feature characterizes the meaning of a word segment.

[0041] That is to say, for a segmented word in the question text, a corresponding pronunciation feature, a character shape feature, and a semantic feature can be obtained respectively. The question text includes multiple segmented words, so feature extraction of the question text can obtain multiple pronunciation features, multiple character shape features, and multiple semantic features.

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

[0043] The pronunciation features, glyph features and semantic features obtained in step S120 are features in the form of vectors. The purpose of fusing the above different features of the question text is to use a vector to represent the pronunciation, glyph and semantics of each word in the question text for use in the subsequent steps of intent recognition.

[0044] S140, querying the semantic vector library for the semantic vector with the highest similarity to the fused feature vector, and determining the queried semantic vector as the intention vector.

[0045] The intent vector represents the intent of the question text after the wrong words in the question text are corrected, that is, the intent that the user originally wanted to express.

[0046] The semantic vector library can be a memory matrix, which is used to store a large number of predefined or pre-learned user expression (user input text) feature prototypes. Each user expression feature prototype is a high-dimensional vector, called a semantic vector, which represents a specific user expression. Specifically, it can represent a combination of features such as pronunciation, glyph, and semantics of a user expression, such as the meaning of a sentence, the pronunciation of each word in the sentence, and the glyph of each word in the sentence. When predefining the semantic vector library, common user expression patterns can be collected from a large amount of conversation data and stored as semantic vectors. In the process of using the semantic vector library, the memory matrix can be dynamically updated according to new user input to add new semantic vectors to the semantic vector library.

[0047] The fused feature vector obtained in step S130 is a high-dimensional vector obtained by abstracting the combination of features such as pronunciation, glyph, and semantics of the question text. At this time, if there are wrong words in the question text, the wrong words are called noise in the question text. The semantic vectors in the semantic vector library are all high-dimensional vectors generated by noise-free text conversion. Based on this, the semantic vector with the highest similarity to the fused feature vector is the highest and noise-free high-dimensional vector that is closest to the combination of features such as pronunciation, glyph, and semantics expressed by the fused feature vector. In this way, the semantic vector with the highest similarity to the fused feature vector is determined as the intention vector, so that the obtained intention vector can restore the user's noise-free expression as much as possible, that is, the user expression obtained on the basis of the wrong words in the question text being corrected, so that the intention that the user actually wants to express can be restored based on the question text containing the wrong words.

[0048] In summary, the disclosed embodiment can convert the question text into a fused feature vector that simultaneously represents the three dimensions of pronunciation, character shape and semantics, and then query the noise-free semantic vector with the highest similarity to the fused feature vector as a vector representing the user's true intention when there is typos in the question text. In this way, when there is typos in the question text, the artificial intelligence robot can understand the true intention of the question text based on the intention vector to make a correct answer.

[0049] See also Figure 2 , Figure 2 It is a schematic diagram of application scenarios of the intent recognition method of some embodiments of the present disclosure.

[0050] exist Figure 2 In the illustrated application scenario, the intention recognition method M100 of the present disclosure can be implemented by an intention recognition neural network (neural network model). The intention recognition neural network includes a preprocessing module, an encoder, a memory module and a decoder. Among them, the preprocessing module is used to implement the method in steps S110 to S120, that is, to obtain the question text input by the user, and to extract features of the question text to obtain the phonetic features, glyph features and semantic features of the question text. The encoder is used to implement the method in step S130, that is, to perform feature fusion on the phonetic features, glyph features and semantic features of the question text to obtain a fused feature vector. The memory module is used to store the semantic vector library, and to implement the method in step S140, that is, to query the semantic vector library for the semantic vector with the highest similarity to the fused feature vector to obtain the intention vector. The decoder is used to decode the intention vector into a natural language text.

[0051] In some embodiments of the present disclosure, the intention recognition method further includes: Figure 3 Step S150 is shown.

[0052] S150: Decode the intention vector into natural language text, and determine the decoded natural language text as the error-corrected text.

[0053] The corrected text represents the text obtained by correcting the wrong words in the question text to the correct words. That is, the function of step S150 is to convert the intention vector represented by the machine language into the corrected text represented by the natural language for the user or other personnel to view.

[0054] Typically, the intent vector obtained in step S140 can be used as the input of the artificial intelligence robot to enable the artificial intelligence robot to understand the user's intention of asking questions. In some usage scenarios, it may be necessary to manually verify whether the intent vector can correctly express the content of the question text. In this case, the corrected text expressed in natural language can be obtained in step S150 for manual verification.

[0055] In one example, it is assumed that the function of intelligent dialogue is realized by a dialogue system. The dialogue system includes an intention recognition neural network and an artificial intelligence robot. The intention recognition neural network is used to generate an intention vector based on the question text input by the user, and decode the intention vector into a corrected text. When the corrected text is obtained, the backstage staff is notified to verify the corrected text and the question text to determine whether the corrected text can correctly express the intention of the question text. If it is determined that the corrected text can correctly express the intention of the question text, the backstage staff controls the intention recognition neural network through relevant instructions to transmit the generated intention vector to the artificial intelligence robot, so that the artificial intelligence robot generates a reply.

[0056] In another example, when obtaining the corrected text, the intent recognition neural network transmits the corrected text to the artificial intelligence robot, which displays the content of the corrected text to the user and asks the user whether the user understands it correctly, and waits for the user's subsequent input in response. If it can be determined based on the user's subsequent input that the corrected text is understood correctly, the artificial intelligence robot generates a reply to the question text based on the intent vector. If it can be determined based on the user's subsequent input that the corrected text is not understood correctly, the user can be further prompted to enter the correct understanding, so that the user can correct the wrong words by himself and re-enter the question text.

[0057] Regarding step S120, in some embodiments of the present disclosure, it may include the following steps: Figure 4 Steps S1201 to S1203 are shown. Figure 2 , steps S1201 to S1203 are respectively used to extract semantic features, phonetic features and character shape features from the question text.

[0058] S1201, performing word segmentation, word embedding and position embedding processing on the question text to obtain semantic features of the question text.

[0059] The question text is segmented to segment the sentences of the question text into multiple words, each of which is called a segmented word. For the segmentation of Chinese text, a Chinese segmentation tool can be called, such as Jieba, THULAC, PKUSeg and other segmentation tools.

[0060] In one example, when performing word segmentation processing, in addition to obtaining the segmented words, part-of-speech tags of the word segmentation can also be obtained. The part-of-speech tags can be used to classify the word segmentation and help the machine understand the meaning of the word segmentation.

[0061] Word embedding is the process of mapping each word segment to a continuous vector space, so that semantically similar words are close to each other in the vector space, which helps the machine understand the semantics of the word segment. Word embedding can be implemented by calling word embedding tools. Commonly used word embedding tools include Word2Vec, GloVe, BERT and other word embedding tools.

[0062] Position 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, position embedding can be implemented by position encoding the word after word embedding based on sine and cosine functions, for example, by the following formulas 1 and 2.

[0063] Formula 1: ; Formula 2: .

[0064] in, represents the position code, It represents the position of the word in the sentence, i is the dimension index of the word embedding vector of the word segmentation, and d is the total dimension of the word embedding vector of the word segmentation. i and d can be obtained by embedding the word segmentation.

[0065] Finally, by superimposing the word embedding processing results and position embedding processing results of the same word segmentation, we can get a word vector containing position information. This word vector obtained based on a word segmentation is called the semantic feature of this word segmentation.

[0066] Through step S1201 , the semantic features corresponding to each segmentation in the question text can be obtained. The semantic features of the question text include the semantic features corresponding to each segmentation in the question text.

[0067] S1202, converting the question text into a pinyin sequence, and performing word segmentation, word embedding and position embedding processing on the pinyin sequence to obtain the phonetic features of the question text.

[0068] In one example, the question text can be converted into a pinyin sequence by calling a pinyin segmenter, and then the pinyin sequence is sequentially subjected to segmentation processing, word embedding processing and position embedding processing to obtain a word vector containing position information. The word vector obtained based on a pinyin segmentation is called the phonetic feature of this pinyin segmentation. Among them, the pinyin sequence can be divided into multiple pinyin segmentations by performing segmentation processing based on the pinyin sequence, and each pinyin segmentation corresponds to a vocabulary in the question text, that is, it can correspond to a Chinese character segmentation obtained in step S1201. Pinyin segmentation does not represent the meaning of the word, but can represent the pronunciation of the word. The process of the above-mentioned segmentation processing, word embedding processing and position embedding processing is basically the same as the processing process in step S1201, and will not be repeated here. Compared with the word vector obtained based on the pinyin segmentation and the word vector obtained based on the Chinese character segmentation, the word vector obtained based on the pinyin segmentation expresses pronunciation but does not express semantics, so it is called a phonetic feature.

[0069] Through step S1202, the phonetic features corresponding to each word segment in the question text can be obtained. The phonetic features of the question text include the phonetic features corresponding to the pinyin word segment of each vocabulary in the question text.

[0070] S1203: Perform edge detection on the question text to obtain the font features of the question text.

[0071] Edge detection is used to detect the edges of Chinese characters to extract the outline of Chinese characters, and to express the shape features of Chinese characters based on the outline of Chinese characters. Edge detection can be achieved by calling edge detection tools such as Canny, Sobel, and VitTransformer.

[0072] In one example, edge detection processing is performed on the question text, including performing edge detection processing on each Chinese character in the question text separately. When performing edge detection processing on the Chinese characters in the question text, it is necessary to first convert the Chinese characters into the form of Chinese character images, and then perform edge detection on the Chinese character images corresponding to the Chinese characters to obtain the glyph features corresponding to the Chinese characters. For example, images of all Chinese characters are collected in advance, and the sizes of the images of these Chinese characters are unified and stored in a Chinese character picture set. For each Chinese character in the question text, the corresponding Chinese character image is queried in the Chinese character picture set, so that the Chinese character image corresponding to the Chinese character is used for edge detection.

[0073] The Chinese character image corresponding to the Chinese character is processed by edge detection, and the processing result is a high-dimensional vector, which represents the global and local structural features of the Chinese character and becomes the glyph feature of the Chinese character. The glyph feature of the question text includes the glyph features corresponding to each Chinese character in the question text.

[0074] Regarding step S130, in some embodiments of the present disclosure, it may include the following steps: Figure 5 Steps S1301 to S1304 are shown.

[0075] S1301: The phonetic feature, the glyph feature and the semantic feature of the question text are respectively used as a sub-feature in the comprehensive embedding vector and are concatenated into the comprehensive embedding vector.

[0076] The purpose of step S1301 is to fuse together the different features of the question text that express the pronunciation, glyph, and semantics, so that the integrated embedding vector obtained after the fusion can express the pronunciation, glyph, and semantic information of the question text. When generating the integrated embedding vector, the pronunciation feature, glyph feature, and semantic feature of the question text are respectively used as a sub-feature in the integrated embedding vector. In other words, the sub-features of the integrated embedding vector may include the pronunciation feature, glyph feature, and semantic feature of the question text.

[0077] Please combine Figure 2 In one example, the phonetic features, glyph features, and semantic features of the question text can be concatenated using a linear transformation layer. The linear transformation layer is used to concatenate the phonetic features, glyph 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 so as to assign weights to different types of sub-features (i.e., phonetic features, glyph features, and semantic features).

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

[0079] In the multi-head self-attention mechanism, the expression of each word is updated according to the dependencies between it and other words, which can be quantitatively represented by attention scores. For example, for adjacent or close words, the attention scores between them are usually higher, indicating stronger dependencies. In contrast, for words that are farther apart, the attention scores between them are usually lower, indicating weaker dependencies.

[0080] The dependencies among multiple sub - features in the comprehensive embedding vector include local dependencies, global dependencies, semantic dependencies, phonetic dependencies, and glyph dependencies, etc. Each dependency is manifested as an attention score. Among them, the local dependency refers to the relationship between adjacent or relatively close word segments in the sequence. For example, in the sentence "The weather is nice today", "天 (tiān)" and "气 (qì)" are adjacent word segments, and there is an obvious semantic association between them. This kind of dependency is usually manifested as short - distance interaction between word segments, especially in terms of grammatical structure, lexical collocation, etc. The global dependency refers to the relationship between word segments 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 kind of dependency spans a relatively long distance and involves the understanding of the whole sentence. The semantic dependency refers to the semantic association between word segments, rather than just their positional relationship. For example, in the sentence "I bought a book yesterday", there is a semantic connection between "买 (mǎi)" and "书 (shū)", although they are not adjacent word segments. This kind of dependency helps the model understand the overall meaning of the sentence. The phonetic dependency means that word segments with similar pinyin may have similar pronunciation patterns, such as "天 (tiān)" and "田 (tián)". The glyph dependency means that word segments with similar glyphs may have similar writing structures, such as "日 (rì)" and "目 (mù)".

[0081] In the multi - head self - attention mechanism, each calculation based on the multi - head self - attention algorithm is called an attention head. Different attention heads can focus on calculating different types of dependencies. For example, some attention heads can focus on calculating the attention scores of sub - features representing phonetics.

[0082] S1303. 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.

[0083] Combined with the above description, for each word segment in the question text, there are three sub - features corresponding to it in the comprehensive embedding vector, namely the phonetic feature concatenated to the comprehensive embedding vector, the glyph feature concatenated to the comprehensive embedding vector, and the semantic feature concatenated to the comprehensive embedding vector. On the basis of concatenating sub - features using a linear transformation layer, weights for each different sub - feature can be assigned through a weight matrix, and these weights can be adjusted using the multi - head global self - attention mechanism.

[0084] Please combine Figure 2Specifically, step S1302 can be implemented by an encoder of the intent recognition neural network, and the intent recognition neural network can be trained to learn to assign weights to different sub-features in the pre-training of the intent recognition neural network. In this way, when using the trained intent recognition neural network, the encoder of the intent recognition neural network can assign respective weights to different sub-features.

[0085] An attention score can be calculated between every two sub-features. For multiple attention scores corresponding to the same sub-feature, they can be combined into a unified attention score matrix to represent the attention distribution of this sub-feature. Based on this, the attention score matrix of the sub-feature is further combined with the feature weight value of the sub-feature for weighted summation. The obtained weighted sum value is the updated representation of this sub-feature. This weighted sum value not only contains the attribute characteristics of the word segmentation represented by the sub-feature itself, but also integrates the dependency relationship between this sub-feature and other sub-features.

[0086] S1304: Encode the weighted sum value of each sub-feature of the comprehensive embedding vector to obtain a fused feature vector.

[0087] In one example, the weighted sum of each sub-feature of the comprehensive embedding vector is encoded, specifically including using a feedforward extension network to perform nonlinear transformation processing on the weighted sum, processing the linear weighted sum into a nonlinear feature, recorded as a nonlinear feature, and using residual connection and layer normalization processing, and through the stacked encoding of the six-layer encoder, each nonlinear feature can express a longer-distance dependency. The output of the final sixth-layer encoder is a fused feature vector, which not only represents the pronunciation, shape, semantics and other features of each word in the question text, but also can represent the role of each molecule in the entire sentence and the dependency relationship with other words.

[0088] Please combine Figure 2 , the semantic vector stored in the query semantic vector library is a pre-stored vector obtained using the same scheme as steps S1301 to S1304. A semantic vector also includes the pronunciation, glyph, semantics and other features of each word segment in a text, as well as the ability to represent the role of each molecule in the entire sentence and the dependency relationship with other word segments. The difference is that the semantic vectors stored in the semantic vector library are derived from texts that do not contain typos. Based on this, the semantic vector with the highest similarity to the fused feature vector is a semantic vector that can best restore the intention representation of the question text based on the noise of the pronunciation and glyph features. In this way, the queried semantic vector is determined as an intention vector, and when processing a question text containing typos, the user's true intention can still be expressed through the intention vector, so that the artificial intelligence robot can understand the user's true intention based on the intention vector and generate a correct answer.

[0089] In some embodiments of the present disclosure, a training method M200 for an intention recognition neural network is also provided, wherein the intention recognition neural network is used to execute the intention recognition method M100 of the embodiment of the present disclosure.

[0090] Specifically, the training method M200 of the intention recognition neural network includes: Figure 6 Steps S210 to S280 are shown.

[0091] S210, obtaining a wrong character training set.

[0092] The wrong character training set includes a plurality of wrong character text sequences, each of which includes at least one wrong character. The wrong character text sequence is used to provide training samples containing wrong characters to train the intention recognition neural network to learn error correction capabilities.

[0093] S220, obtaining the correct word text sequences corresponding to each of the multiple incorrect word text sequences.

[0094] The correct word text sequence is a text sequence obtained by replacing the incorrect words in the incorrect word text sequence with correct words, that is, a text sequence that serves as a standard answer after error correction.

[0095] In one example, incorrect word text sequences may be collected, and incorrect words in the incorrect word text sequences may be replaced with correct words by manual annotation to obtain correct word text sequences corresponding to the incorrect word text sequences.

[0096] S230, performing intent recognition processing on the correct word text sequence to obtain a prototype intent vector, and storing the prototype intent vector in a semantic vector library.

[0097] Please combine Figure 2 , the correct word text sequence is processed for intent recognition, and the correct word text sequence is used as the input of the intent recognition neural network, and is processed by the preprocessing module and the encoder in sequence to generate a prototype intent vector. Among them, the specific functions performed by the preprocessing module and the encoder have been introduced in the previous article and will not be repeated here. Thus, the generated prototype intent vector is a high-dimensional vector that contains the pronunciation, shape, semantics and other features of each word segment in the correct word text sequence, as well as the role of each molecule in the entire sentence and the dependency relationship with other word segments.

[0098] In the same way, a corresponding prototype intention vector is generated for each correct word text sequence, and the generated prototype intention vector is stored in the semantic vector library.

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

[0100] Step S240 is similar to the method of step S230, except that the incorrect word text sequence is used to replace the correct word text sequence of step S230 as the input of the intention recognition neural network, and is processed by the preprocessing module and the encoder in turn, and the output of the encoder is the predicted intention vector. Thus, the generated predicted intention vector is a high-dimensional vector that contains the pronunciation, shape, semantics and other features of each word segment in the incorrect word text sequence, as well as the role of each molecule in the entire sentence and the dependency relationship with other word segments.

[0101] S250, querying the semantic vector library for the prototype intent vector with the highest similarity to the predicted intent vector, and determining the queried prototype intent vector as the target intent vector.

[0102] The prototype intention 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 intention vector determined by the intent recognition neural network is a prototype vector generated based on the correct word text sequence corresponding to the wrong word text sequence, 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 intention vector can be used as an optimization condition for whether the intent recognition neural network has been trained.

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

[0104] While the prototype intent vector in the semantic vector library is used as the correct answer for error correction, the correct word text sequence corresponding to the incorrect word text sequence can also be used as the correct answer for error correction. The higher the similarity and the stronger the correlation between the target text sequence obtained by decoding the target intent vector and the correct word text sequence corresponding to the incorrect word text sequence, the stronger the error correction ability of the intent recognition neural network can be characterized. Based on this, whether the target text sequence is similar or related to the correct word text sequence corresponding to the incorrect word text sequence can be used as an optimization condition for whether the intent recognition neural network has been trained.

[0105] S270, calculating the cross entropy loss 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.

[0106] The calculation of the cross entropy loss can represent the difference between the probability distribution of the prediction result of the intent recognition neural network and the probability distribution of the true result. The smaller the cross entropy, the closer the prediction result of the intent recognition neural network is to the true probability distribution. In an embodiment of the present disclosure, the prediction result of the intent recognition neural network includes a target intent vector and a target text sequence. Among them, the true result corresponding to the target intent vector is the prototype intent vector corresponding to the wrong word text sequence, and the true result corresponding to the target text sequence is the correct word text sequence corresponding to the wrong word text sequence. In this way, the target cross entropy loss obtained based on the prototype intent vector corresponding to the wrong word text sequence, the target intent vector, the correct word text sequence corresponding to the wrong word text sequence, and the target text sequence can represent a measure of the accuracy of the prediction result of the intent recognition neural network.

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

[0108] Among them, when the target cross entropy loss is less than the loss threshold, it means that the prediction result of the intent recognition neural network is accurate enough. Based on this, it can be determined that the training of the intent recognition neural network is completed.

[0109] Furthermore, the target intent vector is the execution result of the intent recognition task of the intent recognition neural network, and the target text sequence is the execution result of the error correction task of the intent recognition neural network. In this way, training the intent recognition neural network based on the target cross entropy loss can simultaneously optimize the intent recognition task and error correction task of the intent recognition neural network, and the optimization of the 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 of the intent recognition neural network.

[0110] See also Figure 7 , Figure 7 is a schematic diagram of the training process of the intent recognition neural network in some embodiments of the present disclosure.

[0111] like Figure 7 As shown in Figure 2, during the training of the intent recognition neural network, the processing method for the text sequence of the wrong word is the same as that for the text sequence of the wrong word. Figure 2 The processing method of the question text in the application scenario is similar. The preprocessing module and the encoder are used to identify the intent of the wrong word text sequence and generate a predicted intention vector. The intention vector is used as the input of the memory module, and the target intention vector output by the memory module is obtained as the first prediction result of the intention recognition neural network; and the target intention vector is used as the input of the decoder, and the target text sequence output by the decoder is obtained as the second prediction result of the intention recognition neural network.

[0112] In one example, for the correct word text sequence, it is first used for the decoder to learn how to correctly generate the text sequence. Furthermore, the correct word text sequence corresponding to the incorrect word text sequence itself is the second true result corresponding to the second prediction result. Furthermore, the prototype intent vector generated by intent recognition of the correct word text sequence is the first true result corresponding to the first prediction result. Thus, the first prediction result for optimizing the intent recognition neural network, the first true result corresponding to the first prediction result, the second prediction result, and the second true result corresponding to the second prediction result can be obtained, so as to realize the optimized training of the intent recognition neural network by calculating the cross entropy loss of the above-mentioned prediction results and true results.

[0113] Regarding step S230, in some embodiments of the present disclosure, it may include the following steps: Figure 8 Steps S2301 to S2302 are shown.

[0114] S2301. Extract features from the correct word text sequence to obtain prototype pronunciation features, prototype shape features, and prototype semantic features.

[0115] S2302: Fusing prototype phonetic features, prototype glyph features, and prototype semantic features to obtain a prototype intent vector.

[0116] The feature extraction scheme and feature fusion scheme in step S2301 to step S2302 are basically the same as the feature extraction scheme and feature fusion scheme in the steps of the intention recognition method M100, and will not be repeated here.

[0117] Regarding step S240, in some embodiments of the present disclosure, it may include: Fig. 9 Steps S2401 to S2402 are shown.

[0118] S2401, extract features from the wrong word text sequence to obtain predicted pronunciation features, predicted shape features and predicted semantic features.

[0119] S2402: Fusing the predicted pronunciation features, predicted character shape features, and predicted semantic features to obtain a predicted intent vector.

[0120] The feature extraction scheme and feature fusion scheme in step S2401 to step S2402 are basically the same as the feature extraction scheme and feature fusion scheme in the steps of the intention recognition method M100, and will not be repeated here.

[0121] Regarding step S270, in some embodiments of the present disclosure, it may include: Fig.10 Steps S2701 to S2703 are shown.

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

[0123] 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.

[0124] S2702. Calculate a second cross entropy loss based on a correct word text sequence corresponding to the incorrect word text sequence and a target text sequence corresponding to the incorrect word text sequence.

[0125] The second cross entropy loss represents the loss of the text error correction task and is used to measure the accuracy of the text error correction function of the intent recognition neural network.

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

[0127] 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, the first cross entropy loss and the second cross entropy loss can be configured with the first cross entropy weight and the second cross entropy weight, respectively, and the weighted sum value is calculated based on the product of the first cross entropy loss and the first cross entropy weight and the product of the second cross entropy loss and the second cross entropy weight as the target cross entropy loss.

[0128] Based on any of the above embodiments, the present disclosure also provides an intention recognition device. Fig.11 It is a schematic block diagram of the structure of an intention recognition device according to an embodiment of the present disclosure.

[0129] like Fig.11 As shown, the intention recognition device includes: The preprocessing module 110 is used to obtain a question text, wherein the question text contains wrong words.

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

[0131] The encoder 120 is used to perform feature fusion on the phonetic features, the glyph features and the semantic features of the question text to obtain a fused feature vector.

[0132] The memory module 130 is used to query the semantic vector library for the semantic vector with the highest similarity to the fused feature vector, and determine the queried semantic vector as the intention vector, which represents the intention expressed by the question text based on the correction of the wrong words therein.

[0133] The above-mentioned intention recognition device can be computer software, and its various modules can be computer software modules. The implementation process of the functions and effects of each module in the above-mentioned intention recognition device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0134] The execution subject of the intention recognition method in the specific implementation manner of the present disclosure may be an electronic device such as a server.

[0135] Based on any of the above embodiments, the present disclosure also provides another intention recognition device. Fig.11 It is a schematic block diagram of the structure of an intention recognition device according to an embodiment of the present disclosure.

[0136] like Fig.12 As shown, the intention recognition device includes: Preprocessing module 110, for implementing Fig.11 The overall functionality of the pre-processing module 110 is shown and can be used to: Obtaining a wrong character training set, the wrong character training set comprising a plurality of wrong character text sequences, each wrong character text sequence comprising at least one wrong character; A correct word text sequence corresponding to each of a plurality of incorrect word text sequences is obtained, wherein the correct word text sequence is a text sequence obtained by replacing incorrect words in the incorrect word text sequence with correct words.

[0137] Encoder 120, for implementing Fig.11 The encoder 120 shown has all its functions and can be used to: Perform intent recognition processing on the correct word text sequence to obtain a prototype intent vector, and store the prototype intent vector in the semantic vector library; Perform intent recognition on the misspelled word text sequence to obtain a predicted intent vector.

[0138] The memory module 130 is used to implement Fig.11 The memory module 130 is fully functional and can be used to: The prototype intent vector with the highest similarity to the predicted intent vector in the query semantic vector library is determined as the target intent vector.

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

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

[0141] The optimization module 150 is further used to determine that the intention recognition neural network training is completed in response to the target cross entropy loss being less than a loss threshold.

[0142] The above-mentioned intention recognition device can be computer software, and its various modules can be computer software modules. The implementation process of the functions and effects of each module in the above-mentioned intention recognition device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0143] The executor of the training method of the intention recognition neural network in the specific implementation of the present disclosure may be an electronic device such as a server.

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

[0145] Fig.13 1 is a schematic block diagram of the structure of an electronic device 1000 according to an embodiment of the present disclosure.

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

[0147] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.

[0148] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.

[0149] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.

[0150] A computer program or instruction may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, a computer program or instruction may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0151] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented 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.

[0152] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable intent recognition device to produce a machine, so that the instructions executed by the processor of the computer or other programmable intent recognition device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable intent recognition device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0154] These computer program instructions may also be loaded onto a computer or other programmable intent recognition device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0155] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.

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

[0157] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.

Claims

1. A method for intention recognition, characterized in that: include: Obtaining a question text, wherein the question text contains a wrong word; Extracting features of the question text to obtain phonetic features, glyph features and semantic features of the question text; Performing feature fusion on the phonetic feature, the glyph feature and the semantic feature of the question text to obtain a fused feature vector; as well as The semantic vector library is queried for the semantic vector with the highest similarity to the fused feature vector, and the queried semantic vector is determined as an intention vector, wherein the intention vector represents the intention expressed by the question text based on the correction of the wrong words therein.

2. The method for intention recognition according to claim 1, characterized in that: Also includes: The intention vector is decoded into a natural language text, and the decoded natural language text is determined as a corrected text, wherein the corrected text represents a text obtained by correcting the incorrect words in the question text into correct words.

3. The method for identifying intention according to claim 1, characterized in that: Extracting features of the question text to obtain phonetic features, glyph features and semantic features of the question text includes: Performing word segmentation processing, word embedding processing and position embedding processing on the question text to obtain the semantic features of the question text; Converting the question text into a pinyin sequence, and performing word segmentation, word embedding and position embedding on the pinyin sequence to obtain the phonetic features of the question text; and Perform edge detection processing on the question text to obtain the glyph features of the question text.

4. The method for identifying intention according to claim 1, characterized in that: The phonetic feature, the glyph feature and the semantic feature of the question text are subjected to feature fusion to obtain a fused feature vector, including: The phonetic feature, the glyph feature and the semantic feature of the question text are respectively used as a sub-feature in a comprehensive embedding vector and are concatenated into the comprehensive embedding vector; Calculate the attention scores between the multiple sub-features based on the multi-head self-attention algorithm; Obtaining a feature weight value corresponding to each of the sub-features, and calculating a weighted sum of the sub-features based on the feature weight value corresponding to each of the sub-features and the attention score of the sub-feature; and The weighted sum value of each of the sub-features of the comprehensive embedding vector is encoded to obtain the fused feature vector.

5. A method for training an intention recognition neural network, characterized in that: The intention recognition neural network is used to execute the intention recognition method according to claim 1, and the training method of the intention recognition neural network includes: Acquire a wrong character training set, wherein the wrong character training set includes a plurality of wrong character text sequences, and each of the wrong character text sequences includes at least one wrong character; Obtaining a correct word text sequence corresponding to each of the plurality of incorrect word text sequences, wherein the correct word text sequence is a text sequence obtained by replacing incorrect words in the incorrect word text sequence with correct words; Performing intent recognition processing on the correct word text sequence to obtain a prototype intent vector, and storing the prototype intent vector in a semantic vector library; Performing intent recognition processing on the misspelled word text sequence to obtain a predicted intent vector; Querying the semantic vector library for a prototype intent vector with the highest similarity to the predicted intent vector, and determining the queried prototype intent vector as a target intent vector; Decoding the target intention vector into a natural language text, and determining the decoded natural language text as a target text sequence; Calculating a cross entropy loss based on the prototype intention vector corresponding to the incorrect word text sequence, the target intention vector, the correct word text sequence corresponding to the incorrect word text sequence, and the target text sequence to obtain a target cross entropy loss; and In response to the target cross entropy loss being less than a loss threshold, it is determined that the intent recognition neural network training is completed.

6. The method for training an intention recognition neural network according to claim 5, characterized in that: Performing intent recognition processing on the correct word text sequence to obtain a prototype intent vector includes: Extracting features from the correct word text sequence to obtain prototype pronunciation features, prototype shape features, and prototype semantic features; and Performing feature fusion on the prototype pronunciation feature, the prototype shape feature and the prototype semantic feature to obtain the prototype intention vector; Optionally, performing intent recognition processing on the misspelled word text sequence to obtain a predicted intent vector includes: Extracting features from the misspelled word text sequence to obtain predicted pronunciation features, predicted glyph features, and predicted semantic features; and The predicted pronunciation feature, the predicted character shape feature and the predicted semantic feature are subjected to feature fusion to obtain the predicted intention vector.

7. The method for training an intention recognition neural network according to claim 5, characterized in that: Calculating a cross entropy loss based on the prototype intention vector corresponding to the incorrect word text sequence, the target intention vector, the correct word text sequence corresponding to the incorrect word text sequence, and the target text sequence to obtain a target cross entropy loss includes: Calculate a first cross entropy loss based on the prototype intention vector and the target intention vector corresponding to the misspelled word text sequence; Calculating a second cross entropy loss based on the correct word text sequence corresponding to the incorrect word text sequence and the target text sequence corresponding to the incorrect 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: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instructions stored in the memory so that the processor executes the intention recognition method described in any one of claims 1 to 4; and / or the training method of the intention recognition neural network described in any one of claims 5 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 intention recognition method described in any one of claims 1 to 4; and / or the training method of the intention recognition neural network described in any one of claims 5 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 intention recognition method described in any one of claims 1 to 4; and / or the training method of the intention recognition neural network described in any one of claims 5 to 7.

Citation Information

Patent Citations

  • User-query-intention-oriented Chinese sentence similarity hierarchical calculation method and user-query-intention-oriented Chinese sentence similarity hierarchical calculation device

    CN104133812A

  • Intention recognizing method based on text similarity

    CN110136699A

  • Text error correction method and device based on character pronunciation and character pattern similarity

    CN115017890A

  • Method and device for predicting and enhancing query instruction of electric power customer service system

    CN118152428A

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

    CN118278392A