A noise extraction and instruction recognition method and electronic device

The pre-trained noise recognition model extracts noise in text, which solves the problem of incomplete noise extraction in the prior art and improves the accuracy of natural language processing.

CN113571052BActive Publication Date: 2024-09-20ECARX (HUBEI) TECHCO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110832253.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-22
Publication Date
2024-09-20
Estimated Expiration
2041-07-22

AI Technical Summary

Technical Problem

In the prior art, the noise method in extracting the to-processed text depends on a limited stop word list, and it is impossible to enumerate all possible noises, resulting in limited accuracy of natural language processing results.

Method used

The pre-trained noise recognition model is used to obtain the target text information and map it to the prediction probability of the preset noise label, and determine the noise text with the greatest prediction probability as the target noise text to realize noise extraction.

Benefits of technology

Without relying on stop word lists, noise in text can be effectively extracted and the accuracy of natural language processing results can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113571052B
    Figure CN113571052B
Patent Text Reader

Abstract

The embodiment of the present invention provides a noise extraction and instruction recognition method and electronic device, which relates to the field of artificial intelligence technology. The method includes: obtaining target text information corresponding to target speech data; inputting the target text information into a pre-trained noise recognition model to obtain the predicted probability of mapping the target text information to each preset noise label; wherein the preset noise label is used to represent the index position of the predicted noise text, the predicted noise text is a phrase in the target text information, and the phrase is a combination of one word or multiple consecutive words in the target text information; the predicted noise text corresponding to the preset noise label with the largest prediction probability is determined as the target noise text. Compared with the prior art, the solution provided by the embodiment of the present invention can be used to extract noise from the text to be processed by natural language without the help of a stop word list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a noise extraction and instruction recognition method and electronic equipment. Background Art

[0002] At present, with the continuous development of artificial intelligence algorithms, there are more and more demands for natural language processing tasks, such as named entity recognition, intent recognition, etc. Among them, according to the user's language habits, the text to be processed expressed by the user may contain meaningless phrases. For example, the text to be processed is: "I don't know when or what I want to go to Xuhui Building", in which "I don't know when or what" is a meaningless phrase.

[0003] Generally, meaningless phrases included in a text are considered as noise in the text. In natural language processing tasks, the noise in the text to be processed may affect the accuracy of the obtained processing results.

[0004] Based on this, in order to improve the accuracy of the processing results of natural language processing tasks, it is necessary to extract the noise in the text to be processed, and then use the text to be processed that does not include noise after noise extraction to perform natural language processing to improve the accuracy of the processing results obtained.

[0005] In the related art, the method of extracting noise in the text to be processed is: pre-constructing a stop word list including multiple noises, thereby comparing each phrase in the text to be processed with each noise in the stop word list to determine the noise in the text to be processed, and then extracting the determined noise.

[0006] However, in the above-mentioned related art, since the number of noises included in the stop word list is limited, it is not possible to enumerate all the noises that may be included in the text to be processed. Therefore, in many cases, it is impossible to extract the noise in the text to be processed. Summary of the invention

[0007] The purpose of the embodiment of the present invention is to provide a noise extraction and instruction recognition method and electronic device to extract noise from a text to be processed by natural language without using a stop word list. The specific technical solution is as follows:

[0008] In a first aspect, an embodiment of the present invention provides a noise extraction method, the method comprising:

[0009] Obtain target text information corresponding to the target voice data;

[0010] Input the target text information into a pre-trained noise recognition model to obtain the predicted probability of mapping the target text information to each preset noise label; wherein the preset noise label is used to indicate the index position of the predicted noise text, the predicted noise text is a phrase in the target text information, and the phrase is a word or a combination of multiple consecutive words in the target text information;

[0011] The predicted noise text corresponding to the preset noise label with the maximum predicted probability is determined as the target noise text.

[0012] Optionally, in a specific implementation, each of the preset noise labels is determined by a preset text length, and a method for generating each of the preset noise labels includes:

[0013] Determining the position numbers of the respective bits forming the preset text length;

[0014] The position label of any one bit or the position labels of any consecutive bits are used as a preset noise label.

[0015] Optionally, in a specific implementation, the acquiring target text information corresponding to the target voice data includes:

[0016] Obtaining the voice data text corresponding to the target voice data;

[0017] If the length of the voice data text is equal to the preset text length, the target text information is sequentially filled into each digit forming the preset text length to obtain the target text information;

[0018] If the length of the voice data text is greater than the preset text length, then obtaining text information in the voice data text starting from the first word and having a length equal to the preset text length, and sequentially filling in each digit forming the preset text length to obtain the target text information;

[0019] If the length of the voice data text is less than the preset text length, at least one specified character is added after the last word of the voice data text, and each bit forming the preset text length is filled in turn to obtain the target text information; wherein the sum of the length of the voice data text and the length of the at least one specified character is the preset text length.

[0020] Optionally, in a specific implementation, inputting the target text information into a pre-trained noise recognition model to obtain a predicted probability of mapping the target text information to each preset noise label includes:

[0021] Inputting the target text information into a feature extraction network in a noise recognition model to obtain target features of the target text information;

[0022] The target features are input into the classification network in the noise recognition model to obtain the predicted probabilities of the feature mapping of the target text information to each preset noise label.

[0023] Optionally, in a specific implementation, the feature extraction network includes: an input layer, a word embedding layer, a convolution layer, an activation layer, a pooling layer and a fusion layer;

[0024] The input layer is used to generate a target array corresponding to the target text information; wherein each element in the target array is: an index value of each word in the target text information;

[0025] The word embedding layer is used to generate a coding matrix corresponding to the target array; wherein each element in the coding matrix is: a word vector of a word represented by each index value in the target array;

[0026] The convolution layer is used to use multiple convolution kernels to extract features from the encoding matrix respectively to obtain multiple initial feature matrices of the target text information;

[0027] The activation layer is used to activate each initial feature matrix respectively using a preset activation function to obtain multiple activated feature matrices of the target text information;

[0028] The pooling layer is used to compress each activated feature matrix by a preset dimension according to a preset downsampling method to obtain a downsampled feature matrix of multiple compressed dimensions of the target text information;

[0029] The fusion layer is used to fuse the multiple down-sampled feature matrices to obtain a target feature matrix of the target text information as the target feature of the target text information.

[0030] Optionally, in a specific implementation, the classification network includes: a fully connected layer and a normalization layer;

[0031] The fully connected layer is used to calculate an initial probability matrix using the target feature matrix; wherein each element in the initial probability matrix is ​​used to represent an initial probability value that a phrase in the target text information corresponding to each preset noise label is a target noise text;

[0032] The normalization layer is used to normalize each element in the initial probability matrix to obtain a target probability matrix of the target text information; wherein each element in the target probability matrix is: the predicted probability of mapping the target text information to each preset noise label.

[0033] Optionally, in a specific implementation, the training method of the noise recognition model includes:

[0034] Acquire preset sample text information with noise annotation added; wherein the noise annotation is the index position of the noise text in the sample text information;

[0035] For each sample text information, the sample text information is input into the initial model to be trained to obtain the probability of mapping the sample text information to each preset noise label;

[0036] If the preset noise label with the highest probability matches the noise label of the sample text information, the next sample text information training is performed;

[0037] If the preset noise label with the highest probability does not match the noise label of the sample text information, the parameters of the initial model are adjusted, and the step of inputting the sample text information into the initial model to be trained is returned to obtain the probability of mapping the sample text information to each preset noise label until the initial model converges.

[0038] Optionally, in a specific implementation, the method further includes:

[0039] Deleting the target noise text in the target text information to obtain the text information to be processed;

[0040] According to a preset processing method, natural language processing is performed on the text information to be processed to obtain a processing result on the text information to be processed.

[0041] In a second aspect, an embodiment of the present invention provides an instruction recognition method, the method comprising:

[0042] Using any of the noise extraction methods provided in the first aspect above, determine the noise text information in the instruction text information corresponding to the target instruction;

[0043] Deleting the noise text information in the instruction text information to obtain the text information to be identified;

[0044] Inputting the text information to be recognized into a pre-trained intention recognition model to obtain the target user intention represented by the text information to be recognized;

[0045] Inputting the text information to be recognized into a pre-trained named entity recognition model to obtain a target named entity recognition result of the text information to be recognized;

[0046] Based on the target user intention and the target named entity recognition result, the target instruction is executed.

[0047] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0048] Memory, used to store computer programs;

[0049] The processor is used to implement the steps of any method provided in the first aspect and the second aspect when executing the program stored in the memory.

[0050] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the methods provided in the first and second aspects are implemented.

[0051] In a fifth aspect, an embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps of any one of the methods provided in the first and second aspects above.

[0052] Beneficial effects of the embodiments of the present invention:

[0053] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, the noise recognition model can be pre-trained. After acquiring the target voice data, the target text information corresponding to the target voice data can be first acquired, and then the acquired target text information can be input into the above-mentioned pre-trained noise recognition model to obtain the predicted probability of mapping the target text information to each preset noise label. In this way, the predicted noise text corresponding to the preset noise label with the largest predicted probability can be determined as the target noise text.

[0054] Based on this, the solution provided by the embodiment of the present invention is applied. Since each preset noise label corresponds to an index position of a predicted noise text, and each predicted noise text is a phrase in the target text information, the obtained target text information is mapped to the predicted probability of each preset noise label, that is, the predicted probability of each phrase in the target text information being the target noise text. Therefore, for the target text information corresponding to the target speech data, the pre-trained noise recognition model can be directly used to obtain the predicted probability of each phrase in the target text information being the target noise text, and the phrase with the largest predicted probability is determined as the target noise text. In this way, when extracting noise from the text to be processed, the noise in the text can be determined without the help of a stop word list, and then the text after noise extraction is obtained, thereby improving the accuracy of the obtained processing result. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0056] Figure 1 A schematic diagram of a noise extraction method provided by an embodiment of the present invention;

[0057] Figure 2 A flowchart of a method for generating each preset noise label;

[0058] FIG. 3( a ) is a schematic diagram of position labels of various bits forming a preset text length;

[0059] FIG3( b ) is a schematic diagram of all preset noise labels corresponding to FIG3( a );

[0060] FIG. 4( a) is a schematic diagram of target text information generated by using various bits forming a preset text length;

[0061] FIG4(b) is a schematic diagram of predicted noise texts corresponding to various preset noise labels based on the target text information shown in FIG4(a);

[0062] Figure 5 for Figure 1 A flowchart of a specific implementation method of S102;

[0063] Figure 6 A schematic diagram of the structure of a noise recognition model provided by an embodiment of the present invention;

[0064] Figure 7 for Figure 6 Schematic diagram of the principle of the convolutional layer;

[0065] Figure 8 A schematic diagram of an activation function ReLu;

[0066] Fig. 9 A schematic diagram of a flow chart of another noise extraction method provided by an embodiment of the present invention;

[0067] Fig.10 This is a schematic diagram of the structure of an intent recognition model;

[0068] Fig.11 It is a structural diagram of a named entity recognition model;

[0069] Fig.12 A flowchart of a designated identification method provided by an embodiment of the present invention;

[0070] Fig.13 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0071] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.

[0072] In the related art, the method of extracting noise in the text to be processed is: pre-constructing a stop word list including multiple noises, thereby comparing each phrase in the text to be processed with each noise in the stop word list to determine the noise in the text to be processed, and then extracting the determined noise. Since the number of noises included in the stop word list is limited, it is impossible to enumerate all the noises that may be included in the text to be processed, so that in many cases, the noise in the text to be processed cannot be extracted.

[0073] In order to solve the above technical problem, an embodiment of the present invention provides a noise extraction method.

[0074] The noise extraction method can be applied to various types of electronic devices, such as desktop computers, laptop computers, mobile phones, etc., which are not specifically limited in the embodiments of the present invention and are hereinafter referred to as electronic devices.

[0075] In addition, the noise extraction method can be applied to various scenarios that require natural language processing tasks. For example, the scenario of using intent recognition to realize voice control of the device; for example, the scenario of adding NER (Named Entity Recognition) tags to the text using named entity recognition, etc. This is all reasonable.

[0076] A noise extraction method provided by an embodiment of the present invention may include the following steps:

[0077] Obtain target text information corresponding to the target voice data;

[0078] Input the target text information into a pre-trained noise recognition model to obtain the predicted probability of mapping the target text information to each preset noise label; wherein the preset noise label is used to indicate the index position of the predicted noise text, the predicted noise text is a phrase in the target text information, and the phrase is a word or a combination of multiple consecutive words in the target text information;

[0079] The predicted noise text corresponding to the preset noise label with the maximum predicted probability is determined as the target noise text.

[0080] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, the noise recognition model can be pre-trained. After acquiring the target voice data, the target text information corresponding to the target voice data can be first acquired, and then the acquired target text information can be input into the above-mentioned pre-trained noise recognition model to obtain the predicted probability of mapping the target text information to each preset noise label. In this way, the predicted noise text corresponding to the preset noise label with the largest predicted probability can be determined as the target noise text.

[0081] Based on this, the solution provided by the embodiment of the present invention is applied. Since each preset noise label corresponds to an index position of a predicted noise text, and each predicted noise text is a phrase in the target text information, the obtained target text information is mapped to the predicted probability of each preset noise label, that is, the predicted probability of each phrase in the target text information being the target noise text. Therefore, for the target text information corresponding to the target speech data, the pre-trained noise recognition model can be directly used to obtain the predicted probability of each phrase in the target text information being the target noise text, and the phrase with the largest predicted probability is determined as the target noise text. In this way, when extracting noise from the text to be processed, the noise in the text can be determined without the help of a stop word list, and then the text after noise extraction is obtained, thereby improving the accuracy of the obtained processing result.

[0082] A noise extraction method provided by an embodiment of the present invention is described in detail below in conjunction with the accompanying drawings.

[0083] Figure 1 A flow chart of a noise extraction method provided by an embodiment of the present invention is shown as follows: Figure 1 As shown, the method may include the following steps S101-S103:

[0084] S101: Acquire target text information corresponding to target voice data;

