Speech spelling correction method and device, computer device and storage medium

By segmenting, semantically encoding, and analyzing the context of the input text, and combining phoneme to determine candidate words for error correction, and using layer perceptron and dual affine network computation, efficient error correction for speech spelling errors in the banking and financial sector was finally achieved.

CN115481620BActive Publication Date: 2026-02-03MJOYS COM
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210926115.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-03
Publication Date
2026-02-03
Estimated Expiration
2042-08-03

AI Technical Summary

Technical Problem

Existing speech spelling correction methods cannot effectively identify and correct all spelling errors, and their error correction capabilities are insufficient.

Method used

By acquiring the input text, performing word segmentation and semantic information encoding, using a pre-trained language model for contextual structure analysis and spelling error detection, combining phonomorphism to determine candidate words for error correction, and using a layer perceptron network and a dual affine network to calculate the final spelling error correction sequence result.

Benefits of technology

It achieves complete identification and correction of all spelling errors, thus improving error correction capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115481620B_ABST
    Figure CN115481620B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a speech spelling correction method and device, computer equipment and a storage medium. The method comprises: obtaining input text content to obtain a text to be corrected; detecting an error position of the text to be corrected to obtain a detection result; determining a spelling correction candidate word according to the detection result; determining a spelling correction sequence result according to the spelling correction candidate word and the text to be corrected; and outputting the spelling correction sequence result. The method can completely identify and point out all spelling errors, and has good correction ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to artificial intelligence, and more specifically to speech spelling error correction methods, apparatus, computer equipment, and storage media. Background Technology

[0002] In the banking and finance sector, intelligent question-answering or intelligent digital human systems are being used in more and more scenarios. However, whether it is voice recognition input in noisy environments or manual pinyin typing input, there are spelling errors of one kind or another.

[0003] Existing error correction methods first generate Chinese characters from speech recognition, and then use a sequence-to-sequence model to predict and correct the text end-to-end. However, this method cannot completely identify and point out all spelling errors, resulting in poor error correction capabilities.

[0004] Therefore, it is necessary to design a new method that can completely identify and point out all spelling errors, with excellent error correction capabilities. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, apparatus, computer equipment and storage medium for correcting speech spelling errors.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a speech spelling error correction method, comprising:

[0007] Obtain the input text content to get the text to be corrected;

[0008] The error locations of the text to be corrected are detected to obtain the detection results;

[0009] Based on the sound morphology, candidate words for error correction are determined from the detection results;

[0010] The spelling correction sequence result is determined based on the candidate words for correction and the text to be corrected.

[0011] Output the spell correction sequence result.

[0012] The further technical solution is as follows: the detection of error locations in the text to be corrected, to obtain the detection results, includes:

[0013] The text to be corrected is segmented into words to obtain the segmentation results;

[0014] The word segmentation results are input into a language model for semantic information encoding to obtain the encoding results;

[0015] The encoding result is subjected to contextual structure analysis to obtain the positional serialization semantic result;

[0016] The location serialization semantic results are subjected to spelling error detection classification and identification to obtain the detection results.

[0017] The further technical solution is as follows: the spelling error detection and classification of the positional serialization semantic result to obtain the detection result includes:

[0018] The words before and after the positional serialization semantic result are used as the context for classification and recognition. If the number of words before and after the positional serialization semantic result is less than the set number, zero padding is used to form the positional serialization semantic result.

[0019] The location serialization semantic results are input into a layer perceptron network and classified using a sigmoid algorithm to determine whether the words corresponding to the location serialization semantic results are incorrect, thereby obtaining the detection results.

[0020] The further technical solution is as follows: determining the error correction candidate word based on the sound morphology of the detection result includes:

[0021] Convert the words corresponding to the detection results into pinyin;

[0022] Determine a candidate set of words for pinyin correction based on the pinyin;

[0023] Based on the word corresponding to the detection results, a candidate set of similar-looking characters is determined according to their character morphology;

[0024] The candidate set of pinyin correction words and the candidate set of similar-looking characters are integrated to obtain candidate words for correction.

[0025] The further technical solution is as follows: the step of determining a candidate set of similar-looking characters based on the word shape corresponding to the detection result includes:

[0026] The words corresponding to the detection results are identified using OCR recognition technology to determine similar-looking Chinese characters, thereby obtaining a candidate set of similar-looking characters.

[0027] The further technical solution is as follows: determining the spell correction sequence result based on the candidate words for correction and the text to be corrected includes:

[0028] For the original erroneous words at the corresponding positions of the detection results in the text to be corrected, determine the candidate words for correction that meet the requirements, and represent them in a vectorized form to obtain the quantization result;

[0029] The text to be corrected is semantically encoded, and the words in several positions before and after the position corresponding to the detection result in the text to be corrected are concatenated into a matrix to obtain a context vector;

[0030] The Biaffine network is used to calculate the alignment score of each error correction candidate word at the current position with the following text vector to obtain the local best error correction word.

[0031] Determine whether the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold.

[0032] If the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold, then for all words between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected, the local best correction words at each position are vector-superimposed, a new context matrix vector is calculated using BERT, and a biaffine network is further used to calculate the semantic alignment score of each subdivided candidate word. The correction candidate word corresponding to the highest score is selected to obtain the spelling correction sequence result.

[0033] The further technical solution is as follows: after determining whether the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold, the process includes:

[0034] If the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is not less than a threshold, then when the local best correction word is the word at the corresponding position of the detection result in the text to be corrected, the word at the corresponding position of the detection result is determined to be the original word.

[0035] The present invention also provides a speech spelling error correction device, comprising:

[0036] The text acquisition unit is used to acquire the input text content in order to obtain the text to be corrected;

[0037] An error detection unit is used to detect the error location in the text to be corrected in order to obtain the detection result;

[0038] A candidate word determination unit is used to determine error correction candidate words based on the phonological characteristics of the detection results;

[0039] The result determination unit is used to determine the spelling correction sequence result based on the error correction candidate words and the text to be corrected.

[0040] The output unit is used to output the spelling correction sequence result.

[0041] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described method.

[0042] The present invention also provides a storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0043] The beneficial effects of this invention compared with the prior art are: this invention detects the error location of the input text to be corrected, determines the candidate words for correction based on phonetic morphology, and determines the final spelling correction sequence result by combining a pre-trained language model, thereby achieving complete recognition and pointing out of all spelling errors, with excellent error correction capability.

[0044] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a schematic diagram illustrating an application scenario of the speech spelling error correction method provided in an embodiment of the present invention;

[0047] Figure 2 A schematic flowchart of the speech spelling error correction method provided in an embodiment of the present invention;

[0048] Figure 3 A schematic diagram of a sub-process of the speech spelling error correction method provided in an embodiment of the present invention;

[0049] Figure 4 A schematic diagram of a sub-process of the speech spelling error correction method provided in an embodiment of the present invention;

[0050] Figure 5 A schematic diagram of a sub-process of the speech spelling error correction method provided in an embodiment of the present invention;

[0051] Figure 6 A schematic diagram of a sub-process of the speech spelling error correction method provided in an embodiment of the present invention;

[0052] Figure 7 A schematic diagram of the error location detection process provided in an embodiment of the present invention;

[0053] Figure 8 A schematic block diagram of a speech spelling correction device provided in an embodiment of the present invention;

[0054] Figure 9 A schematic block diagram of the error detection unit of the speech spelling correction device provided in an embodiment of the present invention;

[0055] Figure 10 A schematic block diagram of the classification and recognition subunit of the speech spelling correction device provided in an embodiment of the present invention;

[0056] Figure 11 A schematic block diagram of the candidate word determination unit of the speech spelling correction device provided in an embodiment of the present invention;

[0057] Figure 12 A schematic block diagram of the result determination unit of the speech spelling correction device provided in the embodiments of the present invention;

[0058] Figure 13 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation

[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0060] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0061] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0062] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0063] Please see Figure 1 and Figure 2 , Figure 1 This is a schematic diagram illustrating an application scenario of the speech spelling error correction method provided in an embodiment of the present invention. Figure 2This is a schematic flowchart illustrating the speech spelling correction method provided in an embodiment of the present invention. The speech spelling correction method is applied in a server. The server interacts with the terminal, acquires text content, performs error detection on the text, determines candidate words for pinyin morphology correction, and outputs the final spelling correction sequence. This enables the server to completely identify and point out all spelling errors, demonstrating excellent error correction capabilities.

[0064] Figure 2 This is a flowchart illustrating the speech spelling error correction method provided in an embodiment of the present invention. For example... Figure 2 As shown, the method includes the following steps S110 to S150.

[0065] S110. Obtain the input text content to get the text to be corrected.

[0066] In this embodiment, the text to be corrected refers to the input spelled text in the financial field or text converted from speech.

[0067] S120. Detect the error location of the text to be corrected to obtain the detection result.

[0068] In this embodiment, the detection result refers to the location where a speech spelling error exists.

[0069] For an input text, error detection is first performed to determine if text correction is necessary. Text spelling error detection involves semantic analysis of the input text to determine if it conforms to language norms. A language model then models and analyzes the language text, encoding the semantics between words in a sentence. In this embodiment, based on a pre-trained language model, each word in the input text is analyzed to determine if it meets the requirements.

[0070] In one embodiment, please refer to Figure 3 The above-mentioned step S120 may include steps S121 to S124.

[0071] S121. Perform word segmentation on the text to be corrected to obtain the word segmentation result.

