An input method, device, and electronic device

By using the sentence prediction model in the input method, obtaining the input sequence and outputting sentence candidates, the inefficiency problem caused by inputting in words in the existing input method is solved, and efficient input of directly input sentences is achieved.

CN113589949BActive Publication Date: 2025-08-01BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202010366780.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-30
Publication Date
2025-08-01
Estimated Expiration
2041-01-27

AI Technical Summary

Technical Problem

In the existing input method technology, users need to input in words during the input process, resulting in low input efficiency and inability to directly enter sentences, interrupting the user's input ideas.

Method used

By obtaining the input sequence of users input and inputting it into the sentence prediction model, the sentence prediction model outputs sentence candidates and presents them to the user to improve input efficiency.

Benefits of technology

Users can directly upload the sentence to the screen when entering the input sequence corresponding to some text in the sentence, improving the input efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113589949B_ABST
    Figure CN113589949B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide an input method, apparatus, and electronic device. Among them, the method includes: obtaining an input sequence input by a user in an input method; inputting the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model; and displaying the sentence candidates. Furthermore, when the user inputs a partial text of a sentence corresponding to the input sequence, the sentence can be directly sent to the screen, greatly improving the user's input efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of input methods, and particularly to an input method, an apparatus, and an electronic device. Background Art

[0002] With the development of computer technology, electronic devices such as mobile phones and tablet computers have become increasingly popular, bringing great convenience to people's lives, studies, and work. These electronic devices are usually installed with an input method application program (referred to as an input method), enabling users to use the input method for information input.

[0003] During the user input process, the input method predicts candidates that match the input sequence for the user to directly screen, so as to improve the user's input efficiency. For example, taking the input sequence as a pinyin sequence, when the user inputs the pinyin string "gaosuni", the input method will provide waiting options such as "tell you".

[0004] However, the basic unit of the user's expression habit is a sentence; based on the existing method of providing word candidates for input, the user can only input in units of words, resulting in the user's input thinking being often interrupted and the input efficiency being low. For example, if the content that the user needs to input is "tell you a thing", when the user inputs the pinyin "gaosuni" during the input process, the input method will give candidates corresponding to the input pinyin such as "tell you"; after the user screens "tell you", and continues to input "yigeshiqing", then the input method predicts the candidate "a thing", and the user screens "a thing" again, and then completes the input of the required content. Summary of the Invention

[0005] Embodiments of the present invention provide an input method to improve input efficiency.

[0006] Correspondingly, embodiments of the present invention further provide an input apparatus and an electronic device to ensure the implementation and application of the above method.

[0007] To solve the above problems, embodiments of the present invention disclose an input method, which specifically includes:

[0008] Obtain an input sequence input by a user in an input method; input the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model; and display the sentence candidates.

[0009] Optionally, the input information of the sentence prediction model further includes at least one of the following: context information, application environment information, and candidate words of the input sequence.

[0010] Optionally, when the input information of the sentence prediction model further includes previous context information, the step of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: inputting the input sequence and the previous context information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model.

[0011] Optionally, the step of inputting the input sequence and the previous context information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence and the previous context information to obtain the sentence candidates output by the sentence prediction model.

[0012] Optionally, the step of inputting the input sequence and the previous context information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the previous context information and output the screened sentence candidates.

[0013] Optionally, the step of inputting the input sequence and the previous context information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the previous context information to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the input sequence and output the screened sentence candidates.

[0014] Optionally, the input sequence includes: a first input sequence obtained after the current input in the current input cycle and a second input sequence before the current input in the current input cycle; the step of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction on the second input sequence to obtain multiple sentence candidates output by the sentence prediction model; using the sentence prediction model to screen the multiple sentence candidates according to the first input sequence and output the screened sentence candidates.

[0015] Optionally, when the input information of the sentence prediction model further includes application environment information, the step of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the application environment information and output the screened sentence candidates.

[0016] Optionally, the method further includes: when there are multiple sentence candidates output by the sentence prediction model, obtaining input association information, where the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the opposite-end user, information of the local user, and historical behavior information of the local user; using the input association information to re-rank the multiple sentence candidates.

[0017] Optionally, the input method includes a client and a server. The step of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: the client generating a long sentence prediction request according to the input sequence and sending the long sentence prediction request to the server; the server obtaining the input sequence from the long sentence prediction request, inputting the input sequence into the sentence prediction model, obtaining the sentence candidates output by the sentence prediction model, and returning them to the client.

[0018] Optionally, the input sequence includes the input sequence input in the current input cycle. The method further includes: the client determining the total length of the input sequence input by the user in the current input cycle; determining whether the total length of the input sequence input by the user in the current input cycle reaches a preset length; if the total length of the input sequence input by the user in the current input cycle does not reach the preset length, then performing the step of generating a long sentence prediction request according to the input sequence.

[0019] Optionally, the method further includes: the client caching the sentence candidates returned by the server in units of input cycles; where the sentence candidates include the sentence candidates returned by the server due to timeout.

[0020] Optionally, the input sequence includes the input sequence input in the current input cycle, and the input sequence input in the current input cycle includes: an input sequence input this time within the current cycle;

[0021] The method further includes: the client determining whether an input sequence input by the user this time matches the currently displayed sentence candidates; when the input sequence input by the user this time does not match the currently displayed sentence candidates, performing the step of generating a long sentence prediction request according to the input sequence; the displaying the sentence candidates includes: when the input sequence input by the user this time matches the currently displayed sentence candidates, continuing to display the currently displayed sentence candidates.

[0022] Optionally, the method further includes: performing other type of predictions according to the input sequence to obtain other type of prediction results, where the other type of prediction results includes at least one of the following: person name prediction result, character-by-character proofreading prediction result, local cloud replacement prediction result, cloud input prediction result, and expression prediction result;

[0023] The displaying of the sentence candidates includes: displaying the sentence candidates according to the priorities of the prediction results of other types and the sentence candidates.

[0024] Optionally, displaying the sentence candidate includes: splicing the content in the edit box with the sentence candidate to obtain a corresponding splicing result; and displaying the splicing result.

[0025] An embodiment of the present invention also discloses an input device, which specifically includes: an acquisition module for acquiring an input sequence input by a user in an input method; a determination module for inputting the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model; and a display module for displaying the sentence candidates.

[0026] Optionally, the input information of the sentence prediction model further includes at least one of the following: context information, application environment information, and candidate words of the input sequence.

[0027] Optionally, when the input information of the sentence prediction model also includes context information, the determination module includes: a first candidate output submodule, used to input the input sequence and context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0028] Optionally, the first candidate output submodule includes: a first prediction unit, configured to use the sentence prediction model to perform prediction based on the input sequence and the above context information to obtain sentence candidates output by the sentence prediction model.

[0029] Optionally, the first candidate output submodule includes: a second prediction unit, used to use the sentence prediction model to predict based on the input sequence to obtain multiple sentence candidates; a first output unit, used to use the sentence prediction model to filter the multiple sentence candidates according to the above information, and output the filtered sentence candidates.

[0030] Optionally, the first candidate output submodule includes: a third prediction unit, used to use the sentence prediction model to make predictions based on the above information to obtain multiple sentence candidates; a second output unit, used to use the sentence prediction model to filter the multiple sentence candidates according to the input sequence, and output the filtered sentence candidates.

[0031] Optionally, the input sequence includes: a first input sequence obtained after this input within the current input cycle and a second input sequence before this input within the current input cycle; the determining module includes: a first candidate prediction sub-module, configured to use the sentence prediction model to predict the second input sequence to obtain multiple sentence candidates output by the sentence prediction model; a second candidate output sub-module, configured to use the sentence prediction model to screen the multiple sentence candidates according to the first input sequence and output the screened sentence candidates.

[0032] Optionally, when the input information of the sentence prediction model further includes application environment information, the determining module includes: a second candidate prediction sub-module, configured to use the sentence prediction model to perform prediction based on the input sequence to obtain multiple sentence candidates; a third candidate output sub-module, configured to use the sentence prediction model to screen the multiple sentence candidates according to the application environment information and output the screened sentence candidates.

[0033] Optionally, the apparatus further includes: an association information acquisition module, configured to, when there are multiple sentence candidates output by the sentence prediction model, acquire input association information, where the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the peer user, information of the local user, and historical behavior information of the local user; a sorting module, configured to re-sort the multiple sentence candidates by using the input association information.

[0034] Optionally, the input method includes a client and a server, and the determining module includes: a sending sub-module, configured to call the client to generate a long sentence prediction request according to the input sequence and send the long sentence prediction request to the server; a third candidate prediction sub-module, configured to call the server to obtain the input sequence from the long sentence prediction request, input the input sequence into the sentence prediction model, obtain the sentence candidates output by the sentence prediction model, and return them to the client.

[0035] Optionally, the input sequence includes the input sequence input in the current input cycle, and the apparatus further includes: a length determination module, configured to call the client to determine the total length of the input sequence input by the user in the current input cycle; a judgment module, configured to judge whether the total length of the input sequence input by the user in the current input cycle reaches a preset length; the sending sub-module, configured to, if the total length of the input sequence input by the user in the current input cycle does not reach the preset length, execute the step of calling the client to generate a long sentence prediction request according to the input sequence and sending the long sentence prediction request to the server.

[0036] Optionally, the device further includes: a caching module, configured to call the client to cache the sentence candidates returned by the server in units of input cycles; wherein, the sentence candidates include the sentence candidates returned by the server with timeout.

[0037] Optionally, the input sequence includes: the input sequence input in the current input cycle, and the input sequence input in the current input cycle includes: an input sequence input in this input in the current cycle; the device further includes: a matching module, configured to call the client to determine whether an input sequence input by the user this time matches the currently displayed sentence candidate; the sending sub-module is configured to, when an input sequence input by the user this time does not match the currently displayed sentence candidate, execute the step of calling the client to generate a long sentence prediction request according to the input sequence and sending the long sentence prediction request to the server; the display module includes: a first candidate display sub-module, configured to continue to display the currently displayed sentence candidate when an input sequence input by the user this time matches the currently displayed sentence candidate.

[0038] Optionally, the device further includes: an other type prediction module, configured to perform other type predictions according to the input sequence to obtain other type prediction results, wherein the other type prediction results include at least one of the following: a person name prediction result, a literal proofreading prediction result, a local cloud replacement prediction result, a cloud input prediction result, and an expression prediction result; the display module includes: a second candidate display sub-module, configured to display the sentence candidates according to the priorities of the respective other type prediction results and the sentence candidates.

[0039] Optionally, the display module includes: a splicing sub-module, configured to splice the content in the edit box with the sentence candidate to obtain a corresponding splicing result; a result display sub-module, configured to display the splicing result.

[0040] An embodiment of the present invention also discloses a readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the input method as described in any one of the embodiments of the present invention.

[0041] An embodiment of the present invention also discloses an electronic device, including a memory, and one or more programs, wherein one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include instructions for performing the following operations: obtaining an input sequence input by a user in an input method; inputting the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model; displaying the sentence candidates.

[0042] Optionally, the input information of the sentence prediction model further includes at least one of the following: previous context information, application environment information, and candidate words of the input sequence.

[0043] Optionally, when the input information of the sentence prediction model further includes previous context information, inputting the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0044] Optionally, inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence and the previous context information to obtain sentence candidates output by the sentence prediction model.

[0045] Optionally, inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the previous context information and output the screened sentence candidates.

[0046] Optionally, inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the previous context information to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the input sequence and output the screened sentence candidates.

[0047] Optionally, the input sequence includes: a first input sequence obtained after the current input in the current input cycle and a second input sequence before the current input in the current input cycle; inputting the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction on the second input sequence to obtain multiple sentence candidates output by the sentence prediction model; using the sentence prediction model to screen the multiple sentence candidates according to the first input sequence and output the screened sentence candidates.

[0048] Optionally, when the input information of the sentence prediction model further includes application environment information, inputting the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the application environment information and output the screened sentence candidates.

[0049] Optionally, it further includes instructions for performing the following operations: when there are multiple sentence candidates output by the sentence prediction model, obtain input association information, where the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the peer user, information of the local user, and historical behavior information of the local user; and reorder the multiple sentence candidates by using the input association information.

[0050] Optionally, the step of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: generating a long sentence prediction request according to the input sequence, and sending the long sentence prediction request to the server; receiving the sentence candidates returned by the server, where the server obtains the input sequence from the long sentence prediction request, inputs the input sequence into the sentence prediction model, and returns the sentence candidates output by the sentence prediction model.

[0051] Optionally, the input sequence includes the input sequence input in the current input cycle, and it further includes instructions for performing the following operations: determining the total length of the input sequence input by the user in the current input cycle; determining whether the total length of the input sequence input by the user in the current input cycle reaches a preset length; if the total length of the input sequence input by the user in the current input cycle does not reach the preset length, then execute the step of generating a long sentence prediction request according to the input sequence.

[0052] Optionally, it further includes instructions for performing the following operations: caching the sentence candidates returned by the server in units of input cycles; where the sentence candidates include the sentence candidates returned by the server due to timeout.

[0053] Optionally, the input sequence includes the input sequence input in the current input cycle, and the input sequence input in the current input cycle includes: an input sequence input in this input in the current cycle; and it further includes instructions for performing the following operations: determining whether an input sequence input by the user in this input matches the currently displayed sentence candidates; when the input sequence input by the user in this input does not match the currently displayed sentence candidates, execute the step of generating a long sentence prediction request according to the input sequence; and the step of displaying the sentence candidates includes: when the input sequence input by the user in this input matches the currently displayed sentence candidates, continue to display the currently displayed sentence candidates.

[0054] Optionally, it further includes instructions for performing the following operations: performing other types of predictions based on the input sequence to obtain other types of prediction results, where the other types of prediction results include at least one of the following: person name prediction results, literal proofreading prediction results, local cloud replacement prediction results, cloud input prediction results, and emoji prediction results; the displaying of the sentence candidates includes: displaying the sentence candidates according to the priorities of the respective other types of prediction results and the sentence candidates.

[0055] Optionally, the displaying of the sentence candidates includes: splicing the content of the edit box with the sentence candidates to obtain a corresponding splicing result; displaying the splicing result.

[0056] The embodiments of the present invention have the following advantages:

[0057] In the embodiments of the present invention, after the input method obtains the input sequence input by the user, it can input the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model, and display the sentence candidates; thereby enabling the user to directly screen the sentence even when only part of the text in the input sentence corresponds to the input sequence, greatly improving the input efficiency of the user. Description of the Drawings

[0058] Figure 1 is a flowchart of the steps of an embodiment of an input method of the present invention;

[0059] Figure 2 is a flowchart of the steps of an alternative embodiment of an input method of the present invention;

[0060] Figure 3 is a flowchart of the steps of another alternative embodiment of an input method of the present invention;

[0061] Figure 4 is a flowchart of the steps of another alternative embodiment of an input method of the present invention;

[0062] Figure 5 is a flowchart of the steps of another alternative embodiment of an input method of the present invention;

[0063] Figure 6 is a flowchart of the steps of another alternative embodiment of an input method of the present invention;

[0064] Figure 7 is a flowchart of the steps of another alternative embodiment of an input method of the present invention;

[0065] Figure 8 is a flowchart of the steps of another alternative embodiment of an input method of the present invention;

[0066] Figure 9It is a flowchart of steps of another alternative embodiment of the input method of the present invention;

[0067] Figure 10a It is a flowchart of steps of another alternative embodiment of the input method of the present invention;

[0068] Figure 10b It is a schematic diagram of a sentence candidate display interface according to an embodiment of the present invention;

[0069] Figure 10c It is a schematic diagram of another sentence candidate display interface according to an embodiment of the present invention;

[0070] Figure 10d It is a schematic diagram of a splicing display interface according to an embodiment of the present invention;

[0071] Figure 11 It is a block diagram of the structure of an input device embodiment of the present invention;

[0072] Figure 12 It is a block diagram of the structure of an alternative embodiment of the input device of the present invention;

[0073] Figure 13 A block diagram of the structure of an electronic device for input according to an exemplary embodiment;

[0074] Figure 14 It is a schematic diagram of the structure of an electronic device for input according to another exemplary embodiment of the present invention. Detailed implementation manners

[0075] To make the above objects, features and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.

[0076] Refer to Figure 1 , which shows a flowchart of steps of an input method embodiment of the present invention, and specifically may include the following steps:

[0077] Step 102, obtain the input sequence input by the user in the input method.

[0078] In the embodiment of the present invention, when the user inputs the input sequence, long sentence prediction can be performed based on the input sequence to generate corresponding sentence candidates.

[0079] Among them, during the process of the user using the input method to input, the input sequence input by the user can be obtained; then, based on the obtained input sequence, the corresponding sentence candidates can be predicted. Among them, the input sequence can include various types, such as a pinyin sequence, a stroke sequence, a foreign language string, etc., and the embodiment of the present invention does not limit this. The input sequence can be a single code or multiple codes, and the embodiment of the present invention does not limit this.

[0080] Step 104: Input the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0081] In an embodiment of the present invention, a sentence prediction model for predicting sentence candidates can be pre-trained; then, the sentence prediction model is used to perform long sentence prediction based on the obtained input sequence to determine corresponding sentence candidates.

[0082] In an example of the present invention, the obtained input sequence can be directly input into the trained sentence prediction model, and the sentence prediction model makes a prediction based on the input sequence and outputs corresponding sentence candidates. Among them, the number of sentence candidates output by the sentence prediction model can be one or more, and the embodiments of the present invention do not limit this. In addition, the sentence candidates can be Chinese sentences or English sentences; they correspond to the language of the input sequence, and the embodiments of the present invention do not limit this.

[0083] Step 106: Display the sentence candidates.

[0084] In an embodiment of the present invention, when the sentence prediction model outputs sentence candidates, it can also output scores (such as probabilities) corresponding to the sentence candidates. Furthermore, when the sentence prediction model outputs multiple sentence candidates, the sentence candidate items can be sorted according to the scores corresponding to the sentence candidates. Then, according to the sorted results, the sentence candidate items are displayed. For example, the sentence candidate with the highest score can be displayed, and the embodiments of the present invention do not limit this. Furthermore, when some text in the input sentence corresponds to the input sequence, the user can directly send the sentence to the screen, which can improve the user's input efficiency.

[0085] It should be noted that the embodiments of the present invention do not limit the length of the input sequence. Whether the input sequence is short or long, the embodiments of the present invention can input the input sequence into the sentence prediction model for prediction to obtain sentence candidates.

[0086] As an example of the present invention, assume that the content in the edit box is: "The information has been received," and the input sequence obtained from the user input is the pinyin sequence: "wokanhou". Input the pinyin sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model; further, the sentence prediction model can also output scores corresponding to the sentence candidates. For example, it outputs: "I will reply to you after reading" (sentence candidate) -0.9 (score), "I will give my opinion after reading" (sentence candidate) -0.8 (score), "I will talk about it later after reading" (sentence candidate) -0.6 (score). Then, these three sentence candidates can be displayed according to the scores of these three sentence candidates.

[0087] As another example of the present invention, assume that the content in the edit box is: "Tell you", and the input sequence obtained from the user input is the pinyin sequence: "yige". Input the pinyin sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model; further, the sentence prediction model can also output the scores corresponding to the sentence candidates. For example, the output is: "Tell you a thing" (sentence candidate) -0.8 (score), "Tell you a news" (sentence candidate) -0.7 (score), "Tell you a good news" (sentence candidate) -0.9 (score). Then these three sentence candidates can be displayed according to their candidate scores.