[0085] Typically, when performing natural speech processing such as intent recognition and named entity recognition, the data to be processed is the user's voice data. When performing natural speech processing on the user's voice data, the voice data can be first converted into text information.

[0086] For example, in the voice control process of a smart device, the smart device needs to convert the user's voice command into text information, thereby performing intent recognition and named entity recognition on the text information, and execute the user's voice command based on the above recognition results.

[0087] Based on this, when executing a noise extraction method provided by an embodiment of the present invention, firstly, target text information corresponding to the target speech data is obtained.

[0088] The target text information can be obtained in a variety of ways, for example, the target voice data of the user can be directly collected, and then the target voice data can be converted into target text information by means of voice conversion algorithms, etc.; for another example, the target voice data of the user can be collected by other devices, and after the target voice data is converted into target text information, the target text information can be obtained from the other devices, etc. This is all reasonable.

[0089] S102: Inputting the target text information into a pre-trained noise recognition model to obtain a predicted probability of mapping the target text information to each preset noise label;

[0090] The preset noise tag is used to indicate the index position of the predicted noise text, the predicted noise text is a phrase in the target text information, and the phrase is a word or a combination of multiple consecutive words in the target text information;

[0091] Generally, the noise in the target text information may be a certain word in the target text information, or a combination of a plurality of consecutive words in the target text information.

[0092] For example, the target text information is: I want to go to Xuhui Building but I don’t know when or what. In the target text information, “I don’t know when or what” is the noise in the target text information.

[0093] Thus, when extracting noise from the target text information, the possibility that each phrase in the target text information can be used as noise in the target text information can be determined first. Each phrase in the target text information can be a word or a combination of multiple consecutive words in the target text information.

[0094] For example, the target text information is: I want to go to Xuhui Building but I don’t know when and what, then each phrase in the target text information includes: I, I want, I want to go, Xuhui Building, etc.

[0095] Since different target text information has different lengths, resulting in different numbers of phrases in different target text information, in order to obtain all phrases that can be used as noise in any target text information, various preset noise labels can be generated in advance.

[0096] Among them, the preset noise label is used to indicate the index position of the predicted noise text, and the predicted noise text is a phrase in the target text information, that is, each preset noise label corresponds to a phrase in the target text information, and the position of the phrase in the target text information matches the index position of the predicted noise text represented by the preset noise label, and further, each preset noise label corresponds to a phrase in the target text information.

[0097] In this way, for each preset noise label, the predicted probability of the target text information being mapped to the preset noise label is: the phrase whose position in the target text information matches the index position of the predicted noise text represented by the preset noise label is used as the predicted probability of the target noise text in the target text information.

[0098] That is to say, the predicted probability of mapping the target text information to each preset noise label is the predicted probability that the phrase in the target text information corresponding to each preset noise label is the target noise text. Thus, the predicted probability of mapping the target text information to each preset noise label is obtained, that is, the predicted probability that each phrase in the target text information is the target noise text.

[0099] For the sake of clarity, the generation method of each of the above preset noise labels will be described in detail later.

[0100] Based on this, after obtaining the target text information, the target text information can be input into a pre-trained noise recognition model to obtain the predicted probability of mapping the target text information to each preset noise label.

[0101] That is to say, by using the above noise recognition model, the predicted probability that each phrase in the target text information is the target noise text can be determined.

[0102] S103: Determine the predicted noise text corresponding to the preset noise label with the largest predicted probability as the target noise text.

[0103] Since the predicted probability of mapping the target text information to each preset noise label is the predicted probability that each phrase in the target text information is the target noise text, therefore, for each preset noise label, the greater the predicted probability of mapping the target text information to the preset noise label, the more likely the phrase in the target text information corresponding to the preset noise label is to be the target noise text.

[0104] In this way, since the phrases in the target text information corresponding to each preset noise label are; each preset noise label corresponds to the predicted noise text; therefore, after obtaining the predicted probability of mapping the target text information to each preset noise label, the preset noise label with the largest predicted probability can be determined, and thus, the predicted noise text corresponding to the preset noise label with the largest predicted probability is determined as the target noise text.

[0105] That is to say, the predicted noise text corresponding to the preset noise label with the highest prediction probability is the noise extracted from the target text information, wherein the predicted noise text corresponding to the preset noise label with the highest prediction probability is a phrase in the target text information, and the position of the phrase in the target text information matches the index position of the predicted noise text corresponding to the preset noise label with the highest prediction probability.

[0106] Optionally, after determining the target noise text, the target noise text in the target text information can be deleted, thereby obtaining the target text information to be processed without noise. In this way, the obtained target text information to be processed without noise can be further processed by natural speech to obtain a corresponding processing result.

[0107] For example, intent recognition can be performed on the target text information to be processed that does not include noise to obtain the user intent of the target text information; for another example, named entity recognition can be performed on the target text information to be processed that does not include noise to obtain the named entity recognition result of the target text information.

[0108] Based on this, the solution provided by the embodiment of the present invention is applied. Since each preset noise label corresponds to an index position of a predicted noise text, and each predicted noise text is a phrase in the target text information, the obtained target text information is mapped to the predicted probability of each preset noise label, that is, the predicted probability of each phrase in the target text information being the target noise text. Therefore, for the target text information corresponding to the target speech data, the pre-trained noise recognition model can be directly used to obtain the predicted probability of each phrase in the target text information being the target noise text, and the phrase with the largest predicted probability is determined as the target noise text. In this way, when extracting noise from the text to be processed, the noise in the text can be determined without the help of a stop word list, and then the text after noise extraction is obtained, thereby improving the accuracy of the obtained processing result.

[0109] Optionally, in a specific implementation, each preset noise label is determined by a preset text length; Figure 2 A flowchart of a method for generating each preset noise label is shown below. Figure 2 As shown, the generation method may include the following steps:

[0110] S201: Determine the position number of each bit that forms a preset text length;

[0111] S202: taking any position label or any continuous plurality of position labels as a preset noise label.

[0112] Due to the different language habits and language abilities of different users, the number of words included in the target text information corresponding to different target speech data is different. In addition, when using a pre-trained noise recognition model to obtain the predicted probability of mapping different target text information to each preset noise label, the model parameters in the noise recognition model are determined. Therefore, in order to be able to uniformly use the above-mentioned noise recognition model to obtain the predicted probability of mapping different target text information to each preset noise label, the number and structure of each preset noise label used for different target text information should be consistent.

[0113] In this way, the text length can be preset in consideration of the number of words a user usually includes in one speech. For example, since the number of words a person usually includes in one speech does not exceed 70 words, the preset text length can be 70.

[0114] After obtaining the preset text length, the position labels of the various bits that form the preset text length can be determined, and then, the position label of any bit or any continuous plurality of bit position labels can be used as the preset noise label.

[0115] That is to say, after obtaining the preset text length, a position label can be set for each position in the preset text length, so that each position label can be used as a preset noise label, and each group of position labels of multiple consecutive positions can also form a preset noise label.

[0116] Among them, optionally, the position label of the first bit among the bits forming the preset text length can be determined as 1, so that, according to the arrangement order of the bits in the preset text length, starting from the second bit, the position label of each bit is determined in turn as the sum of the position label of the previous bit of the bit plus 1.