[0072] In this embodiment, the word segmentation result refers to the several words formed after segmenting the error-correcting text.

[0073] Specifically, the text to be corrected is segmented into word units. Long strings of English letters and numbers, and HTML tags, require filtering and conversion.

[0074] S122. Input the word segmentation results into the language model for semantic information encoding processing to obtain the encoding results.

[0075] In this embodiment, the encoding result refers to the result formed after semantic information encoding processing of the word segmentation result.

[0076] The word segmentation results are input into the language model, i.e., the pre-trained BERT model, and after multi-layer semantic encoding processing, the semantic encoding information of each position is obtained.

[0077] Specifically, for spelling correction in the banking and financial sector, it's necessary to train a pre-trained language model in the financial field. The first step is to collect and organize banking and financial textual materials, including: materials on financial services and products, such as credit cards, large-amount deposits and loans, and wealth management products. We need to organize the textual materials for each product, such as: basic product information, product term, profitability descriptions, risk descriptions, target customer groups, purchase process, maturity or early redemption details, etc., and convert these textual materials into text data. Generally, banking product data is stored in PDF documents or product pages on the homepage, and some are presented in tables or images. This information needs to be organized according to the basic product information items mentioned above. Tools such as pdfbox are used to extract and recognize the text information from the PDF documents, converting it into textual data.

[0078] In addition to the basic information about the financial products mentioned above, the most important aspect is the targeted data collection of relevant news and information about current financial products, primarily from financial industry websites and major departmental websites. This data is extracted using targeted XPath extraction templates, transforming data tables and other formats into storable structured data. For unstructured data such as public opinion news, extraction is mainly based on HTML webpage text extraction methods. Specifically, this typically employs XPath fixed template extraction technology and statistical recognition methods based on character tag features. For news articles, text data is extracted, primarily identifying information such as title, date, body text, author, and publication channel.

[0079] Data cleaning is performed on the collected domain text data. This is mainly because the collected text data contains many HTML tag characters. The main task at this stage is to filter out these meaningless characters. A common method is to use regular expressions to filter out enclosed strings. However, this method cannot cover all cases, such as HTML tags containing complex CSS styles. After some searching, a better approach was found: using the HTML formatting methods in BeautifulShop to filter out the `style` attribute as well. To ensure the quality of the training data, some rules can be used, such as directly filtering out text containing n consecutive non-Chinese characters; word segmentation of the data corpus. Training the language model requires word segmentation. This embodiment uses the open-source word segmentation tool Jieba for text segmentation. For words combining Chinese and English, each Chinese word after segmentation needs to be further segmented using WordPiece. Finally, the word list is masked, using different symbols to represent the non-first characters of a word.

[0080] Most open-source, general-purpose Chinese BERT models are currently trained using Google's TPUs. In this case, performance tuning is generally unnecessary; the batch size can be set to a very large value, and the LAMB optimizer can be used to accelerate training convergence. TPUs typically have at least 128GB of GPU memory and are specifically optimized for deep learning training.

[0081] After the above processing, a pre-trained language model for the banking and finance field is obtained. After word segmentation, a clause of a text can be input into the pre-trained model network to obtain the semantic information encoding of the text, which can then be better used for subsequent tasks such as text classification and sequence selection.

[0082] S123. Perform context structure analysis on the encoding result to obtain the positional serialization semantic result.

[0083] In this embodiment, the positional serialization semantic result refers to the result formed after the words at each position have a contextual semantic representation.

[0084] Specifically, based on semantic encoding, a BiLSTM structure is added to obtain a serialized semantic representation of the entire context structure, which enables the analysis to obtain a more contextualized semantic representation of each word position.

[0085] S124. Perform spelling error detection and classification on the position serialization semantic results to obtain the detection results.

[0086] In one embodiment, please refer to Figure 4, the above step S124 may include steps S1241 to S1242.

[0087] S1241. Classify and identify several words before and after the serialized semantic result of the position as the context. If the number of several words before and after the serialized semantic result of the position is less than the set number, fill it with zeros to form the serialized semantic result of the position.

[0088] S1242. Input the serialized semantic result of the position into a multi-layer perceptron network and apply Sigmoid for classification to determine whether the word corresponding to the serialized semantic result of the position is incorrect, so as to obtain the detection result.

[0089] As Figure 7 shown, for the spelling error detection and classification identification of the words at each position, the specific method is to first take the current position as the main classification processing object, and consider K words before and after the current position (usually 3 words before and after) as the context for classification identification. If the number of words before and after the current position is less than K, fill it with 0. Then send this information to a multi-layer perceptron network and apply Sigmoid for classification to determine whether the word at the current position is incorrect. If the word at a certain position in the current text to be corrected is detected and identified as having an error, spelling correction processing needs to be performed.

