Text correction method, device and storage medium

By introducing text correction methods into the speech recognition system, and using the Pinyin-text prediction model to correct speech recognition errors, the problem of inaccurate speech recognition is solved, and text accuracy and intention recognition capabilities of intelligent machines are improved.

CN113807080BActive Publication Date: 2025-03-07ECOVACS COMML ROBOTICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010544358.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-15
Publication Date
2025-03-07
Estimated Expiration
2040-06-15

AI Technical Summary

Technical Problem

During the human-computer voice interaction process, due to complex interaction scenarios and environments, as well as the accents of different users, speech recognition is inaccurate, text information is incorrect or omitted, affecting the intention recognition and task execution of intelligent machines.

Method used

A text correction method is adopted to obtain the text to be corrected by speech recognition, generate the initial pinyin sequence and add a specified feature identifier to form the target pinyin sequence. Then, the target pinyin sequence is input into the trained pinyin-text prediction model, and text prediction is performed to obtain a candidate text set, and the corrected text is selected from it.

Benefits of technology

It improves text accuracy in the speech recognition process, solves the problems of text errors, first word omissions and vocabulary conflicts in different fields, and improves the accuracy of intelligent machines in identifying user intentions and task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113807080B_ABST
    Figure CN113807080B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a text correction method, device and storage medium. In the embodiment of the present application, a training corpus with a specified feature identifier is used to conduct targeted training in the form of pinyin to Chinese characters, and a pinyin-text prediction model with error correction capability can be obtained. The pinyin-text prediction model performs text prediction on the pinyin sequence with the specified feature identifier corresponding to the input text to be corrected, which can solve the problems of text errors, first word omissions and vocabulary conflicts in different fields in the speech recognition process, obtain accurate corrected text, and greatly improve the accuracy of the speech recognition process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text correction method, device and storage medium. Background Art

[0002] With the rapid development of artificial intelligence, more and more smart machines are applied to people's lives. In order to reduce the difficulty for users to use smart machines, most smart machines are equipped with voice recognition functions. When using smart machines, users can input voice commands to the smart machines, and the smart machines can convert the received voice commands into text information, identify the user's intentions by analyzing the text information, and then perform the corresponding tasks.

[0003] However, in the process of human-computer voice interaction, due to complex interaction scenarios and environments, as well as different users having different accents, intelligent machines often fail to accurately recognize voices and are unable to convert them into corresponding text information, or the converted text information is incorrect, resulting in the inability of intelligent machines to conduct human-computer dialogue or perform corresponding tasks. Summary of the invention

[0004] Multiple aspects of the present application provide a text correction method, device and storage medium to improve the accuracy of converting voice information into text information during human-computer interaction.

[0005] An embodiment of the present application provides a text correction method, which includes: obtaining a text to be corrected, wherein the text to be corrected is obtained by performing speech recognition on a speech signal; generating an initial pinyin sequence corresponding to the text to be corrected, and adding a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence; inputting the target pinyin sequence into a pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is trained based on a training corpus with the specified feature identifier; and selecting a corrected text corresponding to the text to be corrected from the candidate text set.

[0006] An embodiment of the present application also provides a text correction device, which includes: a processor and a memory storing a computer program; the processor is used to execute the computer program to: obtain a text to be corrected, wherein the text to be corrected is obtained by performing speech recognition on a speech signal; generate an initial pinyin sequence corresponding to the text to be corrected, and add a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence; input the target pinyin sequence into a pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is trained based on a training corpus with the specified feature identifier; and select a corrected text corresponding to the text to be corrected from the candidate text set.

[0007] An embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to perform at least the following actions: obtaining a text to be corrected, wherein the text to be corrected is obtained by performing speech recognition on a speech signal; generating an initial pinyin sequence corresponding to the text to be corrected, and adding a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence; inputting the target pinyin sequence into a pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is obtained by training based on a training corpus with the specified feature identifier; and selecting a corrected text corresponding to the text to be corrected from the candidate text set.

[0008] In an embodiment of the present application, a training corpus with designated feature identifiers is used to conduct targeted training in the form of Pinyin to Chinese characters, and a Pinyin-text prediction model with error correction capability can be obtained. The Pinyin-text prediction model performs text prediction on the Pinyin sequence with designated feature identifiers corresponding to the input text to be corrected, which can solve problems such as text errors, omission of the first word, and vocabulary conflicts in different fields that exist in the speech recognition process, and obtain accurate corrected text, greatly improving the accuracy of the speech recognition process. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0010] Figure 1a A flowchart of a text correction method provided in an embodiment of the present application;

[0011] Figure 1b A schematic diagram of the structure of a pinyin-text prediction model provided in an embodiment of the present application;

[0012] Figure 2 A structural schematic diagram of a text correction device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0014] In the existing human-computer interaction technology, for example, intelligent robots such as service robots and sweeping robots, intelligent devices such as smart speakers, televisions, and handheld terminals, as well as intelligent machines such as driverless cars and autonomous service machines all support human-computer interaction functions. When in use, the voice commands issued by the user can be converted into text through voice recognition technology, and the text can be parsed to identify the user's intention, and then human-computer dialogue or perform corresponding actions. However, due to complex scenes and environments, as well as different accents of different users, vocabulary omissions and errors often occur in the process of voice recognition; in addition, in the process of voice recognition, vocabulary conflicts often occur for words with the same or similar pronunciations in different fields. Therefore, in practical applications, it is necessary to correct the problems of text omissions, text errors, and vocabulary conflicts in different fields in the process of converting the above voice into text, so as to improve the subsequent ability of intelligent machines to recognize user intentions and process business.

[0015] To solve the above problems, an embodiment of the present application provides a text correction method, which can be used in a text correction device. Figure 1a A flowchart of a text correction method provided in an embodiment of the present application, such as Figure 1a As shown, the method includes:

[0016] S1a, obtaining the text to be corrected, where the text to be corrected is obtained by performing speech recognition on the speech signal.

[0017] S2a, generating an initial pinyin sequence corresponding to the text to be corrected, and adding a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence.

[0018] S3a, inputting the target pinyin sequence into the pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is trained based on training corpus with specified feature identifiers.

[0019] S4a. Selecting a corrected text corresponding to the text to be corrected from the candidate text set.