[0088] As another example of the present invention, assume that there is no content in the edit box, and the input sequence obtained from the user input is the pinyin sequence: "fenxiangdao". Input the pinyin sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model; further, the sentence prediction model can also output the scores corresponding to the sentence candidates. For example, the output is: "Share to Moments" (sentence candidate) -9.5 (score), "Share to ** platform" (sentence candidate) -0.8 (score). Then these two sentence candidates can be displayed according to their candidate scores.

[0089] In summary, in the embodiment of the present invention, after the input method obtains the input sequence input by the user, it can input the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model, and display the sentence candidates; thereby enabling the user to directly screen the sentence even when only part of the text in the sentence corresponds to the input sequence, greatly improving the user's input efficiency.

[0090] In an optional embodiment of the present invention, the sentence prediction model can perform prediction at the granularity of a single sentence or at the granularity of a complex sentence; the embodiment of the present invention does not limit this. This makes the sentence candidates provided to the user more comprehensive and brings a better input experience to the user. The single sentence can refer to a sentence composed of phrases or single words and cannot be further analyzed into clause; the clause is a grammatical unit that is structurally similar to a single sentence but without a complete intonation. The complex sentence refers to a sentence composed of two or more clauses that are closely related in meaning and structurally independent of each other. Furthermore, the embodiment of the present invention can perform prediction on a complete sentence including multiple clauses with punctuation marks in the sentence.

[0091] In an optional embodiment of the present invention, the information related to the user input and the input sequence input by the user can be input into the sentence prediction model simultaneously; so that the sentence prediction model can predict more accurate sentence candidates.

[0092] In an example of the present invention, the input information of the sentence prediction model further includes at least one of the following: previous text information, application environment information, and candidate words of the input sequence; of course, other information such as local user information can also be included, and the embodiments of the present invention do not limit this.

[0093] The following takes the sentence prediction model predicting based on the input sequence and the previous text information as an example for illustration.

[0094] In an optional embodiment of the present invention, a method of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: inputting the input sequence and the previous text information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model.

[0095] Among them, the previous text information includes interaction information and / or the content in the edit box, and the interaction information may refer to the information already sent between the local end and the opposite end. When the previous text information only contains interaction information, the input method can realize prediction at the beginning of the sentence input by the user this time; when the previous text information includes interaction information and the content in the edit box, or the previous text information only includes the content in the edit box, the input method can realize prediction in the middle or at the end of the sentence input by the user this time.

[0096] Among them, the sentence prediction model can be a statistical model (ngram), or a retrieval model (fasttext), or a generative model (Transformer, LSTM (Long Short-Term Memory)), and the present invention does not limit this.

[0097] Referring to Figure 2 , a step flowchart of an optional embodiment of an input method of the present invention is shown, which may specifically include the following steps:

[0098] Step 202, obtain the input sequence and the previous text information input by the user in the input method.

[0099] In the embodiments of the present invention, during the user's input process, the input sequence input by the user and the previous text information can be obtained. Then, the obtained input sequence and previous text information are used as the input of the sentence prediction model to determine the sentence candidates.

[0100] Among them, a method of inputting the input sequence and the previous text information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model can refer to step 204:

[0101] Step 204, use the sentence prediction model to predict based on the input sequence and the previous text information to obtain the sentence candidates output by the sentence prediction model.

[0102] In an example of the present invention, the sentence prediction model may be a statistical model; the frequency of each sentence can be pre - statistically obtained under the conditions of specific context information and the input sequence. Then, during the process of predicting using the sentence prediction model, both the input sequence and the context information can be input into the sentence prediction model, and the sentence prediction model can look up the frequencies of each sentence under the conditions of the input sequence and the context information obtained this time. Then, the sentences with frequencies greater than the preset threshold are used as sentence candidates. The preset threshold can be set according to requirements, and the embodiments of the present invention do not limit this.

[0103] In another example of the present invention, the sentence prediction model may be a deep - learning model. One way can be to input both the input sequence and the context information into the sentence prediction model, and the sentence prediction model extracts the features corresponding to the input sequence and the context information; then, the sentence prediction model makes a prediction based on the extracted features and outputs the corresponding sentence candidates. Among them, the input sequence and the context information can be input into the sentence prediction model as information in two dimensions respectively; or they can be input into the sentence prediction model as information in one dimension, which can be set according to requirements, and the embodiments of the present invention do not limit this.

[0104] In another example of the present invention, after inputting both the input sequence and the context information into the sentence prediction model, the input sequence can be converted into corresponding word candidates; and the word candidates are concatenated with the context information. The sentence prediction model then makes a prediction based on the concatenated information and outputs a plurality of corresponding sentence candidates.

[0105] Step 206: Display the sentence candidates.

[0106] In an example of the present invention, after the sentence can be displayed in the designated area of the input method, where the designated area can be set according to requirements, such as the upper - right area of the input method, and the embodiments of the present invention do not limit this.

[0107] In summary, in the embodiments of the present invention, the input sequence and the context information input by the user in the input method can be obtained, and then the sentence prediction model is used to make a prediction based on the input sequence and the context information to obtain the sentence candidates output by the sentence prediction model; furthermore, by jointly inputting the input sequence and the context information to predict the sentence candidates, the accuracy of the determined sentence candidates can be improved. Then, the predicted sentence candidates are displayed, thereby further improving the input efficiency of the user.

[0108] Referring to Figure 3 , a step - flow diagram of an alternative embodiment of another input method of the present invention is shown, which may specifically include the following steps:

[0109] Step 302: Obtain the input sequence and the context information input by the user in the input method.

[0110] This step 302 is similar to the above step 202 and will not be elaborated here.

[0111] Among them, a way to input the input sequence and the above context information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model can refer to steps 304 - 306:

[0112] Step 304: Use the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates.

[0113] Step 306: Use the sentence prediction model to screen the multiple sentence candidates according to the above context information and output the screened sentence candidates.

[0114] In the embodiment of the present invention, after the input sequence and the above context information are both input into the sentence prediction model, the sentence prediction model can first make a prediction on the input sequence to obtain multiple sentence candidates. Then, the sentence prediction model screens the multiple sentence candidates predicted based on the input sequence according to the above context information and outputs the screened sentence candidates.

[0115] Step 308: Display the sentence candidates.

[0116] This step 308 is similar to the above step 206 and will not be elaborated here.

[0117] In summary, in the embodiment of the present invention, the input sequence and the above context information input by the user in the input method can be obtained, and then the sentence prediction model is used to make a prediction based on the input sequence to obtain multiple sentence candidates, and then the sentence prediction model is used to screen the multiple sentence candidates according to the above context information and output the screened sentence candidates; thus, the sentence candidates are first predicted through the input sequence and then screened through the above context information, which can improve the accuracy of the determined sentence candidates. Then, the screened sentence candidates are displayed, which can further improve the input efficiency of the user.

[0118] Refer to Figure 4 , which shows the step flow chart of another optional embodiment of the input method of the present invention, and specifically may include the following steps:

[0119] Step 402: Obtain the input sequence and the above context information input by the user in the input method.

[0120] This step 402 is similar to the above step 202 and will not be elaborated here.

[0121] Among them, a way to input the input sequence and the above context information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model can refer to steps 404 - 406:

[0122] Step 404: Use the sentence prediction model to make a prediction based on the above-mentioned information, and obtain multiple sentence candidates.

[0123] Step 406: Use the sentence prediction model to screen the multiple sentence candidates according to the input sequence, and output the screened sentence candidates.

[0124] In the embodiment of the present invention, after both the input sequence and the above-mentioned information are input into the sentence prediction model, the sentence prediction model can predict the above-mentioned information to obtain multiple sentence candidates. Then, the sentence prediction model screens the multiple sentence candidates predicted based on the above-mentioned information according to the input sequence, and outputs the screened sentence candidates.

[0125] Among them, it can be that after the sentence prediction model inputs the above-mentioned information and outputs complete sentence candidates, the input sequence is used for screening. It can also be that when the sentence prediction model makes a prediction at each moment, the input sequence is used to screen the preset word candidates to obtain a candidate word set; then X most likely words are selected from the candidate word set. Then, the X words selected at this moment are output, and based on these X words, the X words predicted at the previous moment, and the above-mentioned information, the X most likely words at the next moment are predicted; until the end of the sentence is predicted. Then, the X words output at each moment are concatenated to obtain X sentence candidates; where X is a positive integer. The embodiment of the present invention does not limit the method of using the input sequence to screen multiple sentence candidates predicted based on the above-mentioned information.

[0126] Step 408: Display the sentence candidates.

[0127] This step 408 is similar to the above step 206 and will not be elaborated here.

[0128] In summary, in the embodiment of the present invention, the input sequence and the above-mentioned information input by the user in the input method can be obtained, and then the sentence prediction model is used to make a prediction based on the above-mentioned information to obtain multiple sentence candidates, and then the sentence prediction model is used to screen the multiple sentence candidates according to the input sequence, and output the screened sentence candidates; furthermore, by first using the input sequence to predict sentence candidates and then using the above-mentioned information to screen the sentence candidates, the accuracy of the determined sentence candidates can be improved. Then, the screened sentence candidates are displayed, which can further improve the input efficiency of the user.

[0129] The following takes the sentence prediction model making a prediction based on the input sequence and application environment information as an example for illustration.

[0130] Refer to Figure 5 , which shows the step flowchart of another optional embodiment of the input method of the present invention.

[0131] Step 502: Obtain the input sequence entered by the user in the input method and the application environment information.

[0132] This step 502 is similar to the above step 202 and will not be elaborated here.