[0117] That is to say, it can start from 1, in the order of natural numbers, starting from the first one of the bits forming the preset text length, and then refer to the position labels for the bits forming the preset text length.

[0118] For example, assuming that the preset text length is 70, as shown in Figure 3(a), the numbers 1-70 in the figure are the position labels of the various bits that form the preset text length, so that any position label can be used as a preset noise label, for example, position label 1, position label 2, position label 3, etc.; and the position labels of any consecutive positions can also form a preset noise label, for example, preset noise label 1-2 composed of position labels 1 and 2, preset noise label 1-3 composed of position labels 1, 2 and 3, etc.

[0119] In this way, when all position labels are determined as preset noise labels, and all combinations of position labels of consecutive digits are determined as preset noise labels, all preset noise labels as shown in FIG. 3( b ) can be obtained.

[0120] Taking into account the various possibilities for the quantitative relationship between the length of the speech data text corresponding to the target speech data and the above-mentioned preset text length, and considering the accuracy of the output result of the noise recognition model, it is necessary to make the length of the target text information input into the noise recognition model the same as the above-mentioned preset text length. When obtaining the above-mentioned target text information, it may be necessary to perform text deletion or text addition on the speech data text corresponding to the target speech data.

[0121] Based on this, optionally, in a specific implementation, in the above Figure 2 Based on the specific implementation shown, the above step S101, obtaining the target text information corresponding to the target voice data may include the following steps 11-14:

[0122] Step 11: Obtain the voice data text corresponding to the target voice data;

[0123] Step 12: If the length of the voice data text is equal to the preset text length, the voice data text is sequentially filled into each position forming the preset text length to obtain the target text information;

[0124] Step 13: If the length of the voice data text is greater than the preset text length, then obtain text information in the voice data text starting from the first word and having a length equal to the preset text length, and fill in each digit forming the preset text length in sequence to obtain the target text information;

[0125] Step 14: If the length of the voice data text is less than the preset text length, at least one specified character is added after the last word of the voice data text, and each digit forming the preset text length is filled in turn to obtain the target text information;

[0126] The sum of the length of the voice data text and the length of at least one specified character is the preset text length.

[0127] In this specific implementation, the target voice data can be obtained first. Then, by means of a voice conversion algorithm or the like, the target voice data is converted into text data, that is, the voice data text corresponding to the target voice data is obtained. In this way, the processing method for the voice data text can be determined according to the quantitative relationship between the length of the voice data text and the preset text length, so as to obtain the target text information with the length of the preset text length.

[0128] Among them, if the length of the voice data text is equal to the preset text length, it can be determined that each character in the voice data text corresponds to one of the bits forming the preset text length. Then, starting from the first character in the voice data text, each character in the voice data text is filled into the first bit to the last bit of each bit forming the preset text length in sequence. Thus, the combination of the bits of the preset text length filled with characters is the target text information.

[0129] If the length of the voice data text is greater than the preset text length, it can be determined that some characters in the voice data text cannot be filled into the bits forming the preset text length. Therefore, the characters in the voice data text whose length exceeds the preset text length can be discarded. That is to say, the text information starting from the first character and with a length equal to the preset text length in the voice data text can be obtained. Then, starting from the first character in the voice data text, each character in the obtained text information is filled into the first bit to the last bit of each bit forming the preset text length in sequence. Thus, the combination of the bits of the preset text length filled with characters is the target text information.

[0130] For example, when the length of the voice data text is N and the preset text length is P (P < N), then the (P + 1)-th character to the N-th character in the voice data text can be discarded, that is, the 1st to P-th characters in the voice data text are obtained. Then, the 1st to P-th characters in the obtained voice text information are filled into the first bit to the P-th bit of each bit forming the preset text length in sequence. Then, the combination of the P bits filled with characters is the target text information.

[0131] If the length of the voice data text is less than the above-mentioned preset text length, it can be determined that there are some bits in each bit that forms the preset text length that cannot be filled by the words in the voice data text. Therefore, according to the difference between the length of the voice data text and the above-mentioned preset text length, at least one specified character can be added after the last word of the voice data text, so that the sum of the length of the voice data text and the number of the at least one specified character added is the above-mentioned preset text information. In this way, starting from the first word of the voice data text, each word in the voice data text and the at least one specified character added can be filled in from the first to the last bit of each bit that forms the preset text length in sequence, so that the combination of each bit that forms the preset text length filled with words or specified characters is the target text information.

[0132] For example, when the length of the voice data text is M, and the above-mentioned preset text length is P (P>M), then, PM specified characters can be added after the Mth word of the voice data text, and then, starting from the first word in the voice text information, the M words in the voice data text and the added PM specified characters are sequentially filled in from the first to the Pth bit of each bit that forms the preset text length, and the combination of the P bits filled in with words is the target text information.

[0133] Optionally, the above-specified character may be: Null (empty) character.

[0134] Exemplarily, assuming that the preset text length is 70, taking the voice data text "I want to go to Xuhui Building but I don't know when and what" as an example, the target text information can be determined as shown in Figure 4(a), and the predicted noise text corresponding to each preset noise label is shown in Figure 4(b).

[0135] Optionally, in a specific implementation, such as Figure 5 As shown, the above step S102, inputting the target text information into the pre-trained noise recognition model to obtain the predicted probability of mapping the target text information to each preset noise label, may include the following steps S1021-S1022:

[0136] S1021: Inputting the target text information into a feature extraction network in the noise recognition model to obtain target features of the target text information;

[0137] S1022: Input the target features into the classification network in the noise recognition model to obtain the predicted probability of mapping the features of the target text information to each preset noise label.

[0138] In this specific implementation, the above-mentioned noise recognition model may include a feature extraction network and a classification network. When the target text information is input into the above-mentioned noise recognition model, the target text information is input into the feature extraction network in the noise recognition model, and then, the feature extraction network can extract the target features of the target text information and input the target features; then, the target features of the target text information can be input into the classification network in the noise recognition model, so that the classification network can use the target features of the target text information to obtain the predicted probability of mapping the features of the target text information to each preset noise label.

[0139] Optionally, in a specific implementation, in the above Figure 5 Based on the specific implementation shown, the feature extraction network may include: an input layer, a word embedding layer, a convolution layer, an activation layer, a pooling layer and a fusion layer.

[0140] The input layer is used to generate a target array corresponding to the target text information; wherein each element in the target array is: the index value of each word in the target text information;

[0141] The word embedding layer is used to generate an encoding matrix corresponding to the target array; each element in the encoding matrix is: the word vector of the word represented by each index value in the target array;

[0142] The convolution layer is used to extract features from the encoding matrix using a variety of convolution kernels to obtain multiple initial feature matrices of the target text information;

[0143] The activation layer is used to activate each initial feature matrix using a preset activation function to obtain multiple activated feature matrices of the target text information;

[0144] The pooling layer is used to compress each activated feature matrix by a preset dimension according to a preset downsampling method to obtain a downsampled feature matrix of multiple compressed dimensions of the target text information;