[0020] In this embodiment, the text information obtained by performing voice recognition on the voice signal is referred to as the text to be corrected. In the embodiment of the present application, the application scenario of voice recognition is not limited, and it can be any application scenario that can convert the user's voice signal into text information. For example, in scenarios such as banks, shopping malls or supermarkets, when users use service robots for self-service voice services, the service robots can recognize the voice questions input by the users as text information, understand the user's intentions based on this, and provide corresponding services to the users. For another example, when using smart terminals such as mobile phones and tablets, the smart terminals can recognize the voice commands input by the users as text information, and understand the user's intentions based on this. For another example, in smart home scenarios, smart home devices such as televisions, smart refrigerators, and sweeping robots can recognize the voice commands input by users as text information, and understand the user's intentions based on this. The text information obtained by speech recognition may have various problems such as vocabulary omissions, errors, and domain vocabulary conflicts. This embodiment takes the text to be corrected as the object and performs text correction on the text to be corrected, so that intelligent machines with speech recognition functions (intelligent machines can be but are not limited to: service robots, smart terminals, smart home devices, etc.) can understand the user's intention based on the corrected text, improve the accuracy of understanding the user's intention, and then improve the accuracy of executing corresponding actions based on the user's intention.

[0021] In the present embodiment, the text to be corrected is corrected in the form of converting pinyin to Chinese characters. First, the text to be corrected is parsed and processed to generate an initial pinyin sequence corresponding to the text to be corrected, and a specified feature identifier is added to the initial pinyin sequence to obtain a target pinyin sequence containing the specified feature identifier. In an embodiment of the present application, the specified feature identifier represents the feature information required to solve the possible problems of the text obtained by speech recognition, and the specified feature identifier can be one or more. For example, if the text obtained by speech recognition may have the problem of missing the first word, the first word identifier can be included to indicate that the text obtained by speech recognition may need to add the first word. The first word missing refers to the problem of lacking or missing the first word in the text obtained by speech recognition. For another example, the text obtained by speech recognition may have the problem of domain vocabulary conflict, and the scene identifier can be included to indicate the domain scene of the text obtained by speech recognition, so as to solve the vocabulary conflict problem in different fields. Domain vocabulary conflict refers to the problem of incorrectly identifying the text in a certain field as the text in other fields during the speech recognition process.

[0022] Further, in an embodiment of the present application, a pinyin-text prediction training model is obtained by pre-training with a training corpus with a specified feature identifier, and a text prediction is performed on a target pinyin sequence corresponding to the text to be corrected by the pinyin-text prediction training model to obtain a candidate text set containing at least one candidate text, and then a corrected text corresponding to the corrected text can be selected from the candidate text set. Among them, in view of the problems that may exist in the speech recognition process, feature identifiers required to solve these problems are added to the training corpus, and the pinyin-text prediction model (i.e., a model for converting pinyin to text) trained based on the training corpus with these feature identifiers has error correction capabilities, can solve the problems in the speech recognition process, and then output a candidate text set that overcomes the corresponding text. In actual use, the text to be corrected obtained by speech recognition is converted into a pinyin sequence with corresponding feature identifiers, and the target pinyin sequence with the corresponding feature identifiers is input into the pinyin-text prediction model for re-text prediction, so as to obtain a candidate text that overcomes the speech recognition problems corresponding to the feature identifiers in the target pinyin sequence (such as omission of the first word, domain vocabulary conflict, etc.) to a certain extent, thereby achieving the purpose of text correction, thereby overcoming the problems existing in the speech recognition process, improving the accuracy of text correction, and making the subsequent intention recognition and action execution based on the corrected text more accurate.

[0023] In an embodiment of the present application, the initial pinyin sequence refers to a pinyin sequence directly generated based on the text to be corrected, and is a pinyin sequence before adding a specified feature identifier. In an embodiment of the present application, the method for generating the initial pinyin sequence is not limited. In an optional embodiment, at least one pinyin mode can be provided, and different pinyin modes correspond to different pinyin features and have different pinyin effects. In actual use, a pinyin mode adapted to the pinyin features of the input text can be selected. Based on this, a method for generating the initial pinyin sequence corresponding to the text to be corrected includes: selecting a target pinyin mode from at least one pinyin mode according to the pinyin features of the text to be corrected; and generating the initial pinyin sequence corresponding to the text to be corrected according to the target pinyin mode.

[0024] Optionally, the at least one pinyin mode mentioned in this embodiment may include the following pinyin modes: a falling tone pinyin mode, a tone pinyin mode, a falling tone and initial and final separated pinyin mode, a tone pinyin mode and initial and final separated pinyin mode, a pinyin mode using only the first initial or final, and a pinyin mode with final pinyin subdivided, etc. The falling tone pinyin mode refers to a pinyin mode with only pinyin without tone; the tone pinyin mode refers to a pinyin mode with both pinyin and tone; the falling tone and initial and final separated pinyin mode refers to a pinyin mode with only pinyin without tone, and adjacent initials and finals are separated; the tone pinyin mode and initial and final separated pinyin mode refers to a pinyin mode with both pinyin and tone, and adjacent initials and finals are separated; the pinyin mode using only the first initial or final refers to a pinyin mode using only the first pinyin letter of each word; the pinyin mode with final pinyin subdivided refers to a pinyin mode in which all adjacent letters in the pinyin are separated. For example, when a user withdraws money from a bank and issues a voice command "I want to withdraw money" to a bank service robot, the bank service robot can recognize the voice command issued by the user to obtain the corresponding text to be corrected. According to the pinyin features corresponding to the text to be corrected, a target pinyin pattern can be selected from the pinyin patterns included in Table 1 below, and then an initial pinyin sequence corresponding to the text to be corrected can be generated according to the target pinyin pattern. In Table 1 below, numbers 3, 4, etc. represent tones, number 3 represents the third tone, and number 4 represents the fourth tone.

[0025] Table 1

[0026] Pinyin Mode Example: I want to withdraw money (text) Falling tone pinyin mode I'm a bitch Pinyin mode with tones wo3 yao4 qu3 kuan3 Pinyin mode with falling tone and separate initials and finals / wo / y ao / qu / kuan Pinyin mode with tones and separate initials and finals / wo 3 / y ao 4 / qu 3 / kuan 3 Pinyin mode using only the first initial or final wxya Pinyin pattern of vowel pinyin subdivision woyaoqukuan

[0027] In this embodiment, at least one pinyin mode is provided, and a more suitable pinyin mode can be flexibly selected according to the pinyin characteristics of the text to be corrected, and the error types such as homophones and tones, homophones with different tones, homophones with different vowels, homophones with different vowels, and homophones with different initials can be solved in a targeted manner during the text correction process. For example, in this embodiment, according to the pinyin characteristics of the text to be corrected, a pinyin mode with tones and separated initials and finals can be selected as the target pinyin mode; then, the initial pinyin sequence corresponding to the text to be corrected is generated according to the pinyin mode with tones and separated initials and finals. For example, assuming that the text to be corrected is: Which of the following is common, the initial pinyin sequence generated according to the pinyin mode with tones and separated initials and finals is: / c ai2 / ch an 3 / p in 3 / na 3 / ge 4 / ch ang 2 / j ian 4 / .