[0133] Among them, the application environment information can include various types, such as the type of third-party application that currently invokes the input method, such as instant messaging, music, video, etc.; location information, weather information, time information, etc. The embodiments of the present invention do not limit this.

[0134] Among them, a method of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model can refer to steps 504 - step 506:

[0135] Step 504: Use the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates.

[0136] Step 506: Use the sentence prediction model to screen the multiple sentence candidates according to the application environment information and output the screened sentence candidates.

[0137] In the embodiments of the present invention, after both the input sequence and the application environment information are input into the sentence prediction model, the sentence prediction model can make a prediction on the input sequence to obtain multiple sentence candidates. Then, the sentence prediction model screens the multiple sentence candidates predicted based on the input sequence according to the application environment information and outputs the screened sentence candidates.

[0138] Step 508: Display the sentence candidates.

[0139] This step 508 is similar to the above step 206 and will not be elaborated here.

[0140] In summary, in the embodiments of the present invention, the input sequence entered by the user in the input method and the application environment information can be obtained, and then the sentence prediction model is used to make a prediction based on the input sequence to obtain multiple sentence candidates. Then, the sentence prediction model is used to screen the multiple sentence candidates according to the application environment information and output the screened sentence candidates, and the screened sentence candidates are displayed; thereby, the sentence candidates are determined by combining the input sequence and the application environment information, so as to improve the accuracy of the determined sentence candidates and further improve the input efficiency of the user.

[0141] In an optional embodiment of the present invention, after obtaining the input sequence, the input sequence can be converted into candidate words of the input sequence; then the input sequence and the candidate words of the input sequence are input into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model.

[0142] In an alternative embodiment of the present invention, in an input cycle, a user may input an input sequence including multiple encodings; at this time, the input sequence input later by the user can be used to screen the sentence candidates of the input sequence input earlier by the user, so as to save the computing resources of the sentence prediction model.

[0143] Wherein, the input duration between two adjacent screenings can be referred to as an input cycle.

[0144] Refer to Figure 6 , which shows a step flowchart of another alternative embodiment of the input method of the present invention.

[0145] Step 602, obtain the input sequence input by the user in the input method; wherein, the input sequence includes: a first input sequence obtained after the current input in the current input cycle and a second input sequence before the current input in the current input cycle.

[0146] In an embodiment of the present invention, after the user inputs a single encoding in an input cycle, the input method can obtain a new input sequence including multiple encodings; the input sequence can be composed of a single encoding input by the user in the current input in the input cycle and all the encodings input by the user earlier in the input cycle. Wherein, for the convenience of subsequent description, the first input sequence obtained after the current input in the current input cycle and the second input sequence before the current input in the current input cycle can be defined; wherein, the second input sequence before the current input in the current input cycle can refer to the second input sequence obtained after any previous input in the current cycle.

[0147] Then, the first input sequence and the second input sequence can be input into the sentence prediction model to determine sentence candidates. Among them, a way to input the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model can refer to steps 604-step 606:

[0148] Step 604, use the sentence prediction model to predict the second input sequence to obtain multiple sentence candidates output by the sentence prediction model.

[0149] Step 606, use the sentence prediction model to screen the multiple sentence candidates according to the first input sequence and output the screened sentence candidates.

[0150] In the embodiments of the present invention, after obtaining the second input sequence, the sentence prediction model can first predict the second input sequence to determine a corresponding plurality of sentence candidates. Then, after obtaining the first input sequence, the sentence prediction model uses the first input sequence to screen the plurality of sentence candidates predicted based on the second input sequence; finally, the screened sentence candidates are output.

[0151] Step 608: Display the sentence candidates.

[0152] This step 608 is similar to the above step 206 and will not be elaborated here.

[0153] In summary, in the embodiments of the present invention, an input sequence input by a user in an input method can be obtained, where the input sequence includes: a first input sequence obtained after the current input in the current input cycle and a second input sequence obtained before the current input in the current input cycle; then the sentence prediction model is used to predict the second input sequence to obtain a plurality of sentence candidates output by the sentence prediction model, and then the sentence prediction model is used to screen the plurality of sentence candidates according to the first input sequence, output the screened sentence candidates, and display the output candidates; furthermore, the input sequence input by the user later can be used to screen the sentence candidates of the input sequence input by the user earlier, saving the computing resources of the sentence prediction model; and it can also improve the accuracy of sentence prediction.

[0154] The above method for determining sentence candidates is to input the input sequence, and at least one of the above text information, application environment information, and candidate words of the input sequence into the sentence prediction model to determine sentence candidates. Since the information input into the sentence prediction model for predicting sentence candidates is different, and after input into the sentence prediction model, the processing methods of the sentence prediction model are different; therefore, the accuracy of using the above different prediction models may be different. Therefore, in an embodiment of the present invention, after obtaining sentence candidates by using the above various methods, relatively comprehensive input association information can be used to reorder all sentence candidates; so that the sorting result of the sentence candidates is more suitable for the current scenario and better meets the user's needs.

[0155] Refer to Figure 7 , which shows a flowchart of steps of another alternative embodiment of the input method of the present invention.

[0156] Step 702: Obtain an input sequence input by a user in an input method.

[0157] Step 704: Input the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model, where the sentence candidates include a plurality of them.

[0158] Among them, multiple ones of the above steps 202 - step 206, step 302 - step 308, step 402 - step 408, step 502 - step 508, and step 602 - step 608 can be used to determine sentence candidates.

[0159] Step 706, obtain input association information, where the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the opposite - end user, information of the local - end user, and historical behavior information of the local - end user.

[0160] Step 708, use the input association information to re - rank multiple sentence candidates.

[0161] In an example of the present invention, a ranking model can be pre - trained, and then the trained ranking model is used to re - rank each sentence candidate. Among them, input association information can be obtained, and then the input association information and each sentence candidate are input into the ranking model; the ranking model scores each sentence candidate based on the input association information to determine the ranking scores corresponding to each sentence candidate. Among them, input association information in multiple dimensions can be obtained, which can include: context information, input environment information, candidate words of the input sequence, application scenario information, information of the opposite - end user, information of the local - end user, and historical behavior information of the local - end user. Of course, other input - related information can also be included, and the embodiments of the present invention do not limit this.

[0162] Then, the candidates corresponding to each path can be ranked according to the ranking scores, and the ranking results of each sentence candidate are output. Of course, the ranking model can also directly output the ranking scores of each sentence candidate, and then other processing modules rank each sentence candidate according to the ranking scores of each sentence candidate to determine the corresponding ranking results.

[0163] In addition, in the embodiments of the present invention, other information associated with predicting sentence candidates can also be used to re - rank each sentence candidate; for example, when the current scenario is a chat scenario, information of the opposite - end user, information of the local - end user, etc. can be obtained, and the embodiments of the present invention do not limit this.

[0164] Step 708, display the sentence candidates according to the re - ranking results.

[0165] In summary, in the embodiments of the present invention, after the input sequence is input into the sentence prediction model and multiple sentence candidates output by the sentence prediction model are obtained, the above - mentioned information, application environment information, and candidate words of the input sequence can be used to re - rank the multiple sentence candidates; furthermore, by comprehensively using information to re - rank the sentence candidates determined by various methods, the ranking results of the sentence candidates are more in line with the current scenario and better meet the user's needs; thereby further improving the user input efficiency and enhancing the user experience.

[0166] In an embodiment of the present invention, the input method may include a client and a server; the sentence prediction model may be deployed on the client, and the client determines sentence candidates corresponding to the input sequence. Of course, the sentence prediction model may also be deployed on the server, and the server determines sentence candidates corresponding to the input sequence.

[0167] The following takes the case where the sentence prediction model is deployed on the server as an example for illustration.

[0168] Refer to Figure 8 , which shows a step flowchart of another alternative embodiment of the input method of the present invention.

[0169] Step 802, the client obtains the input sequence input by the user in the input method.

[0170] Step 804, the client generates a long sentence prediction request according to the input sequence, and sends the long sentence prediction request to the server.

[0171] In an embodiment of the present invention, during the user's input, the client can obtain the input sequence input by the user; then generate a long sentence prediction request according to the input sequence, and send the long sentence prediction request to the server to request the server to determine sentence candidates and return them.

[0172] In an example of the present invention, when the client detects that the user inputs a single code each time (that is, when detecting that the user presses a key of a certain code), the client may use the input sequence input by the user in the current input cycle to generate a long sentence prediction request and send it to the server.

[0173] In another example of the present invention, since when the user inputs a Chinese character / word, the user may continuously input all the codes that make up this Chinese character (such as all the pinyin of a Chinese character, or all the characters of a word); therefore, after detecting that the user inputs the complete code corresponding to a Chinese character or word, the input sequence input by the user in the current input cycle can be used to generate a long sentence prediction request and send it to the server, so as to reduce the number of transmissions and reduce the burden on the server.

[0174] In another example of the present invention, if after detecting the set time after the user inputs a single code and no single code input by the user in the next step is detected, the input sequence input by the user in the current input cycle can be used to generate a long sentence prediction request and send it to the server.

[0175] Step 806, the server obtains the input sequence from the long sentence prediction request, inputs the input sequence into the sentence prediction model, obtains the sentence candidates output by the sentence prediction model and returns them to the client.

[0176] After receiving the long sentence prediction request, the server can obtain the input sequence from the long sentence prediction request, input the input sequence into the sentence prediction model, obtain the sentence candidates output by the sentence prediction model, and return them to the client. This is similar to the above method for determining sentence candidates and will not be elaborated here.

[0177] Step 808, the client displays the sentence candidates.

[0178] In summary, in the embodiments of the present invention, after the client obtains the input sequence input by the user, it can generate a long sentence prediction request according to the input sequence and send the long sentence prediction request to the server; then the server obtains the input sequence from the long sentence prediction request, inputs the input sequence into the sentence prediction model, obtains the sentence candidates output by the sentence prediction model and returns them to the client, and the client displays the sentence candidates; thereby reducing the computing pressure of the client and saving the storage space of the client.