[0090] S130. Determine the error correction candidate words according to the phonetic form of the detection result.

[0091] In this embodiment, the error correction candidate words refer to the similar words determined according to the phonetic form similarity of the words at the corresponding positions of the detection result.

[0092] In one embodiment, please refer to Figure 5 , the above step S130 may include steps S131 to S134.

[0093] S131. Convert the word corresponding to the detection result into pinyin.

[0094] In this embodiment, the words with the spelling error detection and identification results are converted into pinyin. For example, for the spelling error word "Yin Hang" in the question "Excuse me, what is the loan interest of Yin Hang?", the pinyin is "yǐn háng". First, we remove the tones and convert it into pinyin "yinhang", and then expand the front nasal sound, back nasal sound and approximate pronunciation of the pinyin to "yinhang", "yinghang", "yinhuang", "yinhuan", etc.

[0095] S132. Determine the candidate set of pinyin error correction words according to the pinyin.

[0096] In this embodiment, the pinyin error correction vocabulary candidate set refers to words with similar pinyin.

[0097] Based on the professional terms in the banking and financial fields and some common high-frequency words, words such as "bank", "silver ring", "Milky Way", "pilot" etc. are retrieved through pinyin search, and thus the homophones of "yin" such as "silver, sound, hidden, because, lead" etc., and the homophones of "hang" such as "hang, hangzhou, line" etc. are determined, so as to determine a high-quality pinyin error correction vocabulary candidate set.

[0098] S133. Determine the candidate set of similar-shaped characters according to the words corresponding to the detection results in terms of character shape.

[0099] In this embodiment, the candidate set of similar-shaped characters refers to the words with similar character shapes corresponding to the detection results determined according to the similar-shaped character technology.

[0100] Specifically, the OCR recognition technology is used for the words corresponding to the detection results to determine Chinese characters with similar shapes, so as to obtain the candidate set of similar-shaped characters.

[0101] In addition to determining the candidate error correction words before and after according to the pronunciation of words and characters above, it is also necessary to determine the potential candidate words according to the character shape. The relevant OCR recognition technology is mainly used to obtain Chinese characters with similar shapes. Specifically, the standard font shapes of Chinese characters (such as regular script, imitation Song typeface, boldface, etc.) are first converted into 32*32 pictures, and then the CRNN algorithm is used for the text of these pictures for character shape encoding, and then the cosine similarity is calculated. The words that meet a certain similarity threshold are used as OCR shape error-prone characters, such as: "hang, ship", "difficult, silver, very, hate, fierce, follow", "disc, butterfly", "yi, yi, yin" etc. For the misspelled words "yin hang" in the above example sentence "Excuse me, what is the loan interest of your Yin Hang?", the candidate set of similar-shaped characters of this word and each character in the word can be obtained.

[0102] S134. Integrate the pinyin error correction vocabulary candidate set and the candidate set of similar-shaped characters to obtain the candidate error correction words.

[0103] After the above steps, the potential error correction words for the wrong parts of the words in the text to be corrected are determined. Finally, these words are used and combined with the original question sentence to determine the final spelling error correction result.

[0104] S140. Determine the spelling error correction sequence result according to the candidate error correction words and the text to be corrected.

[0105] In this embodiment, the spelling error correction sequence result refers to the best error correction word selected from the candidate error correction words.

[0106] Using these error correction candidate words and the text to be corrected, the best error correction sequence result is selected based on the pre-trained language model. This is somewhat similar to the sequence labeling algorithm CRF, which selects the best sequence prediction result from a potential candidate set.

[0107] In one embodiment, please refer to Figure 6 The above-mentioned step S140 may include steps S141 to S145.

[0108] S141. For the original erroneous words at the corresponding positions of the detection results in the text to be corrected, determine the candidate words for correction that meet the requirements, and perform vectorization representation to obtain the quantization result.

[0109] In this embodiment, the quantization result refers to the vectorized representation of the error correction candidate words that meet the requirements.

[0110] Specifically, for the original erroneous words and potential error correction candidate words at the current position of the detection results in the error correction text, the TOP-N (the coarse selection set N is generally selected as 100) is selected using the above pinyin similarity and character shape similarity, and these selected error correction candidate words are vectorized.

[0111] S142. Semantically encode the text to be corrected, and concatenate the words at several positions before and after the position corresponding to the detection result in the text to be corrected into a matrix to obtain a context vector.

[0112] In this embodiment, the context vector refers to the matrix formed by concatenating the words at several positions before and after the position corresponding to the detection result in the semantically encoded text to be corrected.

[0113] Specifically, the text to be corrected is semantically encoded using a domain-pretrained language model, similar to spelling error location detection. The BERT output vectors of the words at the current error location in the original question (e.g., K is 5) are concatenated into a matrix. If the length of the words before and after the error location is less than K, padding is performed to form the context vector at the current location.