[0028] In an embodiment of the present application, after obtaining the initial pinyin sequence, the text correction is not performed directly according to the initial pinyin sequence, but a specified feature identifier is added to the initial pinyin sequence to obtain a target pinyin sequence with a target feature identifier, and the text correction is performed based on the target pinyin sequence. In the present embodiment, the adding position of the specified feature identifier in the initial pinyin sequence is not limited. For example, the specified feature identifier can be added in front of the first letter in the initial pinyin sequence, that is, the specified feature identifier is added in front of the initial pinyin sequence; or, the specified feature identifier can also be added after the last letter in the initial pinyin sequence, that is, the specified feature identifier is added at the end of the initial pinyin sequence; or, the specified feature identifier can also be added to a middle position in the initial pinyin sequence, that is, the specified feature identifier is added in the middle of the initial pinyin sequence. For example, taking the initial pinyin sequence: c ai 2 ch an 3 pin 3 na 3 g e 4 ch ang 2 j ian 4 as an example, an example of adding the specified feature identifier in front of the initial pinyin sequence is: [identifier] cai 2 ch an 3 pin 3 na 3 ge 4 ch ang 2 j ian 4, an example of adding the specified feature identifier at the end of the initial pinyin sequence is: c ai 2 ch an 3 pin 3 na 3 ge 4 ch ang 2 j ian 4 [identifier], and an example of adding the specified feature identifier in the middle of the initial pinyin sequence is: c ai 2 ch an 3 [identifier] pin 3 n a3 ge 4 ch ang 2 j ian 4.

[0029] In an embodiment of the present application, a designated feature identifier is added to the initial pinyin sequence for the purpose of identifying the feature information required for correcting the initial pinyin sequence or the text expressed by the initial pinyin sequence. Depending on the application scenario and the speech recognition capability of the intelligent machine, the designated feature identifier required for the text obtained by speech recognition may be different, and the designated feature identifier required for use may be determined according to actual needs. For example, for speech recognition scenarios where there may be vocabulary conflicts in different fields, the designated feature identifier may include a scene identifier representing the field scene to which the text to be corrected belongs, so as to correct the vocabulary conflict problem in different fields. For another example, for speech recognition scenarios where there may be omissions of the first word, the designated feature identifier may include a first word identifier indicating that the text to be corrected may need to add the first word to correct the problem of omissions of the first word. For another example, in other application scenarios, there may be both problems of vocabulary conflicts in different fields and problems of omissions of the first word, then the designated feature identifier may include a scene identifier of the field scene to which the text to be corrected belongs, and may include a first word identifier indicating that the text to be corrected may need to add the first word. It is to be noted that the first character identifier only indicates that the text to be corrected may need to add the first character, and does not mean that the text to be corrected must have missed the first character; for the text to be corrected that does miss the first character, the first character can be added to the candidate text output by the pinyin-text prediction model; for the text to be corrected that does not miss the first character, the candidate text output by the pinyin-text prediction model may contain identification information that the first character does not need to be added, or may not contain any prompt information.

[0030] Based on the above analysis, when adding the specified feature identifier to the initial pinyin sequence, at least one of the scene identifier and the first character identifier can be added to the initial pinyin sequence to obtain the target pinyin sequence. For example, assuming that the text to be corrected is: Which of the following is common, its corresponding initial pinyin sequence is: c ai 2 ch an 3 pin 3 na 3 ge 4 ch ang 2j ian 4, then the target pinyin sequence obtained after adding the scene identifier and the first character identifier to the initial pinyin sequence is: [BANK] [F] c ai 2 ch an 3 pin 3 na 3 ge 4 ch ang 2j ian 4; wherein, [BANK] is the scene identifier, which in this example indicates that the field scene to which the text to be corrected belongs is the bank scene; [F] is the first character identifier, which in this example indicates that the text to be corrected lacks the first character, and the first character needs to be added during the correction process. In this example, the implementation of the scene identifier and the first character identifier is only an example and is not limited thereto. Among them, the target pinyin sequence containing the scene identifier carries the characteristic information of the field scene to which the text to be corrected belongs, and the characteristic information can be used to correct the conflict between the text to be corrected and other field vocabulary; the target pinyin sequence containing the first word identifier carries the characteristic information of whether the text to be corrected is missing the first word, and the characteristic information can be used to correct the first word omission problem in the text to be corrected. It is explained here that the embodiment of the present application does not limit the representation method of the specified characteristic identifier. Any identifier method that can distinguish the pinyin sequence from the identifier is applicable to the embodiment of the present application. For example, the identifier can be represented by brackets [] or by double quotes "".

[0031] In the embodiment of the present application, after obtaining the target pinyin sequence, the target pinyin sequence can be input into the pre-trained pinyin-text prediction model for text prediction to obtain a candidate text set containing at least one candidate text. Figure 1b As shown in FIG. 1 , the pinyin-text prediction model includes an encoder network and a decoder network; the encoder network and the decoder network can be implemented using a network structure such as a convolutional neural network (CNN), a recurrent neural network (RNN), a long short-term memory network (LSTM), or a transformer. Figure 1bAs shown, the input of the encoding network is the target pinyin sequence (scene identifier and / or first word identifier, X1, X2, ..., Xn), X1, X2, ..., Xn respectively represent the pinyin of a character in the text to be corrected; the role of the encoding network is to encode the target pinyin sequence into a first feature vector of a fixed size, and output the first feature vector to the decoding network. Optionally, as Figure 1b As shown, the encoding network may include multiple layers. The first layer is used to vectorize the pinyin of each character in the input target pinyin sequence according to the character pair, obtain the feature vector corresponding to each character pinyin and output it to other layers. The other layers are responsible for vectorizing the pinyin sequence corresponding to the text to be corrected from the perspective of grammar and semantics to obtain the first feature vector. After the decoding network obtains the first feature vector provided by the encoding network, it decodes the first vector feature and outputs the second feature vector (Y1, Y2, ..., Yn). The second feature vector includes the feature vector corresponding to each character, that is, Y1, Y2, ..., Yn respectively represent the feature vector corresponding to each character in the text to be corrected, and the feature vector represents the output probability of each character. As shown Figure 1b As shown, the input of the decoding network includes not only the first feature vector output by the encoding network, but also the feature vectors of other characters outputted previously. After obtaining the second feature vector, at least one candidate text can be obtained according to the second feature vector to form a candidate text set. Based on this, after the target pinyin sequence is input into the pinyin-text prediction model, in the pinyin-text prediction model, the encoding network is used to encode the target pinyin sequence into a first feature vector of a fixed size; the decoding network is used to decode the first feature vector to obtain a second feature vector; according to the second feature vector, a candidate text set containing at least one candidate text is obtained.