[0145] The fusion layer is used to fuse multiple downsampled feature matrices to obtain a target feature matrix of the target text information as the target feature of the target text information.

[0146] Optionally, in a specific implementation, in the above Figure 5 Based on the specific implementation shown, the above classification network may include: a fully connected layer and a normalization layer;

[0147] The fully connected layer is used to calculate the initial probability matrix using the target feature matrix; wherein each element in the initial probability matrix is ​​used to represent the initial probability value of the phrase in the target text information corresponding to each preset noise label being the target noise text;

[0148] The normalization layer is used to normalize each element in the initial probability matrix to obtain a target probability matrix of the target text information; wherein each element in the target probability matrix is: the predicted probability of the target text information being mapped to each preset noise label.

[0149] Based on this, optionally, in a specific implementation, such as Figure 6 As shown, the noise recognition model may include: an input layer, a word embedding layer, a convolution layer, an activation layer, a pooling layer, a fusion layer, a fully connected layer, and a normalization layer; wherein the input layer, the word embedding layer, the convolution layer, the activation layer, the pooling layer, and the fusion layer constitute a feature extraction network of the noise recognition model, and the fully connected layer and the normalization layer constitute a classification network of the noise recognition model. In this specific implementation, specifically:

[0150] (1) Input layer:

[0151] After the target text information is obtained, the target text information may be input into the pre-trained noise recognition model, that is, the target text information may be input into the input layer of the noise recognition model.

[0152] In the above noise recognition model, the index value of each word is preset in the input layer. Optionally, the format of the index value of each word can be a one-hot format.

[0153] In this way, after receiving the target text information, the input layer can first start from the first word of the target text information and determine the one-hot index value of each word in the target text information in sequence. Then, the output layer can generate a target array corresponding to the target text information. Optionally, each index value in the generated target array can be an integer value.

[0154] Each element in the target array is an index value of each word in the target text information, and the number of index values ​​included is the same as the number of words included in the target text information.

[0155] Optionally, when generating a target array corresponding to the target text information, the input layer may first determine a quantitative relationship between the length of the target text information and the above-mentioned preset text length.

[0156] When the length of the target text information is equal to the above-mentioned preset text length, the input layer can directly determine the one-hot index value of each word in the target text information, and then generate a target array corresponding to the target text information;

[0157] When the length of the target text information is greater than the preset text length, the input layer may discard the characters in the target text information whose length exceeds the preset text length, and then the input layer may determine the index value of the one-hot format of each remaining character in the target text information, and then generate a target array corresponding to the target text information;

[0158] When the length of the target text information is less than the above-mentioned preset text length, the input layer can add at least one preset character after the one-hot index value of the last word in the target text information after determining the one-hot index value of each word in the target text information, so that the sum of the length of the target text information and the at least one preset character added is the above-mentioned preset text length, and thus, the array formed by the one-hot index value of each word in the target text information and the at least one preset character added is the target array corresponding to the target text information.

[0159] In this way, the number of elements included in the obtained target array is the above-mentioned preset text length.

[0160] After generating the above target array, the input layer can take the target array as output, thereby inputting the target array into the above word embedding layer.

[0161] For example, when the preset text length is 70, the input layer can output a target array including 70 elements.

[0162] (2) Word Embedding Layer:

[0163] The so-called word embedding refers to representing each word with a multi-dimensional data. For example, each word is represented by a one-dimensional array including multiple elements, wherein each element is a number. For example, each word can be represented by a one-dimensional array including 32 elements, that is, each word can be represented by a one-dimensional array including 32 numbers.

[0164] In this way, since the index value of each word can represent a word, and each word corresponds to a word vector, thus, the index value of each word corresponds to a word vector, the word embedding layer can determine the word vector of the word represented by each index value in the obtained target array, thereby, based on each determined word vector, generating a coding matrix corresponding to the target array, and each element in the coding matrix is ​​the word vector of the word represented by each index value in the target array. Among them, the number of elements included in the word vector corresponding to each determined index value is a preset number.

[0165] Furthermore, after generating the above encoding matrix, the word embedding layer can use the encoding matrix as output, thereby inputting the encoding matrix into the above convolutional layer.

[0166] Exemplarily, when the preset text length is 70 and each character is represented by a one-dimensional array including 32 elements, the character embedding layer can output a coding matrix with a dimension of [70, 32].

[0167] (3) Convolutional layer:

[0168] The essence of the convolution layer is to use a preset kernel function, i.e., the convolution kernel, to extract features from the input data and obtain the extracted features. The convolution operation can be understood as a multiplication and accumulation process. For example, Figure 7 As shown, the convolution kernel in the middle is used to extract features from the input data on the left to obtain the features of the output on the right, and, Figure 7 The calculation formula in can be used as the convolution calculation method in the feature extraction process.

[0169] In the above noise recognition model, the function of the convolution layer is to amplify and extract the features in the input coding matrix. When extracting features, the convolution layer can analyze several consecutive words as a whole, for example, it can analyze three consecutive words as a whole, four consecutive words as a whole, or five consecutive words as a whole.

[0170] Among them, when several consecutive characters can form a word or a phrase, the several consecutive characters can be taken as a whole for feature extraction; when several consecutive characters are all single-character words, feature extraction can be performed based on the context of each character in the several consecutive characters.

[0171] Specifically, multiple convolution kernels can be set according to the number of words included in a number of consecutive words analyzed as a whole, so that each convolution kernel is used to extract features from the input coding matrix respectively to obtain multiple initial feature matrices of the target text information.

[0172] Furthermore, after generating the above-mentioned multiple initial feature matrices, the convolution layer can use the multiple initial feature matrices as outputs, thereby inputting the multiple initial feature matrices into the above-mentioned activation layer.

[0173] For example, when the input encoding matrix is ​​a matrix of dimension [70,32], there are three types of convolution kernels, namely, convolution kernels [3,32], [4,32] and [5,32], and the number of each convolution kernel is 128, 128 matrices of dimension [68,1], 128 matrices of dimension [67,1] and 128 matrices of dimension [66,1] can be obtained. Then, by merging the 128 matrices corresponding to each convolution kernel, three matrices of dimensions [68,128], [67,128] and [66,128] can be obtained. The three matrices of dimensions [68,128], [67,128] and [66,128] are the three initial feature matrices of the target text information. The convolutional layer can then output three initial feature matrices with dimensions of [68, 128], [67, 128], and [66, 128].

[0174] (4) Activation layer

[0175] Since the convolutional layers and fully connected layers in the noise recognition model cannot bring nonlinear characteristics to the noise recognition model, and the essence of the noise recognition model is to transform the input data into the desired output data, and the noise recognition model without nonlinear characteristics cannot achieve the above data transformation, it is necessary to use the activation function in the activation layer to bring nonlinear characteristics to the noise recognition model.

[0176] Based on this, the activation layer can use the preset activation function to activate each initial feature matrix respectively to obtain multiple activated feature matrices of the target text information. In addition, the activation layer can not change the dimensions of each initial feature matrix for activation. In other words, the dimensions of the multiple initial feature matrices of the target text information are the same as the dimensions of the multiple activated feature matrices of the target text information.

