Method and device for error correction model training and text error correction
Abstract
A computer-implemented method is performed at a device having one or more processors and memory storing programs executed by the one or more processors. The method comprises: selecting a target word in a target sentence; from the target sentence, acquiring a first sequence of words that precede the target word and a second sequence of words that succeed the target word; from a sentence database, searching and acquiring a group of words, each of which separates the first sequence of words from the second sequence of words in a sentence; creating a candidate sentence for each of the candidate words by replacing the target word in the target sentence with each of the candidate words; determining the fittest sentence among the candidate sentences according to a linguistic model; and suggesting the candidate word within the fittest sentence as a correction.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A computer-implemented method, comprising:
at a device having one or more processors and memory storing programs executed by the one or more processors:
selecting a target word in a target sentence by first predefined criteria;
from the target sentence, acquiring a first sequence of words that precede the target word and a second sequence of words that succeed the target word;
from a sentence database, searching and acquiring a group of words, each of which separates the first sequence of words from the second sequence of words in a sentence;
from the group of words, selecting candidate words whose similarity to the target word is above a pre-set threshold according to second predefined criteria;
creating a candidate sentence for each of the candidate words by replacing the target word in the target sentence with each of the candidate words;
determining the fittest sentence among the candidate sentences according to a linguistic model; and
suggesting the candidate word within the fittest sentence as a correction.
2 . The method of claim 1 , further comprising:
after suggesting the candidate word within the fittest sentence, replacing the target word in the target sentence with the suggested candidate word.
3 . The method of claim 1 , wherein the first predefined criteria include whether a character string is a word based at least on Chinese grammar.
4 . The method of claim 1 , wherein acquiring the first sequence of words comprises determining length of the first sequence of words based at least on meaning of the target word.
5 . The method of claim 1 , wherein acquiring the second sequence of words comprises determining length of the second sequence of words based at least on meaning of the target word.
6 . The method of claim 1 , wherein the length of the first sequence of words is pre-set.
7 . The method of claim 1 , wherein the linguistic model includes criteria for grammar.
8 . The method of claim 1 , wherein the linguistic model includes criteria for meaning of every candidate sentence.
9 . The method of claim 1 , wherein at least one candidate word whose similarity to the target word is determined based on the pronunciation of the candidate word.
10 . The method of claim 1 , wherein the sentence database is updated periodically by acquiring sentences from internet sources.
11 . A text-processing device, comprising:
one or more processors; memory; and one or more program modules stored in the memory and configured for execution by the one or more processors, the one or more program modules including instructions for:
selecting a target word in a target sentence by first predefined criteria;
from the target sentence, acquiring a first sequence of words that precede the target word and a second sequence of words that succeed the target word;
from a sentence database, searching and acquiring a group of words, each of which separates the first sequence of words from the second sequence of words in a sentence;
from the group of words, selecting candidate words whose similarity to the target word is above a pre-set threshold according to second predefined criteria;
creating a candidate sentence for each of the candidate words by replacing the target word in the target sentence with each of the candidate words;
determining the fittest sentence among the candidate sentences according to a linguistic model; and
suggesting the candidate word within the fittest sentence as a correction.
12 . The text-processing device of claim 11 , further comprising:
after suggesting the candidate word within the fittest sentence, replacing the target word in the target sentence with the suggested candidate word.
13 . The text-processing device of claim 11 , wherein the first predefined criteria include whether a character string is a word based at least on Chinese grammar.
14 . The text-processing device of claim 11 , wherein acquiring the first sequence of words comprises determining length of the first sequence of words based at least on meaning of the target word.
15 . The text-processing device of claim 11 , wherein the length of the first sequence of words is pre-set.
16 . The text-processing device of claim 11 , wherein the linguistic model includes criteria for grammar.
17 . The text-processing device of claim 11 , wherein the linguistic model includes criteria for meaning of every candidate sentence.
18 . The text-processing device of claim 11 , wherein at least one candidate word whose similarity to the target word is determined based on the pronunciation of the candidate word.
19 . The text-processing device of claim 11 , wherein the sentence database is updated periodically by acquiring sentences from internet sources.
20 . A non-transitory computer readable storage medium, storing one or more programs for execution by one or more processors of a computer system, the one or more programs including instructions for:
selecting a target word in a target sentence by first predefined criteria; from the target sentence, acquiring a first sequence of words that precede the target word and a second sequence of words that succeed the target word; from a sentence database, searching and acquiring a group of words, each of which separates the first sequence of words from the second sequence of words in a sentence; from the group of words, selecting candidate words whose similarity to the target word is above a pre-set threshold according to second predefined criteria; creating a candidate sentence for each of the candidate words by replacing the target word in the target sentence with each of the candidate words; determining the fittest sentence among the candidate sentences according to a linguistic model; and suggesting the candidate word within the fittest sentence as a correction.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.