[0114] S143. The Biaffine network is used to calculate the alignment score of each error correction candidate word at the current position with the following text vector to obtain the local best error correction word.

[0115] In this embodiment, the local best correction word refers to the candidate word for correction when the matching alignment score meets the requirements.

[0116] S144. Determine whether the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold.

[0117] S145. If the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold, then for all words between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected, the local best correction word at each position is vector-superimposed, a new context matrix vector is calculated using BERT, and the semantic alignment matching score of each subdivided candidate word is calculated using a biaffine network, and the correction candidate word corresponding to the highest score is selected to obtain the spelling correction sequence result.

[0118] S146. If the difference between the local error correction score of the best local error correction word and the word at the corresponding position of the detection result in the text to be corrected is not less than a threshold, then when the best local error correction word is the word at the corresponding position of the detection result in the text to be corrected, the word at the corresponding position of the detection result is determined to be the original word.

[0119] Specifically, if the best local correction word is a word in the text to be corrected, then the correction result at the current position is directly determined as the original word. If the difference between the local correction score of the best word and the original word at the current position is less than the threshold t (usually 0.1 points), then all words between the best local correction word and the original word, i.e., the refined selection set, are needed. Generally, there are only 2 / 3 of them, which is much smaller than the original coarse selection set N. Then, the words in the refined selection set at each position are vector-superimposed, and a new context matrix vector is calculated using BERT. Furthermore, a biaffine network is used to calculate the semantic alignment and matching score of each subdivided candidate word, and the highest score is selected as the spell correction sequence result.

[0120] S150. Output the spelling correction sequence result.

[0121] The aforementioned speech spelling correction method detects the error locations in the input text to be corrected, determines candidate words for correction based on phonetic morphology, and combines a pre-trained language model to determine the final spelling correction sequence. This enables the complete identification and pointing out of all spelling errors, demonstrating excellent error correction capabilities.

[0122] Figure 8 This is a schematic block diagram of a speech spelling correction device 300 provided in an embodiment of the present invention. Figure 8 As shown, corresponding to the above-described speech spelling correction method, the present invention also provides a speech spelling correction device 300. This speech spelling correction device 300 includes a unit for performing the above-described speech spelling correction method, and the device can be configured in a server. Specifically, please refer to... Figure 8The speech spelling error correction device 300 includes a text acquisition unit 301, an error detection unit 302, a candidate word determination unit 303, a result determination unit 304, and an output unit 305.

[0123] The text acquisition unit 301 is used to acquire the input text content to obtain the text to be corrected; the error detection unit 302 is used to detect the error position of the text to be corrected to obtain the detection result; the candidate word determination unit 303 is used to determine the candidate words for correction based on the phonological characteristics of the detection result; the result determination unit 304 is used to determine the spelling correction sequence result based on the candidate words for correction and the text to be corrected; and the output unit 305 is used to output the spelling correction sequence result.

[0124] In one embodiment, such as Figure 9 As shown, the error detection unit 302 includes a word segmentation subunit 3021, an encoding subunit 3022, an analysis subunit 3023, and a classification and recognition subunit 3024.

[0125] The word segmentation subunit 3021 is used to perform word segmentation processing on the text to be corrected to obtain word segmentation results; the encoding subunit 3022 is used to input the word segmentation results into a language model for semantic information encoding processing to obtain encoding results; the analysis subunit 3023 is used to perform context structure analysis on the encoding results to obtain positional serialization semantic results; and the classification and recognition subunit 3024 is used to perform spelling error detection classification and recognition on the positional serialization semantic results to obtain detection results.

[0126] In one embodiment, such as Figure 10 As shown, the classification and recognition subunit 3024 includes a processing module 30241 and a classification module 30242.

[0127] Processing module 30241 is used to classify and identify several words before and after the location serialization semantic result as context. If the number of words before and after the location serialization semantic result is less than a set number, zero padding is used to form the location serialization semantic result. Classification module 30242 is used to input the location serialization semantic result into a layer perceptron network and apply Sigmoid to classify it to determine whether the words corresponding to the location serialization semantic result are incorrect, so as to obtain the detection result.

[0128] In one embodiment, such as Figure 11 As shown, the candidate word determination unit 303 includes a transformation subunit 3031, a first determination subunit 3032, a second determination subunit 3033, and an integration subunit 3034.

[0129] The conversion subunit 3031 is used to convert the words corresponding to the detection results into pinyin; the first determining subunit 3032 is used to determine a candidate set of pinyin correction words based on the pinyin; the second determining subunit 3033 is used to determine a candidate set of similar-looking characters based on the character shape of the words corresponding to the detection results; and the integration subunit 3034 is used to integrate the candidate set of pinyin correction words and the candidate set of similar-looking characters to obtain correction candidate words.