[0177] Optionally, the preset activation function may be ReLu (Rectified Linear Unit, linear rectification function). Figure 8 As shown, it is a schematic diagram of ReLu, where the horizontal axis represents the function input and the vertical axis represents the function output. In addition, using ReLu to activate each initial feature matrix separately can not change the dimension of each initial feature matrix.

[0178] Furthermore, after obtaining the above-mentioned multiple activation feature matrices, the activation layer can use the multiple activation feature matrices as outputs, thereby inputting the multiple activation feature matrices into the above-mentioned pooling layer.

[0179] Exemplarily, when the target text information has three activation feature matrices, and the dimensions of the three activation feature matrices are [68, 128], [67, 128], and [66, 128], respectively, the activation layer can output three activation feature matrices with dimensions of [68, 128], [67, 128], and [66, 128], respectively.

[0180] (5) Pooling layer

[0181] The purpose of the pooling layer is to ignore unimportant features extracted by the convolutional layer, and the method used by the pooling layer is "downsampling".

[0182] Based on this, in the noise recognition model, the purpose of the pooling layer is to compress each activated feature matrix by a preset dimension using a preset pooling method, namely a downsampling method, so as to ignore certain unimportant features of the target text information represented by each activated feature matrix.

[0183] Optionally, the above pooling method may be average pooling or maximum pooling.

[0184] The so-called average pooling means: calculating the average value of all data in the original data of a preset size, and replacing the original data with the calculated average value, thereby achieving the purpose of reducing the dimension of the original data and retaining the data characteristics of the original data. For example, if the preset size is 4*4, there are 16 data in the original data, which becomes 1 data after average pooling, so it can be considered that the original data is reduced by 16 times.

[0185] The so-called maximum pooling means: using the maximum data in the original data of the preset size to replace the original data. For example, if the preset size is 4*4, there are 16 data in the original data, then the maximum value of the 16 data is determined and the 16 data are replaced with the maximum value, that is, after the maximum pooling, it becomes 1 data, so it can be considered that the original data is reduced by 16 times.

[0186] Furthermore, after obtaining the multiple down-sampling feature matrices, the pooling layer can use the multiple down-sampling feature matrices as outputs, thereby inputting the multiple down-sampling feature matrices into the fusion layer.

[0187] Exemplarily, when the target text information has three activated feature matrices, and the dimensions of the three activated feature matrices are [68, 128], [67, 128], and [66, 128], respectively, assuming that the pooling sizes of the three downsampled feature matrices are 68, 67, and 66, respectively, the pooling layer can output three downsampled feature matrices with dimensions of [1, 128], [1, 128], and [1, 128], respectively.

[0188] (6) Fusion layer

[0189] The multiple downsampled feature matrices of the target text information are fused to obtain a target feature matrix of the target text information, and the dimension of the target feature matrix of the target text information is [1, K], where K is determined according to the dimensions of the multiple downsampled feature matrices of the target text information. Then, the obtained target feature matrix can be used as an output, and thus, the target feature matrix is ​​input into the above-mentioned fully connected layer.

[0190] Exemplarily, when the target text information has three downsampled feature matrices, and the dimensions of the three downsampled feature matrices are [1,128], [1,128], and [1,128], respectively, the fusion layer can output a target feature matrix with a dimension of [1,384].

[0191] (7) Fully connected layer:

[0192] The function of the fully connected layer is to project the target feature matrix of the target text information onto the dimensions of each preset noise label. The fully connected layer includes a preset weight matrix, and the dimension of the weight matrix is ​​[K, M], where K is the same as the dimension [1, K] of the target feature matrix of the target text information, and M is the number of each predicted noise label.

[0193] Assuming that the preset text length is T, then M=T*(T+1) / 2.

[0194] That is to say, the fully connected layer can use the target feature matrix to calculate the initial probability matrix; wherein each element in the initial probability matrix is ​​used to represent the initial probability value of the phrase in the target text information corresponding to each preset noise label being the target noise text.

[0195] Among them, the fully connected layer can use the following formula to calculate the initial probability matrix.

[0196] Y = X*W+B;

[0197] Among them, Y is the initial probability matrix, whose dimension is [1, K]; X is the target feature matrix of the target text information, whose dimension is [1, K]; W is the pre-trained weight matrix, whose dimension is [K, M]; B is the pre-trained bias array, which is a one-dimensional array including M elements.

[0198] Among them, each element in the initial probability matrix can be used to characterize the initial probability value of the phrase in the target text information corresponding to each preset noise label being the target noise text. That is to say, each element in the calculated initial probability matrix corresponds to a preset noise label, so that each element is the semantics of the preset noise label corresponding to the element, that is, each element is the semantics of the predicted noise text corresponding to the preset noise label in the target text information, so that the element can represent the possibility that the phrase in the target text information corresponding to the preset noise label is the target noise text.

[0199] After obtaining the initial probability matrix, the fully connected layer can use the initial probability matrix as output, thereby inputting the initial probability matrix into the normalization layer.

[0200] Exemplarily, when the length of the preset text information is 70 and the dimension of the target feature matrix of the target text information is [1,384], the fully connected layer can output an initial probability matrix with a dimension of [1,2485].

[0201] (8) Normalization layer

[0202] The function of the normalization layer is to normalize the element values ​​of each element in the initial probability matrix by reducing them proportionally, thereby converting each element in the initial probability matrix into a probability in percentage form to obtain the target probability matrix of the target text information, and the sum of each element in the target probability matrix is ​​1.

[0203] Among them, each element in the target probability matrix is: the predicted probability of mapping the target text information to each preset noise label.

[0204] When the fully connected layer outputs an initial probability matrix with a dimension of [1, M], each element in the initial probability matrix can be proportionally reduced to a probability value in percentage form to obtain the target probability matrix of the target text information. Among them, each element in the target probability matrix of the target text information can be C0, C1, C2, ..., C M-1 Among them, C X The predicted probability of mapping the target text information to the Xth preset noise label.

[0205] Optionally, the normalization layer may use a softmax (normalization) function to normalize each element in the initial probability matrix of the target text information to obtain a target probability matrix of the target text information.

[0206] Optionally, in a specific implementation, based on the above specific implementations, the training method of the noise recognition model includes the following steps 21-24:

[0207] Step 21: obtaining preset sample text information with noise annotation added, wherein the noise annotation is the index position of the noise text in the sample text information;

[0208] Step 22: for each sample text information, input the sample text information into the initial model to be trained to obtain the probability of mapping the sample text information to each preset noise label; if the preset noise label with the highest probability matches the noise label of the sample text information, execute step 23; if the preset noise label with the highest probability does not match the noise label of the sample text information, execute step 24;

[0209] Step 23: Conduct training on the next sample text information;

[0210] Step 24: Adjust the parameters of the initial model and return to step 22 until the initial model converges.

[0211] The noise recognition model can be obtained by training any type of electronic device, such as a laptop computer, a desktop computer, a tablet computer, etc., and the embodiment of the present invention does not specifically limit this, and is hereinafter referred to as a training device. The training device and the electronic device that executes a noise extraction method provided by the embodiment of the present invention can be the same electronic device or different electronic devices. The electronic device that executes a noise extraction method provided by the embodiment of the present invention is referred to as an execution device.