[0179] In the embodiments of the present invention, the long sentence prediction can be performed based on the word candidates corresponding to the input sequence input by the user in the current input cycle (which can include single characters, words, words, English phrases, etc.). When the input sequence input by the user in the current input cycle is relatively long, due to the decrease in the accuracy of the word candidates corresponding to the input sequence input by the user in the current input cycle, correspondingly, the accuracy of the long sentence prediction will also decrease. Therefore, when the input sequence input in the current input cycle is relatively long, no cloud sending is performed; while when the input sequence input in the current input cycle is relatively short, it is judged whether to send cloud; thereby reducing the number of cloud sending times and reducing the server load.

[0180] Refer to Figure 9 , which shows the step flowchart of another optional embodiment of the input method of the present invention.

[0181] Step 902, the client obtains the input sequence input by the user in the input method.

[0182] Step 904, the client determines the total length of the input sequence input by the user in the current input cycle.

[0183] Step 906, the client determines whether the total length of the input sequence input by the user in the current input cycle reaches a preset length.

[0184] In an embodiment of the present invention, after the client obtains the input sequence, it can determine the total length of the input sequence input by the user in the current input cycle; then it determines whether the total length of the input sequence input by the user in the current input cycle reaches a preset length. If the total length of the input sequence input by the user in the current input cycle does not reach the preset length, step 908 can be executed. When the total length of the input sequence input by the user in the current input cycle reaches the preset length, it may not send to the cloud this time and can return to execute step 902.

[0185] Wherein, the total length of the input sequence may be the total number of encodings corresponding to the input sequence; at this time, the preset length may be M1; M1 is a positive integer and can be set according to requirements; the embodiments of the present invention do not limit this.

[0186] When the input sequence is a pinyin sequence, the total length of the input sequence may also be the total number of syllables corresponding to the input sequence; at this time, the preset length may be M2; M2 is a positive integer and can be set according to requirements, and M2 may be less than M1; the embodiments of the present invention do not limit this.

[0187] When the input sequence is a foreign language string, the total length of the input sequence may also be the total number of words corresponding to the input sequence; at this time, the preset length may be M3; M3 is a positive integer and M3 can be set according to requirements, and the embodiments of the present invention do not limit this.

[0188] Step 908: The client generates a long sentence prediction request based on the input sequence and sends the long sentence prediction request to the server.

[0189] Step 910: The server obtains the input sequence from the long sentence prediction request, inputs the input sequence into the sentence prediction model, obtains the sentence candidates output by the sentence prediction model, and returns them to the client.

[0190] Step 912: The client displays the sentence candidates.

[0191] In the existing process of the client sending to the cloud, sending a request to the server is processed on the same time line as the key presses. For example, when continuously pressing the keys ABC, a request is sent when pressing key A. If the result is not returned when pressing key B, it is regarded as a timeout request and discarded; this causes the server to make a prediction, but the client does not utilize the prediction result of this prediction, resulting in a large amount of waste. Therefore, the present invention proposes an asynchronous caching mechanism: separating the request and the key input process, caching the requests that were previously discarded due to timeout for subsequent reuse. Thus, on the one hand, the request cost is saved, and on the other hand, the efficiency of long sentence prediction display is improved. For example, when continuously pressing the keys ABC, the request sent when pressing key A, if the result is returned after pressing key B, it is not discarded but cached locally and can be continued to be utilized when pressing key C.

[0192] Correspondingly, in an optional embodiment of the present invention, the client caches the sentence candidates returned by the server in units of input cycles; so that after receiving the input sequence subsequently, the sentence candidates matching the received input sequence can be searched from the cache. Among them, the sentence candidates may include the sentence candidates returned by the server with timeout, or may include the sentence candidates returned by the server without timeout. In an example of the present invention, a way to determine whether the received sentence candidate is a sentence candidate returned with timeout may be: to determine whether the sentence candidate received by the client is after the client receives the target input sequence input by the user; wherein, the target input sequence is the one received by the client after sending the long sentence prediction request corresponding to the received sentence candidate. Among them, when the sentence candidate received by the client is after the client receives the target input sequence input by the user, it is determined that the received sentence candidate is a sentence candidate returned with timeout; when the sentence candidate received by the client is before the client receives the target input sequence input by the user, it is determined that the received sentence candidate is not a sentence candidate returned with timeout.

[0193] In an embodiment of the present invention, continuous prediction can be performed based on the input sequence. When the input sequence input by the user matches the currently displayed sentence candidate, the currently displayed sentence candidate can continue to be displayed without sending to the cloud; thus, both the user experience can be improved and the server burden can be reduced.

[0194] Refer to Figure 10a , which shows the step flowchart of another optional embodiment of the input method of the present invention.

[0195] Step 1002: The client obtains the input sequence input by the user in the input method.

[0196] Step 1004: The client determines whether an input sequence input by the user this time matches the currently displayed sentence candidate.

[0197] Among them, if an input sequence input by the user this time does not match the currently displayed sentence candidate, step 1006 can be executed; if an input sequence input by the user this time matches the currently displayed sentence candidate, step 1012 can be executed.

[0198] Step 1006: The client generates a long sentence prediction request according to the input sequence and sends the long sentence prediction request to the server.

[0199] Step 1008: The server obtains the input sequence from the long sentence prediction request, inputs the input sequence into the sentence prediction model, obtains the sentence candidates output by the sentence prediction model and returns them to the client.

[0200] Step 1010: The client displays the sentence candidates returned by the server.

[0201] Step 1012: The client displays the currently shown sentence candidates.

[0202] For example, it can be as Figure 10b - 10c shown that the input sequence is a pinyin sequence. Among them, Figure 10b the shown sentence candidate is "Happy birthday to you". After the user continues to input a pinyin "s", Figure 10c the sentence candidate "Happy birthday to you" is still shown.

[0203] In an optional embodiment of the present invention, a way to display the sentence candidates can be: splicing the content in the edit box with the sentence candidates to obtain a corresponding splicing result; displaying the splicing result. Thus, on the one hand, it can improve the user's perception of long sentence prediction, and on the other hand, it is not necessary for the user to switch the visual focus back and forth between the above text and the long sentence prediction candidates to understand the long sentence prediction candidates and judge whether the long sentence prediction candidates are correct. For example, it can be referred to Figure 10d , where the content in the edit box is "a person". After the user inputs the pinyin sequence "zhaoy", the determined sentence candidate is "have a great time as before". The splicing result "a person have a great time as before" is displayed in the upper right area of the input method keyboard.

[0204] In the embodiment of the present invention, during the user input process, on the one hand, long sentence prediction can be performed based on the input sequence to determine the corresponding sentence candidates; so that the user can also obtain the corresponding sentence by only inputting the input sequence corresponding to part of the text in the sentence, thereby improving the user's input efficiency. On the other hand, other types of predictions are performed based on the input sequence to obtain other types of prediction results; where the other types of prediction results include at least one of the following: person name prediction results, character-by-character proofreading prediction results, local cloud substitution prediction results, cloud input prediction results, and expression prediction results, etc., and the embodiment of the present invention does not limit this. Among them, the input method can display the sentence candidates and other types of prediction results in the same display area; or can display the sentence candidates and other types of prediction results in different areas respectively. When the input method displays the sentence candidates and other types of prediction results in the same display area, after determining the long sentence prediction candidates and other types of prediction results, the candidates to be displayed in this display area can be determined and displayed.

[0205] In an example of the present invention, the priorities of sentence candidates and other types of prediction results can be determined first; then, based on the determined priority information, the above-mentioned candidates can be displayed. Among them, if the priority of the sentence candidate is higher than the priorities of other types of prediction results, the sentence candidate is displayed; if the priority of the sentence candidate is lower than the priority of any other type of prediction result, the other type of prediction result with the highest priority is displayed in the specified area of the input method.

[0206] In the embodiments of the present invention, in different situations, the user's expression methods may be different. For example, when chatting, one may say "There will be strong winds tomorrow", and when formally writing a news release, one may say "There will be strong winds of level 3 to 4 tomorrow". Also, for example, when chatting with a superior, the expression is more serious and formal, and one may say "Thank you"; when chatting with a friend, it is more relaxed, and one may say "Thank you, dear", etc. Therefore, in the embodiments of the present invention, after obtaining the sentence candidates output by the sentence prediction model, the sentence candidates output by the sentence prediction model can also be screened based on the user's expression method, and the sentence candidates that meet the user's expression method are screened out and displayed. Furthermore, the sentence candidates that meet the user's personalized expression can be selected and displayed from multiple sentence candidates, thereby improving the user experience.

[0207] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequences, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.

[0208] Refer to Figure 11 , which shows a structural block diagram of an embodiment of an input device of the present invention, and specifically may include the following modules:

[0209] An acquisition module 1102, configured to acquire an input sequence input by a user in an input method;

[0210] A determination module 1104, configured to input the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model;

[0211] A display module 1106, configured to display the sentence candidates.

[0212] Refer to Figure 12 , which shows a structural block diagram of an alternative embodiment of an input device of the present invention.

[0213] In an alternative embodiment of the present invention, the input information of the sentence prediction model further includes at least one of the following: previous context information, application environment information, and candidate words of the input sequence.

[0214] In an alternative embodiment of the present invention, when the input information of the sentence prediction model further includes previous context information, the determination module 1104 includes:

[0215] A first candidate output sub-module 11042, configured to input the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0216] In an alternative embodiment of the present invention, the first candidate output sub-module 11042 includes:

[0217] A first prediction unit 110422, configured to use the sentence prediction model to perform prediction based on the input sequence and the previous context information to obtain sentence candidates output by the sentence prediction model.