[0130] In one embodiment, the second determining subunit 3033 is used to use OCR recognition technology to determine similar-looking Chinese characters for the words corresponding to the detection results, so as to obtain a candidate set of similar-looking characters.

[0131] In one embodiment, such as Figure 12 As shown, the result determination unit 304 includes a vectorization subunit 3041, a splicing subunit 3042, a first calculation subunit 3043, a judgment subunit 3044, a second calculation subunit 3045, and a word determination subunit 3046.

[0132] Vectorization subunit 3041 is used to determine the corrected candidate words that meet the requirements for the original erroneous words at the corresponding positions of the detection results in the text to be corrected, and to perform vectorization representation to obtain quantization results; concatenation subunit 3042 is used to perform semantic encoding on the text to be corrected, and to concatenate the words at several positions before and after the corresponding positions of the detection results in the text to be corrected into a matrix to obtain a context vector; first calculation subunit 3043 is used to calculate the alignment score of each corrected candidate word at the current position with the context vector using a biaffine network to obtain the locally optimal corrected word; judgment subunit 3044 is used to judge the locally optimal corrected word. The second calculation subunit 3045 is used to determine whether the difference between the local error correction score of the word at the corresponding position of the detection result in the text to be corrected and the local error correction score of the word at the corresponding position of the detection result in the text to be corrected is less than a threshold. If the difference between the local error correction score of the word at the local best correction position and the local error correction score of the word at the corresponding position of the detection result in the text to be corrected is less than a threshold, then for all words between the local best correction position and the word at the corresponding position of the detection result in the text to be corrected, the local best correction position at each position is vector-superimposed, a new context matrix vector is calculated using BERT, and a biaffine network is further used to calculate the semantic alignment score of each subdivided candidate word. The candidate word corresponding to the highest score is selected to obtain the spelling correction sequence result. The word determination subunit 3046 is used to determine the word at the corresponding position of the detection result in the text to be corrected as the original word if the difference between the local best correction score of the word at the local best correction position and the local error correction score of the word at the corresponding position of the detection result in the text to be corrected is not less than a threshold.

[0133] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned speech spelling correction device 300 and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0134] The aforementioned speech spelling correction device 300 can be implemented as a computer program, which can, for example, Figure 13 It runs on the computer device shown.

[0135] Please see Figure 13 , Figure 13 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 is a server, wherein the server can be a standalone server or a server cluster composed of multiple servers.

[0136] See Figure 13 The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0137] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a speech spelling error correction method.

[0138] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0139] The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a speech spelling error correction method.

[0140] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0141] The processor 502 is used to run a computer program 5032 stored in the memory to perform the following steps:

[0142] The system acquires the input text content to obtain the text to be corrected; it detects the error locations in the text to be corrected to obtain the detection results; it determines the candidate words for correction based on the phonological characteristics of the detection results; it determines the spelling correction sequence result based on the candidate words for correction and the text to be corrected; and it outputs the spelling correction sequence result.

[0143] In one embodiment, when the processor 502 performs the step of detecting the error location of the text to be corrected to obtain the detection result, it specifically implements the following steps:

[0144] The text to be corrected is segmented into words to obtain segmentation results; the segmentation results are input into a language model for semantic information encoding to obtain encoding results; the encoding results are analyzed for contextual structure to obtain positional serialization semantic results; and the positional serialization semantic results are classified and identified for spelling error detection to obtain detection results.

[0145] In one embodiment, when the processor 502 performs the step of spell error detection classification and recognition on the position serialization semantic result to obtain the detection result, it specifically implements the following steps:

[0146] The words before and after the location serialization semantic result are used as the context for classification and recognition. If the number of words before and after the location serialization semantic result is less than a set number, zero padding is used to form the location serialization semantic result. The location serialization semantic result is input into a layer perceptron network and classified using Sigmoid to determine whether the words corresponding to the location serialization semantic result are incorrect, so as to obtain the detection result.

[0147] In one embodiment, when the processor 502 implements the step of determining the error correction candidate word based on the phonological characteristics of the detection result, it specifically implements the following steps:

[0148] The words corresponding to the detection results are converted into pinyin; a candidate set of pinyin correction words is determined based on the pinyin; a candidate set of similar-looking characters is determined based on the character shape of the words corresponding to the detection results; the candidate set of pinyin correction words and the candidate set of similar-looking characters are integrated to obtain correction candidate words.

[0149] In one embodiment, when implementing the step of determining the candidate set of similar-looking characters based on the word shape corresponding to the detection result, the processor 502 specifically implements the following steps:

[0150] The words corresponding to the detection results are identified using OCR recognition technology to determine similar-looking Chinese characters, thereby obtaining a candidate set of similar-looking characters.