[0032] After obtaining the candidate text set, a candidate text can be selected from the candidate text set as the corrected text corresponding to the text to be corrected. For example, assuming that the text to be corrected is: which financial product is common, then after the above processing process, the candidate text set obtained includes: [BANK][null] which financial product is common, [BANK][null] which financial product is common, [BANK] which financial product is common, [BANK] which financial product is common, [BANK] which material product is common, and [BANK][null] which manufacturer of material products. One can be selected from them as the corrected text, for example, [BANK] which financial product is common can be selected from them as the corrected text corresponding to the text to be corrected. In the embodiment of the present application, the method of selecting the corrected text from the candidate text set is not limited. For example, in an optional embodiment, first, the score of each candidate text in the candidate text set is calculated according to the language model, and further, according to the known field keywords, the score of the candidate text containing the field keywords is adjusted, and the candidate text with the highest score after adjustment is selected as the corrected text corresponding to the text to be corrected.

[0033] Among them, the language model is a model used to calculate the probability of a sentence. For example, the probability value of each word in each candidate text can be calculated, and then the probability value of each candidate text can be calculated based on the probability value of each word in each candidate text. The probability value of each candidate text is used as the score of each candidate text. In practical applications, the method of calculating the score of the candidate text is not limited. For each word in each candidate text, the probability value of its possible appearance can be calculated based on the probability values ​​of all the previous words. For example, assuming that S represents a candidate text composed of a series of words W1, W2, ..., Wn arranged in a specific order, the probability of S appearing in the text library is P(S) = P(W1, W2, ..., Wn). Using the conditional probability formula, the probability of S appearing is equal to the multiplication of the conditional probabilities of each word appearing, that is, the formula P(S) = P(W1, W2, ..., Wn) = P(W1)P(W2|W1)P(W3|W1, W2)...P(Wn|W1, W2, ..., Wn-1). Among them, P(W1) represents the probability value of the word W1 appearing, and P(W2|W1) represents the probability value of the word W2 appearing under the premise of knowing the probability value of the word W1 appearing. By analogy, the probability value of each candidate text appearing, that is, the score of each candidate text, can be calculated. Alternatively, the score of the candidate text can be calculated based on the N-gram algorithm. N-gram is a statistical language model that uses a statistical method to predict the nth word based on the previous (n-1) words. Taking the bigram model as an example, it is assumed that the appearance of a word depends only on the word that appears before it, that is, for each word in each candidate text, its probability value of appearance can be calculated based on the probability value of the previous word. For example, the formula P(S) = P(W1)P(W2|W1)P(W3|W2)...P(Wn|Wn-1) is used. Among them, P(Wi|Wi-1)=C(Wi-1,Wi) / C(Wi-1), C(Wi-1,Wi) is the number of times the vocabulary Wi and the vocabulary Wi-1 appear in the vocabulary library used by the speech model. The probability values ​​of the appearance of the vocabulary Wi and Wi-1 can be calculated based on the number of times the vocabulary Wi and Wi-1 appear in the vocabulary library used by the speech model. Furthermore, the probability value of the appearance of each candidate text can be calculated, that is, the score of each candidate text.

[0034] After obtaining the score of each candidate text, optionally, the candidate text with the highest score can be directly selected as the corrected text corresponding to the text to be corrected according to the score of each candidate text, but it is not limited to this implementation method. In the present embodiment, after obtaining the score of each candidate text, further, according to the known domain keywords, the candidate text containing the domain keywords is determined; the score of the candidate text containing the domain keywords is adjusted, and the adjustment here is mainly to increase the score of the candidate text containing the domain keywords; and then, the candidate text with the highest score after adjustment is selected as the corrected text corresponding to the text to be corrected. The way to adjust the score of the candidate text containing the domain keywords is not limited here. In practical applications, the candidate text containing the domain keywords and the number of domain keywords contained in the candidate text containing the domain keywords can be counted according to the known domain keywords, and the score of the candidate text containing the domain keywords can be adjusted according to the number of domain keywords contained in the candidate text containing the domain keywords. For example, the weight factor corresponding to the candidate text containing the domain key can be calculated according to the number of domain keywords contained in the candidate text containing the domain key, and the score of the text containing the domain key is multiplied by the corresponding weight factor to obtain a new score, and then all candidate texts are re-ranked according to the updated score, and the text with the highest score is used as the corrected text corresponding to the text to be corrected. Optionally, the formula score=score*(1+0.5*Ncount) can be used to adjust the score of the candidate text containing the domain key, where Ncount represents the number of domain keywords in the candidate text, and 1+0.5*Ncount represents the weight factor corresponding to the candidate text containing the domain key. Of course, in practical applications, the candidate text containing the domain key is not limited to the above method for adjusting. It should be noted that, when determining the candidate text containing the domain keywords, its score may not be adjusted according to the number of domain keywords it contains, but the candidate text with the highest score and containing the domain keywords may be directly selected from the candidate text containing the domain keywords as the corrected text corresponding to the text to be corrected; or, the candidate texts containing the domain keywords are compared, and the text containing the domain keywords that best fits the current context is used as the corrected text corresponding to the corrected text, etc. As long as the text method that can screen out the most suitable text for the current domain scenario is used in the embodiments of the present application. In addition, it should be noted that the known domain keywords can be stored in a keyword thesaurus or a keyword dictionary, without limitation.

[0035] In an embodiment of the present application, before using the pinyin-text prediction model, training can be performed based on a training corpus with a specified feature identifier to obtain a pinyin-text prediction model. Among them, the process of training the pinyin-text prediction model includes: obtaining a training corpus, the training corpus includes a text corpus and a pinyin corpus corresponding to the text corpus; adding a specified feature identifier to the pinyin corpus in the training corpus; performing model training based on the training corpus with the specified feature identifier to obtain a pinyin-text prediction model. In this embodiment, the specified feature identifier represents the feature information required to solve the problems that may exist in the text obtained by speech recognition. Model training is performed based on the training corpus with the specified feature identifier added, and a pinyin-text prediction model with error correction capability can be obtained. Furthermore, using the pinyin-text prediction model with error correction capability for text prediction can solve the problems in the speech recognition process, and then output a candidate text set that overcomes the corresponding text.