[0218] In an alternative embodiment of the present invention, the first candidate output sub-module 11042 includes:

[0219] A second prediction unit 110424, configured to use the sentence prediction model to perform prediction based on the input sequence to obtain multiple sentence candidates;

[0220] A first output unit 110426, configured to use the sentence prediction model to screen the multiple sentence candidates according to the previous context information and output the screened sentence candidates.

[0221] In an alternative embodiment of the present invention, the first candidate output sub-module 11042 includes:

[0222] A third prediction unit 110428, configured to use the sentence prediction model to perform prediction based on the previous context information to obtain multiple sentence candidates;

[0223] A second output unit 1104210, configured to use the sentence prediction model to screen the multiple sentence candidates according to the input sequence and output the screened sentence candidates.

[0224] In an alternative embodiment of the present invention, the input sequence includes: a first input sequence obtained after the current input in the current input cycle and a second input sequence before the current input in the current input cycle;

[0225] The determination module 1104 includes:

[0226] The first candidate prediction sub-module 11044 is configured to use the sentence prediction model to predict the second input sequence, and obtain multiple sentence candidates output by the sentence prediction model;

[0227] The second candidate output sub-module 11046 is configured to use the sentence prediction model to screen the multiple sentence candidates according to the first input sequence, and output the screened sentence candidates.

[0228] In an optional embodiment of the present invention, when the input information of the sentence prediction model further includes application environment information, the determination module 1104 includes:

[0229] The second candidate prediction sub-module 11048 is configured to use the sentence prediction model to perform prediction based on the input sequence, and obtain multiple sentence candidates;

[0230] The third candidate output sub-module 110410 is configured to use the sentence prediction model to screen the multiple sentence candidates according to the application environment information, and output the screened sentence candidates.

[0231] In an optional embodiment of the present invention, the device further includes:

[0232] The association information acquisition module 1108 is configured to, when there are multiple sentence candidates output by the sentence prediction model, acquire input association information, and the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, peer user information, local user information, and local user historical behavior information;

[0233] The sorting module 1110 is configured to re-sort the multiple sentence candidates by using the input association information.

[0234] In an optional embodiment of the present invention, the input method includes a client and a server, and the determination module includes:

[0235] The sending sub-module 110412 is configured to call the client to generate a long sentence prediction request according to the input sequence, and send the long sentence prediction request to the server;

[0236] The third candidate prediction sub-module 110414 is configured to call the server to obtain the input sequence from the long sentence prediction request, input the input sequence into the sentence prediction model, and obtain the sentence candidates output by the sentence prediction model and return them to the client.

[0237] In an optional embodiment of the present invention, the input sequence includes the input sequence input in the current input cycle, and the device further includes:

[0238] A length determination module 1112, configured to call the client to determine the total length of the input sequence input by the user in the current input cycle;

[0239] A judgment module 1114, configured to judge whether the total length of the input sequence input by the user in the current input cycle reaches a preset length;

[0240] The sending sub-module 110412 is configured to, if the total length of the input sequence input by the user in the current input cycle does not reach the preset length, execute the step of calling the client to generate a long sentence prediction request according to the input sequence and sending the long sentence prediction request to the server.

[0241] In an optional embodiment of the present invention, the device further includes:

[0242] A cache module 1116, configured to call the client to cache the sentence candidates returned by the server in units of input cycles; wherein, the sentence candidates include the sentence candidates returned by the server due to timeout.

[0243] In an optional embodiment of the present invention, the input sequence includes: the input sequence input in the current input cycle, and the input sequence input in the current input cycle includes: an input sequence input in the current cycle this time;

[0244] The device further includes:

[0245] A matching module 1118, configured to call the client to judge whether an input sequence input by the user this time matches the currently displayed sentence candidate;

[0246] The sending sub-module 110412 is configured to, when an input sequence input by the user this time does not match the currently displayed sentence candidate, execute the step of calling the client to generate a long sentence prediction request according to the input sequence and sending the long sentence prediction request to the server;

[0247] The display module 1106 includes:

[0248] A first candidate display sub-module 11062, configured to continue to display the currently displayed sentence candidate when an input sequence input by the user this time matches the currently displayed sentence candidate.

[0249] In an optional embodiment of the present invention, the device further includes:

[0250] An other type prediction module 1120, configured to perform other type predictions according to the input sequence to obtain other type prediction results, where the other type prediction results include at least one of the following: a person name prediction result, a word-by-word proofreading prediction result, a local cloud substitution prediction result, a cloud input prediction result, and an expression prediction result;

[0251] The display module 1106 includes:

[0252] A second candidate display sub-module 11064, configured to display the sentence candidates according to the prediction results of other types and the priorities of the sentence candidates.

[0253] In an alternative embodiment of the present invention, the display module 1106 includes:

[0254] A splicing sub-module 11066, configured to splice the content in the edit box with the sentence candidates to obtain corresponding splicing results;

[0255] A result display sub-module 11068, configured to display the splicing results.

[0256] In summary, in the embodiment of the present invention, after the input method obtains the input sequence input by the user, the input sequence can be input into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model, and display the sentence candidates; thereby enabling the user to directly screen the sentence even when only part of the text in the input sentence corresponds to the input sequence, greatly improving the input efficiency of the user.

[0257] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the related parts, please refer to the partial description of the method embodiment.

[0258] Figure 13 It is a block diagram of a structure of an electronic device 1300 for input according to an exemplary embodiment. For example, the electronic device 1300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0259] Referring to Figure 13 , the electronic device 1300 may include one or more of the following components: a processing component 1302, a memory 1304, a power component 1306, a multimedia component 1308, an audio component 1310, an input / output (I / O) interface 1312, a sensor component 1314, and a communication component 1316.

[0260] The processing component 1302 generally controls the overall operation of the electronic device 1300, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing element 1302 may include one or more processors 1320 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 1302 may include one or more modules to facilitate the interaction between the processing component 1302 and other components. For example, the processing component 1302 may include a multimedia module to facilitate the interaction between the multimedia component 1308 and the processing component 1302.

[0261] The memory 1304 is configured to store various types of data to support the operation of the device 1300. Examples of such data include instructions for any application or method operating on the electronic device 1300, contact data, phone book data, messages, pictures, videos, etc. The memory 1304 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0262] The power component 1306 provides power to various components of the electronic device 1300. The power component 1306 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 1300.

[0263] The multimedia component 1308 includes a screen that provides an output interface between the electronic device 1300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 1308 includes a front camera and / or a rear camera. When the electronic device 1300 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each of the front camera and the rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0264] The audio component 1310 is configured to output and / or input audio signals. For example, the audio component 1310 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 1300 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 1304 or transmitted via the communication component 1316. In some embodiments, the audio component 1310 further includes a speaker for outputting audio signals.

[0265] The I / O interface 1312 provides an interface between the processing component 1302 and peripheral interface modules, and the peripheral interface modules may be a keyboard, a click wheel, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0266] The sensor component 1314 includes one or more sensors for providing status assessments of various aspects of the electronic device 1300. For example, the sensor component 1314 can detect the on / off state of the device 1300, the relative positioning of components, such as the display and keypad of the electronic device 1300. The sensor component 1314 can also detect a change in the position of the electronic device 1300 or a component of the electronic device 1300, the presence or absence of user contact with the electronic device 1300, the orientation or acceleration / deceleration of the electronic device 1300, and the temperature change of the electronic device 1300. The sensor component 1314 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 1314 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 1314 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0267] The communication component 1316 is configured to facilitate communication between the electronic device 1300 and other devices in a wired or wireless manner. The electronic device 1300 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1314 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1314 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0268] In an exemplary embodiment, the electronic device 1300 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above method.

[0269] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as the memory 1304 including instructions, and the above instructions can be executed by the processor 1320 of the electronic device 1300 to complete the above method. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0270] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute an input method, and the method includes: obtaining an input sequence input by a user in an input method; inputting the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model; and presenting the sentence candidates.

[0271] Optionally, the input information of the sentence prediction model further includes at least one of the following: previous context information, application environment information, and candidate words of the input sequence.

[0272] Optionally, when the input information of the sentence prediction model further includes previous context information, the step of inputting the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0273] Optionally, the step of inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence and the previous context information to obtain sentence candidates output by the sentence prediction model.

[0274] Optionally, the step of inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence to obtain a plurality of sentence candidates; and using the sentence prediction model to screen the plurality of sentence candidates according to the previous context information and output the screened sentence candidates.

[0275] Optionally, inputting the input sequence and the above information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the above information to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the input sequence, and outputting the screened sentence candidates.

[0276] Optionally, the input sequence includes: a first input sequence obtained after this input in the current input cycle and a second input sequence before this input in the current input cycle; inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction on the second input sequence to obtain multiple sentence candidates output by the sentence prediction model; using the sentence prediction model to screen the multiple sentence candidates according to the first input sequence, and outputting the screened sentence candidates.

[0277] Optionally, when the input information of the sentence prediction model further includes application environment information, inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the application environment information, and outputting the screened sentence candidates.

[0278] Optionally, the method further includes: when there are multiple sentence candidates output by the sentence prediction model, obtaining input association information, where the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the opposite-end user, information of the local user, and historical behavior information of the local user; using the input association information to re-rank the multiple sentence candidates.

[0279] Optionally, the input method includes a client and a server. Inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: the client generating a long sentence prediction request according to the input sequence and sending the long sentence prediction request to the server; the server obtaining the input sequence from the long sentence prediction request, inputting the input sequence into the sentence prediction model, obtaining the sentence candidates output by the sentence prediction model, and returning them to the client.