[0151] In one embodiment, when implementing the step of determining the spell correction sequence result based on the candidate words for correction and the text to be corrected, the processor 502 specifically implements the following steps:

[0152] For the original erroneous words at the corresponding positions of the detection results in the text to be corrected, select suitable candidate words for correction and represent them using vectorization to obtain quantization results; perform semantic encoding on the text to be corrected, and concatenate the words at several positions before and after the corresponding position of the detection results in the text to be corrected into a matrix to obtain a context vector; use a biaffine network to calculate the alignment score between each candidate word at the current position and the context vector to obtain the locally optimal correction word; determine the relationship between the locally optimal correction word and the corresponding position of the detection results in the text to be corrected. Whether the difference in the local error correction scores of the words is less than a threshold; if the difference in the local error correction scores of the best local error correction word and the word at the corresponding position of the detection result in the text to be corrected is less than the threshold, then for all words between the best local error correction word and the word at the corresponding position of the detection result in the text to be corrected, the best local error correction word at each position is vector-superimposed, a new context matrix vector is calculated using BERT, and a biaffine network is further used to calculate the semantic alignment matching score of each subdivided candidate word, and the error correction candidate word corresponding to the highest score is selected to obtain the spelling error correction sequence result.

[0153] In one embodiment, after performing the step of determining whether the difference between the local error correction score of the word at the corresponding position of the detection result in the text to be corrected is less than a threshold, the processor 502 further performs the following steps:

[0154] If the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is not less than a threshold, then when the local best correction word is the word at the corresponding position of the detection result in the text to be corrected, the word at the corresponding position of the detection result is determined to be the original word.

[0155] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0156] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0157] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein when executed by a processor, the computer program causes the processor to perform the following steps:

[0158] The system acquires the input text content to obtain the text to be corrected; it detects the error locations in the text to be corrected to obtain the detection results; it determines the candidate words for correction based on the phonological characteristics of the detection results; it determines the spelling correction sequence result based on the candidate words for correction and the text to be corrected; and it outputs the spelling correction sequence result.

[0159] In one embodiment, when the processor executes the computer program to detect the error location of the text to be corrected in order to obtain the detection result, it specifically implements the following steps:

[0160] The text to be corrected is segmented into words to obtain segmentation results; the segmentation results are input into a language model for semantic information encoding to obtain encoding results; the encoding results are analyzed for contextual structure to obtain positional serialization semantic results; and the positional serialization semantic results are classified and identified for spelling error detection to obtain detection results.

[0161] In one embodiment, when the processor executes the computer program to perform spelling error detection, classification, and recognition on the positional serialization semantic results to obtain detection results, it specifically implements the following steps:

[0162] The words before and after the location serialization semantic result are used as the context for classification and recognition. If the number of words before and after the location serialization semantic result is less than a set number, zero padding is used to form the location serialization semantic result. The location serialization semantic result is input into a layer perceptron network and classified using Sigmoid to determine whether the words corresponding to the location serialization semantic result are incorrect, so as to obtain the detection result.

[0163] In one embodiment, when the processor executes the computer program to implement the step of determining the error correction candidate word based on the phonological characteristics of the detection result, it specifically implements the following steps:

[0164] The words corresponding to the detection results are converted into pinyin; a candidate set of pinyin correction words is determined based on the pinyin; a candidate set of similar-looking characters is determined based on the character shape of the words corresponding to the detection results; the candidate set of pinyin correction words and the candidate set of similar-looking characters are integrated to obtain correction candidate words.

[0165] In one embodiment, when the processor executes the computer program to implement the step of determining a candidate set of similar-looking characters based on the character morphology of the words corresponding to the detection results, the processor specifically implements the following steps:

[0166] The words corresponding to the detection results are identified using OCR recognition technology to determine similar-looking Chinese characters, thereby obtaining a candidate set of similar-looking characters.

[0167] In one embodiment, when the processor executes the computer program to implement the step of determining the spell correction sequence result based on the candidate words for correction and the text to be corrected, it specifically implements the following steps:

[0168] In one embodiment, after the processor executes the computer program to determine whether the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold, the processor further implements the following steps:

[0169] For the original erroneous words at the corresponding positions of the detection results in the text to be corrected, select suitable candidate words for correction and represent them using vectorization to obtain quantization results; perform semantic encoding on the text to be corrected, and concatenate the words at several positions before and after the corresponding position of the detection results in the text to be corrected into a matrix to obtain a context vector; use a biaffine network to calculate the alignment score between each candidate word at the current position and the context vector to obtain the locally optimal correction word; determine the relationship between the locally optimal correction word and the corresponding position of the detection results in the text to be corrected. Whether the difference in the local error correction scores of the words is less than a threshold; if the difference in the local error correction scores of the best local error correction word and the word at the corresponding position of the detection result in the text to be corrected is less than the threshold, then for all words between the best local error correction word and the word at the corresponding position of the detection result in the text to be corrected, the best local error correction word at each position is vector-superimposed, a new context matrix vector is calculated using BERT, and a biaffine network is further used to calculate the semantic alignment matching score of each subdivided candidate word, and the error correction candidate word corresponding to the highest score is selected to obtain the spelling error correction sequence result.