[0212] When the training device and the execution device are the same device, the noise recognition model can be obtained by training in the same electronic device, and then, on the electronic device, the noise extraction method provided by the embodiment of the present invention can be implemented using the obtained noise recognition model; when the training device and the execution device are not the same electronic device, after the training device obtains the noise recognition model, the obtained noise recognition model can be sent to the execution device. In this way, after obtaining the noise recognition model, the execution device can use the obtained noise recognition model to implement the noise extraction method provided by the embodiment of the present invention.

[0213] The training device may first obtain preset sample text information with noise annotations added thereto, wherein the noise annotation of each sample text information is: the index position of the noise text in the sample text information.

[0214] The sample text information may be a sentence, or a phrase or a short phrase consisting of multiple words, which is reasonable. In addition, the sample text information may be obtained in a variety of ways. For example, the sample text information stored in the local storage space may be directly obtained; or the sample text information may be obtained from other non-local storage spaces. This is reasonable.

[0215] In addition, in the embodiment of the present invention, in order to ensure the accuracy of the noise recognition model obtained by training, a large amount of sample text information can be used in the training process of the noise recognition model. Therefore, multiple sample text information can be obtained. Among them, the number of sample text information can be set according to the needs of actual applications, and is not specifically limited in the present invention. And the type of sample text information can only include sentences, phrases or phrases, or can include at least two of sentences, phrases and phrases. This is all reasonable.

[0216] After obtaining the above sample text information, the noise text in each sample text information can be further determined through methods such as manual recognition, and the index position of the noise text in the sample text information is used as the noise annotation of the sample text information where the noise text is located, thereby adding a noise annotation to each sample text information.

[0217] In this way, for each sample text information, the sample text information can be input into the initial model to be trained, and the probability of the sample text information being mapped to each preset noise label can be obtained. Then, based on the obtained probability of the sample text information being mapped to each preset noise label, the preset noise label with the highest probability can be determined, that is, the predicted value of the index position of the noise text in the sample text information can be obtained.

[0218] For each sample text information, the noise annotation of the sample text information can be regarded as the true value of the index position of the noise text in the sample text information.

[0219] Therefore, for each sample text information, it is possible to determine whether the above initial model has converged based on the degree of match between the predicted value and the true value of the index position of the noise text in the sample text information, and further determine whether the training can be stopped to obtain the above noise recognition model.

[0220] Based on this, for each sample text information, when the preset noise label with the highest probability matches the noise label of the sample text information, it can be determined that the above initial model converges for the sample text information, so that the next sample text information training can be carried out.

[0221] The method of training the next sample text information is the same as the method of training the sample text information, which will not be repeated here. In this way, when the above initial models converge for all sample text information, it can be determined that the noise recognition model has been trained, and the training can be stopped to obtain the trained noise recognition model.

[0222] When the preset noise label with the highest probability does not match the noise label of the sample text information, it can be determined that the above-mentioned initial model has not converged, and thus, the noise recognition model has not been trained and needs to be further trained. In this way, the parameters of the above-mentioned initial model can be adjusted, and thus, the above-mentioned step 22 is returned to be executed, that is, the sample text information is input into the initial model with adjusted parameters, and the probability of mapping the sample text information to each preset noise label is obtained again.

[0223] The above process is repeated until the initial model converges, and the above noise recognition model can be obtained.

[0224] Generally, the purpose of noise extraction on target text information is to perform natural language processing on the target text information after noise removal to improve the accuracy of the obtained processing result. That is to say, noise extraction on target text information is a preprocessing process for natural language processing of the target text information.

[0225] Based on this, optionally, in a specific implementation, such as Fig. 9 As shown, a noise extraction method provided by an embodiment of the present invention may further include the following steps S104-S105:

[0226] S104: deleting the target noise text in the target text information to obtain the text information to be processed;

[0227] S105: Performing natural language processing on the text information to be processed according to a preset processing method to obtain a processing result on the text information to be processed.

[0228] In this specific implementation, a natural language processing method for the target text information can be pre-set according to the needs of the actual application, such as named entity recognition, intent recognition, etc.

[0229] Thus, after determining the target noise text in the target text information, the target noise text in the target text information can be deleted to obtain the target text information after the noise is removed, that is, the text information to be processed. Then, the obtained text information to be processed can be subjected to natural language processing according to a preset processing method to obtain a processing result on the text information to be processed. The obtained processing result can be used as the processing result on the target text information.

[0230] In this way, since the text information to be processed during natural language processing is the target text information after noise is removed, the interference of noise in the target text information on the natural language processing process can be reduced, thereby improving the accuracy of the processing results obtained about the target text information.

[0231] Optionally, in a specific implementation, the above step S105 may include the following step 31:

[0232] Step 31: Input the text information to be processed into a pre-trained intent recognition model to obtain the user intent represented by the text information to be processed.

[0233] Among them, Fig.10 As shown in the figure, the intent recognition model includes: input layer, word embedding layer, convolution layer, pooling layer, fusion layer, fully connected layer and output layer.

[0234] In this specific implementation, the text information to be processed can be input into a pre-trained intent recognition model, so that the intent recognition model recognizes the text to be processed to obtain the user intent represented by the text information to be processed.

[0235] Optionally, in a specific implementation, the above step S105 may include the following step 32:

[0236] Step 32: Input the text information to be processed into a pre-trained named entity recognition model to obtain a named entity recognition result of the text information to be processed.

[0237] Among them, Fig.11 As shown in the figure, the named entity recognition model includes: input layer, word embedding layer, bidirectional long short-term memory network LSTM layer, fully connected layer, conditional random field CRF layer and output layer.

[0238] In this specific implementation, the text information to be processed can be input into a pre-trained named entity recognition model, so that the named entity recognition result of the text information to be processed is obtained by recognizing the text to be processed through the named entity recognition model.

[0239] Corresponding to the noise extraction method provided by the above-mentioned embodiment of the present invention, the embodiment of the present invention provides an instruction recognition method.

[0240] Fig.12 A flowchart of a designated identification method provided by an embodiment of the present invention is shown in FIG. Fig.12 As shown, the instruction recognition method may include the following steps S1201-S1205:

[0241] S1201: Determine the noise text in the instruction text information corresponding to the target instruction by using any of the noise extraction methods provided by the above embodiments of the present invention;

[0242] S1202: deleting the noise text in the determined instruction text information to obtain the text information to be recognized;

[0243] S1203: Inputting the text information to be recognized into a pre-trained intent recognition model to obtain the target user intent represented by the text information to be recognized;

[0244] S1204: inputting the text information to be recognized into a pre-trained named entity recognition model to obtain a target named entity recognition result of the text information to be recognized;

[0245] S1205: Execute the target instruction based on the target user intention and the target named entity recognition result.

[0246] Users can usually control smart devices through various control commands, for example, controlling smart home devices through voice, etc. Therefore, during the control process, smart devices need to perform intent recognition and named entity recognition on the control commands sent by users, and then execute the control commands sent by users according to the obtained recognition results.