[0280] Optionally, the input sequence includes the input sequence entered in the current input cycle, and the method further includes: the client determines the total length of the input sequence entered by the user in the current input cycle; determines whether the total length of the input sequence entered by the user in the current input cycle reaches a preset length; if the total length of the input sequence entered by the user in the current input cycle does not reach the preset length, then perform the step of generating a long sentence prediction request according to the input sequence.

[0281] Optionally, the method further includes: the client caches the sentence candidates returned by the server in units of input cycles; wherein, the sentence candidates include the sentence candidates returned by the server due to timeout.

[0282] Optionally, the input sequence includes: the input sequence entered in the current input cycle, and the input sequence entered in the current input cycle includes: an input sequence entered this time within the current cycle;

[0283] The method further includes: the client determines whether an input sequence entered by the user this time matches the currently displayed sentence candidate; when the input sequence entered by the user this time does not match the currently displayed sentence candidate, perform the step of generating a long sentence prediction request according to the input sequence; the displaying of the sentence candidate includes: when the input sequence entered by the user this time matches the currently displayed sentence candidate, continue to display the currently displayed sentence candidate.

[0284] Optionally, the method further includes: performing other type of predictions according to the input sequence to obtain other type of prediction results, where the other type of prediction results includes at least one of the following: person name prediction result, word-by-word proofreading prediction result, local cloud substitution prediction result, cloud input prediction result, and expression prediction result;

[0285] The displaying of the sentence candidate includes: displaying the sentence candidate according to the priorities of the other type of prediction results and the sentence candidate.

[0286] Optionally, the displaying of the sentence candidate includes: splicing the content in the edit box with the sentence candidate to obtain a corresponding splicing result; displaying the splicing result.

[0287] Figure 14FIG. 0 is a schematic structural diagram of an electronic device 1400 for input according to another exemplary embodiment of the present invention. The electronic device 1400 may be a server, which may vary significantly due to different configurations or performances, and may include one or more central processing units (CPUs) 1422 (for example, one or more processors) and a memory 1432, and one or more storage media 1430 (for example, one or more mass storage devices) for storing application programs 1442 or data 1444. Among them, the memory 1432 and the storage media 1430 may be transient storage or persistent storage. The programs stored in the storage media 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Further, the central processor 1422 may be configured to communicate with the storage media 1430 and execute a series of instruction operations in the storage media 1430 on the server.

[0288] The server may further include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458, one or more keyboards 1456, and / or one or more operating systems 1441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so on.

[0289] An electronic device includes a memory and one or more programs, where one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations: obtaining an input sequence input by a user in an input method; inputting the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model; and displaying the sentence candidates.

[0290] Optionally, the input information of the sentence prediction model further includes at least one of the following: context information, application environment information, and candidate words of the input sequence.

[0291] Optionally, when the input information of the sentence prediction model further includes context information, the step of inputting the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: inputting the input sequence and the context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0292] Optionally, the step of inputting the input sequence and the above information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence and the above information to obtain the sentence candidates output by the sentence prediction model.

[0293] Optionally, the step of inputting the input sequence and the above information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the above information and output the screened sentence candidates.

[0294] Optionally, the step of inputting the input sequence and the above information into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the above information to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the input sequence and output the screened sentence candidates.

[0295] Optionally, the input sequence includes: a first input sequence obtained after the current input in the current input cycle and a second input sequence before the current input in the current input cycle; the step of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction on the second input sequence to obtain multiple sentence candidates output by the sentence prediction model; using the sentence prediction model to screen the multiple sentence candidates according to the first input sequence and output the screened sentence candidates.

[0296] Optionally, when the input information of the sentence prediction model further includes application environment information, the step of inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: using the sentence prediction model to make a prediction based on the input sequence to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the application environment information and output the screened sentence candidates.

[0297] Optionally, it further includes instructions for performing the following operations: when there are multiple sentence candidates output by the sentence prediction model, obtain input association information, where the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the opposite-end user, information of the local user, and historical behavior information of the local user; use the input association information to re-rank the multiple sentence candidates.

[0298] Optionally, inputting the input sequence into the sentence prediction model to obtain the sentence candidates output by the sentence prediction model includes: generating a long sentence prediction request based on the input sequence and sending the long sentence prediction request to the server; receiving the sentence candidates returned by the server, where the server obtains the input sequence from the long sentence prediction request, inputs the input sequence into the sentence prediction model, and returns the sentence candidates output by the sentence prediction model.

[0299] Optionally, the input sequence includes the input sequence input in the current input cycle and further includes instructions for performing the following operations: determining the total length of the input sequence input by the user in the current input cycle; determining whether the total length of the input sequence input by the user in the current input cycle reaches a preset length; if the total length of the input sequence input by the user in the current input cycle does not reach the preset length, then perform the step of generating a long sentence prediction request based on the input sequence.

[0300] Optionally, it further includes instructions for performing the following operations: caching the sentence candidates returned by the server in units of input cycles; where the sentence candidates include the sentence candidates returned by the server due to timeout.

[0301] Optionally, the input sequence includes: the input sequence input in the current input cycle, and the input sequence input in the current input cycle includes: an input sequence input this time within the current cycle; it further includes instructions for performing the following operations: determining whether an input sequence input by the user this time matches the currently displayed sentence candidates; when an input sequence input by the user this time does not match the currently displayed sentence candidates, perform the step of generating a long sentence prediction request based on the input sequence; the displaying of the sentence candidates includes: when an input sequence input by the user this time matches the currently displayed sentence candidates, continue to display the currently displayed sentence candidates.

[0302] Optionally, it further includes instructions for performing the following operations: performing other type of predictions based on the input sequence to obtain other type of prediction results, where the other type of prediction results include at least one of the following: person name prediction result, character-by-character proofreading prediction result, local cloud substitution prediction result, cloud input prediction result, and expression prediction result; the displaying of the sentence candidates includes: displaying the sentence candidates according to the priorities of the other type of prediction results and the sentence candidates.

[0303] Optionally, the displaying of the sentence candidates includes: splicing the content of the edit box with the sentence candidates to obtain a corresponding splicing result; displaying the splicing result.

[0304] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.

[0305] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0306] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0307] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process. Therefore, the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0308] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.

[0309] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such a process, method, article or terminal device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.

[0310] The above has provided a detailed introduction to an input method, an input device and an electronic device provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. An input method, characterized in that, including: Obtaining an input sequence input by a user in an input method; The input sequence includes: a first input sequence obtained after this input in the current input cycle and a second input sequence before this input in the current input cycle; Inputting the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model, including: using the sentence prediction model to predict the second input sequence to obtain multiple sentence candidates output by the sentence prediction model; using the sentence prediction model to screen the multiple sentence candidates according to the first input sequence and output the screened sentence candidates; the input information of the sentence prediction model further includes at least one of the following: previous text information, application environment information, and candidate words of the input sequence, and the previous text information includes: interaction information and content in an edit box; when the input information of the sentence prediction model further includes previous text information, inputting the input sequence and the previous text information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model; when the input information of the sentence prediction model further includes application environment information, using the sentence prediction model to predict based on the input sequence to obtain multiple sentence candidates; using the sentence prediction model to screen the multiple sentence candidates according to the application environment information and output the screened sentence candidates; Displaying the sentence candidates; When there are multiple sentence candidates output by the sentence prediction model, obtaining input association information, where the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the opposite-end user, information of the local user, and historical behavior information of the local user; Using the input association information to re-rank the multiple sentence candidates.

2. The method according to claim 1, characterized in that, The step of inputting the input sequence and the previous text information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: Using the sentence prediction model to predict based on the input sequence and the previous text information to obtain sentence candidates output by the sentence prediction model.

3. The method according to claim 1, wherein The step of inputting the input sequence and the previous text information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: Using the sentence prediction model to predict based on the input sequence to obtain multiple sentence candidates; Using the sentence prediction model to screen the multiple sentence candidates according to the previous text information and output the screened sentence candidates.

4. The method according to claim 1, wherein The step of inputting the input sequence and the previous text information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: Using the sentence prediction model to predict based on the previous text information to obtain multiple sentence candidates; Using the sentence prediction model to screen the multiple sentence candidates according to the input sequence and output the screened sentence candidates.

5. The method according to claim 1, characterized in that The input method includes a client and a server, and the step of inputting the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: The client generates a long sentence prediction request according to the input sequence and sends the long sentence prediction request to the server; The server obtains an input sequence from the long sentence prediction request, inputs the input sequence into a sentence prediction model, obtains sentence candidates output by the sentence prediction model, and returns them to the client.

6. The method according to claim 5, characterized in that, The input sequence includes the input sequence input in the current input cycle, and the method further includes: The client determines the total length of the input sequence input by the user in the current input cycle; Determine whether the total length of the input sequence input by the user in the current input cycle reaches a preset length; If the total length of the input sequence input by the user in the current input cycle does not reach the preset length, execute the step of generating a long sentence prediction request based on the input sequence.

7. The method according to claim 5, characterized in that The method further includes: The client caches the sentence candidates returned by the server in units of input cycles; wherein, the sentence candidates include the sentence candidates returned by the server due to timeout.

8. The method according to claim 5, wherein The input sequence includes: the input sequence input in the current input cycle, and the input sequence input in the current input cycle includes: an input sequence input this time within the current cycle; The method further includes: The client determines whether an input sequence input by the user this time matches the currently displayed sentence candidate; When an input sequence input by the user this time does not match the currently displayed sentence candidate, execute the step of generating a long sentence prediction request based on the input sequence; The displaying of the sentence candidates includes: When an input sequence input by the user this time matches the currently displayed sentence candidate, continue to display the currently displayed sentence candidate.

9. The method according to claim 1, wherein The method further includes: Perform other type predictions based on the input sequence to obtain other type prediction results, where the other type prediction results include at least one of the following: person name prediction result, character-by-character proofreading prediction result, local cloud replacement prediction result, cloud input prediction result, and expression prediction result; The displaying of the sentence candidates includes: Display the sentence candidates according to the priorities of the various other type prediction results and the sentence candidates.

