Key input method and related device, equipment and storage medium
By comprehensively analyzing user historical input, interface location and device information, and using weight weighting method to predict user intentions, the error touch problem in the existing input method is solved, and the input accuracy and user experience are improved.
Patent Information
- Application Number
- CN202111509386.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-12-10
AI Technical Summary
In the existing input method technology, when users input touch screen keys, the actual keyboard input does not match the user's real input intention, resulting in frequent errors and re-deletion.
Through a comprehensive analysis based on user historical key operation, input interface operation position, user input habits and device information, the user's real input intention is predicted, and the target character is determined by using the weight weighting method.
Improve input accuracy, reduce input inconsistency caused by mistaken touch, and improve user input experience.
Smart Images

Figure CN114356112B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of input methods, and in particular to a key input method and related devices, equipment and storage media. Background Art
[0002] At present, each key in the input method input interface corresponds to a key area. Generally speaking, the key area is a rectangle with a fixed center coordinate point and fixed length and width. When the user's finger touches the key area, if there is no subsequent sliding behavior, the coordinate point where the user's input finger touches the input interface is returned, and the input character corresponding to the key operation is determined based on the coordinate point.
[0003] However, in real-world scenarios, when users use input methods to input on the touch screen, the actual input on the keyboard often does not match the user's actual input intention. For example, the user's actual input intention is to press the "p" key, but due to the user's input habits, finger deviation, and many other reasons, the key "o" is pressed, which causes the user to delete it back to correct the error. In view of this, how to accurately predict the user's actual input intention has become an urgent problem to be solved. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a key input method and related devices, equipment and storage media, which can more accurately predict the user's actual input intention.
[0005] In order to solve the above-mentioned technical problems, the first aspect of the present application provides a key input method, including: based on the character strings actually triggered by several historical key operations of the user before the current key operation, predicting the first probability value of each preset character expected to be triggered by the current key operation; based on the relative position relationship between the operation position of the current key operation in the input interface and the key area of each preset character in the input interface, predicting the second probability value of each preset character expected to be triggered by the current key operation; based on the first reference information related to the user's input habits, obtaining the first weight, and based on the second reference information related to the input device, obtaining the second weight; based on the weighted result of the first probability value and the second probability value by the first weight and the second weight, determining the target character actually triggered by the current key operation.
[0006] In order to solve the above-mentioned technical problems, the second aspect of the present application provides a key input device, including: a first prediction module, which is used to predict the first probability value of each preset character expected to be triggered by the current key operation based on the character string actually triggered by several historical key operations of the user before the current key operation; a second prediction module, which is used to predict the second probability value of each preset character expected to be triggered by the current key operation based on the relative position relationship between the operation position of the current key operation in the input interface and the key area of each preset character in the input interface; a weight calculation module, which is used to obtain a first weight based on first reference information related to the user's input habits, and to obtain a second weight based on second reference information related to the input device; a character determination module, which is used to determine the target character actually triggered by the current key operation based on the weighted result of the first probability value and the second probability value by the first weight and the second weight.
[0007] In order to solve the above-mentioned technical problems, the third aspect of the present application provides an input device, including a touch screen, a memory and a processor, the touch screen and the memory are coupled to the processor, the touch screen is used to display an input interface, the memory stores program instructions, and the processor is used to execute the program instructions to implement the key input method in the above-mentioned first aspect.
[0008] In order to solve the above technical problem, the fourth aspect of the present application provides a computer-readable storage medium, which stores program instructions that can be executed by a processor, and the program instructions are used to implement the key input method in the above first aspect.
[0009] The above scheme can determine the target character actually triggered by the current key operation based on the weighted result of the first weight and the second weight on the first probability value and the second probability value. Therefore, the target character actually triggered by the current key operation finally determined by the present application is a comprehensive consideration of the factors of the user's historical key operations, the user's operation position in the input interface and the relative position relationship of each preset character in the key area of the input interface, the first reference information factor related to the user's input habits, and the second reference information factor related to the input device. It can more accurately predict the user's true input intention, reduce the phenomenon of mis-touch resulting in inconsistent input with the user's expectations, and improve the user's input experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flowchart of an embodiment of a key input method provided by the present application;
[0011] Figure 2 yes Figure 1 The flowchart of step S11 is shown as an embodiment;
[0012] Figure 3 yes Figure 1The flowchart of step S12 is shown as an embodiment;
[0013] Figure 4 yes Figure 1 The flowchart of step S13 is shown as an embodiment;
[0014] Figure 5 It is a flowchart of an embodiment of obtaining a weighting factor corresponding to reference information provided by the present application;
[0015] Figure 6 is a schematic diagram of a flow chart of an embodiment of obtaining a weight vector provided by the present application;
[0016] Figure 7 It is a schematic diagram of a framework of an embodiment of a key input device provided by the present application;
[0017] Figure 8 It is a schematic diagram of a framework of an embodiment of an input device provided by the present application;
[0018] Fig. 9 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0019] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0020] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0021] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0022] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of the key input method provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not necessarily refer to the embodiment of the present invention. Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes:
[0023] Step S11: based on character strings actually triggered by several historical key operations of the user before the current key operation, predict and obtain first probability values of various preset characters that the current key operation is expected to trigger.
[0024] In this embodiment, based on the character strings actually triggered by several historical key operations before the current key operation, the first probability values of the current key operation expected to trigger various preset characters can be predicted. In other words, taking the factors of the user's historical key operations into consideration, the preset characters expected to be triggered by the current key operation are predicted based on the character strings actually triggered by several historical key operations. The larger the first probability value of the preset character, the greater the possibility that the current key operation triggers this preset character when only the factors of the user's historical key operations are considered.
[0025] In one embodiment, the number of historical key operations performed by the user before the current key operation is not limited, and can be specifically set according to actual use needs. For example, the number N of historical key operations performed by the user before the current key operation is 2, 3, 4, 5, 6, 7, 8, 9, 10, etc.; taking the number of historical key operations performed by the user before the current key operation as 5, the character string actually triggered by the 5 historical key operations of the user before the current key operation is "X1X2X3X4X5", and the triggered character string can specifically be "shugu", "anqua", etc.
[0026] In one embodiment, each preset character may be one of the 26 English letters, that is, each of the 26 English letters is a preset character. Therefore, based on the character strings actually triggered by several historical key operations of the user before the current key operation, it is possible to predict the first probability value of each English letter that the current key operation is expected to trigger. It is understandable that in other embodiments, each preset character may also include only any number of different English letters, for example, each preset character is "a, b, d, r, y". Of course, the preset characters may also include other characters such as punctuation marks and Greek letters, which can be specifically set according to actual use needs and are not specifically limited here.
[0027] Step S12: based on the relative position relationship between the operation position of the current key operation on the input interface and the key area of each preset character in the input interface, predict the second probability value of the current key operation expected to trigger each preset character.
[0028] In this embodiment, according to the relative position relationship between the operation position of the current key operation on the input interface and the key area of each preset character in the input interface, it is possible to predict the second probability value of the current key operation that is expected to trigger each preset character. In other words, by taking into account the factors of the relative position relationship between the operation position of the user on the input interface and the key area of each preset character in the input interface, by determining the relative position of the operation position of the current key operation on the input interface and the key area of each preset character in the input interface, it is possible to predict the preset character that is expected to be triggered by the current key operation. The larger the second probability value of the preset character, the greater the possibility that the current key operation triggers this preset character when only considering the factors of the relative position relationship between the operation position of the user on the input interface and the key area of each preset character in the input interface.
[0029] In one embodiment, the second probability value of the current key operation expected to trigger each preset character can be predicted based on the distance between the operation position of the current key operation on the input interface and the key area of each preset character in the input interface. There is no limitation on the size and shape of the key area, which can be specifically set according to actual use needs. For example, the key area of each preset character is a rectangular area with a length of L and a width of M.
[0030] In order to improve the accuracy of the predicted second probability value of the current key operation that is expected to trigger each preset character, in other embodiments, the relative position relationship between the operation position of the current key operation in the input interface and the core area of the key area of each preset character in the input interface can also be used. Among them, the center point position, shape, size, etc. of the core area are not limited, and can be specifically set according to actual use needs. In a specific embodiment, the center point of the core area is the center point of the key area and the core area is smaller than the key area, such as the core area is a rectangular area with a length and width of half the length and width of the key area, or the core area is a circular area with a radius of half the length of the key area. In other specific embodiments, the center point of the core area can also be any point in the key area and the core area is smaller than the key area.
[0031] In other embodiments, the second probability value of each preset character that the current key operation is expected to trigger can be predicted based on the relative position relationship between the operation position of the current key operation in the input interface and the key area and core area of each preset character in the input interface.
[0032] In one embodiment, the Euclidean distance between the specific coordinate point corresponding to the operation position of the current key operation on the input interface and the coordinates of the center point of the key area of each preset character in the input interface can be calculated to obtain the relative position relationship between the operation position of the current key operation on the input interface and the key area of each preset character in the input interface. It can be understood that in other embodiments, the Euclidean distance between the specific coordinate point corresponding to the operation position of the current key operation on the input interface and the coordinate point corresponding to the point closest to the operation position coordinate point in the core area of each preset character can also be calculated to obtain the relative position relationship between the operation position of the current key operation on the input interface and the key area of each preset character in the input interface.
[0033] Step S13: obtaining a first weight based on first reference information related to the user's input habit, and obtaining a second weight based on second reference information related to the input device.
[0034] Taking the factors of the user's historical key operations into consideration, through the character strings actually triggered by several historical key operations, the preset characters expected to be triggered by the current key operation can be predicted; taking the factors of the relative position relationship between the user's operation position on the input interface and the key area of each preset character in the input interface into consideration, by determining the relative positions of the operation position of the current key operation on the input interface and the key area of each preset character in the input interface, the preset characters expected to be triggered by the current key operation can be predicted. Therefore, the preset characters expected to be triggered by the current key operation predicted by comprehensively considering the factors of the user's historical key operations and the factors of the relative position relationship between the user's operation position on the input interface and the key area of each preset character in the input interface can reduce the phenomenon of mis-touching causing input that is inconsistent with the user's expectations, and improve the user's input experience. However, the weights of the factors of the user's historical key operations and the factors of the relative position relationship between the user's operation position on the input interface and the key area of each preset character in the input interface are different for different users.
[0035] Among them, taking the factors of the user's historical key operations into consideration, it is predicted that the weight of the first probability value that the current key operation is expected to trigger each preset character is affected by the first reference information related to the user's input habits; taking the factors of the relative position relationship between the user's operation position in the input interface and the key area of each preset character in the input interface into consideration, it is predicted that the weight of the second probability value that the current key operation is expected to trigger each preset character is affected by the second reference information related to the input device.
[0036] Therefore, in this embodiment, the first weight can be obtained based on the first reference information related to the user's input habit, and the second weight can be obtained based on the second reference information related to the input device.
[0037] Optionally, in one embodiment, the first reference information related to the user's input habits includes at least one of the following reference items: the number of characters that have been triggered by the continuous input operation to which the current key operation belongs (for example, the characters that have been triggered by the continuous input operation to which the current key operation belongs are "X1X2X3X4X5", that is, the number of characters that have been triggered is 5), the user's age, the user's gender, and the application in which the user performs the current key operation (for example, WeChat, Taobao, QQ, etc.). It can be understood that in other embodiments, the first reference information related to the user's input habits may also include other types of reference items, which are not specifically limited here.
[0038] Optionally, in one embodiment, the second reference information related to the input device includes the model of the input device. It is understandable that in other embodiments, the second reference information related to the input device may also include other types of reference items, which are not specifically limited here.
[0039] Step S14: Determine the target character actually triggered by the current key operation based on the weighted result of the first probability value and the second probability value by the first weight and the second weight.
[0040] In this embodiment, the target character actually triggered by the current key operation can be determined according to the weighted result of the first probability value and the second probability value by the first weight and the second weight. That is to say, the first probability value and the second probability value are weighted by the first weight and the second weight to obtain the final probability value of each preset character expected to be triggered by the current key operation, thereby determining the target character actually triggered by the current key operation according to the final probability value of each preset character.
[0041] The first weight obtained by considering the first reference information factor related to the user's input habits and the second weight obtained by considering the second reference information factor related to the input device are weighted to determine the target character actually triggered by the current key operation by weighting the first probability value predicted by considering the user's historical key operation and the second probability value predicted by considering the user's operation position in the input interface and the relative position relationship between the key area of each preset character in the input interface. That is, the target character actually triggered by the current key operation finally determined by the present application is a comprehensive consideration of the factors of the user's historical key operation, the user's operation position in the input interface and the relative position relationship between the key area of each preset character in the input interface, the first reference information factor related to the user's input habits and the second reference information factor related to the input device, which can more accurately predict the user's true input intention, reduce the phenomenon of input that is inconsistent with the user's expectations due to mis-touch, and improve the user's input experience.
[0042] In one embodiment, the first probability value and the second probability value may be weighted and summed using the first weight and the second weight to determine the target character actually triggered by the current key operation according to the weighted summation result. Assuming that the character string actually triggered by the five historical key operations of the user before the current key operation is "X1X2X3X4X5", the specific formula for weighted summing the first probability value and the second probability value using the first weight and the second weight is as follows:
[0043] Y=W a *P a (α|X1X2X3X4X5)+W b *P b (α|X1X2X3X4X5)
[0044] Among them, Y is the weighted summation result; W a is the first weight; P a (α|X1X2X3X4X5) is the first probability value; W b is the second weight; P b (α|X1X2X3X4X5) is the second probability value.
[0045] It is understandable that in other implementations, the first weight and the second weight may be used to perform weighted summing and then averaging the first probability value and the second probability value, so as to determine the target character actually triggered by the current key operation based on the weighted summing and then averaging result.
[0046] For example, the character string actually triggered by the user's several historical key operations before the current key operation is "shugu", and the first weight is W a The second weight is W b For example. According to the character strings actually triggered by several historical key operations before the current key operation, it is predicted that the first probability value of the current key operation expected to trigger the preset character "o" is the largest, and the first probability value of the current key operation expected to trigger the preset character "i" is the second largest (that is, the first probability value of the preset character "i" is less than the first probability value of the preset character "o" and greater than the first probability values of other preset characters); according to the operation position of the current key operation on the input interface, the distance between the operation position and the key area of the preset character "o" is the smallest, and the distance to the key area of the preset character "i" is the second largest, which indicates that the second probability value of the current key operation expected to trigger the preset character "o" is the largest, and the second probability value of the current key operation expected to trigger the preset character "i" is the second largest. Therefore, the first weight and the second weight are used to perform weighted summation on the first probability value and the second probability value, and the final probability value of the current key operation expected to trigger the preset character "o" is the largest, so it is determined that the target character actually triggered by the current key operation is "o", that is, the user's actual input intention is predicted to be "Shu".
[0047] For another example, the character string actually triggered by the user's several historical key operations before the current key operation is "shugu", and the first weight is W a The second weight is W b For example. According to the character strings actually triggered by several historical key operations before the current key operation, it is predicted that the first probability value of the current key operation expected to trigger the preset character "o" is the largest, and the first probability value of the current key operation expected to trigger the preset character "p" is the smallest; according to the operation position of the current key operation in the input interface, the distance between the operation position and the key area of the preset character "o" is equal to the distance between the operation position and the key area of the preset character "p", which indicates that the second probability value predicted to trigger the preset character "o" by the current key operation is equal to the second probability value predicted to trigger the preset character "p" by the current key operation. Therefore, the first weight and the second weight are used to perform weighted summation on the first probability value and the second probability value, and the final probability value of the current key operation expected to trigger the preset character "o" is the largest, so it is determined that the target character actually triggered by the current key operation is "o", that is, it is predicted that the user's actual input intention is "Shu".
[0048] The above implementation method can determine the target character actually triggered by the current key operation based on the weighted result of the first weight and the second weight on the first probability value and the second probability value. Therefore, the target character actually triggered by the current key operation finally determined by the present application is a comprehensive consideration of the factors of the user's historical key operations, the user's operation position in the input interface and the relative position relationship of each preset character in the key area of the input interface, the first reference information factor related to the user's input habits, and the second reference information factor related to the input device. It can more accurately predict the user's true input intention, reduce the phenomenon of mis-touch resulting in input that is inconsistent with the user's expectations, and improve the user's input experience.
[0049] See also Figure 2 , Figure 2 yes Figure 1 It should be noted that if there is substantially the same result, this embodiment does not use Figure 2 The process sequence shown is limited. Figure 2 As shown, this embodiment includes:
[0050] Step S111: counting the frequency of each preset character being triggered by the user, and counting the proportion of the character string in each target character string input by the user.
[0051] In this embodiment, the frequency value of each preset character being triggered by the user is counted, and the proportion of the character string in each target character string input by the user is counted, so that the first probability value of the corresponding preset character can be obtained based on the frequency value of the preset character being triggered by the user and the proportion of the character string in the target character string input by the user. The target character string has the same length as the character string. Specifically, the formula for the frequency value of each preset character being triggered by the user is as follows:
[0052] P(α)=N α / N
[0053] Wherein, α is any preset character; P(α) is the frequency value of each preset character being triggered by the user; N α is the frequency of each preset character being triggered by all users of the input method; N is the sum of the frequencies of each preset character being triggered by the user. For example, each preset character is one of the 26 English letters; the frequency N of the preset character k being triggered by all users is k is 20; the sum of the frequencies of each preset character, i.e., 26 English letters, being triggered by the user is 100; therefore, the probability value P(k) of the preset character k being triggered by the user is 0.2.
[0054] Assume that the string input by the user is "X1X2X3X4X5", so the formula for the proportion of the string "X1X2X3X4X5" in each target string input by the user is as follows:
[0055] P(X1X2X3X4X5)=S β / S
[0056] Among them, X1X2X3X4X5 is the character string input by the user; P(X1X2X3X4X5) is the proportion of the character string in each target character string input by the user; S β is the frequency of input strings among all users of the input method; S is the sum of the frequencies of input of each target string. For example, the frequency S of the string input by the user is "X1X2X3X4X5" β is 10; the sum S of the input frequencies of target strings of the same length as the string is 100; therefore, the proportion value P(X1X2X3X4X5) of the user input string "X1X2X3X4X5" is 0.1.
[0057] Step S112: taking the ratio between the frequency value and the proportion value corresponding to each preset character as the first probability value corresponding to the preset character.
[0058] In this embodiment, the ratio between the frequency value and the ratio value corresponding to each preset character is used as the first probability value of the corresponding preset character. That is to say, the first probability value of the preset character can be obtained according to the frequency value and the ratio value corresponding to the preset character. Specifically, assuming that the character string input by the user is "X1X2X3X4X5", the formula of the first probability value of each preset character is as follows:
[0059] P a (α|X1X2X3X4X5)=P(α) / P(X1X2X3X4X5)
[0060] Wherein, α is any preset character; X1X2X3X4X5 is the character string input by the user; P(α) is the frequency value of each preset character being triggered by the user; P(X1X2X3X4X5) is the proportion of the character string in each target character string input by the user; P a (α|X1X2X3X4X5) is the first probability value of any preset character.
[0061] Furthermore, since P(α)=N α / N,P(X1X2X3X4X5)=S β / S, and put it into the formula of the first probability value of each preset character to obtain:
[0062]
[0063] See also Figure 3 , Figure 3 yes Figure 1 It should be noted that if there is substantially the same result, this embodiment does not use Figure 3 The process sequence shown is limited. Figure 3 As shown, in this embodiment, the center point of the core area of the key area is the center point of the key area, and the core area is a rectangular area whose length and width are respectively half of the length and width of the key area, specifically including:
[0064] Step S121: based on whether the operation position is located in the core area of the key area of the preset character and the distance between the operation position and the preset position of the key area of the preset character, obtain a predicted value of the current key operation expected to trigger the corresponding preset character.
[0065] In this embodiment, the predicted value of the current key operation expected to trigger the corresponding preset character is obtained according to whether the operation position is located in the core area of the key area of the preset character and the distance between the operation position and the preset position of the key area of the preset character. That is to say, it will first be determined whether the operation position is located in the core area of the key area of the preset character. If it is located in the core area of the key area of the preset character, the predicted value of the current key operation expected to trigger the corresponding preset character is determined based on the operation position being located in the core area of the key area of the preset character; if it is not located in the core area of the key area of the preset character, the predicted value of the current key operation expected to trigger the corresponding preset character is determined based on the distance between the operation position and the preset position of the key area of the preset character. Among them, the smaller the distance between the operation position and the preset position of the key area of the preset character is, the more obvious the user's intention to trigger the preset character is, that is, the larger the predicted value corresponding to the preset character is, so that the subsequent second probability value corresponding to the preset character is larger.
[0066] In one embodiment, the preset position of the key area of the preset character may be the center position of the key area of the preset character. It is understandable that in other embodiments, the preset position of the preset character may also be the position of the point of the core area closest to the operation position, which may be specifically set according to actual use needs and is not specifically limited here.
[0067] In one embodiment, the operation position of the current key operation on the input interface and the preset position of the key area of the preset character can be represented in the form of coordinate points. It can be understood that in other embodiments, the operation position of the key operation on the input interface and the preset position of the key area of the preset character can also be represented in other forms. In one embodiment, when the operation position of the current key operation on the input interface and the preset position of the key area of the preset character are represented in the form of coordinate points, the Euclidean distance between the contact coordinate point of the current key operation on the input interface and the center point punctuation of the key area of the preset character can be calculated as the distance between the operation position and the preset position of the key area of the preset character, or the Euclidean distance between the contact coordinate point of the current key operation on the input interface and the coordinate point corresponding to the point closest to the operation position in the core area of the preset character can be calculated as the distance between the operation position and the preset position of the key area of the preset character.
[0068] In a specific implementation, the preset position of the key area of the preset character is the center point position of the key area of the preset character, and the operation position and the preset position are represented in the form of coordinate points. Specifically, each preset character is “k1, k2, …, k M "; Assume that the center point coordinates of the key area of each preset character are , the operation position of the current key operation on the input interface, that is, the contact coordinate point of the operation position on the input interface is I=(I x ,I y ); The contact coordinate point of the current key operation on the input interface I=(I x ,I y ) are respectively related to the center point coordinates of the key area of each preset character The distance between , when the key operation is at the contact coordinate point I of the input interface x ,I y ) in the core area of the key area of the preset character, (It can also be understood that the distance between the operation position of the current key operation on the input interface and the preset position of the key area of the preset character is 0); when the key operation is at the contact coordinate point I=(I x ,I y ) is not in the core area of the key area of the preset character, calculate the contact coordinate point I of the current key operation on the input interface = (I x ,I y ) and the center point coordinates of the key area of the preset character The distance between them is to calculate the Euclidean distance between them, which is
[0069] For example, the preset characters are “k1=a, k2=b, k3=d, k4=r, k5=z”; the center point coordinates of the key area of each preset character are , the operation position of the current key operation on the input interface, that is, the contact coordinate point of the operation position on the input interface is I=(I x ,I y The operation position is at the contact coordinate point I of the input interface = (I x ,I y ) is in the core area of the preset characters "k1=a, k1=b, k1=d" and is not in the core area of the preset characters "k4=r, k5=z", so
[0070] In one embodiment, when the operation position is located in the core area corresponding to the preset character, the predicted value of the preset character that the current key operation is expected to trigger is set to the preset value; when the operation position is not in the core area corresponding to the preset character, the predicted value of the preset character that the current key operation is expected to trigger is set to the distance corresponding to the operation position. There is no specific limitation on the size of the preset value, for example, the preset value is 0, 1 or 2. For example, taking the preset value of 0 as an example, the preset characters are "k1=a, k2=b, k3=d, k4=r, k5=z" respectively; the operation position is at the contact coordinate point I=(I x ,I y ) is in the core area of the preset characters "k1=a, k2=b, k3=d" and is not in the core area of the preset characters "k4=r, k5=z". Therefore, the predicted value of the preset character "k1=a" is 0, the predicted value of the preset character "k2=b" is 0, the predicted value of the preset character "k3=d" is 0, and the predicted value of the preset character "k4=r" is The predicted value of the preset character "k5=z" is
[0071] Step S122: normalizing the predicted values of the current key operation expected to trigger each preset character to obtain a second probability value of the current key operation expected to trigger each preset character.
[0072] Since the predicted values of the preset characters that the current key operation is expected to trigger may vary greatly, directly using them as the second probability values of the preset characters that the current key operation is expected to trigger will cause the second probability values of the preset characters to vary greatly, which is not convenient for subsequent calculations to determine the target characters actually triggered by the current key operation. Therefore, in this embodiment, the predicted values of the preset characters that the current key operation is expected to trigger are normalized to obtain the second probability values of the preset characters that the current key operation is expected to trigger, so that the second probability values of the preset characters are in the same order of magnitude.
[0073] Specifically, assume that the character string actually triggered by the five historical key operations before the current key operation is "X1X2X3X4X5", and the preset characters are "k1, k2, ..., k M ", the current key operation is expected to trigger the predicted values of each preset character respectively Therefore, the predicted values of the current key operation expected to trigger each preset character are normalized to obtain the second probability value P of the current key operation expected to trigger each preset character. b (α|X1X2X3X4X5). The formula for normalizing the predicted values of each preset character expected to be triggered by the current key operation is as follows:
[0074]
[0075] Among them, P b (α|X1X2X3X4X5) is the second probability value of each preset character expected to be triggered by the current key operation; D ki The current key operation is expected to trigger the predicted value of each preset character.
[0076] See also Figure 4 , Figure 4 yes Figure 1 It should be noted that if there is substantially the same result, this embodiment does not use Figure 4 The process sequence shown is limited. Figure 4 As shown, in this embodiment, the first reference information related to the user's input habits includes the number of characters that have been triggered by the continuous input operation to which the current key operation belongs, the user's age, the user's gender, and the application where the user performs the current key operation; the second reference information related to the input device includes the model of the input device. Specifically including:
[0077] Step S131: extracting feature vectors of various reference items based on the variable types of various reference items in the reference information.
[0078] Since users have different habits of continuous input, that is, the character strings actually triggered by several historical key operations before the current key operation are different, the first weight will be affected by the number of characters that have been triggered by the continuous input operation to which the current key operation belongs, the user's age, the user's gender, and the application in which the user performs the current key operation. Therefore, in this embodiment, the first reference information related to the user's input habits includes the number of characters that have been triggered by the continuous input operation to which the current key operation belongs, the user's age, the user's gender, and the application in which the user performs the current key operation. In addition, since the screen sizes of different input device models are different, the second weight will be affected by the models of different input devices. Therefore, in this embodiment, the second reference information related to the input device includes the model of the input device.
[0079] Therefore, it is necessary to determine the influence of various reference items included in the first reference information on the first weight, and it is necessary to determine the influence of various reference items included in the second reference information on the second weight. Therefore, in this embodiment, firstly, the feature vectors of various reference items are extracted according to the variable types of various reference items in the reference information.
[0080] In one embodiment, the variable type of the reference item includes but is not limited to a numerical variable, a categorical variable, etc., which is not specifically limited here.
[0081] In one implementation, for reference items of different variable types, the manner of extracting the feature vector of the reference item is different, which can be specifically set according to the variable type characteristics of the reference item and is not limited here.
[0082] In a specific embodiment, when the variable type of the reference item is a numerical variable, the specific numerical value of the reference item is directly used as the feature vector of the reference item. For example, taking the reference item "the number of characters that have been triggered by the continuous input operation to which the current key operation belongs" as an example, the variable type of the reference item is a numerical variable, so the feature vector [f1] of the reference item "the number of characters that have been triggered by the continuous input operation to which the current key operation belongs" is the number of characters that have been triggered, and the vector length of the feature vector [f1] is 1. For another example, taking the reference item "the age of the user" as an example, the variable type of the age of the user is a numerical variable, so the feature vector [f2] of the reference item "the age of the user" is the numerical value of the age, and the vector length of the feature vector [f2] is 1.
[0083] In other specific embodiments, when the variable type of the reference item is a categorical variable, one-hot encoding can be performed according to the specific category of the reference item to obtain a feature vector of the reference item. One-hot encoding can convert categorical variable data into a numerical vector, which is represented as a feature vector of an attribute. At the same time, only one vector element in the vector has a value that is not 0, which is used to represent that the feature corresponding to the vector element is activated, while the values of other vector elements are all 0. For example, taking the reference item "user's gender" as an example, the variable type of the reference item is a categorical variable; since the user's gender is divided into male and female, one-hot encoding is used to convert the user's gender data into a 2-dimensional vector, such as the feature vector corresponding to male users can be [0,1], and the feature vector corresponding to female users can be [1,0], so the feature vector of the reference item "user's gender" is [f3,f4], and the vector length of the feature vector [f3,f4] is 2.
[0084] For another example, taking the reference item "the application where the user performs the current key operation" as an example, the variable type of this reference item is a categorical vector; the name of the application where the user performs the current key operation is converted into a numerical vector using one-hot encoding, and is defined as a feature vector [f5,f6,...,f k+4], where the vector length of the feature vector is K, K is the total number of applications installed in the terminal device used by the user (for example, a mobile phone, tablet computer, etc.), and the size of K can be set according to actual usage needs. For example, taking the reference item "the application where the user performs the current key operation is WeChat" as an example, the total number of applications installed in the terminal device used by the user is 5. Since the application where the user performs the current key operation is WeChat, and the vector element representing WeChat is located at the second element of the position feature vector corresponding to the reference item, the feature vector of the reference item is [0,1,0,0,0].
[0085] For another example, taking the reference item “input device model” as an example, the variable type of this reference item is a categorical vector; the model name of the input device is converted into a numerical vector using one-hot encoding and defined as a feature vector [f k+5 ,f k+6 ,...,f k+4+L ], the eigenvector [f k+5 ,f k+6 ,...,f k+4+L ] has a vector length of L, where L is the total number of all aircraft models. The total number of common aircraft models can be filtered and set according to actual conditions.
[0086] Step S132: weighting the feature vectors of the reference items using the weight vectors of various reference items respectively to obtain weighting factors corresponding to the reference information.
[0087] In this embodiment, the feature vectors of the reference items are weighted using the weight vectors of the various reference items to obtain the weighting factors corresponding to the reference information. Wherein, when the reference information is the first reference information, the weighting factor is the first weight; when the reference information is the second reference information, the weighting factor is the second weight.
[0088] In one embodiment, if Figure 5 As shown, Figure 5 : This is a flow chart of an embodiment of obtaining a weighted factor corresponding to reference information provided by the present application. The weight vectors of various reference items can be used to perform weighted summation on the feature vectors of the reference items to obtain the weighted factor corresponding to the reference information. The process specifically includes the following sub-steps:
[0089] Step S51: For each reference item, weighted sums are performed on the elements contained in the reference item's feature vector using the elements contained in the reference item's weight vector to obtain a sub-weight corresponding to the reference item.
[0090] In this implementation, for each reference item, the elements contained in the reference item's weight vector are used to perform weighted summation on the elements contained in the reference item's feature vector to obtain the sub-weight corresponding to the reference item. The size of the weight vector corresponding to each reference item is not limited.
[0091] In one embodiment, the feature vector and the weight vector of each reference item respectively contain the same number of elements.
[0092] In a specific embodiment, the reference item is "the number of characters triggered by the continuous input operation to which the current key operation belongs", the feature vector of the reference item is [f1] and the weight vector is w1, so the elements contained in the weight vector w1 of the reference item "the number of characters triggered by the continuous input operation to which the current key operation belongs" are used to perform weighted summation on the elements contained in the feature vector [f1] of the reference item, and the corresponding sub-weight is f1*w1.
[0093] In a specific implementation, the reference item is "user's age", the feature vector of the reference item is [f2], and the weight vector is w2, so the elements contained in the weight vector w2 of the reference item "user's age" are weighted summed up with the elements contained in the feature vector [f2] of the reference item, and the corresponding sub-weight is f2*w2.
[0094] In a specific embodiment, the reference item is "user's gender", the feature vector of the reference item is [f3, f4], and the weight vectors corresponding to the elements contained in the feature vector [f3, f4] are w3 and w4 respectively. Therefore, the weight vectors w3 and w4 corresponding to the elements contained in the reference item "user's gender" are used to perform weighted summation on the elements contained in the feature vector [f3, f4] of the reference item, and the corresponding sub-weight is f3*w3+f4*w4.
[0095] In a specific implementation, the reference item is “the application where the user performs the current key operation”, and the feature vector of the reference item is [f5, f6, …, f k+4 ], eigenvectors [f5,f6,...,f k+4 ] The weight vectors corresponding to the elements contained in them are w5,w6,...,w k+4 , so the weight vectors w5, w6, ..., w corresponding to the elements contained in the reference item "the application where the user performs the current key operation" are used k+4 The eigenvectors of the reference terms [f5,f6,...,f k+4 ] is weighted summed up, and the corresponding sub-weight is f5*w5+f6*w6+…+f k+4 *w k+4 .
[0096] In a specific implementation, the reference item is “input device model”, and the feature vector of the reference item is [f k+5 ,f k+6 ,...,f k+4+L ], eigenvector [f k+5 ,f k+6 ,...,f k+4+L The weight vectors corresponding to the elements contained in ] are w k+5 ,w k+6 ,...,w k+4+L , so the weight vector w corresponding to the elements contained in the reference item "input device model" is used k+5 ,w k+6 ,...,w k+4+L The eigenvector of the reference term [f k+5 ,f k+6 ,...,f k+4+L ] is weighted summed up, and the corresponding sub-weight is f k+5 *w k+5 +f k+6 *w k+6 +…+f k+4+L *w k+4+L .
[0097] In one embodiment, the weight vector is obtained by training with several groups of sample data. Compared with manually setting the weight vector size of each reference item, the weight vector obtained by training with several groups of sample data has better generalization performance, making the subsequent prediction results more accurate. Wherein, each group of sample data includes sample input data and first reference information and second reference information corresponding to the sample input data, and the sample input data includes sample characters actually triggered by several consecutive sample key operations, and the last sample key operation among the several sample key operations is used as the sample current key operation, and the sample key operation before the sample current key operation among the several sample key operations is used as the sample history key operation.
[0098] In one embodiment, if Figure 6 As shown, Figure 6 : is a flow chart of an embodiment of obtaining a weight vector provided by the present application. The obtaining of the weight vector specifically includes the following sub-steps:
[0099] Step S61: Based on the sample characters actually triggered by the sample historical key operations, predict the first sample probability value that the sample current key operation is expected to trigger each preset character, and based on the relative position relationship between the operation position of the sample current key operation on the input interface and the key area of each preset character, predict the second sample probability value that the sample current key operation is expected to trigger each preset character.
[0100] In this embodiment, according to the sample characters actually triggered by the sample historical key operations, it is possible to predict the first sample probability value of the sample current key operation that is expected to trigger each preset character. That is to say, taking into account the factors of the user's historical key operations, through the sample character string actually triggered by the sample historical key operations, it is possible to predict the first sample probability value of the sample current key operation that is expected to trigger each preset character. The larger the first sample probability value of the preset character, the greater the possibility that the sample current key operation triggers this preset character when only considering the factors of the user's historical key operations. In addition, according to the relative position relationship between the operation position of the sample current key operation on the input interface and the key area of each preset character, it is possible to predict the second sample probability value of the sample current key operation that is expected to trigger each preset character. That is to say, taking into account the factors of the relative position relationship between the operation position of the user on the input interface and the key area of each preset character in the input interface, by determining the relative position of the operation position of the sample current key operation on the input interface and the key area of each preset character in the input interface, it is possible to predict the second sample probability value of the sample current key operation that is expected to trigger each preset character. The larger the second sample probability value of the preset character is, the greater the possibility that the current key operation of the sample will trigger this preset character when only considering the relative position relationship between the user's operation position in the input interface and the key area of each preset character in the input interface.
[0101] Step S62: obtaining a first sample weight based on the feature vectors and weight vectors of various reference items in the first reference information, and obtaining a second sample weight based on the feature vectors and weight vectors of various reference items in the second reference information.
[0102] In this embodiment, the first sample weight is obtained according to the feature vectors and weight vectors of various reference items in the first reference information; and the second sample weight is obtained according to the feature vectors and weight vectors of various reference items in the second reference information. In one embodiment, the feature vectors of the reference items can be weighted using the weight vectors of the various reference items to obtain the sample weights. For example, the weight vectors of the various reference items in the first reference information are used to perform weighted summation on the feature vectors corresponding thereto to obtain the first sample weight; the weight vectors of the various reference items in the second reference information are used to perform weighted summation on the feature vectors corresponding thereto to obtain the second sample weight.
[0103] Among them, the method for extracting the feature vector of each reference item in the first reference information and the second reference information can be referred to step S131, which will not be repeated here; and which reference items the first reference information and the second reference information may specifically include can be referred to step S13, which will not be repeated here.
[0104] In one embodiment, the initialization value of the weight vector model corresponding to each reference item in the first reference information and the second reference information is set to 1, and the weight vector corresponding to each reference item can be adjusted according to the loss value, and iterative training is performed using several groups of sample data to finally obtain a stable weight vector corresponding to each reference item. It can be understood that in other embodiments, the initialization value of the weight vector model corresponding to each reference item in the first reference information and the second reference information can also be set to 2, 3 or other values, which are not specifically limited here.
[0105] Step S63: Determine the predicted character triggered by the current key operation prediction of the sample based on the sample weighting result of the first sample probability value and the second sample probability value by the first sample weight and the second sample weight.
[0106] In this embodiment, the predicted character triggered by the current key operation prediction of the sample is determined based on the sample weighted result of the first sample weight and the second sample weight on the first sample probability value and the second sample probability value. In one embodiment, the first sample weight and the second sample weight can be used to perform weighted summation on the first sample probability value and the second sample probability value to obtain the sample weighted result. It can be understood that in other embodiments, the first sample weight and the second sample weight can also be used to perform weighted summation on the first sample probability value and the second sample probability value and then average to obtain the sample weighted result.
[0107] In a specific implementation, the sample weighted result includes the weighted sample probability value of the sample current key operation predicting the triggering of each preset character, the first reference information includes the number of characters that have been triggered by the continuous input operation to which the current key operation belongs, the user's age, the user's gender, and the application where the user performs the current key operation; the second reference information includes the model of the input device; wherein the weight vector model initialization value corresponding to each reference item in the first reference information and the second reference information is 1. Therefore, based on the first sample weight and the second sample weight, the first sample probability value and the second sample probability value are weighted, and the specific formula for the weighted sample probability value of the sample current key operation predicting the triggering of each preset character is obtained as follows:
[0108] Y'=W a *P a (α|X1X2X3X4X5)+W b *P b (α|X1X2X3X4X5)
[0109] =(f1*w1+f2*w2+...+f k+4 *w k+4a )*P a (α|X1X2X3X4X5)
[0110] +(fk+5 *w k+5 +f k+6 *w k+6 +…+f k+4+L *w k+4+L )*P b (α|X1X2X3X4X5)
[0111] Among them, Y' is the weighted sample probability value of the sample's current key operation prediction triggering each preset character; w1,w2,...,w k+4+L is the weight vector corresponding to each reference item.
[0112] Step S64: adjusting the weight vectors of various reference items based on the prediction loss obtained by the difference between the sample character actually triggered by the current key operation of the sample and the predicted character triggered by the prediction.
[0113] In this embodiment, the weight vectors of various reference items are adjusted according to the prediction loss obtained by the difference between the sample character actually triggered by the current key operation of the sample and the predicted character triggered by the prediction. In other words, the weight vectors of each reference item are adjusted according to the prediction loss, and after multiple iterations of training and adjustment, the predicted character triggered by the prediction tends to the sample character actually triggered by the current key operation of the sample, thereby obtaining a stable first sample weight and a second sample weight.
[0114] In one embodiment, when the current key operation of the sample has not been back-deleted, the weighted sample probability value corresponding to the sample character actually triggered by the current key operation of the sample is negatively correlated with the prediction loss. For example, taking the sample historical key operation as "shugu" as an example, the sample character actually triggered by the current key operation of the sample is "o", and the weighted sample probability value of the preset character "a" predicted to be triggered by the current key operation of the sample is the largest, that is, the output result of the model under the current weight vector is inaccurate. Therefore, it is necessary to adjust the weight vectors of various reference items according to the prediction loss obtained by the difference between the sample character actually triggered by the current key operation of the sample and the predicted character triggered by the prediction. Since the larger the weighted sample probability value of the preset character "o" predicted to be triggered by the current key operation of the sample is, the higher the accuracy of the output result of the model under the current weight vector is, the smaller the difference between the sample character actually triggered by the current key operation of the sample and the predicted character triggered by the prediction is, that is, the smaller the prediction loss is, indicating that the weighted sample probability value corresponding to the sample character actually triggered by the current key operation of the sample is negatively correlated with the prediction loss.
[0115] In the case where the current key operation of the sample is deleted, the weighted sample probability value corresponding to the sample character actually triggered by the current key operation of the sample is positively correlated with the prediction loss. For example, taking the user's actual input intention as "shuguo", after the user enters "shugui", the character "i" needs to be deleted, indicating that the user does not really want to enter "i". Therefore, if the weighted sample probability value of the preset character "i" predicted to be triggered by the current key operation of the sample is larger, it means that the accuracy of the output result of the model under the current weight vector is lower, and the difference between the sample character actually triggered by the current key operation of the sample and the predicted character predicted to be triggered is greater, that is, the greater the prediction loss, indicating that the weighted sample probability value corresponding to the sample character actually triggered by the current key operation of the sample is positively correlated with the prediction loss.
[0116] Step S52: based on the sub-weights corresponding to the various reference items, obtain the weighting factor corresponding to the reference information.
[0117] In this implementation, the weighted factors corresponding to the reference information can be obtained according to the sub-weights corresponding to the various reference items. The weighted sum of the sub-weights corresponding to the various reference items can be used to obtain the weighted factors corresponding to the reference information. In other implementations, the weighted sum of the sub-weights corresponding to the various reference items can be used to obtain the weighted factors corresponding to the reference information.
[0118] In a specific embodiment, when the reference information is the first reference information, the weighting factor is the first weight, and the reference information includes the number of characters that have been triggered by the continuous input operation to which the current key operation belongs, the user's age, the user's gender, and the application in which the user performs the current key operation. For example, the feature vector corresponding to the reference item "the reference information includes the number of characters that have been triggered by the continuous input operation to which the current key operation belongs" is [f1], and the corresponding sub-weight is f1*w1; the feature vector corresponding to the reference item "the age of the user" is [f2], and the corresponding sub-weight is f2*w2; the feature vector corresponding to the reference item "the gender of the user" is [f3,f4], and the corresponding sub-weight is f3*w3+f4*w4; the feature vector corresponding to the reference item "the application in which the user performs the current key operation" is [f5,f6,...,f k+4 ], the corresponding sub-weight is f5*w5+f6*w6+...+f k+4 *w k+4 Therefore, the corresponding weighting factor obtained based on the first reference information, that is, the first weight is W a =f1*w1+f2*w2+...+f k+4 *w k+4 .
[0119] In a specific implementation, when the reference information is the second reference information, the weighting factor is the second weight, that is, the reference information includes the model of the input device. For example, the feature vector corresponding to the reference item "model of the input device" is [f k+5 ,f k+6 ,...,f k+4+L ], the corresponding sub-weight is w k+5 *f k+5 +f k+6 *w k+6 +...+f k+4+L *w k+4+L Therefore, the corresponding weighting factor obtained based on the second reference information, that is, the second weight is W b =f k+5 *w k+5 +f k+6 *w k+6 +…+f k+4+L *w k+4+L .
[0120] In a specific implementation, assuming that the character string actually triggered by the five historical key operations before the current key operation is "X1X2X3X4X5", the first probability value of each preset character expected to be triggered by the current key operation is P a (α|X1X2X3X4X5), the second probability value of the current key operation expected to trigger each preset character is P b (α|X1X2X3X4X5), the first weight obtained based on the first reference information is W a =f1*w1+f2*w2+...+f k+4 *w k+4 , the second weight obtained based on the second reference information is W b =f k+5 *w k+5 +f k+6 *w k+6 +…+f k+4+L *w k+4+L , so use the first weight W a , the second weight W b For the first probability value P a (α|X1X2X3X4X5), the second probability value P b (α|X1X2X3X4X5) is weighted summed to predict the final probability value Y of the current key operation to trigger each preset character as follows:
[0121] Y=W a *P a (α|X1X2X3X4X5)+W b *P b(α|X1X2X3X4X5)
[0122] =(f1*w1+f2*w2+...+f k+4 *w k+4a )*P a (α|X1X2X3X4X5)
[0123] +(f k+5 *w k+5 +f k+6 *w k+6 +…+f k+4+L *w k+4+L )*P b (α|X1X2X3X4X5)
[0124] It is understandable that in other implementations, the first weight and the second weight may be used to perform weighted summing and then averaging the first probability value and the second probability value, so as to determine the target character actually triggered by the current key operation based on the weighted summing and then averaging result.
[0125] See also Figure 7 , Figure 7 It is a schematic diagram of a framework of an embodiment of a key input device provided by the present application. The key input device 70 includes a first prediction module 71, a second prediction module 72, a weight calculation module 73 and a character determination module 74. The first prediction module 71 is used to predict the first probability value of each preset character expected to be triggered by the current key operation based on the character string actually triggered by several historical key operations of the user before the current key operation; the second prediction module 72 is used to predict the second probability value of each preset character expected to be triggered by the current key operation based on the relative position relationship between the operation position of the current key operation in the input interface and the key area of each preset character in the input interface; the weight calculation module 73 is used to obtain the first weight based on the first reference information related to the user's input habits, and obtain the second weight based on the second reference information related to the input device; the character determination module 74 is used to determine the target character actually triggered by the current key operation based on the weighted result of the first probability value and the second probability value by the first weight and the second weight.
[0126] Among them, the weight calculation module 73 is used to obtain the second weight based on the first reference information related to the user's input habits, or based on the second reference information related to the input device, specifically including: extracting the feature vectors of various reference items based on the variable types of various reference items in the reference information; weighting the feature vectors of the reference items using the weight vectors of various reference items respectively to obtain the weighting factor corresponding to the reference information; wherein, when the reference information is the first reference information, the weighting factor is the first weight, and when the reference information is the second reference information, the weighting factor is the second weight.
[0127] Among them, the weight calculation module 73 is used to extract the feature vectors of various reference items based on the variable types of various reference items in the reference information, specifically including: when the variable type of the reference item is a numerical variable, the specific numerical value of the reference item is used as the feature vector of the reference item; and / or, when the variable type of the reference item is a categorical variable, unique hot encoding is performed based on the specific category of the reference item to obtain the feature vector of the reference item.
[0128] Among them, the number of elements contained in the characteristic vector and weight vector of each of the above-mentioned reference items is the same; the weight calculation module 73 is used to weight the characteristic vector of the reference item using the weight vectors of various reference items respectively, and obtain the weighting factor corresponding to the reference information, specifically including: for each reference item, using the elements contained in the weight vector of the reference item to perform weighted summation on the elements contained in the characteristic vector of the reference item, and obtain the sub-weight corresponding to the reference item; based on the sub-weights corresponding to various reference items, obtain the weighting factor corresponding to the reference information.
[0129] Among them, the above-mentioned weight vector is obtained by training using several groups of sample data, and each group of sample data includes sample input data and first sample reference information and second sample reference information corresponding to the sample input data, the sample input data includes sample characters actually triggered by several consecutive sample key operations, and the last sample key operation among the several sample key operations is used as the sample current key operation, and the sample key operation before the sample current key operation among the several sample key operations is used as the sample historical key operation.
[0130] Among them, the above-mentioned weight vector acquisition step includes: the weight calculation module 73 is used to predict the first sample probability value of each preset character expected to be triggered by the current key operation of the sample based on the sample character actually triggered by the sample historical key operation, and predict the second sample probability value of each preset character expected to be triggered by the current key operation of the sample based on the relative position relationship between the operation position of the current key operation of the sample on the input interface and the key area of each preset character; based on the feature vectors and weight vectors of various reference items in the first reference information, obtain the first sample weight, and based on the feature vectors and weight vectors of various reference items in the second reference information, obtain the second sample weight; based on the sample weighting result of the first sample probability value and the second sample probability value of the first sample weight and the second sample weight, determine the predicted character predicted to be triggered by the current key operation of the sample; based on the prediction loss obtained by the difference between the sample character actually triggered by the current key operation of the sample and the predicted character predicted to be triggered, adjust the weight vectors of various reference items.
[0131] Among them, the above-mentioned sample weighted results include the weighted sample probability values of the sample's current key operation predicting the triggering of each preset character; among them, when the sample's current key operation has not been back-deleted, the weighted sample probability value corresponding to the sample character actually triggered by the sample's current key operation is negatively correlated with the predicted loss; when the sample's current key operation has been back-deleted, the weighted sample probability value corresponding to the sample character actually triggered by the sample's current key operation is positively correlated with the predicted loss.
[0132] Among them, the first prediction module 71 is used to predict the first probability value of each preset character expected to be triggered by the current key operation based on the character strings actually triggered by several historical key operations of the user before the current key operation, specifically including: counting the frequency value of each preset character triggered by the user, and counting the proportion value of the character string in each target character string input by the user; wherein the target character string is the same length as the character string; and taking the ratio between the frequency value and the proportion value corresponding to each preset character as the first probability value of the corresponding preset character.
[0133] Among them, the second prediction module 72 is used to predict the second probability value of the current key operation expected to trigger each preset character based on the relative position relationship between the operation position of the current key operation in the input interface and the key area of each preset character in the input interface, specifically including: based on whether the operation position is located in the core area of the key area of the preset character, and the distance between the operation position and the preset position of the key area of the preset character, obtaining the prediction value of the current key operation expected to trigger the corresponding preset character; normalizing the prediction value of the current key operation expected to trigger each preset character, to obtain the second probability value of the current key operation expected to trigger each preset character.
[0134] Among them, the second prediction module 72 is used to obtain the predicted value of the current key operation expected to trigger the corresponding preset character based on whether the operation position is located in the core area of the key area of the preset character, and the distance between the operation position and the preset position of the key area of the preset character, specifically including: when the operation position is located in the core area corresponding to the preset character, the predicted value of the current key operation expected to trigger the corresponding preset character is set to the preset value; when the operation position is not in the core area corresponding to the preset character, the predicted value of the current key operation expected to trigger the corresponding preset character is set to the distance corresponding to the operation position.
[0135] The center of the core area is the center of the button area, and the core area is smaller than the button area; and / or the preset position is the center position of the button area.
[0136] Among them, the above-mentioned first reference information includes at least one of the following reference items: the number of characters triggered by the continuous input operation to which the current key operation belongs, the user's age, the user's gender, and the application in which the user performs the current key operation; and / or, the above-mentioned second reference information includes at least the following reference items: the model of the input device.
[0137] See also Figure 8 , Figure 8 80 is a schematic diagram of a framework of an input device embodiment provided by the present application. The input device 80 includes a touch screen 81, a memory 82 and a processor 83. The touch screen 81 and the memory 82 are coupled to the processor 83. The touch screen 81 is used to display an input interface. The memory 82 stores program instructions. The processor 83 is used to execute the program instructions to implement the steps in any of the above-mentioned key input method embodiments. Specifically, the input device 80 may include, but is not limited to: a laptop computer, a mobile phone, a tablet computer, a self-service machine (such as a hospital reporting machine, a self-service violation inquiry machine, etc.), etc., which are not limited here.
[0138] Specifically, the processor 83 is used to control itself, the touch screen 81, and the memory 82 to implement the steps in any of the above-mentioned key input method embodiments. The processor 83 can also be called a CPU (Central Processing Unit). The processor 83 may be an integrated circuit chip with signal processing capabilities. The processor 83 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 83 can be implemented by an integrated circuit chip.
[0139] See also Fig. 9 , Fig. 9 The computer-readable storage medium 90 stores program instructions 91 that can be executed by a processor, and the program instructions 91 are used to implement the steps in any of the above key input method embodiments.
[0140] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0141] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0142] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0144] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0145] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0146] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A key input method, characterized in that: include: Based on character strings actually triggered by several historical key operations of the user before the current key operation, predict and obtain first probability values of respective preset characters expected to be triggered by the current key operation; Based on the relative position relationship between the operation position of the current key operation on the input interface and the key area of each preset character in the input interface, predicting a second probability value of the current key operation expected to trigger each preset character; Acquire a first weight based on first reference information related to the input habit of the user, and acquire a second weight based on second reference information related to the input device; Determining a target character actually triggered by the current key operation based on a weighted result of the first weight and the second weight on the first probability value and the second probability value; The acquiring of the second weight based on the first reference information related to the input habit of the user, or based on the second reference information related to the input device, includes: Extracting feature vectors of various reference items based on variable types of the various reference items in the reference information; Using the weight vectors of the various reference items respectively to weight the feature vectors of the reference items, to obtain weighting factors corresponding to the reference information; In which, when the reference information is the first reference information, the weighting factor is the first weight; and when the reference information is the second reference information, the weighting factor is the second weight.
2. The method according to claim 1, characterized in that The step of extracting feature vectors of various reference items based on the variable types of the various reference items in the reference information includes: When the variable type of the reference item is a numerical variable, the specific numerical value of the reference item is used as the feature vector of the reference item; And / or, when the variable type of the reference item is a categorical variable, one-hot encoding is performed based on the specific category of the reference item to obtain a feature vector of the reference item.
3. The method according to claim 1, characterized in that The number of elements contained in the feature vector and the weight vector of each reference item is the same; the weight vectors of the various reference items are used to weight the feature vectors of the reference items to obtain the weighting factors corresponding to the reference information, including: For each of the reference items, weighted summing is performed on the elements contained in the feature vector of the reference item using the elements contained in the weight vector of the reference item to obtain a sub-weight corresponding to the reference item; Based on the sub-weights respectively corresponding to the various reference items, a weighting factor corresponding to the reference information is obtained.
4. The method according to claim 1, characterized in that: The weight vector is obtained by training using several groups of sample data, and each group of sample data includes sample input data and first sample reference information and second sample reference information corresponding to the sample input data. The sample input data includes sample characters actually triggered by several consecutive sample key operations, and the last sample key operation among the several sample key operations is used as the sample current key operation, and the sample key operations before the sample current key operation among the several sample key operations are sample historical key operations.
5. The method according to claim 4, characterized in that The step of obtaining the weight vector comprises: Based on the sample characters actually triggered by the sample historical key operations, a first sample probability value of the sample current key operation expected to trigger each preset character is predicted, and based on the relative position relationship between the operation position of the sample current key operation on the input interface and the key area of each preset character, a second sample probability value of the sample current key operation expected to trigger each preset character is predicted; Obtaining a first sample weight based on the feature vectors and the weight vectors of various reference items in the first reference information, and obtaining a second sample weight based on the feature vectors and the weight vectors of various reference items in the second reference information; Determine a predicted character triggered by the current key operation prediction of the sample based on a sample weighting result of the first sample probability value and the second sample probability value by the first sample weight and the second sample weight; The weight vectors of the various reference items are adjusted based on the prediction loss obtained by the difference between the sample character actually triggered by the current key operation of the sample and the predicted character triggered by the prediction.
6. The method according to claim 5, characterized in that The sample weighted result includes the weighted sample probability value of the current key operation of the sample predicting triggering of each preset character; Among them, when the current key operation of the sample has not been deleted, the weighted sample probability value corresponding to the sample character actually triggered by the current key operation of the sample is negatively correlated with the predicted loss; when the current key operation of the sample has been deleted, the weighted sample probability value corresponding to the sample character actually triggered by the current key operation of the sample is positively correlated with the predicted loss.
7. The method according to claim 1, characterized in that Based on character strings actually triggered by several historical key operations of the user before the current key operation, predicting first probability values of respective preset characters expected to be triggered by the current key operation includes: Counting the frequency value of each preset character being triggered by the user, and counting the proportion value of the character string in each target character string input by the user; wherein the target character string is the same length as the character string; The ratio between the frequency value corresponding to each preset character and the proportion value is respectively used as the first probability value corresponding to the preset character.
8. The method according to claim 1, characterized in that: The predicting of obtaining a second probability value of the current key operation expected to trigger each preset character based on the relative position relationship between the operation position of the current key operation on the input interface and the key area of each preset character in the input interface includes: Based on whether the operation position is located in the core area of the key area of the preset character and the distance between the operation position and the preset position of the key area of the preset character, a predicted value of the preset character corresponding to the current key operation being expected to be triggered is obtained; The predicted values of the current key operation expected to trigger the respective preset characters are normalized to obtain second probability values of the current key operation expected to trigger the respective preset characters.
9. The method according to claim 8, characterized in that The step of obtaining a predicted value of the preset character that is expected to be triggered by the current key operation based on whether the operation position is located in the core area of the key area of the preset character and the distance between the operation position and the preset position of the key area of the preset character comprises: In the case where the operation position is located in the core area corresponding to the preset character, the predicted value of the preset character expected to be triggered by the current key operation is set to a preset value; In the case that the operation position is not in the core area corresponding to the preset character, the predicted value of the preset character corresponding to the current key operation is set to the distance corresponding to the operation position.
10. The method according to claim 8, characterized in that The center of the core area is the center of the key area, and the core area is smaller than the key area; And / or, the preset position is the center position of the button area.
11. The method according to claim 1, characterized in that: The first reference information includes at least one of the following reference items: the number of characters that have been triggered by the continuous input operation to which the current key operation belongs, the age of the user, the gender of the user, and the application in which the user performs the current key operation; And / or, the second reference information at least includes the following reference item: the model of the input device.
12. A key input device, characterized in that: include: A first prediction module, configured to predict, based on character strings actually triggered by a number of historical key operations by the user before the current key operation, a first probability value of each preset character expected to be triggered by the current key operation; A second prediction module is used to predict the second probability value of the current key operation expected to trigger each preset character based on the relative position relationship between the operation position of the current key operation on the input interface and the key area of each preset character in the input interface; A weight calculation module, configured to obtain a first weight based on first reference information related to the input habit of the user, and to obtain a second weight based on second reference information related to the input device; A character determination module, configured to determine a target character actually triggered by the current key operation based on a weighted result of the first weight and the second weight on the first probability value and the second probability value; The acquiring of the second weight based on the first reference information related to the input habit of the user, or based on the second reference information related to the input device, includes: Extracting feature vectors of various reference items based on variable types of the various reference items in the reference information; Using the weight vectors of the various reference items respectively to weight the feature vectors of the reference items, to obtain weighting factors corresponding to the reference information; In which, when the reference information is the first reference information, the weighting factor is the first weight; and when the reference information is the second reference information, the weighting factor is the second weight.
13. An input device, characterized in that: It includes a touch screen, a memory and a processor, the touch screen and the memory are coupled to the processor, the touch screen is used to display an input interface, the memory stores program instructions, and the processor is used to execute the program instructions to implement the key input method described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the key input method according to any one of claims 1 to 11.