[0170] If the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is not less than a threshold, then when the local best correction word is the word at the corresponding position of the detection result in the text to be corrected, the word at the corresponding position of the detection result is determined to be the original word.

[0171] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0172] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0173] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0174] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0175] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0176] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A speech spelling error correction method, characterized in that, include: Obtain the input text content to get the text to be corrected; The error locations of the text to be corrected are detected to obtain the detection results; Based on the sound morphology, candidate words for error correction are determined from the detection results; The spelling correction sequence result is determined based on the candidate words for correction and the text to be corrected. Output the spell correction sequence result; The step of determining the spell correction sequence result based on the candidate words for correction and the text to be corrected includes: For the original erroneous words at the corresponding positions of the detection results in the text to be corrected, determine the corrected candidate words that meet the requirements, and perform vectorization representation to obtain the quantization result; The text to be corrected is semantically encoded, and the words in several positions before and after the position corresponding to the detection result in the text to be corrected are concatenated into a matrix to obtain a context vector; The Biaffine network is used to calculate the alignment score of each error correction candidate word at the current position with the following text vector to obtain the local best error correction word. Determine whether the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold. If the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold, then for all words between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected, the local best correction words at each position are vector-superimposed, a new context matrix vector is calculated using BERT, and a biaffine network is further used to calculate the semantic alignment matching score of each subdivided candidate word. The correction candidate word corresponding to the highest score is selected to obtain the spelling correction sequence result. After determining whether the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is less than a threshold, the process includes: If the difference between the local best correction word and the word at the corresponding position of the detection result in the text to be corrected is not less than a threshold, then when the local best correction word is the word at the corresponding position of the detection result in the text to be corrected, the word at the corresponding position of the detection result is determined to be the original word.

2. The speech spelling error correction method according to claim 1, characterized in that, The step of detecting the error location in the text to be corrected, and obtaining the detection result, includes: The text to be corrected is segmented into words to obtain the segmentation results; The word segmentation results are input into a language model for semantic information encoding to obtain the encoding results; The encoding result is subjected to contextual structure analysis to obtain the positional serialization semantic result; The location serialization semantic results are subjected to spelling error detection classification and identification to obtain the detection results.

3. The speech spelling error correction method according to claim 2, characterized in that, The step of performing spelling error detection and classification on the positional serialization semantic results to obtain detection results includes: The words before and after the positional serialization semantic result are used as the context for classification and recognition. If the number of words before and after the positional serialization semantic result is less than the set number, zero padding is used to form the positional serialization semantic result. The location serialization semantic results are input into a multilayer perceptron network and classified using the Sigmoid algorithm to determine whether the words corresponding to the location serialization semantic results are incorrect, thereby obtaining the detection results.

4. The speech spelling error correction method according to claim 3, characterized in that, The process of determining error correction candidate words based on the detection results according to phonetic morphology includes: Convert the words corresponding to the detection results into pinyin; Determine a candidate set of words for pinyin correction based on the pinyin; Based on the word corresponding to the detection results, a candidate set of similar-looking characters is determined according to their character morphology; The candidate set of pinyin correction words and the candidate set of similar-looking characters are integrated to obtain candidate words for correction.

5. The speech spelling error correction method according to claim 4, characterized in that, The step of determining a candidate set of similar-looking characters based on the word form corresponding to the detection results includes: The words corresponding to the detection results are identified using OCR recognition technology to determine similar-looking Chinese characters, thereby obtaining a candidate set of similar-looking characters.

6. A speech spelling correction device, characterized in that, The device uses the speech spelling correction method as described in any one of claims 1 to 5, including: The text acquisition unit is used to acquire the input text content in order to obtain the text to be corrected; An error detection unit is used to detect the error location in the text to be corrected in order to obtain the detection result; A candidate word determination unit is used to determine error correction candidate words based on the phonological characteristics of the detection results; The result determination unit is used to determine the spelling correction sequence result based on the error correction candidate words and the text to be corrected. The output unit is used to output the spelling correction sequence result.

7. A computer device, characterized in that, The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Text error correction method and device, electronic equipment and storage medium

    CN112016304A

  • Sentence intelligent error correction method and device, computer equipment and storage medium

    CN112668313A

  • BERT and feedforward neural network-based text error correction method

    CN112836496A