[0247] In this way, after detecting the target instruction, the instruction text information corresponding to the target instruction can be obtained first. Then, in order to avoid the influence of the noise existing in the instruction text information on the accuracy of the recognition result of the instruction text information, any noise extraction method provided by the above-mentioned embodiments of the present invention can be further used to determine the noise text in the instruction text information.

[0248] Then, the noise text determined in the instruction text information can be deleted to obtain the text information to be recognized. In this way, the text information to be recognized can be input into the pre-trained intent recognition model to obtain the target user intent represented by the text information to be recognized, and the text information to be recognized can be input into the pre-trained named entity recognition model to obtain the target named entity recognition result of the text information to be recognized.

[0249] After obtaining the above-mentioned target user intention and target named entity recognition results, the detected target instruction can be executed based on the above-mentioned target user intention and target named entity recognition results.

[0250] Based on this, by applying the solution provided by the embodiment of the present invention, when executing the target instruction, the noise in the target instruction can be removed by any noise extraction method provided by the above-mentioned embodiment of the present invention, thereby improving the accuracy of identifying the target instruction and achieving more accurate execution of the detected target instruction.

[0251] Corresponding to the noise extraction method and the instruction recognition method provided by the above-mentioned embodiment of the present invention, the embodiment of the present invention also provides an electronic device, such as Fig.13As shown, it includes a processor 1301, a communication interface 1302, a memory 1303 and a communication bus 1304, wherein the processor 1301, the communication interface 1302, and the memory 1303 communicate with each other through the communication bus 1304.

[0252] Memory 1303, used for storing computer programs;

[0253] The processor 1301 is used to implement the steps of any noise extraction method provided by the above-mentioned embodiment of the present invention and / or the instruction recognition method provided by the above-mentioned embodiment of the present invention when executing the program stored in the memory 1303.

[0254] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0255] The communication interface is used for communication between the above electronic device and other devices.

[0256] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0257] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0258] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any noise extraction method provided by the above-mentioned embodiment of the present invention and / or the instruction recognition method provided by the above-mentioned embodiment of the present invention are performed.

[0259] In another embodiment provided by the present invention, a computer program product comprising instructions is also provided. When the computer program product is run on a computer, the computer executes the steps of any noise extraction method provided by the above-mentioned embodiment of the present invention, and / or the instruction recognition method provided by the above-mentioned embodiment of the present invention.

[0260] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by 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 instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidState Disk (SSD)), etc.

[0261] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0262] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the electronic device embodiment, computer-readable storage medium, and computer program product, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0263] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A noise extraction method, characterized in that: The method comprises: Obtain target text information corresponding to the target voice data; Input the target text information into a pre-trained noise recognition model to obtain the predicted probability of mapping the target text information to each preset noise label; wherein the preset noise label is used to indicate the index position of the predicted noise text, the predicted noise text is a phrase in the target text information, and the phrase is a word or a combination of multiple consecutive words in the target text information; Determine the predicted noise text corresponding to the preset noise label with the largest prediction probability as the target noise text; The generation method of each preset noise label includes: Determining the position numbers of the respective bits forming the preset text length; Any position label or any continuous position labels of multiple bits are used as preset noise labels.

2. The method according to claim 1, characterized in that The step of obtaining target text information corresponding to the target voice data includes: Obtain the voice data text corresponding to the target voice data; If the length of the voice data text is equal to the preset text length, the voice data text is sequentially filled into each position forming the preset text length to obtain the target text information; If the length of the voice data text is greater than the preset text length, then obtaining text information in the voice data text starting from the first word and having a length equal to the preset text length, and sequentially filling in each digit forming the preset text length to obtain the target text information; If the length of the voice data text is less than the preset text length, at least one specified character is added after the last word of the voice data text, and the respective bits forming the preset text length are filled in sequence to obtain the target text information; wherein the sum of the length of the voice data text and the length of the at least one specified character is the preset text length.

3. The method according to claim 1 or 2, characterized in that: The step of inputting the target text information into a pre-trained noise recognition model to obtain a predicted probability of mapping the target text information to each preset noise label includes: Inputting the target text information into a feature extraction network in a noise recognition model to obtain target features of the target text information; The target features are input into the classification network in the noise recognition model to obtain the predicted probabilities of the feature mapping of the target text information to each preset noise label.

4. The method according to claim 3, characterized in that The feature extraction network includes: an input layer, a word embedding layer, a convolution layer, an activation layer, a pooling layer and a fusion layer; The input layer is used to generate a target array corresponding to the target text information; wherein each element in the target array is: an index value of each word in the target text information; The word embedding layer is used to generate a coding matrix corresponding to the target array; wherein each element in the coding matrix is: a word vector of a word represented by each index value in the target array; The convolution layer is used to use multiple convolution kernels to extract features from the encoding matrix respectively to obtain multiple initial feature matrices of the target text information; The activation layer is used to activate each initial feature matrix respectively using a preset activation function to obtain multiple activated feature matrices of the target text information; The pooling layer is used to compress each activated feature matrix by a preset dimension according to a preset downsampling method to obtain a downsampled feature matrix of multiple compressed dimensions of the target text information; The fusion layer is used to fuse the multiple down-sampled feature matrices to obtain a target feature matrix of the target text information as the target feature of the target text information.

5. The method according to claim 4, characterized in that The classification network includes: a fully connected layer and a normalization layer; The fully connected layer is used to calculate an initial probability matrix using the target feature matrix; wherein each element in the initial probability matrix is ​​used to represent an initial probability value that a phrase in the target text information corresponding to each preset noise label is a target noise text; The normalization layer is used to normalize each element in the initial probability matrix to obtain a target probability matrix of the target text information; wherein each element in the target probability matrix is: the predicted probability of mapping the target text information to each preset noise label.

6. The method according to claim 3, characterized in that The training method of the noise recognition model includes: Acquire preset sample text information with noise annotation added; wherein the noise annotation is the index position of the noise text in the sample text information; For each sample text information, the sample text information is input into the initial model to be trained to obtain the probability of mapping the sample text information to each preset noise label; If the preset noise label with the highest probability matches the noise label of the sample text information, the next sample text information training is performed; If the preset noise label with the highest probability does not match the noise label of the sample text information, the parameters of the initial model are adjusted, and the step of inputting the sample text information into the initial model to be trained is returned to obtain the probability of mapping the sample text information to each preset noise label until the initial model converges.

7. The method according to claim 1 or 2, characterized in that: The method further comprises: Deleting the target noise text in the target text information to obtain the text information to be processed; According to a preset processing method, natural language processing is performed on the text information to be processed to obtain a processing result on the text information to be processed.

8. A method for instruction recognition, characterized in that: The method comprises: Using the noise extraction method described in any one of claims 1 to 7, determining target noise text information in the instruction text information corresponding to the target instruction; Deleting the target noise text information in the instruction text information to obtain text information to be identified; Inputting the text information to be recognized into a pre-trained intention recognition model to obtain the target user intention represented by the text information to be recognized; Inputting the text information to be recognized into a pre-trained named entity recognition model to obtain a target named entity recognition result of the text information to be recognized; Based on the target user intention and the target named entity recognition result, the target instruction is executed.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-8 when executing a program stored in a memory.