IP Library Granted Patent US 12,456,317
Granted Patent B2
US 12,456,317 · App. 17/895,818 · Granted Oct 28, 2025

Systems and methods for detection and correction of OCR text

Inventors: Masaki Stanley Fujimoto (Provo, UT); Yen-Yun Yu (Murray, UT)
Assignee: Ancestry.com Operations Inc.
G06V30/133G06V30/19147G06V30/26
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,456,317
App. No.
17/895,818
Granted
Oct 28, 2025
Kind
B2
Abstract

OCR-text correction system and method embodiments are described. The OCR-text correction embodiments comprise or cooperate with a transformer-based sequence-to-sequence language model. The model is pretrained to denoise corrupted text and is fine-tuned using OCR-correction-specific examples. Text obtained at least in part through OCR is applied to the fine-tuned pretrained transformer model to detect at least one error in a subset of the text. Responsive to detecting the at least one error, the fine-tuned pretrained transformer model outputs an updated subset of the text to correct the at least one error.

Claims (37)

1 . A computer-implemented method, comprising:

receiving a document that includes text obtained at least in part through OCR;

applying an adjusted bidirectional-and-auto-regressive-transformers (BART) model to the text to detect at least one error in a subset of the text, the adjusted BART model having been adjusted from a BART model pretrained to perform a non-optical character recognition (non-OCR) task using a first training dataset comprising corrupted text data and the adjusted BART model further being adjusted from the BART model to perform an OCR task using a second training dataset comprising OCR samples; and

generating, by applying the adjusted BART model to the text of the document, an updated subset of the text correcting the at least one error in the subset of the text.

2 . The computer-implemented method of claim 1 , wherein the BART model comprises:

a bidirectional encoder configured to receive the text; and

an autoregressive decoder configured to detect the at least one error in the text and correct the at least one error in the text by predicting original text.

3 . The computer-implemented method of claim 1 , wherein the first training dataset includes one or more of the following: token masking, token deletion, sentence permutation, document rotation, or text infilling.

4 . The computer-implemented method of any of claim 1 , wherein the second training dataset includes monograph and periodical example sentences.

5 . The computer-implemented method of claim 1 , wherein the adjusted BART model is configured to perform detection and correction of the at least one error in a single step.

6 . The computer-implemented method of claim 1 , wherein the adjusted BART model is configured to correct the at least one error in the text without being trained on alignment of characters between inputs to an encoder and outputs to a decoder.

7 . The computer-implemented method of claim 1 , wherein the first training dataset comprises fewer than 1,000 documents.

8 . The computer-implemented method of claim 1 , wherein the adjusted BART model has been fine-tuned from a BART-base checkpoint comprising weights arrived at based on pretraining.

9 . The computer-implemented method of claim 1 , wherein the at least one error includes an undersegmentation error caused by incorrectly combining a plurality of words into a single word by OCR or an oversegmentation error caused by incorrectly segmenting a single word into two separate words by OCR.

10 . The computer-implemented method of claim 1 , wherein the adjusted BART model has been fine-tuned utilizing a hugging face package.

11 . The computer-implemented method of claim 1 , wherein the at least one error includes a missing character error caused by incorrectly omitting a character by OCR or a misrecognized character error caused by incorrectly recognizing a character by OCR.

12 . The computer-implemented method of claim 1 , wherein the at least one error includes a hallucination error caused by incorrectly inserting a non-existing character by OCR.

13 . A computer system for detecting and/or correcting text, comprising:

a processor; and

memory in communication with the processor, the memory configured to store instructions that, when executed by the processor, cause the processor to:

access an adjusted bidirectional-and-auto-regressive-transformers (BART) model, the adjusted BART model having been adjusted from a BART model pretrained to perform a non-optical character recognition (non-OCR) task using a first training dataset comprising corrupted text data and the adjusted BART model further being adjusted from the BART model to perform an OCR task using a second training dataset comprising OCR samples;

provide text obtained at least in part through optical character recognition (OCR);

apply the text to the adjusted BART model to detect at least one error in a subset of the text; and

generate an updated subset of the text by the adjusted BART model correcting the at least one error in the subset of the text.

14 . The computer system of claim 13 , wherein the BART model comprises:

a bidirectional encoder configured to receive the text; and

an autoregressive decoder configured to detect the at least one error in the text and correct the at least one error in the text by predicting original text.

15 . The computer system of claim 13 wherein the first training dataset includes one or more of the following: token masking, token deletion, sentence permutation, document rotation, or text infilling.

16 . The computer system of claim 13 , wherein the second training dataset includes monograph and periodical example sentences.

17 . The computer system of claim 13 , wherein the adjusted BART model is configured to perform detection and correction of the at least one error in a single step.

18 . The computer system of claim 13 , wherein the adjusted BART model is configured to correct the at least one error in the text without being trained on alignment of characters between inputs to an encoder and outputs to a decoder.

19 . The computer system of claim 13 , wherein the first training dataset comprises fewer than 1,000 documents.

20 . A non-transitory computer readable storage medium configured to store code comprising instructions, wherein the instructions, when executed by a processor, cause the processor to:

access an adjusted bidirectional-and-auto-regressive-transformers (BART) model, the adjusted BART model having been adjusted from a BART model pretrained to perform a non-optical character recognition (non-OCR) task using a first training dataset comprising corrupted text data and the adjusted BART model further being adjusted from the BART model to perform an OCR task using a second training dataset comprising OCR samples;

provide text obtained at least in part through optical character recognition (OCR);

apply the text to the adjusted BART model to detect at least one error in a subset of the text; and

generate an updated subset of the text by the adjusted BART model correcting the at least one error in the subset of the text.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 29, 2022
From: FUJIMOTO, MASAKI STANLEY; YU, YEN-YUN
To: ANCESTRY.COM OPERATIONS INC.
Reel/Frame 062236/0949 →
Continuity (2)
Provisional Application 63237839 · Aug 27, 2021
Related Publication 20230083000A1 · Mar 16, 2023
References Cited (5)
US 20220350998A1 · Desai · 2022 [cited by examiner]
US 20220405524A1 · Yuan · 2022 [cited by examiner]
US 20230064122A1 · Hu · 2023 [cited by examiner]
US 20230136527A1 · Zhang · 2023 [cited by examiner]
CN 113095067A · 2021 [cited by examiner]