[0036] In this embodiment, the form of the designated feature identifier added to the training corpus is not limited. For example, for a speech recognition scenario where there may be a first word missing, a first word identifier can be added to the training corpus, that is, the designated feature identifier includes the first word identifier. In this case, the process of obtaining the training corpus includes: obtaining a text corpus; generating a standard training corpus from the text corpus and its corresponding correct pinyin sequence; using known fuzzy sounds to replace the correct pinyin in the standard training corpus to obtain a fuzzy sound training corpus; removing the first word pinyin in the standard training corpus and the fuzzy sound training corpus to obtain a first word missing training corpus.

[0037] About obtaining text corpus:

[0038] In the speech recognition scenario where the first word may be omitted, the domain scenario to which the text corpus belongs is not limited. For example, the text in the general domain scenario can be obtained as the text corpus, the text in the vertical domain scenario can be obtained as the text corpus, or the text in the general domain scenario and the vertical domain scenario can be obtained as the text corpus at the same time. It is explained here that for the speech recognition scenario where there may be a domain vocabulary conflict, the text in the general domain scenario and the vertical domain scenario can be obtained as the text corpus at the same time, and accordingly, it is also necessary to add a scene identifier to the training corpus. Among them, the scale of the text corpus in the general domain scenario is relatively large, which can cover most of the general vocabulary, and the scale of the text corpus in the vertical domain scenario is relatively small, usually only covering vocabulary in a specific field, with domain characteristics. After obtaining the text corpus, the text corpus is parsed and processed to obtain the corresponding pinyin sequence and text, and the domain identifier is added to the corresponding pinyin sequence as the input of the training corpus to solve the vocabulary conflict problem caused by different fields in the speech recognition process. The obtained text corpus is exemplified, for example, I am from Fujian, which financial product is common, I want to withdraw money, etc.

[0039] In an embodiment of the present application, the training corpus used for model training is in a sentence pair format, namely (pinyin sequence (input), text corpus (output)). In each training corpus, the pinyin sequence serves as the input (input) of the model training, and the text corpus is the output (output) of the model training. According to various problems that may exist in the speech recognition scenario and need to be corrected, such as the first word omission and confused sounds, in some optional embodiments of the present application, three sentence pair modes are used to form the training corpus, namely: standard training corpus, ambiguous sound training corpus and first word omission training corpus. The generation process of these three corpora is described in detail below.

[0040] About the generation of standard training corpus: The standard training corpus refers to the training corpus formed by the text corpus and its corresponding correct pinyin sequence, and its sentence pair structure is (correct pinyin sequence (input), text corpus (output)). Optionally, after collecting the text corpus, the text corpus can be segmented, and then the segmentation result can be converted into the corresponding pinyin to obtain the correct pinyin sequence corresponding to the text corpus, and the two are combined together to obtain the standard training corpus. Taking the text corpus "I am a Fujianese" in the above embodiment as an example, its corresponding standard training corpus is (wo 3 shi 4 fu 2 j ian 4 r en2, I am a Fujianese).

[0041] About the generation of fuzzy sound training corpus:The fuzzy sound training corpus refers to the training corpus obtained by replacing the correct pinyin in the standard training corpus with known fuzzy sounds, and its sentence pair structure is (incorrect pinyin sequence replaced by fuzzy sounds (input), text corpus (output)). Among them, the known fuzzy sounds are the pinyin corpus obtained by analyzing and arranging the commonly existing confused pronunciations in daily life and the text corpus in specific scenarios. Among them, common examples of fuzzy sound replacement can be found in Table 2 below. Specifically, the known fuzzy sounds can be used to replace the relevant pinyin in the correct pinyin sequence in the standard training corpus with fuzzy sounds to obtain an incorrect pinyin sequence, and the incorrect pinyin sequence and the text corpus are combined to obtain the fuzzy sound training corpus. For example, taking the text corpus "I am a Fujianese" in the above embodiment as an example, the corresponding standard training corpus is (wo 3 sh i 4 fu 2 j ian 4 r en 2, I am a Fujianese), and the fuzzy sound training corpus obtained after the fuzzy sound replacement is (wo 3 sh i 4 hu 2 j ian 4 r en 2, I am a Fujianese).

[0042] Table 2

[0043]

[0044] By using known fuzzy sounds to replace the correct pinyin in the standard training corpus, we can correct words with the same or similar pronunciations and resolve conflicts in words with the same or similar pronunciations. By training based on the training corpus after the fuzzy sounds have been replaced, the pinyin-text prediction model obtained has higher prediction accuracy. Based on the training corpus after the fuzzy sounds have been replaced, it can be predicted that the true text corresponding to the text corpus is: I am from Fujian.

[0045] About the generation of first word missing training corpus:The first word missing training corpus is a training corpus obtained by removing the first word pinyin in the standard training corpus and the fuzzy sound training corpus, and its sentence pair structure is (the wrong pinyin sequence after removing the first word pinyin, the text corpus). Due to the complex environmental influence in the speech recognition scene, the phenomenon of first word missing occurs. Therefore, by removing the first pinyin (including initial consonants and finals) in the pinyin sequence corresponding to the text corpus, the remaining pinyin sequence is used as the training corpus for model training. For example, after removing the first word pinyin from the correct pinyin sequence in the standard training corpus corresponding to the text corpus "I am a Fujianese" mentioned in the above embodiment, the first word missing training corpus obtained is (sh i 4 fu 2 j ian 4 r en 2, I am a Fujianese). Similarly, after removing the first word pinyin from the wrong pinyin sequence in the fuzzy sound training corpus corresponding to the text corpus "I am a Fujianese" mentioned in the above embodiment, the first word missing training corpus obtained is (sh i 4 h u 2 j ian 4 r en 2, I am a Fujianese). Based on the training of the first word missing training corpus formed by removing the first word pinyin from the standard training corpus and the fuzzy sound training corpus, the pinyin-text prediction model can correct the first word missing problem that occurs during speech recognition during prediction, thereby improving the prediction accuracy of the pinyin-text prediction model. According to the training of the first word missing training corpus after the above replacement, it can be predicted that the real text corresponding to the text corpus is: I am from Fujian.

[0046] Notes on adding specified feature identifiers: In an embodiment of the present application, a first-word identifier and / or a domain identifier can be added to the training corpus to address the two situations of missing first words and / or domain vocabulary conflicts. The first-word identifier and the domain identifier can be added separately at the beginning of the sentence of the training corpus, or they can be used in combination at the same time. Taking the pinyin mode using tonal pinyin as the pinyin corpus as an example, the addition of specified feature identifiers is exemplified by taking the three types of training corpora mentioned above as examples. Among them, Table 3 uses the domain identifier alone, Table 4 uses the first-word identifier alone, and Table 5 uses both the first-word identifier and the domain identifier.

