CN107688400B - Input error correction method and device for input error correction - Google Patents
Input error correction method and device for input error correction Download PDFInfo
- Publication number
- CN107688400B CN107688400B CN201610641418.XA CN201610641418A CN107688400B CN 107688400 B CN107688400 B CN 107688400B CN 201610641418 A CN201610641418 A CN 201610641418A CN 107688400 B CN107688400 B CN 107688400B
- Authority
- CN
- China
- Prior art keywords
- string
- input
- historical
- input string
- error correction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/02—Input arrangements using manually operated switches, e.g. using keyboards or dials
- G06F3/023—Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
- G06F3/0233—Character input methods
- G06F3/0237—Character input methods using prediction or retrieval techniques
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The embodiment of the invention provides an input error correction method and device and a device for input error correction, wherein the method specifically comprises the following steps: acquiring an input string in an input process; matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed; and taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string. The embodiment of the invention can effectively correct the first error input of the user, can realize personalized and real-time error correction, and improves the accuracy of the error correction.
Description
Technical Field
The invention relates to the technical field of computer information input, in particular to an input error correction method and device and a device for input error correction.
Background
At present, devices involved in interaction generally require a user to recognize their own operation intention in interaction with the devices through an input method system. For example, a user can type an input string through a keyboard, and then the input string is converted into a candidate item of a corresponding language and displayed by the input method system according to a preset standard mapping rule, so that the candidate item selected by the user is displayed on a screen.
In practical applications, the user may press a wrong key (on the PC) or click a wrong screen position (on the smart terminal), which may cause a wrong input string to be typed. The input error correction is an input method system solution aiming at the errors, and can actively identify the input errors of the user and correct the input strings with the errors into correct input strings, so that the user can input correct characters on the premise of not modifying the input strings.
The existing input error correction scheme may specifically include: an edit distance based error correction scheme and a statistical based error correction scheme; wherein the edit distance based error correction scheme may perform the following error correction attempts for each position of the input string: inserting a character, deleting a character, replacing a character, etc., to generate an error correction candidate string corresponding to the input string; a statistical-based error correction scheme may generate an error correction model through big data mining that may be used to learn the probability of an error correction candidate string being incorrectly input as an input string.
However, different users often have different wrong input habits, for example, some users are used to press the left key by mistake, and some users are used to press the right key by mistake; the error correction scheme based on the edit distance and the error correction scheme based on the statistics provide the same error correction candidate strings for different users, and the error correction is not capable of realizing personalized error correction, so that the accuracy of error correction is easily influenced.
Disclosure of Invention
In view of the above problems, embodiments of the present invention provide an input error correction method, an input error correction apparatus, and an input error correction apparatus that overcome or at least partially solve the above problems.
In order to solve the above problems, the present invention discloses an input error correction method, comprising:
acquiring an input string in an input process;
matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed;
and taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
Optionally, the step of matching the input string with a historical input string in a mapping relationship between a historical input string and historical screen content established in advance includes:
determining a second editing distance between the current historical input string and the input string in the mapping relation between the historical input string and the historical screen content;
determining that the current historical input string matches the input string successfully when the second edit distance does not exceed a second edit distance threshold.
Optionally, the method further comprises:
taking the historical screen-loading content corresponding to the historical input string successfully matched with the input string as an error correction candidate corresponding to the error correction candidate string;
and sequencing a plurality of error correction candidates according to at least one of the frequency of the historical on-screen content, the on-screen time and the second editing distance.
Optionally, the step of sorting the plurality of error correction candidates according to at least one of the frequency of the historical on-screen content, the on-screen time, and the second edit distance includes:
calculating the score of each error correction candidate according to at least one of the frequency, the screen-on time and the second editing distance of the historical screen-on content;
and sorting the plurality of error correction candidates according to the scores of the error correction candidates.
Optionally, the step of calculating a score of each error correction candidate according to at least one of the frequency of the historical on-screen content, the on-screen time, and the second edit distance includes:
determining a first ratio of the frequency of the historical screen contents corresponding to the error correction candidate to the maximum frequency of all the frequency of the historical screen contents;
determining a second ratio of the screen-on time of the historical screen-on content corresponding to the error correction candidate to the maximum screen-on time of all the historical screen-on contents;
and calculating the score of each error correction candidate according to at least one of the first ratio, the second ratio and the second editing distance.
Optionally, the score is proportional to the first ratio and the second ratio, and the score is inversely proportional to the second edit distance.
Optionally, the mapping relationship between the history input string and the history on-screen content is established by the following steps:
when the input process does not contain error correction operation and the on-screen content of the input process is not changed, determining that the input process is the correct input process;
and aiming at the correct input process, establishing a mapping relation between the historical input string and the historical screen content according to the corresponding input string and the screen content.
Optionally, before the step of matching the input string with a historical input string in a mapping relationship between a pre-established historical input string and historical screen content, the method further includes:
searching in a mapping relation between a pre-established error string and a correct string according to the input string to obtain a corresponding correct string; after the input process related to the error correction operation is completed, establishing and obtaining the mapping relation between the error string and the correct string according to the error correction operation, and taking the correct string obtained by searching as an error correction candidate string corresponding to the input string;
and when the correct string corresponding to the input string is not found, matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance, and taking the historical input string which is successfully matched with the input string as an error correction candidate string corresponding to the input string.
In another aspect, the present invention discloses an input error correction apparatus, comprising:
the input string acquisition module is used for acquiring an input string in an input process;
the matching module is used for matching the input string with a historical input string in a mapping relation between a pre-established historical input string and historical screen content; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed; and
and the error correction module is used for taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
Optionally, the apparatus further comprises:
the searching module is used for searching in the mapping relation between the pre-established error string and the correct string according to the input string before the matching module matches the input string with the historical input string in the mapping relation between the pre-established historical input string and the historical screen content so as to obtain the corresponding correct string; after the input process related to the error correction operation is completed, establishing and obtaining the mapping relation between the error string and the correct string according to the error correction operation, and taking the correct string obtained by searching as an error correction candidate string corresponding to the input string;
the matching module is specifically configured to, when the correct string corresponding to the input string is not found, match the input string with a historical input string in a mapping relationship between a historical input string and historical on-screen content that is established in advance, and use the historical input string that is successfully matched with the input string as the error correction candidate string corresponding to the input string.
In yet another aspect, an apparatus for input error correction is disclosed that includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured for execution by the one or more processors to include instructions for:
acquiring an input string in an input process;
matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed;
and taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
Optionally, the processor is further configured to execute the one or more programs including instructions for:
before matching the input string with a historical input string in a mapping relation between a pre-established historical input string and historical screen content, searching in a mapping relation between a pre-established error string and a correct string according to the input string to obtain a corresponding correct string; after the input process related to the error correction operation is completed, establishing and obtaining the mapping relation between the error string and the correct string according to the error correction operation, and taking the correct string obtained by searching as an error correction candidate string corresponding to the input string;
and when the correct string corresponding to the input string is not found, matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance, and taking the historical input string which is successfully matched with the input string as an error correction candidate string corresponding to the input string.
The embodiment of the invention has the following advantages:
the embodiment of the invention can match the input string in the input process with the historical input string in the mapping relation between the historical input string and the historical screen content which is established in advance; because the mapping relation between the historical input string and the historical screen content is obtained by establishing after the correct input process is completed, the historical input string in the second mapping relation can be used as the correct input string used by the user, has higher reference value and can effectively correct the first wrong input of the user; therefore, the matching process can take the historical input string in the mapping relation between the historical input string and the historical on-screen content as the target of an error correction result (such as an error correction candidate string), and can realize efficient and accurate error correction according with the personalized input habit of the user.
Moreover, the mapping relation is obtained according to the input behavior of the user, so that the personalized input habit of the user can be reflected, personalized error correction can be realized, and the error correction accuracy is improved.
Drawings
FIG. 1 is a flowchart illustrating steps of a first embodiment of an input error correction method according to the present invention;
FIG. 2 is a flowchart illustrating steps of a second embodiment of an input error correction method according to the present invention;
FIG. 3 is a block diagram of an embodiment of an input error correction apparatus according to the present invention;
FIG. 4 is a block diagram of an apparatus 900 for input error correction of the present invention; and
fig. 5 is a schematic diagram of a server according to the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Method embodiment one
Referring to fig. 1, a flowchart illustrating steps of a first embodiment of an input error correction method according to the present invention is shown, which may specifically include the following steps:
102, matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance; the mapping relation between the historical input string and the historical on-screen content can be established after the correct input process is completed;
and 103, taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
The embodiment of the invention can be applied to input method systems with various input modes, for example, the input modes can specifically include input modes such as keyboard symbols, handwritten information and the like, that is, a user can input on-screen contents through coded character strings, handwritten input information and the like. In the following, only the input method of the code string (hereinafter, simply referred to as an input string) will be described as an example, and other input methods may be referred to each other.
The input error correction method provided by the embodiment of the invention can be applied to application environments corresponding to the client and the server of the input method system, wherein the client and the server of the input method system can be positioned in a wired or wireless network, and the client and the server perform data interaction through the wired or wireless network.
Specifically, a client of the input method system may run on the intelligent terminal, and the client may capture an input string of the user in the input process. The intelligent terminal may specifically include, but is not limited to: smart phones, tablet computers, electronic book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop portable computers, car-mounted computers, desktop computers, set-top boxes, smart televisions, wearable devices, and the like.
In the field of input method systems, no matter the input method systems are in Chinese, Japanese, Korean or other languages, coded character strings input by users are converted into candidate items of corresponding languages, and then the users select contents output to application programs, wherein the contents output to the application programs, namely, on-screen contents, are output through on-screen operation. In an alternative embodiment of the present invention, an input process may begin with the receipt of an input string and end with the screen of the candidate item corresponding to the input string. Taking the input process of the input string "nihao" and the on-screen content "hello" as an example, the input process starts when the character "n" is received, and the input process ends after the on-screen operation of the candidate item "hello" corresponding to the input string "nihao" is received.
The input error correction process of the embodiment of the invention can comprise the following steps: matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance; because the mapping relation (hereinafter referred to as a first mapping relation) between the historical input string and the historical screen content is established after the correct input process is completed, the historical input string in the first mapping relation can be used as the correct input string used by the user, so that the historical input string has a higher reference value, and the first wrong input of the user can be effectively corrected; therefore, the step 102 targets the historical input string in the first mapping relationship as an error correction result (e.g., an error correction candidate string), so that efficient and accurate error correction according to the personalized input habit of the user can be realized.
In practical applications, the higher the frequency of the history input string in the first mapping relationship is and the longer the history time is (that is, the used history is the latest), the higher the frequency of the history input string in the first mapping relationship is, the more the history input string can reflect the personalized input habit of the user, and therefore, the history input string can be used as the target of the error correction result.
In an alternative embodiment of the present invention, the mapping relationship between the history input string and the history on-screen content may be established by:
step A1, when the input process does not include error correction operation and the on-screen content of the input process is not changed, determining that the input process is the correct input process;
and step A2, aiming at the correct input process, establishing a mapping relation between the historical input string and the historical screen content according to the corresponding input string and the screen content.
In the embodiment of the present invention, a correct input process may be used to ensure that the history input string in the first mapping relationship may be used as a correct input string used by the user.
Step a1 may be used to determine whether an input procedure is the correct input procedure. The input string in the input process of a certain time does not contain error correction operation, that is, the input string entered by the user at first is the correct input string, means that the input string in the input process of the certain time is not corrected by the user or the input method system. The fact that the content on the screen of the input process is not changed means that the user does not change all or part of the content on the screen of the input process, and the content on the screen of the input process can be used for indicating that the user is satisfied with the input string and the content on the screen of the input process, so that the accuracy of the input string of the input process can be further ensured.
For each correct input process, the embodiment of the present invention may add the input string and the corresponding on-screen content to the first mapping relationship. For example, if the user inputs "nihao", screens "hello", and does not change "hello", then "nihao" and "hello" may be added to the first mapping relationship.
In an optional embodiment of the present invention, the first mapping relationship may be stored in a user input string lexicon, and since the granularity of the first mapping relationship stored in the user input string lexicon is a correct input string that meets the input habit of the user, in the input process of the embodiment of the present invention, the historical input string may be used as a target of an error correction result corresponding to an incorrect input string through the matching process of step 102, so that the efficiency and accuracy of input error correction can be improved.
It should be noted that although the traditional user thesaurus stores the on-screen content of the user, the field corresponding to the on-screen content is a matching sequence similar to the syllable sequence [ ni ] [ hao ] and the glyph sequence, but the syllable sequence [ ni ] [ hao ] may correspond to a plurality of input strings, such as "nh", "nih", "nhao", and the like, due to factors such as spelling and the like, and therefore, the traditional user thesaurus cannot store the input strings input by the user. Moreover, the traditional user thesaurus does not relate to the judgment of whether the input process is correct, and even if the input process comprises an error correction operation or the on-screen content of the input process is changed, the on-screen content can be recorded, so that the correctness of the on-screen content cannot be ensured by the traditional user thesaurus. In summary, since the conventional user lexicon does not have the key features of the user input string lexicon according to the embodiment of the present invention (e.g., correct input strings that conform to the input habits of the user), the conventional user lexicon cannot be used for input error correction.
In an optional embodiment of the present invention, the word library of user input strings may further store a frequency and a screen-up time of the first mapping relationship, in addition to the first mapping relationship. The frequency may represent the occurrence frequency of the first mapping relationship, for example, in the input process of the user, if the occurrence frequency of the user inputting "nihao", the user having displayed "hello" and not having changed "hello" is 2, the frequency of the first mapping relationship is 2. The screen-up time of the first mapping relation may be used to indicate the occurrence time or the saved time of the first mapping relation, where each time a user inputs "nihao", has "hello" on the screen, and has not changed "hello", the corresponding first mapping relation may have the corresponding screen-up time; optionally, for convenience of operation, only the screen-up time corresponding to the first mapping relationship that occurs last time may be recorded, that is, only the maximum screen-up time may be recorded.
In an optional embodiment of the present invention, in consideration of the capacity limit of the storage space occupied by the user input string lexicon, the data records in the user input string lexicon may be updated according to the frequency and the screen-up time. For example, when the maximum capacity of a user input string lexicon is 1w data records, if the number of the data records exceeds 1w, the data records can be thinned according to the frequency and the screen time, wherein the data records with low frequency and small screen time can be preferentially eliminated, so that the historical input strings in the user input string lexicon better conform to the current input habits of the user, and it can be understood that the specific slimming process is not limited by the embodiment of the invention.
It should be understood that the process of establishing the first mapping relationship in step a1 and step a2 is only an alternative embodiment, and actually, a person skilled in the art may adopt a required process of establishing the first mapping relationship according to the actual application requirement, and the embodiment of the present invention does not limit the specific process of establishing the first mapping relationship.
In an optional embodiment of the present invention, the step 102 of matching the input string with a history input string in a mapping relationship between a history input string and history on-screen content, which is established in advance, may specifically include:
step B1, determining a second editing distance between the current historical input string and the input string in the mapping relation between the historical input string and the historical screen content;
and step B2, when the second edit distance does not exceed a second edit distance threshold, determining that the current historical input string is successfully matched with the input string.
In the process of using the history input string in the first mapping relationship as the target of the error correction result, the embodiment of the invention may calculate a second edit distance between the current history input string and the input string, and when the second edit distance does not exceed a second edit distance threshold, it may be considered that the correct input string that the user wants to input may be the current history input string, but the input string that is incorrectly entered due to pressing an incorrect key (on a PC) or clicking a wrong screen position (on an intelligent terminal), and the like, so the current history input string may be used as the target of the error correction result corresponding to the input string.
In practical applications, those skilled in the art may use an appropriate second edit distance threshold according to practical application requirements. Alternatively, the greater the second edit distance threshold value is, the lower the accuracy of error correction based on the above-described first mapping relationship is, and therefore, the second edit distance may be set to a smaller value. For example, the second edit distance may be a numerical value of 1, 2, 3, etc., and of course, the specific numerical value of the second edit distance threshold is not limited in the embodiment of the present invention.
In practical applications, the history input string in the mapping relationship between the history input string and the on-screen content may be traversed to obtain the current history input string, wherein, regardless of whether the matching of step B1 is successful, the next history input string may be used as the current history input string, and the matching process of step B1 and step B2 is continuously performed, that is, the matching process of step B1 and step B2 may be a circularly performed process.
In an optional embodiment of the present invention, a corresponding candidate may be further obtained according to a historical input string successfully matched with the input string, and accordingly, the method may further include: taking the historical screen-loading content corresponding to the historical input string successfully matched with the input string as an error correction candidate corresponding to the error correction candidate string; and sequencing a plurality of error correction candidates according to at least one of the frequency of the historical on-screen content, the on-screen time and the second editing distance. In the optional embodiment, the history on-screen content corresponding to the history input string in the first mapping relationship is used as the corresponding error correction candidate, and compared with the case that the error correction candidate corresponding to the error correction candidate string is queried from a word bank (e.g., a system word bank), the history on-screen content is a word used by the user, so that the input habit of the user can be better adapted, that is, the quality of the error correction candidate can be improved. In addition, in this alternative embodiment, the plurality of error correction candidates are sorted according to at least one of the frequency of the historical screen-up content, the screen-up time, and the second edit distance, so that a better error correction candidate that better fits the input habit of the user can be arranged in front.
In another optional embodiment of the present invention, the step of sorting the plurality of error correction candidates according to at least one of the frequency of the historical on-screen content, the on-screen time, and the second edit distance may specifically include
Step C1, calculating the score of each error correction candidate according to at least one of the frequency, the screen-on time and the second editing distance of the historical screen-on content; the higher the frequency of the historical screen-up content, the longer the screen-up time, or the smaller the second editing distance, the higher the degree of engagement between the historical screen-up content and the input habits of the user, and thus the score of the corresponding error correction candidate may be higher.
Step C2, the plurality of error correction candidates are sorted according to the score of each error correction candidate.
In a further optional embodiment of the present invention, the step C1 of calculating a score of each error correction candidate according to at least one of the frequency of the historical on-screen content, the on-screen time, and the second edit distance may specifically include:
step C11, determining a first ratio of the frequency of the historical screen contents corresponding to the error correction candidates to the maximum frequency of the frequency of all the historical screen contents;
step C12, determining a second ratio of the screen-on time of the historical screen-on content corresponding to the error correction candidate to the maximum screen-on time of all the historical screen-on contents;
and step C13, calculating a score of each error correction candidate according to at least one of the first ratio, the second ratio and the second edit distance.
Assuming that the first mapping relationship is stored using the user input string lexicon, the maximum frequency may be used to represent the maximum frequency of all historical on-screen content in the user input string lexicon. In practical applications, when the user input string lexicon is empty, the maximum frequency fmax may be set to a preset value (e.g., 0), and after the frequency f of each historical screen content in the user input string lexicon is updated, the frequency f of the historical screen content may be compared with fmax, and if f > fmax, the value of f may be assigned to fmax. Or, when the user input string lexicon is non-empty, the frequency f of each historical screen content may be sorted to obtain the maximum frequency fmax therein, and then, after the frequency f of each historical screen content in the user input string lexicon is updated, the frequency f of the historical screen content may be compared with fmax, and if f > fmax, the value of f may be assigned to fmax.
The maximum screen-on time tmax can be used for representing the maximum screen-on time, namely the latest screen-on time, of all historical screen-on contents in the user input string lexicon, the obtaining mode of tmax is similar to that of fmax, and the value of t can be assigned to tmax if t > tmax after the screen-on time t of a certain historical screen-on content is updated every time.
The first ratio and the second ratio can be respectively used for representing the normalized frequency and the normalized screen-on time of the historical screen-on content of the corresponding target of the error correction candidate in all historical screen-on contents, so that conditions can be provided for the fusion of the frequency and the screen-on time. It will be appreciated that it is also possible to not calculate the first ratio and the second ratio corresponding to the two features without fusing the two features.
In an alternative embodiment of the present invention, the score may be proportional to the first ratio and the second ratio, and the score may be inversely proportional to the second edit distance.
An example of calculating a score according to three features of frequency f, screen time t and edit distance d is provided here: score log (w1 f/fmax + w2 t/tmax)/d), where w1 and w2 represent the weights of the first ratio and the second ratio, respectively, and those skilled in the art can determine the values of w1 and w2 according to the importance of the two ratios, for example, when the importance of the two ratios is equivalent, w1 is 0.5, w2 is 0.5, etc., it is understood that the specific weights of the first ratio and the second ratio are not limited in the embodiments of the present invention.
In summary, the embodiment of the present invention may match the input string with a historical input string in a mapping relationship between a historical input string and historical screen content that is established in advance; because the mapping relation between the historical input string and the historical screen content is obtained by establishing after the correct input process is completed, the historical input string in the first mapping relation can be used as the correct input string used by the user, so that the method has a higher reference value and can effectively correct the first wrong input of the user; therefore, the matching process can take the historical input string in the mapping relation between the historical input string and the historical on-screen content as the target of an error correction result (such as an error correction candidate string), and can realize efficient and accurate error correction according with the personalized input habit of the user.
Moreover, the first mapping relation is obtained according to the input behavior of the user, so that the personalized input habit of the user can be reflected, personalized error correction can be realized, and the error correction accuracy is improved.
In an application example 1 of the present invention, assuming that in a single input process, a user inputs "nihao" and screens "hello", the embodiment of the present invention may store "nihao" and "hello" in the first mapping relationship, and the stored information may further include the frequency of the historical screen-on content and the screen-on time. Next, the user inputs "nihoa", if the first mapping relation is not hit, the first mapping relation may be queried, a history input string with a second edit distance less than or equal to 3 is found, then the history on-screen content corresponding to each history input string is scored by using a scoring formula, the best is selected, for example, the edit distance between "nihao" and "nihoa" is 1, the condition is met, and the score calculated by the scoring formula for the word "hello" is the highest, so the corresponding best error correction candidate is "hello". As is apparent from this example, when the user enters an incorrect input string for the first time, even if the correct string corresponding to the incorrect input string is not stored in the first mapping relationship, the embodiment of the present invention can still successfully correct the error according to the first mapping relationship and provide an error correction candidate meeting the user's intention, and thus, personalized error correction is better achieved.
Method embodiment two
Referring to fig. 2, a flowchart illustrating steps of a second embodiment of an input error correction method according to the present invention is shown, which may specifically include the following steps:
and step 204, taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
Compared with the first method embodiment, the implementation can search in the mapping relation between the pre-established error string and the correct string according to the input string before matching the input string with the historical input string in the mapping relation between the pre-established historical input string and the historical screen content to obtain the corresponding correct string, and take the searched correct string as the error correction candidate string corresponding to the input string; because the mapping relationship (for convenience of description, hereinafter referred to as a second mapping relationship) between the error string and the correct string is established according to the error correction operation after the input process related to the error correction operation is completed, that is, the second mapping relationship is obtained according to the input behavior of the user, the personalized error input habit of the user can be reflected, the personalized error correction can be realized, and the error correction accuracy can be improved. For example, the user a is accustomed to mistakenly press the right key, the input intention of the user a is originally "zhonghua", but the character "u" is mistakenly input as the character "i" corresponding to the right key due to the mistaken input habit, so that the error string "zhonghua" is obtained, and the embodiment of the present invention may establish the corresponding first mapping relationship ("zhonghua" - > "zhonghua") according to the input process of the user, so that after the user inputs the error string "zhonghua" next time, the embodiment of the present invention may accurately obtain the corresponding correct string "zhou" according to the second mapping relationship, which may improve the accuracy of error correction compared to the existing error correction scheme based on the edit distance and the error correction scheme based on statistics.
In addition, the embodiment of the invention can establish the second mapping relation after completing the input process related to the error correction operation, thereby realizing real-time error correction. Specifically, even if the user re-enters the same input string as the previous input process in the next adjacent input process after completing the previous input process related to the error correction operation, the embodiment of the present invention can successfully correct the error of the input string of the next input process.
In practical applications, the capacity limitation corresponding to the mapping relationship between the error string and the correct string may cause the error string previously input by the user to be deleted in the mapping relationship between the error string and the correct string, or, when the user inputs an error input string for the first time, the mapping relationship between the error string and the correct string may not be hit by the error input string, and in both cases, the correct string corresponding to the input string may not be found in step 202.
According to the embodiment of the invention, when the correct string corresponding to the input string is not found, the input string is matched with the historical input string in the mapping relation between the historical input string and the historical screen content which is established in advance, so that the error correction of the input string can be effectively carried out by using the first mapping relation and the second mapping relation, and the error correction efficiency and the error correction accuracy rate are effectively improved.
In the embodiment of the present invention, as for the input process related to the error correction operation, the corresponding error correction operation may be executed by the user, or may be executed by the input method system, and the input process may involve one input process when the on-screen content is not deleted, or may involve two input processes when the on-screen content is deleted.
For different situations of the error correction operation, the embodiment of the present invention may provide the following technical solutions for establishing the mapping relationship between the error string and the correct string:
the technical scheme 1,
The input process in technical scheme 1 may relate to a one-time input process when the content on the screen is not deleted, and accordingly, the process of establishing the mapping relationship between the error string and the correct string may specifically include: in the input process, if the input string is corrected by a user or an input method system, after subsequent corresponding screen-on operation is received, a mapping relation between an error string and a correct string is established according to the input string before and after correction.
An application example 2 of a user correcting an input string is provided herein. In this application example 2, if an error occurs in the input string, which results in no result that meets the intention in the candidate, the user may perform the following correction operation: deleting a plurality of characters in the input string, or possibly moving a cursor to a certain position of the input string and then deleting or adding a plurality of characters, and the user can screen candidates meeting the intention after performing correction operation; in this case, the input string before correction may be an error string of the second mapping relationship, and the input string after correction may be a correct string of the second mapping relationship. For example, in a certain input process, the user first inputs "nihoa", then deletes "oa", then inputs "ao", and finally screens "hello", then after completing the input process, the mapping of "nihoa" and "nihao" may be added to the second mapping relationship described above.
An application example 3 of the input method system to correct an input string is provided herein. In this application example 3, when an error occurs in an input string, if the input method system successfully corrects the input string and returns a candidate item meeting the intention, the user may screen the candidate item meeting the intention; in this case, an erroneous input string and an input string corrected by the input method system may be added to the second mapping relationship. For example, in a certain input process, the input string entered by the user is "nihaa", the input method system successfully corrects the input string into "nihao", provides a candidate of "hello", and finally screens "hello", and after the input process is completed, the mappings of "nihaa" and "nihao" may be added to the second mapping relationship.
Technical solution 2
The input process in technical scheme 2 may involve two input processes when the content on the screen is deleted, and accordingly, the process of establishing the mapping relationship between the error string and the correct string may specifically include: if the screen-loading content of the previous input process is deleted and the first editing distance between the second input string of the next input process and the first input string of the previous input process does not exceed the first editing distance threshold, after screen-loading operation of the next input process is received, establishing a mapping relation between an error string and a correct string according to the first input string and the second input string.
In an application example 4 of the present invention, it is assumed that an error occurs in an input string during a previous input process, resulting in no result that meets the intention in candidates, but a user mistakenly screens a certain candidate that does not meet the intention, and then deletes the mistaken screen content, and continues to screen the candidate that meets the intention through a subsequent input process. In this case, whether the intention to delete the on-screen content is the re-input intention may be determined according to a first edit distance between a second input string of a subsequent input process and a first input string of a previous input process, and specifically, if the first edit distance is smaller than a first edit distance threshold, it may be considered that the user intends to correct the first input string of the previous input process by the second input string of the subsequent input process, and thus, it may be considered that the intention to delete the on-screen content is the re-input intention. For example, in the previous input process, the user inputs "nihoa" and screens "you red o", then deletes "you red o", and inputs "nihao" and screens "you good" in the next input process, then the intention of deleting the content on the screen may be considered as the re-input intention, so the mappings of "nihoa" and "nihao" may be added to the second mapping relationship. It can be seen that the technical solutions corresponding to the application example 2, the application example 3, and the application example 4 can all obtain the second mapping relationship between "nihoa" and "nihao".
In an embodiment of the present invention, the edit distance may be used to indicate the minimum number of edit operations required to change from one to another between two encoded strings. The editing operation may specifically include operations of replacing one character with another, inserting one character, deleting one character, and the like.
In practical applications, a person skilled in the art may use an appropriate first edit distance threshold according to practical application requirements. Alternatively, the greater the first edit distance threshold value is, the lower the accuracy of error correction based on the above-described second mapping relationship is, and therefore, the first edit distance may be set to a smaller value. For example, the first edit distance may be a numerical value of 1, 2, etc., and of course, the specific numerical value of the first edit distance threshold is not limited in the embodiment of the present invention.
The process of establishing the mapping relationship between the error string and the correct string is described in detail in the foregoing through technical solutions 1 and 2, and it can be understood that a person skilled in the art may adopt any one or a combination of the above technical solutions 1 and 2 according to a practical application requirement, and may also adopt other technical solutions.
In an optional embodiment of the present invention, the second mapping relationship may be stored in the user error correction lexicon, and since the granularity of the second mapping relationship stored in the user error correction lexicon is a complete input string that meets the input habit of the user, in the input process of the embodiment of the present invention, the incorrect input string may be directly located to the correct string through the search process of step 202, so that the efficiency and accuracy of input error correction can be improved.
In an optional embodiment of the present invention, the user error correction thesaurus may further store a frequency and a history time of the second mapping relationship in addition to the second mapping relationship. For example, in the input process of the user, if "nihoa" is corrected to "nihao" with the occurrence number of 2, the frequency of the second mapping relationship is 2. The historical time of the second mapping relation can be used to represent the occurrence time or the saved time of the second mapping relation, wherein, each time when the condition that the 'nihoa' is corrected to the 'nihao' occurs, the corresponding second mapping relation can have the corresponding historical time; optionally, for convenience of operation, only the historical time corresponding to the last occurring second mapping relationship may be recorded, that is, only the maximum historical time may be recorded. The recording format of the historical time may be embodied as year, month, day, hour, minute and second, for example, 20160619080023 may represent 2016, 6, month, 19, day, 8 and 23 seconds, and it can be understood that the embodiment of the present invention does not limit the specific recording format of the historical time.
In an optional embodiment of the present invention, in consideration of the capacity limit of the storage space occupied by the user error correction lexicon, the data records in the user error correction lexicon may be updated according to the frequency and the historical time. For example, when the maximum capacity of a user error correction lexicon is 1w data records, if the number of the data records exceeds 1w, the data records can be thinned according to the frequency and the historical time, wherein the data records with low frequency and small historical time can be preferentially eliminated, so that the error string in the user error correction lexicon better conforms to the current wrong input habit of the user, and it can be understood that the embodiment of the present invention does not limit the specific slimming process.
In practical application, step 202 may traverse the error string in the second mapping relationship, match the input string in step 201 with the current error string in the second mapping relationship, and if the matching is successful, may use the correct string corresponding to the current error string as the correct string corresponding to the input string. It is understood that the search process of step 202 is not limited by the embodiments of the present invention.
In practical applications, step 203 may use the found correct string as an error correction candidate string corresponding to the input string, obtain a corresponding error correction candidate according to the error correction candidate string, and then present the error correction candidate and a common candidate corresponding to the input string to the user. The error correction candidate corresponding to the error correction candidate string may be obtained by querying in a word bank, and the specific process of obtaining the error correction candidate is not limited in the embodiment of the present invention.
In an optional embodiment of the present invention, the input string may correspond to a plurality of error correction candidate strings, and the error correction candidate strings may be sorted according to the frequency and the historical time recorded in the user error correction thesaurus, where the sorting result of the error correction candidate strings may be used as a sorting basis of the error correction candidates.
In an alternative embodiment of the present invention, a second score and a first score of the error correction candidate and the normal candidate may be determined, respectively, and then the error correction candidate and the normal candidate may be sorted according to the second score and the first score, and the candidates may be provided to the user according to the sorting result. Optionally, the first score may be a score corresponding to the first choice of the input string, and the second score may be a score minus a penalty value corresponding to the first choice of the error correction candidate string. The preferred score can be a score calculated according to at least one characteristic of the preferred word frequency, the classification information, the grade and the weight information, and can be used for measuring the preferred quality; the penalty value can be used for controlling the degree of the second score exceeding the first score under the condition of ensuring the accuracy of the input error correction, and generally, the larger the penalty value is, the smaller the probability that the input string is replaced is, and the smaller the penalty value is, the larger the probability that the input string is replaced is. In practical application, the penalty value can be determined through an experiment simulating the input process of a user, so that the accuracy rate of input error correction is ensured as much as possible. It is understood that the specific sorting procedure of the error correction candidates and the common candidates is not limited by the embodiments of the present invention.
To sum up, the embodiment of the present invention may first search in the mapping relationship between the pre-established error string and the correct string according to the input string to obtain the corresponding correct string; the mapping relation between the error string and the correct string is established according to the error correction operation after the input process related to the error correction operation is completed, that is, the second mapping relation is obtained according to the input behavior of the user, so that the personalized error input habit of the user can be reflected, the personalized error correction can be realized, and the error correction accuracy is improved. In addition, the embodiment of the invention can establish the second mapping relation after completing the input process related to the error correction operation, thereby realizing real-time error correction. Specifically, even if the user re-enters the same input string as the previous input process in the next adjacent input process after completing the previous input process related to the error correction operation, the embodiment of the present invention can successfully correct the error of the input string of the next input process.
Moreover, when the capacity limit corresponding to the mapping relationship between the error string and the correct string may cause the error string previously input by the user to be deleted in the mapping relationship between the error string and the correct string, or when the user inputs an error input string for the first time, the mapping relationship between the error string and the correct string cannot be hit by the error input string, and both cases may cause that the correct string corresponding to the input string is not found; according to the embodiment of the invention, when the correct string corresponding to the input string is not found, the input string is matched with the historical input string in the mapping relation between the historical input string and the historical screen content which is established in advance, so that the error correction of the input string can be effectively carried out by using the first mapping relation and the second mapping relation, and the error correction efficiency and the error correction accuracy rate are effectively improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of motion combinations, but those skilled in the art should understand that the present invention is not limited by the described motion sequences, because some steps may be performed in other sequences or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no moving act is required as an embodiment of the invention.
Device embodiment
Referring to fig. 3, a block diagram of an embodiment of an input error correction apparatus according to the present invention is shown, which may specifically include: an input string acquisition module 301, a matching module 302, and an error correction module 303.
The input string obtaining module 301 may be configured to obtain an input string in an input process;
the matching module 302 may be configured to match the input string with a historical input string in a mapping relationship between a historical input string and historical screen content, where the mapping relationship is established in advance; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed;
the error correction module 303 is configured to use a history input string successfully matched with the input string as an error correction candidate string corresponding to the input string.
In yet another optional embodiment of the present invention, the matching module may specifically include:
the first determining sub-module is used for determining a second editing distance between the current historical input string and the input string in the mapping relation between the historical input string and the historical on-screen content;
and the second determining sub-module is used for determining that the current historical input string is successfully matched with the input string when the second editing distance does not exceed a second editing distance threshold.
In yet another optional embodiment of the present invention, the apparatus may further comprise:
an error correction candidate acquisition module, configured to use historical on-screen content corresponding to a historical input string successfully matched with the input string as an error correction candidate corresponding to the error correction candidate string;
and the sorting module is used for sorting the plurality of error correction candidates according to at least one of the frequency of the historical screen-up content, the screen-up time and the second editing distance.
In an optional embodiment of the present invention, the sorting module may specifically include:
the score calculation submodule is used for calculating the score of each error correction candidate according to at least one of the frequency, the screen-on time and the second editing distance of the historical screen-on content;
and the score sorting submodule is used for sorting the error correction candidates according to the scores of the error correction candidates.
In another optional embodiment of the present invention, the score calculating sub-module may specifically include:
the first ratio determining unit is used for determining a first ratio of the frequency of the historical screen contents corresponding to the error correction candidates to the maximum frequency of the frequencies of all the historical screen contents;
a second ratio determining unit, configured to determine a second ratio between the screen-up time of the historical screen-up content corresponding to the error correction candidate and a maximum screen-up time of the screen-up times of all historical screen-up contents;
and the score calculating unit is used for calculating the score of each error correction candidate according to at least one of the first ratio, the second ratio and the second editing distance.
In yet another alternative embodiment of the present invention, the score is proportional to the first ratio and the second ratio, and the score is inversely proportional to the second edit distance.
In yet another optional embodiment of the present invention, the apparatus may further comprise: the second establishing module is used for establishing a mapping relation between the historical input string and historical screen-on content;
the second establishing module may specifically include:
the input process determining submodule is used for determining that the input process is the correct input process when the input process does not contain error correction operation and the on-screen content of the input process is not changed;
and the mapping establishing submodule is used for establishing a mapping relation between the historical input string and the historical screen-on content according to the corresponding input string and the screen-on content aiming at the correct input process.
In an optional embodiment of the present invention, the apparatus may further include:
the searching module is used for searching in the mapping relation between the pre-established error string and the correct string according to the input string before the matching module matches the input string with the historical input string in the mapping relation between the pre-established historical input string and the historical screen content so as to obtain the corresponding correct string; after the input process related to the error correction operation is completed, establishing and obtaining the mapping relation between the error string and the correct string according to the error correction operation, and taking the correct string obtained by searching as an error correction candidate string corresponding to the input string;
the matching module 302 may be configured to, when a correct string corresponding to the input string is not found, match the input string with a historical input string in a mapping relationship between a historical input string and historical on-screen content that is established in advance, and use the historical input string that is successfully matched with the input string as an error correction candidate string corresponding to the input string.
In an optional embodiment of the present invention, the apparatus may further include: the first establishing module is used for establishing a mapping relation between the error string and the correct string;
the first establishing module may specifically include:
the first establishing submodule is used for establishing a mapping relation between an error string and a correct string according to input strings before and after correction after receiving subsequent corresponding screen-on operation if the input strings are corrected by a user or an input method system in the input process; and/or
And the second establishing sub-module is used for establishing a mapping relation between an error string and a correct string according to the first input string and the second input string after receiving the screen-up operation of the next input process when the screen-up content of the previous input process is deleted and the first editing distance between the second input string of the next input process and the first input string of the previous input process does not exceed the first editing distance threshold.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 4 is a block diagram illustrating an apparatus 900 for input error correction according to an example embodiment. For example, the apparatus 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, apparatus 900 may include one or more of the following components: processing component 902, memory 904, power component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916.
The processing component 902 generally controls overall operation of the device 900, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing element 902 may include one or more processors 920 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 902 can include one or more modules that facilitate interaction between processing component 902 and other components. For example, the processing component 902 can include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
The memory 904 is configured to store various types of data to support operation at the device 900. Examples of such data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 904 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 906 provides power to the various components of the device 900. The power components 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 900.
The multimedia component 908 comprises a screen providing an output interface between the device 900 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide motion action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 900 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 910 is configured to output and/or input audio signals. For example, audio component 910 includes a Microphone (MIC) configured to receive external audio signals when apparatus 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 904 or transmitted via the communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
I/O interface 912 provides an interface between processing component 902 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 914 includes one or more sensors for providing status assessment of various aspects of the apparatus 900. For example, the sensor assembly 914 may detect an open/closed state of the device 900, the relative positioning of the components, such as a display and keypad of the apparatus 900, the sensor assembly 914 may also detect a change in the position of the apparatus 900 or a component of the apparatus 900, the presence or absence of user contact with the apparatus 900, orientation or acceleration/deceleration of the apparatus 900, and a change in the temperature of the apparatus 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 916 is configured to facilitate communications between the apparatus 900 and other devices in a wired or wireless manner. The apparatus 900 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 900 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 904 comprising instructions, executable by the processor 920 of the apparatus 900 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a smart terminal, enable the smart terminal to perform a search engine based input error correction method, the method comprising: acquiring an input string in an input process; matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed; and taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
Fig. 5 is a schematic structural diagram of a server in an embodiment of the present invention. The server 1900 may vary widely by configuration or performance and may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) storing applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instructions operating on a server. Still further, a central processor 1922 may be provided in communication with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is only limited by the appended claims
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
The input error correction method, the input error correction device and the device for input error correction provided by the present invention are introduced in detail, and specific examples are applied in this text to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (25)
1. An input error correction method, comprising:
acquiring an input string in an input process;
matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed; the correct input process is used to characterize: the input string input by the user at the beginning is the correct input string and is not corrected, and all or part of the corresponding on-screen content of the input string input at the beginning is not changed;
and taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
2. The method of claim 1, wherein the step of matching the input string with historical input strings in a pre-established mapping relationship between historical input strings and historical on-screen content comprises:
determining a second editing distance between the current historical input string and the input string in the mapping relation between the historical input string and the historical screen content;
determining that the current historical input string matches the input string successfully when the second edit distance does not exceed a second edit distance threshold.
3. The method of claim 1, further comprising:
taking the historical screen-loading content corresponding to the historical input string successfully matched with the input string as an error correction candidate corresponding to the error correction candidate string;
sorting the plurality of error correction candidates according to at least one of the frequency, the screen-on time and a second editing distance of the historical screen-on content; wherein the second edit distance is used to characterize: an edit distance between the input string and the historical input string.
4. The method of claim 3, wherein the step of sorting the plurality of error correction candidates according to at least one of the frequency of the historical on-screen content, the on-screen time, and the second edit distance comprises:
calculating the score of each error correction candidate according to at least one of the frequency, the screen-on time and the second editing distance of the historical screen-on content;
and sorting the plurality of error correction candidates according to the scores of the error correction candidates.
5. The method of claim 4, wherein the step of calculating the score of each error correction candidate according to at least one of the frequency of the historical on-screen content, the on-screen time, and the second edit distance comprises:
determining a first ratio of the frequency of the historical screen contents corresponding to the error correction candidate to the maximum frequency of all the frequency of the historical screen contents;
determining a second ratio of the screen-on time of the historical screen-on content corresponding to the error correction candidate to the maximum screen-on time of all the historical screen-on contents;
and calculating the score of each error correction candidate according to at least one of the first ratio, the second ratio and the second editing distance.
6. The method of claim 5, wherein the score is proportional to the first ratio and the second ratio, and wherein the score is inversely proportional to the second edit distance.
7. The method of any one of claims 1 to 6, wherein the mapping between the historical input string and the historical on-screen content is established by:
when the input process does not contain error correction operation and the on-screen content of the input process is not changed, determining that the input process is the correct input process;
and aiming at the correct input process, establishing a mapping relation between the historical input string and the historical screen content according to the corresponding input string and the screen content.
8. The method of any of claims 1-6, wherein prior to the step of matching the input string to a historical input string in a pre-established mapping between historical input strings and historical on-screen content, the method further comprises:
searching in a mapping relation between a pre-established error string and a correct string according to the input string to obtain a corresponding correct string; after the input process related to the error correction operation is completed, establishing and obtaining the mapping relation between the error string and the correct string according to the error correction operation, and taking the correct string obtained by searching as an error correction candidate string corresponding to the input string;
and when the correct string corresponding to the input string is not found, matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance, and taking the historical input string which is successfully matched with the input string as an error correction candidate string corresponding to the input string.
9. An input error correction apparatus, comprising:
the input string acquisition module is used for acquiring an input string in an input process;
the matching module is used for matching the input string with a historical input string in a mapping relation between a pre-established historical input string and historical screen content; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed; the correct input process is used to characterize: the input string input by the user at the beginning is the correct input string and is not corrected, and all or part of the corresponding on-screen content of the input string input at the beginning is not changed; and
and the error correction module is used for taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
10. The apparatus of claim 9, further comprising:
the searching module is used for searching in the mapping relation between the pre-established error string and the correct string according to the input string before the matching module matches the input string with the historical input string in the mapping relation between the pre-established historical input string and the historical screen content so as to obtain the corresponding correct string; after the input process related to the error correction operation is completed, establishing and obtaining the mapping relation between the error string and the correct string according to the error correction operation, and taking the correct string obtained by searching as an error correction candidate string corresponding to the input string;
the matching module is specifically configured to, when the correct string corresponding to the input string is not found, match the input string with a historical input string in a mapping relationship between a historical input string and historical on-screen content that is established in advance, and use the historical input string that is successfully matched with the input string as the error correction candidate string corresponding to the input string.
11. The apparatus of claim 9, further comprising:
an error correction candidate acquisition module, configured to use historical on-screen content corresponding to a historical input string successfully matched with the input string as an error correction candidate corresponding to the error correction candidate string;
the sorting module is used for sorting the plurality of error correction candidates according to at least one of the frequency, the screen-on time and the second editing distance of the historical screen-on content; wherein the second edit distance is used to characterize: an edit distance between the input string and the historical input string.
12. The apparatus of claim 11, wherein the ordering module comprises:
the score calculation submodule is used for calculating the score of each error correction candidate according to at least one of the frequency, the screen-on time and the second editing distance of the historical screen-on content;
and the score sorting submodule is used for sorting the error correction candidates according to the scores of the error correction candidates.
13. The apparatus of claim 12, wherein the score computation sub-module comprises:
the first ratio determining unit is used for determining a first ratio of the frequency of the historical screen contents corresponding to the error correction candidates to the maximum frequency of the frequencies of all the historical screen contents;
a second ratio determining unit, configured to determine a second ratio between the screen-up time of the historical screen-up content corresponding to the error correction candidate and a maximum screen-up time of the screen-up times of all historical screen-up contents;
and the score calculating unit is used for calculating the score of each error correction candidate according to at least one of the first ratio, the second ratio and the second editing distance.
14. The apparatus of claim 13, wherein the score is proportional to the first ratio and the second ratio, and wherein the score is inversely proportional to the second edit distance.
15. The apparatus of any of claims 9 to 14, further comprising: the second establishing module is used for establishing a mapping relation between the historical input string and historical screen-on content;
the second establishing module comprises:
the input process determining submodule is used for determining that the input process is the correct input process when the input process does not contain error correction operation and the on-screen content of the input process is not changed;
and the mapping establishing submodule is used for establishing a mapping relation between the historical input string and the historical screen-on content according to the corresponding input string and the screen-on content aiming at the correct input process.
16. The apparatus of any of claims 9 to 14, further comprising:
the searching module is used for searching in the mapping relation between the pre-established error string and the correct string according to the input string before the matching module matches the input string with the historical input string in the mapping relation between the pre-established historical input string and the historical screen content so as to obtain the corresponding correct string; after the input process related to the error correction operation is completed, establishing and obtaining the mapping relation between the error string and the correct string according to the error correction operation, and taking the correct string obtained by searching as an error correction candidate string corresponding to the input string;
and the matching module is used for matching the input string with a historical input string in a mapping relation between a pre-established historical input string and historical screen content when a correct string corresponding to the input string is not found, and taking the historical input string successfully matched with the input string as an error correction candidate string corresponding to the input string.
17. An apparatus for input error correction comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors the one or more programs including instructions for:
acquiring an input string in an input process;
matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance; the mapping relation between the historical input string and the historical on-screen content is obtained by establishing after the correct input process is completed; the correct input process is used to characterize: the input string input by the user at the beginning is the correct input string and is not corrected, and all or part of the corresponding on-screen content of the input string input at the beginning is not changed;
and taking the history input string successfully matched with the input string as the error correction candidate string corresponding to the input string.
18. The apparatus of claim 17, wherein matching the input string with a historical input string in a pre-established mapping between historical input strings and historical on-screen content comprises:
determining a second editing distance between the current historical input string and the input string in the mapping relation between the historical input string and the historical screen content;
determining that the current historical input string matches the input string successfully when the second edit distance does not exceed a second edit distance threshold.
19. The apparatus of claim 17, further comprising:
taking the historical screen-loading content corresponding to the historical input string successfully matched with the input string as an error correction candidate corresponding to the error correction candidate string;
sorting the plurality of error correction candidates according to at least one of the frequency, the screen-on time and a second editing distance of the historical screen-on content; wherein the second edit distance is used to characterize: an edit distance between the input string and the historical input string.
20. The apparatus of claim 19, wherein the sorting the plurality of error correction candidates according to at least one of a frequency of the historical on-screen content, an on-screen time, and the second edit distance comprises:
calculating the score of each error correction candidate according to at least one of the frequency, the screen-on time and the second editing distance of the historical screen-on content;
and sorting the plurality of error correction candidates according to the scores of the error correction candidates.
21. The apparatus of claim 20, wherein the calculating a score for each error correction candidate according to at least one of a frequency of the historical on-screen content, an on-screen time, and the second edit distance comprises:
determining a first ratio of the frequency of the historical screen contents corresponding to the error correction candidate to the maximum frequency of all the frequency of the historical screen contents;
determining a second ratio of the screen-on time of the historical screen-on content corresponding to the error correction candidate to the maximum screen-on time of all the historical screen-on contents;
and calculating the score of each error correction candidate according to at least one of the first ratio, the second ratio and the second editing distance.
22. The apparatus of claim 21, wherein the score is proportional to the first ratio and the second ratio, and wherein the score is inversely proportional to the second edit distance.
23. The apparatus of any of claims 17-22, wherein the apparatus is further configured to execute the one or more programs by one or more processors includes instructions for:
when the input process does not contain error correction operation and the on-screen content of the input process is not changed, determining that the input process is the correct input process;
and aiming at the correct input process, establishing a mapping relation between the historical input string and the historical screen content according to the corresponding input string and the screen content.
24. The apparatus of any of claims 17-22, wherein the processor is further configured to execute the one or more programs including instructions for:
before matching the input string with a historical input string in a mapping relation between a pre-established historical input string and historical screen content, searching in a mapping relation between a pre-established error string and a correct string according to the input string to obtain a corresponding correct string; after the input process related to the error correction operation is completed, establishing and obtaining the mapping relation between the error string and the correct string according to the error correction operation, and taking the correct string obtained by searching as an error correction candidate string corresponding to the input string;
and when the correct string corresponding to the input string is not found, matching the input string with a historical input string in a mapping relation between a historical input string and historical screen content which is established in advance, and taking the historical input string which is successfully matched with the input string as an error correction candidate string corresponding to the input string.
25. One or more machine readable media having instructions stored thereon that, when executed by one or more processors, cause an apparatus to perform the method of any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610641418.XA CN107688400B (en) | 2016-08-05 | 2016-08-05 | Input error correction method and device for input error correction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610641418.XA CN107688400B (en) | 2016-08-05 | 2016-08-05 | Input error correction method and device for input error correction |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107688400A CN107688400A (en) | 2018-02-13 |
CN107688400B true CN107688400B (en) | 2021-11-30 |
Family
ID=61151241
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610641418.XA Active CN107688400B (en) | 2016-08-05 | 2016-08-05 | Input error correction method and device for input error correction |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107688400B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115509374A (en) * | 2022-10-24 | 2022-12-23 | 科大讯飞股份有限公司 | Input method, input device, electronic equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101241514A (en) * | 2008-03-21 | 2008-08-13 | 北京搜狗科技发展有限公司 | Method for creating error-correcting database, automatic error correcting method and system |
CN102402298A (en) * | 2010-09-16 | 2012-04-04 | 腾讯科技(深圳)有限公司 | Pinyin input method and user word adding method and system thereof |
CN102915314A (en) * | 2011-08-05 | 2013-02-06 | 腾讯科技(深圳)有限公司 | Automatic error correction pair generation method and system |
CN103049458A (en) * | 2011-10-17 | 2013-04-17 | 北京搜狗科技发展有限公司 | Method and system for revising user word bank |
CN104317780A (en) * | 2014-09-28 | 2015-01-28 | 无锡卓信信息科技有限公司 | Quick correction method of Chinese input texts |
CN104598473A (en) * | 2013-10-31 | 2015-05-06 | 联想(北京)有限公司 | Information processing method and electronic device |
CN105447019A (en) * | 2014-08-20 | 2016-03-30 | 北京羽扇智信息科技有限公司 | User usage scene based input identification result calibration method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8201087B2 (en) * | 2007-02-01 | 2012-06-12 | Tegic Communications, Inc. | Spell-check for a keyboard system with automatic correction |
-
2016
- 2016-08-05 CN CN201610641418.XA patent/CN107688400B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101241514A (en) * | 2008-03-21 | 2008-08-13 | 北京搜狗科技发展有限公司 | Method for creating error-correcting database, automatic error correcting method and system |
CN102402298A (en) * | 2010-09-16 | 2012-04-04 | 腾讯科技(深圳)有限公司 | Pinyin input method and user word adding method and system thereof |
CN102915314A (en) * | 2011-08-05 | 2013-02-06 | 腾讯科技(深圳)有限公司 | Automatic error correction pair generation method and system |
CN103049458A (en) * | 2011-10-17 | 2013-04-17 | 北京搜狗科技发展有限公司 | Method and system for revising user word bank |
CN104598473A (en) * | 2013-10-31 | 2015-05-06 | 联想(北京)有限公司 | Information processing method and electronic device |
CN105447019A (en) * | 2014-08-20 | 2016-03-30 | 北京羽扇智信息科技有限公司 | User usage scene based input identification result calibration method and system |
CN104317780A (en) * | 2014-09-28 | 2015-01-28 | 无锡卓信信息科技有限公司 | Quick correction method of Chinese input texts |
Also Published As
Publication number | Publication date |
---|---|
CN107688400A (en) | 2018-02-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107918496B (en) | Input error correction method and device for input error correction | |
CN107436691B (en) | Method, client, server and device for correcting errors of input method | |
CN107870677B (en) | Input method, input device and input device | |
CN107688399B (en) | Input method and device and input device | |
CN109799916B (en) | Candidate item association method and device | |
CN106886294B (en) | Input method error correction method and device | |
CN110968246A (en) | Intelligent Chinese handwriting input recognition method and device | |
CN110389666B (en) | Input error correction method and device | |
CN111381685B (en) | Sentence association method and sentence association device | |
CN110795014B (en) | Data processing method and device and data processing device | |
CN109388249B (en) | Input information processing method and device, terminal and readable storage medium | |
CN108073291B (en) | Input method and device and input device | |
CN110780749B (en) | Character string error correction method and device | |
CN107688400B (en) | Input error correction method and device for input error correction | |
CN110147426B (en) | Method for determining classification label of query text and related device | |
CN109426354B (en) | Input method, device and device for input | |
CN109144286B (en) | Input method and device | |
CN113936697B (en) | Voice processing method and device for voice processing | |
CN113127613B (en) | Chat information processing method and device | |
CN112905023A (en) | Input error correction method and device for input error correction | |
CN109992120B (en) | Input error correction method and device | |
CN109471538B (en) | Input method, input device and input device | |
CN109388252B (en) | Input method and device | |
CN112925423B (en) | Dynamic error correction method and device for dynamic error correction | |
CN113703588B (en) | Input method, device and device for inputting |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |