IP Library › Granted Patent US 12,265,790
Granted Patent B2
US 12,265,790 · App. 18/053,034 · Granted Apr 1, 2025

Method for correcting text, method for generating text correction model, device

Inventors: Ruiqing Zhang (Beijing, CN); Zhongjun He (Beijing, CN); Hua Wu (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
G06F40/279G06F40/166
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,265,790
App. No.
18/053,034
Granted
Apr 1, 2025
Kind
B2
Abstract

Disclosed are a method for correcting a text, an electronic device and a storage medium. The method includes: acquiring a text to be corrected; acquiring a phonetic symbol sequence of the text to be corrected; and obtaining a corrected text by inputting the text to be corrected and the phonetic symbol sequence into a text correction model, in which, the text correction model obtains the corrected text by: detecting an error word in the text to be corrected, determining a phonetic symbol corresponding to the error word in the phonetic symbol sequence, and adding the phonetic feature corresponding to the phonetic symbol behind the error word to obtain a phonetic symbol text, and correcting the error word and the phonetic feature in the phonetic symbol text to obtain the corrected text.

Claims (47)

1. A method for correcting a text, comprising:

acquiring a text to be corrected;

acquiring a phonetic symbol sequence of the text to be corrected; and

obtaining a corrected text by inputting the text to be corrected and the phonetic symbol sequence into a text correction model, wherein, the text correction model obtains the corrected text by: detecting an error word in the text to be corrected, determining a phonetic symbol corresponding to the error word in the phonetic symbol sequence, and adding a phonetic feature corresponding to the phonetic symbol behind the error word to obtain a phonetic symbol text, and correcting the error word and the phonetic feature in the phonetic symbol text to obtain the corrected text;

wherein, the text correction model comprises an error detection submodel and an error correction submodel, each of the error detection submodel and the error correction submodel comprises one encoder and one decoder, and the two submodels share the one encoder; the error detection submodel performs encoding and a binary classification mapping on a vector representation of the input sample text to obtain a binary classification result; the error correction submodel performs encoding and one classification mapping on the vector representation of the input sample phonetic symbol text to obtain a corrected result;

wherein, the text correction model corrects the error word and the phonetic feature in the phonetic symbol text by the following to obtain the corrected text:

obtaining a candidate correction text by correcting the error word and the phonetic feature in the phonetic symbol text; and

obtaining the corrected text by performing de-duplication processing on the candidate correction text.

2. The method of claim 1 , wherein, the text correction model detects the error word in the text to be corrected by:

obtaining an error tagging sequence by performing error word detection on the text to be corrected; and

determining the error word in the text to be corrected based on the error tagging sequence.

3. A method for generating a text correction model, comprising:

acquiring a sample text, a sample phonetic symbol sequence of the sample text, and a target text of the sample text;

obtaining a corrected sample text by inputting the sample text and the sample phonetic symbol sequence into a text correction model to be trained, wherein, the text correction model to be trained obtains the corrected sample text by: detecting a sample error word in the sample text, determining a sample phonetic symbol corresponding to the sample error word in the sample phonetic symbol sequence, and adding a sample phonetic feature corresponding to the sample phonetic symbol behind the sample error word to obtain a sample phonetic symbol text, and correcting the sample error word and the sample phonetic feature in the sample phonetic symbol text to obtain the corrected sample text;

generating a first loss value based on the sample text, the corrected sample text, and the target text; and

obtaining a final text correction model by training the text correction model to be trained based on the first loss value;

wherein, the text correction model comprises an error detection submodel and an error correction submodel, each of the error detection submodel and the error correction submodel comprises one encoder and one decoder, and the two submodels share the one encoder; the error detection submodel performs encoding and a binary classification mapping on a vector representation of the input sample text to obtain a binary classification result; the error correction submodel performs encoding and one classification mapping on the vector representation of the input sample phonetic symbol text to obtain a corrected result;

wherein, the text correction model to be trained corrects the sample error word and the sample phonetic feature in the sample phonetic symbol text by the following to obtain the corrected sample text:

obtaining a sample candidate correction text by correcting the sample error word and the sample phonetic feature in the sample phonetic symbol text; and

obtaining the corrected sample text by performing de-duplication processing on the sample candidate correction text.

4. The method of claim 3 , wherein, the text correction model to be trained detects the sample error word in the sample text by:

obtaining a sample error tagging sequence by performing error word detection on the sample text; and

determining the sample error word in the sample text based on the sample error tagging sequence.

5. The method of claim 3 , further comprising:

acquiring a target phonetic symbol text of the sample text;

wherein generating the first loss value based on the sample text, the corrected sample text, and the target text, comprises:

generating a second loss value based on the sample text, the sample phonetic symbol text and the target phonetic symbol text;

generating a third loss value based on the target phonetic symbol text, the corrected sample text, and the target text; and

generating the first loss value based on the second loss value and the third loss value.

6. An electronic device, comprising:

at least one processor; and

a memory communicatively connected to the at least one processor;

wherein the memory is stored with instructions executable by the at least one processor, and when the instructions are performed by the at least one processor, the at least one processor is caused to perform the method of claim 3 .

7. An electronic device, comprising:

at least one processor; and

a memory communicatively connected to the at least one processor;

wherein the memory is stored with instructions executable by the at least one processor, and when the instructions are performed by the at least one processor, the at least one processor is caused to perform the following:

acquiring a text to be corrected;

acquiring a phonetic symbol sequence of the text to be corrected; and

obtaining a corrected text by inputting the text to be corrected and the phonetic symbol sequence into a text correction model, wherein, the text correction model obtains the corrected text by: detecting an error word in the text to be corrected, determining a phonetic symbol corresponding to the error word in the phonetic symbol sequence, and adding a phonetic feature corresponding to the phonetic symbol behind the error word to obtain a phonetic symbol text, and correcting the error word and the phonetic feature in the phonetic symbol text to obtain the corrected text;

wherein, the text correction model comprises an error detection submodel and an error correction submodel, each of the error detection submodel and the error correction submodel comprises one encoder and one decoder, and the two submodels share the one encoder; the error detection submodel performs encoding and a binary classification mapping on a vector representation of the input sample text to obtain a binary classification result; the error correction submodel performs encoding and one classification mapping on the vector representation of the input sample phonetic symbol text to obtain a corrected result;

wherein, the text correction model corrects the error word and the phonetic feature in the phonetic symbol text by the following to obtain the corrected text:

obtaining a candidate correction text by correcting the error word and the phonetic feature in the phonetic symbol text; and

obtaining the corrected text by performing de-duplication processing on the candidate correction text.

8. The electronic device of claim 7 , wherein, the text correction model detects the error word in the text to be corrected by:

obtaining an error tagging sequence by performing error word detection on the text to be corrected; and

determining the error word in the text to be corrected based on the error tagging sequence.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 11, 2022
From: ZHANG, RUIQING; HE, ZHONGJUN; WU, HUA
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 061740/0932 →
Priority Claims (1)
CN 202111350558.9 · Nov 15, 2021 · national
Continuity (1)
Related Publication 20230090625A1 · Mar 23, 2023
References Cited (20)
US 10586556B2 · Caskey · 2020 [cited by examiner]
US 11024287B2 · Yao · 2021 [cited by examiner]
US 11568761B2 · Kobashikawa · 2023 [cited by examiner]
US 11823659B2 · Reinspach · 2023 [cited by examiner]
US 11935523B2 · Diment · 2024 [cited by examiner]
US 20160179774A1 · McAteer · 2016 [cited by examiner]
US 20200184953A1 · Yao · 2020 [cited by applicant]
US 20210248309A1 · Zhang et al. · 2021 [cited by applicant]
CN 110765772A · 2020 [cited by applicant]
CN 111192586A · 2020 [cited by applicant]
CN 113095067A · 2021 [cited by examiner]
CN 113255331A · 2021 [cited by examiner]
CN 111192586B · 2023 [cited by examiner]
GB 2533370A · 2016 [cited by applicant]
KR 20090028219A · 2009 [cited by examiner]
Manar Alkhatib, Azza Abdel Monem, Khaled Shaalan, “Deep Learning for Arabic Error Detection and Correction”, : Aug. 2020, ACM Trans. Asian Low-Resour. Lang. Inf. Process., vol. 19, No. 5, Article 71. (Year: 2020). [cited by examiner]
Li Yang,Ying Li ,Jin Wang, Zhuo Tang, “Post Text Processing of Chinese Speech Recognition Based on Bidirectional LSTM Networks and CRF”, Electronics 2019,MDPI,Oct. 2019, (Year: 2019). [cited by examiner]
Zhang et al., “Correcting Chinese Spelling Errors with Phonetic Pre-training,” Findings of the Association for Computational Linguistics: ACL-IJCNLP, 2021. [cited by applicant]
JPO, Office Action for JP Application No. 2022-169806, Dec. 19, 2023. [cited by applicant]
EPO, Extended European Search Report for EP Application No. 22206102.0, Mar. 14, 2023. [cited by applicant]