[0047] The domain identifier is used to indicate the domain scenario information of the training corpus, such as [BANK] for the banking field, [MEDICAL] for the medical field, and [COM] for the general domain scenario. The first letter identifier is consistent in all training corpora (or when inputting model training), and is represented by [F], indicating that there may be a problem of missing the first letter, or that the first letter may need to be added; when outputting model training, [null] is used to indicate that the first letter does not need to be added, otherwise the default text is directly added at the first letter position.

[0048] Table 3

[0049]

[0050] Table 4

[0051]

[0052] Table 5

[0053]

[0054] In an embodiment of the present application, after obtaining a training corpus with a specified feature identifier, a model training can be performed according to the training corpus with the specified feature identifier to obtain a pinyin-text prediction model. Optionally, a model training process includes: pre-training a preset network structure model using a training corpus corresponding to a general domain scenario to obtain an initialization model; fine-tuning the initialization model using a training corpus corresponding to a vertical domain scenario to obtain a pinyin-text prediction model. Among them, the training corpus corresponding to the general domain scenario refers to the training corpus generated by parsing the text corpus in the general domain scenario; the training corpus corresponding to the vertical domain scenario refers to the training corpus generated by parsing the text corpus in the vertical domain scenario. Since the scale of the text corpus in the general domain scenario is relatively large and can cover most of the general vocabulary, the prediction result obtained by model prediction based on the generated training corpus is relatively broad and can predict most of the general text content; while the scale of the text corpus in the vertical domain scenario is relatively small, usually only covering vocabulary in a specific field, the prediction result obtained by model prediction based on the generated training corpus can predict the text content in a specific field, and the prediction result is more specific and has a higher accuracy. Based on the process of two rounds of model training with the training corpus with the specified feature identifiers in the above embodiment, the resulting pinyin-text prediction model can solve problems such as text errors, text omissions, and vocabulary conflicts in different fields in the pinyin-to-text process, and the prediction results are more accurate.

[0055] In the embodiment of the present application, the implementation method of the preset network structure model is not limited. In this embodiment, a method having the following characteristics can be adopted: Figure 1b The Masked Sequence to Sequence Pre-training (MASS) model of the structure shown can be implemented by using the convolutional neural network (CNN), recurrent neural network (RNN) and long short-term memory network (LSTM) mentioned in the above embodiments to pre-train and fine-tune the training corpus to obtain a pinyin-text prediction model. Pre-training refers to the process of encoding and decoding the training corpus based on a large-scale general domain scene corpus to obtain an initialized model; fine-tuning training refers to the process of encoding and decoding the training corpus based on a small-scale vertical domain scene corpus to obtain a pinyin-text prediction model.

[0056] In the above embodiments, there is no limitation on the implementation method of the entire text correction process, which can be determined according to the specific implementation form of the intelligent machine. For example, for an intelligent machine that supports human-computer interaction, if its processing function is powerful enough and has a built-in text correction module and pinyin-text training model, the entire text correction process can be completed on the intelligent machine side; if the processing function of the intelligent machine is not powerful enough and it can rely on a remote server, the text correction process can be completed on the remote server corresponding to the intelligent machine. The following is a detailed description of the entire process of text correction using the method of converting pinyin to Chinese characters in the embodiment of the present application in conjunction with a specific scenario embodiment:

[0057] Scenario Example 1:

[0058] Taking the autonomous service machine with human-computer interaction function as a service robot as an example, the service robot has a built-in speech recognition module and a text correction module, and the text correction module uses a pinyin-text training model for text correction. When the user needs the service robot to perform a service task, the user can issue a voice command to the service robot in the form of voice. For example, the service robot is a bank service robot. When the user needs to register the withdrawal information when handling the withdrawal business, the user can issue a voice command of "Register withdrawal information!" to the service robot. For another example, the service robot can be a shopping mall or supermarket service robot. When the user wants to confirm the location of the fruit and vegetable area during self-service shopping, the user can issue a voice command of "Where is the fruit and vegetable area?" to the service robot. After receiving the voice command, the service robot can recognize the user's voice command as text through the built-in speech recognition module, and then use the built-in text correction module to correct the text recognized by the speech recognition module as the text to be corrected. Specifically, the text correction module can generate an initial pinyin sequence of the text to be corrected, add the first character identifier and / or the scene identifier to the initial pinyin sequence, and obtain a target pinyin sequence; input the target pinyin sequence into the pinyin-text training model to perform text prediction on the target pinyin sequence to obtain the corrected text information. Afterwards, the service robot can understand the user's intention based on the corrected text information, and then perform corresponding actions according to the user's intention. For example, if it is understood that the user's intention is to register withdrawal information, a withdrawal information registration window can be displayed to the user on the electronic screen for the user to register the withdrawal information; or, the corresponding manual withdrawal window location can be broadcast to the user in the form of voice broadcast, etc. If it is understood that the user's intention is to find the location of the fruit and vegetable area, an electronic map of the shopping mall or supermarket can be displayed to the user on the electronic screen, and the route from the current location to the fruit and vegetable area can be marked in the electronic map; or, the route from the current location to the fruit and vegetable area can be broadcast to the user in the form of voice broadcast, etc.

[0059] Scenario Example 2:

[0060] In the embodiment of the present application, if the processing power of the autonomous service machine is not strong enough, the human-computer interaction process can be completed by relying on a remote server. The autonomous service machine is equipped with a speech recognition module, and the text correction module is set on the remote server side. The text correction module uses a pinyin-text training model to correct the text. For example, taking the autonomous service machine with human-computer interaction function as a sweeping robot as an example, when the user needs the sweeping robot to perform a cleaning task, the sweeping robot can be issued a voice command of "please clean the kitchen and living room" in the form of voice. Alternatively, when the sweeping robot is too low in power during the cleaning task, a low power alarm can be issued. After the user hears the low power alarm, the sweeping robot can be issued a voice command of "return to the charging station to charge" in the form of voice. After receiving the voice command, the sweeping robot can recognize the user's voice command as text through the built-in speech recognition module, and then upload the text information to the text correction module on the remote server side. After receiving the text information, the text correction module can correct it as a text to be corrected. Specifically, the text correction module can generate an initial pinyin sequence of the text to be corrected, add the first character identifier and / or the scene identifier to the initial pinyin sequence, and obtain a target pinyin sequence; input the target pinyin sequence into the pinyin-text training model to perform text prediction on the target pinyin sequence to obtain the corrected text information. Afterwards, the server transmits the corrected text information back to the sweeping robot, and the sweeping robot can understand the user's intention based on the corrected text information, and then perform corresponding actions according to the user's intention. For example, if it is understood that the user's intention is to clean the kitchen and the living room, the sweeping robot can first move to the kitchen to perform the cleaning task in the kitchen, and then move to the living room to perform the cleaning task in the living room. If it is understood that the user's intention is to charge the recharge base, the sweeping robot can record the current cleaning position, start the recharge action, and gradually move to the charging base until it successfully docks with the charging base and starts charging.