10. The method according to claim 1, characterized in that, The displaying of the sentence candidates includes: Concatenate the content in the edit box with the sentence candidates to obtain a corresponding concatenation result; Display the concatenation result.

11. An input device, characterized in that, Includes: An acquisition module for acquiring an input sequence input by the user in the input method; The input sequence includes: a first input sequence obtained after this input in the current input cycle and a second input sequence before this input in the current input cycle; A determination module, configured to input the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model; the determination module includes: a first candidate prediction sub-module, configured to use the sentence prediction model to predict the second input sequence to obtain multiple sentence candidates output by the sentence prediction model; a second candidate output sub-module, configured to use the sentence prediction model to screen the multiple sentence candidates according to the first input sequence and output the screened sentence candidates; the input information of the sentence prediction model further includes at least one of the following: previous context information, application environment information, and candidate words of the input sequence, and the previous context information includes: interaction information and content in an edit box; when the input information of the sentence prediction model further includes previous context information, the determination module includes: a first candidate output sub-module, configured to input the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model; when the input information of the sentence prediction model further includes application environment information, the determination module includes: a second candidate prediction sub-module, configured to use the sentence prediction model to perform prediction based on the input sequence to obtain multiple sentence candidates; a third candidate output sub-module, configured to use the sentence prediction model to screen the multiple sentence candidates according to the application environment information and output the screened sentence candidates A display module, configured to display the sentence candidates; An associated information acquisition module, configured to, when there are multiple sentence candidates output by the sentence prediction model, acquire input associated information, where the input associated information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the peer user, information of the local user, and historical behavior information of the local user; A sorting module, configured to re-sort the multiple sentence candidates by using the input associated information.

12. The device according to claim 11, characterized in that, The first candidate output sub-module includes: A first prediction unit, configured to use the sentence prediction model to perform prediction based on the input sequence and the previous context information to obtain sentence candidates output by the sentence prediction model.

13. The device according to claim 11, wherein The first candidate output sub-module includes: A second prediction unit, configured to use the sentence prediction model to perform prediction based on the input sequence to obtain multiple sentence candidates; A first output unit, configured to use the sentence prediction model to screen the multiple sentence candidates according to the previous context information and output the screened sentence candidates.

14. The device according to claim 11, wherein The first candidate output sub-module includes: A third prediction unit, configured to use the sentence prediction model to perform prediction based on the previous context information to obtain multiple sentence candidates; A second output unit, configured to use the sentence prediction model to screen the multiple sentence candidates according to the input sequence and output the screened sentence candidates.

15. The device according to claim 11, characterized in that, The input method includes a client and a server, and the determination module includes: A sending sub-module, configured to call the client to generate a long sentence prediction request according to the input sequence and send the long sentence prediction request to the server; The third candidate prediction sub-module is used to call the server to obtain an input sequence from the long sentence prediction request, input the input sequence into the sentence prediction model, obtain the sentence candidates output by the sentence prediction model, and return them to the client.

16. The device according to claim 15, characterized in that, The input sequence includes the input sequence input in the current input cycle, and the device further includes: The length determination module is used to call the client to determine the total length of the input sequence input by the user in the current input cycle; The judgment module is used to judge whether the total length of the input sequence input by the user in the current input cycle reaches a preset length; The sending sub-module is used to, if the total length of the input sequence input by the user in the current input cycle does not reach the preset length, execute the step of calling the client to generate a long sentence prediction request according to the input sequence and sending the long sentence prediction request to the server.

17. The device according to claim 15, characterized in that The device further includes: The caching module is used to call the client to cache the sentence candidates returned by the server in units of input cycles; wherein, the sentence candidates include the sentence candidates returned by the server due to timeout.

18. The device according to claim 15, characterized in that, The input sequence includes: the input sequence input in the current input cycle, and the input sequence input in the current input cycle includes: an input sequence input this time within the current cycle; The device further includes: The matching module is used to call the client to judge whether an input sequence input by the user this time matches the currently displayed sentence candidates; The sending sub-module is used to, when an input sequence input by the user this time does not match the currently displayed sentence candidates, execute the step of calling the client to generate a long sentence prediction request according to the input sequence and sending the long sentence prediction request to the server; The display module includes: The first candidate display sub-module is used to continue to display the currently displayed sentence candidates when an input sequence input by the user this time matches the currently displayed sentence candidates.

19. The device according to claim 11, characterized in that, The device further includes: The other type prediction module is used to perform other type predictions according to the input sequence to obtain other type prediction results, where the other type prediction results include at least one of the following: person name prediction results, word-by-word proofreading prediction results, local cloud replacement prediction results, cloud input prediction results, and expression prediction results; The display module includes: The second candidate display sub-module is used to display the sentence candidates according to the priorities of the various other type prediction results and the sentence candidates.

20. The device according to claim 12, characterized in that, The display module includes: The splicing sub-module is used to splice the content in the edit box with the sentence candidates to obtain a corresponding splicing result; The result display sub-module is used to display the splicing result.

21. An electronic device, characterized in that, It includes a memory, and one or more programs, where one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations: Obtain the input sequence input by the user in the input method; the input sequence includes: a first input sequence obtained after this input in the current input cycle and a second input sequence before this input in the current input cycle; Input the input sequence into a sentence prediction model to obtain sentence candidates output by the sentence prediction model, including: using the sentence prediction model to predict the second input sequence to obtain multiple sentence candidates output by the sentence prediction model; using the sentence prediction model to screen the multiple sentence candidates based on the first input sequence and output the screened sentence candidates; the input information of the sentence prediction model further includes at least one of the following: previous context information, application environment information, and candidate words of the input sequence, and the previous context information includes: interaction information and content in an edit box; when the input information of the sentence prediction model further includes previous context information, input the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model; when the input information of the sentence prediction model further includes application environment information, use the sentence prediction model to predict based on the input sequence to obtain multiple sentence candidates; use the sentence prediction model to screen the multiple sentence candidates based on the application environment information and output the screened sentence candidates. Display the sentence candidates. When there are multiple sentence candidates output by the sentence prediction model, obtain input association information, where the input association information includes: context information, input environment information, candidate words of the input sequence, application scenario information, information of the opposite-end user, information of the local user, and historical behavior information of the local user. Use the input association information to re-rank the multiple sentence candidates.

22. The electronic device according to claim 21, wherein, The step of inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: Use the sentence prediction model to predict based on the input sequence and the previous context information to obtain sentence candidates output by the sentence prediction model.

23. The electronic device according to claim 21, wherein The step of inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: Use the sentence prediction model to predict based on the input sequence to obtain multiple sentence candidates. Use the sentence prediction model to screen the multiple sentence candidates based on the previous context information and output the screened sentence candidates.

24. The electronic device according to claim 21, wherein The step of inputting the input sequence and the previous context information into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: Use the sentence prediction model to predict based on the previous context information to obtain multiple sentence candidates. Use the sentence prediction model to screen the multiple sentence candidates based on the input sequence and output the screened sentence candidates.

25. The electronic device according to claim 21, wherein The step of inputting the input sequence into the sentence prediction model to obtain sentence candidates output by the sentence prediction model includes: Generate a long sentence prediction request based on the input sequence and send the long sentence prediction request to a server. Receive the sentence candidates returned by the server, where the sentence candidates are obtained by the server retrieving the input sequence from the long sentence prediction request, inputting the input sequence into the sentence prediction model, obtaining sentence candidates output by the sentence prediction model, and then returning them.

26. The electronic device according to claim 25, wherein The input sequence includes the input sequence entered in the current input cycle, and also contains instructions for performing the following operations: Determine the total length of the input sequence entered by the user in the current input cycle; Judge whether the total length of the input sequence entered by the user in the current input cycle reaches a preset length; If the total length of the input sequence entered by the user in the current input cycle does not reach the preset length, then execute the step of generating a long sentence prediction request based on the input sequence.

27. The electronic device according to claim 25, characterized in that, It also contains instructions for performing the following operations: Cache the sentence candidates returned by the server in units of input cycles; wherein, the sentence candidates include the sentence candidates returned by the server due to timeout.

28. The electronic device according to claim 25, wherein The input sequence includes: the input sequence entered in the current input cycle, and the input sequence entered in the current input cycle includes: an input sequence entered this time within the current cycle; It also contains instructions for performing the following operations: Judge whether an input sequence entered by the user this time matches the currently displayed sentence candidate; When an input sequence entered by the user this time does not match the currently displayed sentence candidate, execute the step of generating a long sentence prediction request based on the input sequence; The displaying of the sentence candidate includes: When an input sequence entered by the user this time matches the currently displayed sentence candidate, continue to display the currently displayed sentence candidate.

29. The electronic device according to claim 21, wherein It also contains instructions for performing the following operations: Perform other types of predictions based on the input sequence to obtain other types of prediction results, where the other types of prediction results include at least one of the following: person name prediction result, word-by-word proofreading prediction result, local cloud substitution prediction result, cloud input prediction result, and expression prediction result; The displaying of the sentence candidate includes: Display the sentence candidate according to the priorities of each other type of prediction result and the sentence candidate.

30. The electronic device according to claim 21, wherein The displaying of the sentence candidate includes: Concatenate the content in the edit box with the sentence candidate to obtain a corresponding concatenation result; Display the concatenation result.

31. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the input method as described in any one of claims 1-10 of the method claim.

Citation Information

Patent Citations

  • Candidate word recommendation method and device, storage medium and mobile terminal

    CN108132717A

  • Expression prediction for user input

    CN108628911A

  • Method and device for providing candidate long sentences in input method

    CN110673748A

  • Input method and device and electronic equipment

    CN110874145A

  • Input method and device

    CN110908523A