[0061] Alternatively, after receiving the voice command from the user, the sweeping robot directly uploads the voice command to the server, which performs voice recognition on the voice command and converts it into text; then, the text correction module on the server can correct the text information as text to be corrected after receiving it, and return the corrected text information to the sweeping robot.

[0062] In an embodiment of the present application, based on the text corpus corresponding to the general domain scenario and the training corpus in the vertical domain scenario, targeted training is performed by considering the feature information corresponding to the problems such as the omission of the first letter and the conflict of domain vocabulary in the training corpus, and a pinyin-text prediction model with error correction capability can be obtained. By using the pinyin-text prediction model, text prediction is performed on the pinyin sequence with feature identifiers of the input text to be corrected, which can solve the problems of text errors, omission of the first letter and conflict of different domain vocabulary in the speech recognition process, and obtain accurate corrected text, which greatly improves the accuracy of the speech recognition process.

[0063] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of steps S1a to S4a can be device A; for another example, the execution subject of steps S1a and S2a can be device A, and the execution subject of steps S3a and S4a can be device B; and so on.

[0064] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as S1a, S2a, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0065] Figure 2 The text correction device 100 provided in the embodiment of the present application can be an intelligent machine with human-computer interaction function, for example, it can be an intelligent robot such as a service robot or a sweeping robot, or an intelligent device such as an intelligent speaker, a television, a handheld terminal, or an unmanned vehicle, or a server device that cooperates with an intelligent machine.

[0066] like Figure 2 As shown, the text correction device 100 includes: a processor 10 and a memory 20 for storing computer instructions. The processor 10 and the memory 20 may be one or more.

[0067] The memory 20 is mainly used to store computer programs, which can be executed by the processor 10, so that the processor 10 controls the text correction device 100 to implement corresponding functions, complete corresponding actions or tasks. In addition to storing computer programs, the memory 20 can also be configured to store various other data to support operations on the text correction device 100. Examples of such data include instructions for any application or method operating on the text correction device 100.

[0068] The memory 20 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0069] In the embodiments of the present application, the implementation form of the processor 10 is not limited, for example, it can be but not limited to a CPU, a GPU or an MCU. The processor 10 can be regarded as a control system of the text correction device 100, and can be used to execute the computer program stored in the memory 20 to control the text correction device 100 to implement corresponding functions and complete corresponding actions or tasks. It is worth noting that, depending on the implementation form of the text correction device 100 and the scene in which it is located, the functions to be implemented, the actions or tasks to be completed will be different; accordingly, the computer programs stored in the memory 20 will also be different, and the processor 10 can control the text correction device 100 to implement different functions and complete different actions or tasks by executing different computer programs.

[0070] In some optional embodiments, such as Figure 2 As shown, the text correction device 100 may further include other components such as a communication component 40 , a power component 50 , and a driving component 60 . Figure 2 Only some components are shown schematically, which does not mean that the text correction device 100 only includes Figure 2 The drive component 50 may include a drive wheel, a drive motor, a universal wheel, etc. Further, optionally, the text correction device 100 may also include other components such as a display 70 and an audio component 80 according to different application requirements. Figure 2 The dashed box is used as an example, and it can be understood that the components in the dashed box are optional components, not mandatory components, which can be determined according to the product form of the text correction device 100. If the text correction device 100 with human-computer interaction function is a sweeping robot, then the text correction device 100 may also include a dust bucket and a floor brush component, etc., which will not be described in detail here.

[0071] In an embodiment of the present application, when the processor 10 executes the computer program in the memory 20, it is used to: obtain a text to be corrected, wherein the text to be corrected is obtained by performing speech recognition on a speech signal; generate an initial pinyin sequence corresponding to the text to be corrected, and add a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence; input the target pinyin sequence into a pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is trained based on a training corpus with the specified feature identifier; and select a corrected text corresponding to the text to be corrected from the candidate text set.

[0072] In an optional embodiment, when obtaining the target pinyin sequence, the processor 10 is used to: add at least one of a scene identifier and a first-word identifier to the initial pinyin sequence to obtain the target pinyin sequence; wherein the scene identifier indicates the domain scene to which the text to be corrected belongs, and is used to correct vocabulary conflicts in different domains; the first-word identifier indicates that the text to be corrected may need to add the first word to correct the problem of missing the first word.

[0073] In an optional embodiment, when selecting the corrected text corresponding to the text to be corrected, the processor 10 is used to: calculate the score of each candidate text in the candidate text set according to the language model; adjust the score of the candidate text containing the domain keywords according to the known domain keywords; and select the candidate text with the highest adjusted score as the corrected text corresponding to the text to be corrected.

[0074] In an optional embodiment, the processor 10 is also used to: obtain training corpus, the training corpus includes a text corpus and its corresponding pinyin corpus; add a specified feature identifier to the pinyin corpus in the training corpus; perform model training based on the training corpus with the specified feature identifier to obtain a pinyin-text prediction model.

[0075] In an optional embodiment, if the designated feature identifier includes a first-character identifier, the processor 10, when acquiring the training corpus, is used to: acquire a text corpus; generate a standard training corpus from the text corpus and its corresponding correct pinyin sequence; use known fuzzy sounds to replace the correct pinyin in the standard training corpus to obtain fuzzy sound training corpus; remove the first-character pinyin in the standard training corpus and the fuzzy sound training corpus to obtain a first-character missing training corpus.

[0076] In an optional embodiment, if the specified feature identifier also includes a scene identifier, the processor 10, when acquiring the text corpus, is used to: acquire text corpus in a general domain scene and a vertical domain scene.

[0077] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to perform at least the following actions: obtain a text to be corrected, which is obtained by performing speech recognition on a speech signal; generate an initial pinyin sequence corresponding to the text to be corrected, and add a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence; input the target pinyin sequence into a pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is trained based on a training corpus with a specified feature identifier; and select a corrected text corresponding to the text to be corrected from the candidate text set.

[0078] Above Figure 2 The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may also include a near field communication (NFC) module, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and the like.

[0079] Above Figure 2 The display in the embodiment includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0080] Above Figure 2 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0081] Above Figure 2The audio component in can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.

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

[0083] The present invention is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box 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 data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0084] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0085] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0086] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0087] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0088] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0089] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0090] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A text correction method, characterized in that: include: Acquire a text to be corrected, where the text to be corrected is obtained by performing speech recognition on a speech signal; Generate an initial pinyin sequence corresponding to the text to be corrected, and add a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence; the specified feature identifier is feature information required to solve the problem existing in the text obtained by speech recognition; Inputting the target pinyin sequence into a pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is trained based on training corpus with the specified feature identifier; From the candidate text set, a corrected text corresponding to the text to be corrected is selected.

2. The method according to claim 1, characterized in that Generating an initial pinyin sequence corresponding to the text to be corrected, including: According to the pinyin features of the text to be corrected, selecting a target pinyin mode from at least one pinyin mode; According to the target pinyin pattern, generating an initial pinyin sequence corresponding to the text to be corrected; The at least one Pinyin mode includes one or more of a falling tone Pinyin mode, a tone Pinyin mode, a falling tone Pinyin mode with separate initials and finals, a tone Pinyin mode with separate initials and finals, a Pinyin mode using only the first initial or final, and a Pinyin mode with subdivided final Pinyin.

3. The method according to claim 1, characterized in that Adding a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence includes: Add at least one of a scene identifier and a first character identifier to the initial pinyin sequence to obtain a target pinyin sequence; The scene identifier indicates the field scene to which the text to be corrected belongs, and is used to correct vocabulary conflicts in different fields; the first word identifier indicates that the text to be corrected may need to add the first word, and is used to correct the problem of missing the first word.

4. The method according to claim 1, characterized in that: The target pinyin sequence is input into the pinyin-text prediction model for text prediction to obtain a candidate text set, including: In the pinyin-text prediction model, the target pinyin sequence is encoded into a first feature vector of a fixed size using an encoding network; Decoding the first feature vector using a decoding network to obtain a second feature vector; A candidate text set including at least one candidate text is obtained according to the second feature vector.

5. The method according to claim 1, characterized in that Selecting a corrected text corresponding to the text to be corrected from the candidate text set includes: Calculating a score for each candidate text in the candidate text set according to the language model; According to known domain keywords, the scores of candidate texts containing domain keywords are adjusted; The candidate text with the highest adjusted score is selected as the corrected text corresponding to the text to be corrected.

6. The method according to claim 5, characterized in that Based on known domain keywords, the scores of candidate texts containing domain keywords are adjusted, including: According to known domain keywords, counting candidate texts containing domain keywords and the number of domain keywords they contain; The score of the candidate text containing the domain keyword is adjusted according to the number of domain keywords contained in the candidate text containing the domain keyword.

7. The method according to any one of claims 1 to 6, characterized in that: Also includes: Acquire training corpus, wherein the training corpus includes text corpus and its corresponding pinyin corpus; In the pinyin corpus in the training corpus, adding a specified feature identifier; Model training is performed based on the training corpus with the specified feature identifier to obtain the pinyin-text prediction model.

8. The method according to claim 7, characterized in that If the specified feature identifier includes a first-letter identifier, obtaining training corpus includes: Get text corpus; Generate standard training corpus from the text corpus and its corresponding correct pinyin sequence; Using known fuzzy sounds, the correct pinyin in the standard training corpus is replaced to obtain fuzzy sound training corpus; The first character pinyin in the standard training corpus and the fuzzy sound training corpus is removed to obtain the first character missing training corpus.

9. The method according to claim 8, characterized in that If the designated feature identifier also includes a scene identifier, then acquiring text corpus includes: acquiring text corpus in a general domain scene and a vertical domain scene.

10. The method according to claim 9, characterized in that Performing model training according to the training corpus with the specified feature identifier to obtain the pinyin-text prediction model includes: Use the training corpus corresponding to the general domain scenario to pre-train the preset network structure model to obtain the initialization model; The initialization model is fine-tuned using training corpus corresponding to the vertical domain scenario to obtain the pinyin-text prediction model.

11. The method according to claim 10, characterized in that The network structure model is a masked sequence-to-sequence pre-trained MASS model.

12. A text correction device, characterized in that: include: a processor and a memory storing a computer program; The processor is configured to execute the computer program to: Acquire a text to be corrected, where the text to be corrected is obtained by performing speech recognition on a speech signal; Generate an initial pinyin sequence corresponding to the text to be corrected, and add a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence; the specified feature identifier is feature information required to solve the problem existing in the text obtained by speech recognition; Inputting the target pinyin sequence into a pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is trained based on training corpus with the specified feature identifier; From the candidate text set, a corrected text corresponding to the text to be corrected is selected.

13. The text correction device according to claim 12, characterized in that When obtaining the target pinyin sequence, the processor is used to: Add at least one of a scene identifier and a first character identifier to the initial pinyin sequence to obtain a target pinyin sequence; The scene identifier indicates the field scene to which the text to be corrected belongs, and is used to correct vocabulary conflicts in different fields; the first word identifier indicates that the text to be corrected may need to add the first word, and is used to correct the problem of missing the first word.

14. The text correction device according to claim 12, characterized in that When selecting the corrected text corresponding to the text to be corrected, the processor is used to: Calculating a score for each candidate text in the candidate text set according to the language model; According to known domain keywords, the scores of candidate texts containing domain keywords are adjusted; The candidate text with the highest adjusted score is selected as the corrected text corresponding to the text to be corrected.

15. The text correction device according to any one of claims 12 to 14, characterized in that: The processor is further configured to: Acquire training corpus, wherein the training corpus includes text corpus and its corresponding pinyin corpus; In the pinyin corpus in the training corpus, adding a specified feature identifier; Model training is performed based on the training corpus with the specified feature identifier to obtain the pinyin-text prediction model.

16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform at least the following actions: Acquire a text to be corrected, where the text to be corrected is obtained by performing speech recognition on a speech signal; Generate an initial pinyin sequence corresponding to the text to be corrected, and add a specified feature identifier to the initial pinyin sequence to obtain a target pinyin sequence; the specified feature identifier is feature information required to solve the problem existing in the text obtained by speech recognition; Inputting the target pinyin sequence into a pinyin-text prediction model for text prediction to obtain a candidate text set; the pinyin-text prediction model is trained based on training corpus with the specified feature identifier; From the candidate text set, a corrected text corresponding to the text to be corrected is selected.

Citation Information

Patent Citations

  • Voice recognition error correction method and man-machine conversation system

    CN110428822A

  • Speech recognition text error correction method and device, computer equipment and storage medium

    CN110765763A