Data processing method, device and electronic equipment

By splicing the word candidates of the input sequence with the above information and inputting them into the sentence prediction model, combined with the sorting of the input related information, the problem of insufficient accuracy of sentence candidate prediction in the existing technology is solved, and the user input efficiency is improved.

CN113589948BActive Publication Date: 2024-10-29BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010366776.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-30
Publication Date
2024-10-29
Estimated Expiration
2040-04-30

AI Technical Summary

Technical Problem

In the existing technology, the prediction accuracy of sentence candidates is not high, and the user input efficiency cannot be effectively improved.

Method used

By obtaining the input sequence and the above information, the word candidates of the input sequence are spliced ​​with the above information, and input into the sentence prediction model to generate sentence candidates, and sort them based on the input associated information to improve the accuracy of long sentence prediction.

Benefits of technology

The accuracy of long sentence prediction is improved, thereby improving user input efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113589948B_ABST
    Figure CN113589948B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a data processing method, device and electronic device, wherein the method comprises: obtaining an input sequence and context information; splicing word candidates of the input sequence with the context information to obtain a corresponding splicing result; inputting the splicing result into a sentence prediction model to obtain sentence candidates output by the sentence prediction model; and then performing long sentence prediction by combining the input sequence and input association information to improve the accuracy of long sentence prediction, thereby improving user input efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device and electronic equipment. Background Art

[0002] With the development of computer technology, electronic devices such as mobile phones and tablet computers are becoming more and more popular, bringing great convenience to people's life, study and work. These electronic devices are usually installed with input method applications (input methods for short), so that users can use the input methods to input information.

[0003] During the user input process, the input method can predict various types of candidates that match the input sequence, such as sentence candidates, name candidates, associations, etc., for the user to display on the screen, thereby improving the user input efficiency. However, in the prior art, the prediction accuracy of sentence candidates is not high, which cannot well meet the user's input needs, thereby failing to well improve the user input efficiency. Summary of the invention

[0004] An embodiment of the present invention provides a data processing method to improve the user input efficiency by improving the accuracy of long sentence prediction.

[0005] Correspondingly, an embodiment of the present invention further provides a data processing device and an electronic device to ensure the implementation and application of the above method.

[0006] In order to solve the above problems, an embodiment of the present invention discloses a data processing method, which specifically includes: obtaining an input sequence and context information; splicing the word candidates of the input sequence with the context information to obtain a corresponding splicing result; inputting the splicing result into a sentence prediction model to obtain a sentence candidate output by the sentence prediction model.

[0007] Optionally, the step of splicing the word candidates of the input sequence with the above context information to obtain a corresponding splicing result includes: converting the input sequence into corresponding word candidates; and splicing the word candidates after the above context information to obtain a corresponding splicing result.

[0008] Optionally, the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: parsing the pinyin sequence into multiple forms of pinyin; for a target form of pinyin, converting the target form of pinyin into a pinyin identifier that matches a pinyin prefix of the target form to obtain a syllable path corresponding to the target form of pinyin; using multiple syllable paths to generate a target syllable network; and converting the pinyin sequence into corresponding word candidates based on the target syllable network.

[0009] Optionally, the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: correcting the pinyin sequence to obtain a corresponding error correction sequence; parsing the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; and converting the pinyin sequence into a corresponding word candidate based on the target syllable network.

[0010] Optionally, after converting the input sequence into corresponding word candidates, the method further includes: obtaining input association information; determining first score information of each word candidate based on the input association information and the above information, wherein the first score information is used to characterize the rationality of the word candidate; and selecting the first N word candidates with the highest first score information, where N is a positive integer.

[0011] Optionally, the output of the sentence prediction model also includes second score information of sentence candidates. When the sentence candidates include multiple sentence candidates, the method also includes: sorting each sentence candidate based on the second score information of the sentence candidate and the first score information corresponding to the word candidates in the sentence candidates.

[0012] Optionally, when the sentence candidates include multiple ones, the method further includes: acquiring input association information; and sorting the sentence candidates based on the input association information.

[0013] Optionally, the method further includes the step of training a sentence prediction model: collecting corpus; dividing the corpus into sentence granularity to obtain training data; and / or dividing the corpus into word granularity to obtain training data; and using the training data to train the sentence model.

[0014] An embodiment of the present invention also discloses a data processing device, which specifically includes: an acquisition module, used to acquire an input sequence and context information; a splicing module, used to splice the word candidates of the input sequence with the context information to obtain a corresponding splicing result; and a prediction module, used to input the splicing result into a sentence prediction model to obtain a sentence candidate output by the sentence prediction model.

[0015] Optionally, the splicing module includes: a conversion submodule, used to convert the input sequence into corresponding word candidates; and an information splicing submodule, used to splice the word candidates after the above information to obtain a corresponding splicing result.

[0016] Optionally, the input sequence includes a pinyin sequence, and the conversion submodule is used to parse the pinyin sequence into multiple forms of pinyin; for the target form of pinyin, convert the target form of pinyin into a pinyin identifier that matches the target form of pinyin prefix to obtain a syllable path corresponding to the target form of pinyin; use multiple syllable paths to generate a target syllable network; based on the target syllable network, convert the pinyin sequence into corresponding word candidates.

[0017] Optionally, the input sequence includes a pinyin sequence, and the conversion submodule is used to correct the pinyin sequence to obtain a corresponding error correction sequence; parse the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; and convert the pinyin sequence into a corresponding word candidate based on the target syllable network.

[0018] Optionally, the device also includes: a selection module, used to obtain input association information after converting the input sequence into corresponding word candidates; determine the first score information of each word candidate based on the input association information and the above information, the first score information is used to characterize the rationality of the word candidate; select the first N word candidates with the highest first score information, N is a positive integer.

[0019] Optionally, the output of the sentence prediction model also includes second score information of sentence candidates, and the device also includes: a first sorting module, which is used to sort each sentence candidate based on the second score information of the sentence candidate and the first score information corresponding to the word candidate in the sentence candidate when the sentence candidate includes multiple candidates.

[0020] Optionally, the device further includes: a second sorting module, configured to obtain input association information when the sentence candidates include multiple ones; and sort the sentence candidates based on the input association information.

[0021] Optionally, the device further includes: a training module for collecting corpus; dividing the corpus into sentence granularity to obtain training data; and / or dividing the corpus into word granularity to obtain training data; and using the training data to train the sentence model.

[0022] An embodiment of the present invention further discloses a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute a data processing method as described in any one of the embodiments of the present invention.

[0023] An embodiment of the present invention also discloses an electronic device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: obtaining an input sequence and context information; splicing word candidates of the input sequence with the context information to obtain a corresponding splicing result; inputting the splicing result into a sentence prediction model to obtain a sentence candidate output by the sentence prediction model.

[0024] Optionally, the step of splicing the word candidates of the input sequence with the above context information to obtain a corresponding splicing result includes: converting the input sequence into corresponding word candidates; and splicing the word candidates after the above context information to obtain a corresponding splicing result.

[0025] Optionally, the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: parsing the pinyin sequence into multiple forms of pinyin; for a target form of pinyin, converting the target form of pinyin into a pinyin identifier that matches a pinyin prefix of the target form to obtain a syllable path corresponding to the target form of pinyin; using multiple syllable paths to generate a target syllable network; and converting the pinyin sequence into corresponding word candidates based on the target syllable network.

[0026] Optionally, the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: correcting the pinyin sequence to obtain a corresponding error correction sequence; parsing the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; and converting the pinyin sequence into a corresponding word candidate based on the target syllable network.

[0027] Optionally, after converting the input sequence into corresponding word candidates, the electronic device also includes: obtaining input association information; determining first score information of each word candidate based on the input association information and the above information, wherein the first score information is used to characterize the rationality of the word candidate; and selecting the first N word candidates with the highest first score information, where N is a positive integer.

[0028] Optionally, the output of the sentence prediction model also includes second score information of sentence candidates. When the sentence candidates include multiple ones, it also includes instructions for performing the following operations: sorting each sentence candidate based on the second score information of the sentence candidate and the first score information corresponding to the word candidates in the sentence candidates.

[0029] Optionally, when the sentence candidates include multiple ones, it also includes instructions for performing the following operations: obtaining input association information; and sorting the sentence candidates based on the input association information.

[0030] Optionally, it also includes instructions for training a sentence prediction model as follows: collecting corpus; dividing the corpus into sentence granularity to obtain training data; and / or dividing the corpus into word granularity to obtain training data; and using the training data to train the sentence model.

[0031] The embodiments of the present invention include the following advantages:

[0032] In an embodiment of the present invention, an input sequence and context information can be obtained, and then the word candidates of the input sequence are spliced ​​with the context information to obtain a corresponding splicing result; the splicing result is then input into a sentence prediction model to obtain sentence candidates output by the sentence prediction model, and then long sentence prediction is performed by combining the input sequence and input association information to improve the accuracy of long sentence prediction, thereby improving user input efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a flow chart of steps of an embodiment of a data processing method of the present invention;

[0034] Figure 2 is a flowchart of steps of an embodiment of a model training method of the present invention;

[0035] Figure 3 is a flowchart of steps of an optional embodiment of a data processing method of the present invention;

[0036] Figure 4 is a structural block diagram of an embodiment of a data processing device of the present invention;

[0037] Figure 5 is a structural block diagram of an optional embodiment of a data processing device of the present invention;

[0038] Figure 6 A structural block diagram of an electronic device for data processing according to an exemplary embodiment;

[0039] Figure 7 It is a structural schematic diagram of an electronic device for data processing according to another exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0041] Reference Figure 1, shows a flow chart of steps of a data processing method embodiment of the present invention, which may specifically include the following steps:

[0042] Step 102: Obtain input sequence and above information.

[0043] In the embodiment of the present invention, long sentence prediction can be performed to generate corresponding sentence candidates during the process of the user inputting an input sequence.

[0044] The embodiments of the present invention can be applied to various input scenarios to predict long sentences. For example, it can be applied to stroke input scenarios to predict long sentences; it can also be applied to pinyin input scenarios to predict long sentences; it can also be applied to voice input scenarios to predict long sentences; etc., and the embodiments of the present invention are not limited to this.

[0045] In addition, the embodiments of the present invention can also be applied to predict long sentences in multiple language scenarios. For example, it can be applied to predict long sentences in Chinese input scenarios; for example, it can be applied to predict long sentences in English input scenarios; for example, it can be applied to predict long sentences in Korean input scenarios; and so on, which are not limited by the embodiments of the present invention.

[0046] Correspondingly, the input sequence may include a stroke sequence, a pinyin sequence, a foreign character string, etc., which is not limited in the embodiment of the present invention.

[0047] In the process of inputting using the input method, the input sequence and the context information of the user input can be obtained, and then the corresponding sentence candidate can be predicted based on the obtained input sequence and the context information. The context information can include the content and / or interaction information in the edit box.

[0048] In an example of the present invention, a method for predicting a long sentence based on an acquired input sequence and context information may refer to the following steps 104 to 106:

[0049] Step 104: concatenate the word candidates of the input sequence with the above context information to obtain a corresponding concatenation result.

[0050] Step 106: input the concatenation result into a sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0051] In the embodiment of the present invention, the sentence prediction model can be pre-trained, and then the trained sentence prediction model is used to perform long sentence prediction. The training process of the sentence prediction model will be described in the subsequent embodiments.

[0052] The word candidates corresponding to the input sequence can be concatenated with the above information to obtain a corresponding concatenation result; the concatenation result is then input into the sentence prediction model, and the sentence prediction model performs long sentence prediction based on the concatenation result and outputs the corresponding sentence candidate. The sentence prediction model can output one or more sentence candidates, which is not limited in the embodiment of the present invention.

[0053] In summary, in an embodiment of the present invention, an input sequence and context information can be obtained, and then the word candidates of the input sequence are spliced ​​with the context information to obtain a corresponding splicing result; the splicing result is then input into a sentence prediction model to obtain sentence candidates output by the sentence prediction model, and then long sentence prediction is performed by combining the input sequence and input association information to improve the accuracy of long sentence prediction, thereby improving user input efficiency.

[0054] The following describes the training process of the sentence prediction model.

[0055] Reference Figure 2 , shows a flow chart of steps of an embodiment of a model training method of the present invention, which may specifically include the following steps:

[0056] Step 202: Collect corpus.

[0057] In the embodiment of the present invention, corpus can be collected, and then training data can be generated based on the collected corpus, so as to train the sentence prediction model using the training data. There are many ways to collect corpus, such as collecting sentences input by users in the input method as corpus; or collecting the text and abstracts in various web pages as corpus; the embodiment of the present invention does not limit this.

[0058] Step 204: divide the corpus into sentence granularity to obtain training data; and / or divide the corpus into word granularity to obtain training data.

[0059] In an embodiment of the present invention, the corpus can be divided to generate training data. Among them, a way to divide the corpus and generate training data can be: divide the corpus into sentence granularity to obtain training data. Among them, the corpus can be divided into multiple sentences based on a sentence; then two adjacent and semantically related sentences are used as a group of training data; and then multiple groups of training data can be obtained. Among them, the sentences can include simple sentences and complex sentences. The simple sentence can refer to a sentence composed of a phrase or a single word, and the clause cannot be analyzed; the clause is a grammatical unit that is similar in structure but does not have a complete sentence intonation. The complex sentence refers to a sentence composed of two or more clauses that are closely related in meaning and do not contain each other in structure.

[0060] In addition, in order to provide users with more comprehensive sentence candidates and further bring users a better input experience, each complex sentence can be divided into multiple clauses separated by punctuation marks. Then, two adjacent clauses in each complex sentence can be used as a set of training data to expand the training data generated above.

[0061] One way to divide the corpus and generate training data may be: divide the corpus into word granularity to obtain training data. The corpus may be divided into multiple words with words as granularity; and then two adjacent and semantically related words are used as a set of training data.

[0062] In the embodiment of the present invention, the word granularity may be determined based on natural language processing, and then the corpus is divided into multiple words based on the word granularity. Alternatively, the word granularity may be determined based on the user's on-screen operation during the input process, and then the corpus is divided into multiple words based on the word granularity; the embodiment of the present invention does not limit this.

[0063] Step 206: Use the training data to train the sentence prediction model.

[0064] The following is an example of using a set of training data to train the sentence prediction model.

[0065] In one example of the present invention, when the training data is obtained by dividing the corpus into sentence granularity, each group of training data may include two sentences or two clauses. The following is an example in which a group of training data includes two sentences. In an embodiment of the present invention, the first sentence in the group of training data can be input into a sentence prediction model, and the sentence prediction model performs forward calculation to obtain a sentence candidate. The sentence candidate is then compared with the second sentence in the group of training data, and the weight of the sentence prediction model is adjusted. In this way, the sentence prediction model is trained using multiple groups of training data until the set end condition is met.

[0066] In one embodiment of the present invention, when the training data is obtained by dividing the corpus into sentence granularity, each group of training data may include two groups of words. In this embodiment of the present invention, the first group of words in the group of training data can be input into the sentence prediction model, and the sentence prediction model performs forward calculation to obtain word candidates. The word candidates are then compared with the second group of words in the group of training data, and the weight of the sentence prediction model is adjusted. In this way, the sentence prediction model is trained using multiple groups of training data until the set end condition is met.

[0067] Reference Figure 3, shows a flow chart of steps of an optional embodiment of a data processing method of the present invention, which may specifically include the following steps:

[0068] Step 302: Obtain input sequence and above information.

[0069] The input sequence may include a single code or multiple codes, which is not limited in this embodiment of the present invention.

[0070] In an embodiment of the present invention, a method of splicing the word candidates of the input sequence with the above context information to obtain a corresponding splicing result may be: converting the input sequence into corresponding word candidates, splicing the word candidates with the above context information to obtain a corresponding splicing result.

[0071] Step 304: Convert the input sequence into corresponding word candidates.

[0072] In an example of the present invention, when the input sequence is a pinyin sequence, a method of converting the input sequence into corresponding word candidates may be: parsing the pinyin sequence to obtain a corresponding target syllable network (refer to sub-steps 22 to 26); and then converting the pinyin sequence into corresponding word candidates based on the target syllable network (refer to sub-step 28).

[0073] Sub-step 22: parsing the pinyin sequence into pinyin in various forms.

[0074] In an embodiment of the present invention, the same Pinyin sequence may correspond to multiple forms of Pinyin. For example, the Pinyin sequence: "fangan" may correspond to forms of Pinyin including: "fang'an", "fan'gan", "fa'n'gan", etc. Therefore, the Pinyin sequence may be parsed into multiple forms of Pinyin; wherein each form of Pinyin may include Pinyin of M syllables, where M is a positive integer. For example: one form of Pinyin is "fang'an", corresponding to Pinyin including two syllables: "fang" and "an"; one form of Pinyin is "fan'gan", corresponding to Pinyin including two syllables: "fan" and "gan"; one form of Pinyin is "fa'n'gan", corresponding to Pinyin including two syllables: "fa", "n" and "gan".

[0075] Sub-step 24: for the pinyin in the target form, convert the pinyin in the target form into a pinyin identifier that matches the pinyin prefix in the target form, and obtain a syllable path corresponding to the pinyin in the target form.

[0076] In the embodiment of the present invention, one form of Pinyin can be selected from multiple forms of Pinyin as the target form of Pinyin, and then the target form of Pinyin is converted into a corresponding syllable path, wherein one form of Pinyin can include Pinyin of M syllables, where M is a positive integer.

[0077] Since most users are accustomed to only inputting the first pinyin character or the first few pinyin characters of the target text when inputting a pinyin sequence, in order to provide users with sentence candidates related to their target input when they have not input a complete pinyin sequence, thereby improving user input efficiency, the embodiments of the present invention can convert the pinyin in the target form into a pinyin identifier that matches the pinyin prefix of the target form when converting the pinyin in the target form to obtain the syllable path corresponding to the pinyin in the target form, so as to increase the comprehensiveness of the word candidates corresponding to the pinyin sequence, thereby increasing the comprehensiveness of the sentence candidates subsequently predicted based on the word candidates.

[0078] Among them, one way to convert the pinyin of the target form into a pinyin identifier that matches the pinyin prefix of the target form is: convert the pinyin of the Mth syllable in the pinyin of the target form into a pinyin identifier that matches the pinyin prefix of the Mth syllable. Among them, prefix matching can mean that the pinyin corresponding to the pinyin identifier contains the pinyin corresponding to the syllable in the pinyin of the target form. And determine the syllables whose corresponding pinyin contains initial consonants and finals and the syllables whose pinyin only contains initial consonants in the first M-1 syllables in the pinyin sequence of the target form; convert the syllables whose corresponding pinyin contains initial consonants and finals in the first M-1 syllables in the pinyin sequence of the target form into a pinyin identifier that completely matches the corresponding pinyin. And convert the syllables whose corresponding pinyin only contains initial consonants in the first M-1 syllables in the pinyin sequence of the target form into a pinyin identifier that matches the corresponding initial consonant.

[0079] Among them, the pinyin of the target form can be converted into a pinyin identifier that matches the pinyin prefix of the target form by querying the mapping relationship between the pinyin and the pinyin identifier (such as the pinyin ID). For example, the pinyin of the Mth syllable in the pinyin of the target form is "h", and the pinyins that match the prefix of "h" are "h", "hen", "he", "heng" and "ha", etc.; then the pinyin identifier 99 corresponding to "h", the pinyin identifier 120 corresponding to "hen", the pinyin identifier 110 corresponding to "he", the pinyin identifier 122 corresponding to "heng" and the pinyin identifier 105 corresponding to "ha" are determined as the pinyin identifiers that match the pinyin prefix corresponding to the Mth syllable. For another example, if there is a pinyin of "he" in the first M-1 syllables of the pinyin of the target form, then only the identifier 110 corresponding to "he" can be used as the pinyin identifier of the pinyin corresponding to the syllable.

[0080] Then, the pinyin identifier corresponding to each syllable in the target pinyin can be used as a syllable node; the pinyin identifier corresponding to the Mth syllable in the target pinyin can include X, where X is a positive integer. Then, the first M-1 syllable nodes in the target pinyin are combined with the X syllable nodes corresponding to the Mth syllable to form a syllable path; and then the X syllable paths corresponding to the target pinyin can be obtained.

[0081] Sub-step 26: using multiple syllable paths to generate a target syllable network.

[0082] Then, syllable paths corresponding to various forms of pinyin are used to generate a target syllable network corresponding to the pinyin sequence; and the target syllable network may include multiple syllable paths.

[0083] Sub-step 28: converting the pinyin sequence into corresponding word candidates based on the target syllable network.

[0084] When the target syllable network includes multiple syllable paths, each syllable path can be converted into a corresponding word candidate; and each syllable path can be converted into at least one word candidate.

[0085] In an example of the present invention, taking the input sequence as a pinyin sequence as an example, the method of converting the input sequence into corresponding word candidates can be described with reference to sub-steps 42 to 46:

[0086] Sub-step 42: correct the pinyin sequence to obtain a corresponding error correction sequence.

[0087] Sub-step 44: parsing the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network.

[0088] Sub-step 46: converting the pinyin sequence into corresponding word candidates based on the target syllable network.

[0089] Since users may make mistakes in inputting, the pinyin sequence can be corrected first, and then the correct pinyin sequence can be converted into corresponding word candidates. Subsequently, based on the word candidates, accurate sentence candidates can be predicted, which further improves the efficiency of user input and improves the user experience.

[0090] Of course, when the input sequence is other sequences or foreign language character strings, the input sequence can also be corrected to obtain an error-corrected sequence.

[0091] Among them, the syllable network obtained by analyzing the error correction sequence and the syllable network obtained by parsing the pinyin sequence can be referred to as the target syllable network. Among them, the method of parsing the error correction sequence to obtain the corresponding target syllable network is similar to the method of parsing the pinyin sequence to obtain the corresponding target syllable network (refer to sub-steps 22-26), which will not be repeated here.

[0092] Among the word candidates, some word candidates may be unreasonable, that is, they do not meet the rules of natural language. Therefore, after obtaining the word candidates of the input sequence, reasonable word candidates can be screened out from the corresponding multiple word candidates to improve the accuracy of subsequent long sentence prediction. You can refer to the following steps 306-310:

[0093] Step 306: Obtain input association information.

[0094] Step 308: Determine first score information of each word candidate based on the input association information and the previous context information, where the first score information is used to characterize the rationality of the word candidate.

[0095] Step 310: Select the first N word candidates with the highest first score information.

[0096] In an embodiment of the present invention, input association information can be obtained, and the input association information may include information related to the input, such as input environment information, user personalized information, etc.; the embodiment of the present invention is not limited to this. Then, based on the input association information and the above information, the first score information of each word candidate can be determined; the first score information is used to characterize the rationality of the word candidate. For example, a language model can be used to score each word candidate based on the input association information and the above information, such as determining the conditional probability of each word candidate under the conditions of the input association information and the above information. Then, the top N word candidates with the highest first score information can be selected. Wherein, N is a positive integer.

[0097] Step 312: concatenate the word candidates after the above context information to obtain a corresponding concatenation result.

[0098] Then, for each selected word candidate, the word candidate can be concatenated after the above-mentioned context information to obtain a corresponding concatenation result. When the selected word candidate includes multiple words, the corresponding concatenation result can also include multiple words.

[0099] Step 314: input the concatenation result into a sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0100] When there are multiple concatenation results, one concatenation result may be input into the sentence prediction model at a time to obtain a sentence candidate output by the sentence prediction model; until all concatenation results are input into the sentence prediction model to obtain the corresponding sentence candidate.

[0101] In summary, in an embodiment of the present invention, an input sequence and context information can be obtained, and then the input sequence is converted into corresponding word candidates, and the word candidates are spliced ​​after the context information to obtain a corresponding splicing result; the splicing result is then input into a sentence prediction model to obtain sentence candidates output by the sentence prediction model, and then the word candidates of the input sequence are input as part of the context information into the sentence prediction model for long sentence prediction, which can increase the amount of information in the context information and further improve the accuracy of the prediction.

[0102] Among them, in an embodiment of the present invention, when the input sequence is a pinyin sequence, the pinyin sequence can be parsed into multiple forms of pinyin; then the pinyin in the target form is converted into a pinyin identifier that matches the pinyin prefix of the target form to obtain a syllable path corresponding to the pinyin in the target form; then a target syllable network is generated using multiple syllable paths, and based on the target syllable network, the pinyin sequence is converted into corresponding word candidates, thereby increasing the comprehensiveness of the converted word candidates, thereby improving the accuracy and comprehensiveness of the sentence candidates.

[0103] Furthermore, in an embodiment of the present invention, when the input sequence is a pinyin sequence, the pinyin sequence can be corrected to obtain a corresponding error correction sequence; then the pinyin sequence and the error correction sequence are parsed to obtain a corresponding target syllable network, and then the pinyin sequence is converted into a corresponding word candidate based on the target syllable network; and then the conversion can be performed based on the accurate pinyin sequence to obtain accurate word candidates; thus, even in the case of incorrect input by the user, accurate sentence candidates can be predicted for the user, further improving the accuracy of the sentence candidates.

[0104] Again, in an embodiment of the present invention, after converting the input sequence into corresponding word candidates, input association information can be obtained, and then based on the input association information and the above information, the first score information of each word candidate can be determined and then the top N word candidates with the highest first score information can be selected; wherein, the first score information is used to characterize the rationality of the word candidates, and then reasonable word candidates can be screened out, which can improve the accuracy of predicting sentence candidates on the one hand, and reduce the computational complexity of the sentence prediction model on the other hand.

[0105] In one embodiment of the present invention, the sentence prediction model may output second score information corresponding to the sentence candidates while outputting the sentence candidates; and then the sentence candidates may be sorted and displayed according to the second score information. The sentence candidates may be displayed according to the sorting results of the sentence candidates. Since the second score information is determined based on the input sequence and the above information, the factors considered for sorting the sentence candidates based on the second score information are not comprehensive enough; therefore, more factors may be introduced to sort the sentence candidates.

[0106] In an example of the present invention, a method for sorting sentence candidates may be: sorting the sentence candidates based on the second score information of the sentence candidates and the first score information corresponding to the word candidates in the sentence candidates.

[0107] In another example of the present invention, a method for sorting sentence candidates may be: obtaining input association information; sorting the sentence candidates based on the input association information; thereby improving the accuracy of sorting the sentence candidates.

[0108] In addition, when there is a lot of context information, the concatenation result of the input sequence and part of the context information can be input into the sentence prediction model to obtain sentence candidates output by the sentence prediction model; so as to reduce the computational complexity of the sentence prediction model. Therefore, in the process of sorting the sentence candidates, the sentence candidates can be sorted based on the complete context information. In another example of the present invention, a method for sorting sentence candidates can be: obtaining input association information; sorting each sentence candidate based on the input association information and / or the context information; thereby also being able to improve the accuracy of sorting each sentence candidate.

[0109] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0110] Reference Figure 4 , shows a structural block diagram of a data processing device embodiment of the present invention, which may specifically include the following modules:

[0111] An acquisition module 402 is used to acquire an input sequence and the above information;

[0112] A splicing module 404, used for splicing the word candidates of the input sequence with the above context information to obtain a corresponding splicing result;

[0113] The prediction module 406 is used to input the concatenation result into a sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0114] Reference Figure 5 , showing a structural block diagram of an optional embodiment of a data processing device of the present invention.

[0115] In an optional embodiment of the present invention, the splicing module 404 includes:

[0116] A conversion submodule 4042, used to convert the input sequence into corresponding word candidates;

[0117] The information splicing submodule 4044 is used to splice the word candidate after the above information to obtain a corresponding splicing result.

[0118] In an optional embodiment of the present invention, the input sequence includes a pinyin sequence, and the conversion submodule 4042 is used to parse the pinyin sequence into multiple forms of pinyin; for the target form of pinyin, convert the target form of pinyin into a pinyin identifier that matches the target form of pinyin prefix to obtain a syllable path corresponding to the target form of pinyin; use multiple syllable paths to generate a target syllable network; based on the target syllable network, convert the pinyin sequence into corresponding word candidates.

[0119] In an optional embodiment of the present invention, the input sequence includes a pinyin sequence, and the conversion submodule 4042 is used to correct the pinyin sequence to obtain a corresponding error correction sequence; parse the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; and convert the pinyin sequence into a corresponding word candidate based on the target syllable network.

[0120] In an optional embodiment of the present invention, the device further comprises:

[0121] The selection module 408 is used to obtain input association information after converting the input sequence into corresponding word candidates; determine the first score information of each word candidate based on the input association information and the above information, wherein the first score information is used to characterize the rationality of the word candidate; and select the first N word candidates with the highest first score information, where N is a positive integer.

[0122] In an optional embodiment of the present invention, the output of the sentence prediction model also includes second score information of the sentence candidate, and the device further includes:

[0123] The first sorting module 410 is used to sort the sentence candidates based on the second score information of the sentence candidates and the first score information corresponding to the word candidates in the sentence candidates when the sentence candidates include multiple sentence candidates.

[0124] In an optional embodiment of the present invention, the device further comprises:

[0125] The second sorting module 412 is used to obtain input association information when the sentence candidates include multiple ones; and sort the sentence candidates based on the input association information.

[0126] In an optional embodiment of the present invention, the device further comprises:

[0127] The training module 414 is used to collect corpus; divide the corpus into sentence granularity to obtain training data; and / or divide the corpus into word granularity to obtain training data; and use the training data to train the sentence model.

[0128] In summary, in an embodiment of the present invention, an input sequence and context information can be obtained, and then the word candidates of the input sequence are spliced ​​with the context information to obtain a corresponding splicing result; the splicing result is then input into a sentence prediction model to obtain sentence candidates output by the sentence prediction model, and then long sentence prediction is performed by combining the input sequence and input association information to improve the accuracy of long sentence prediction, thereby improving user input efficiency.

[0129] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0130] Figure 6 1 is a block diagram of an electronic device 600 for data processing according to an exemplary embodiment. For example, the electronic device 600 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.

[0131] Reference Figure 6 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0132] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0133] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can 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.

[0134] The power component 606 provides power to the various components of the electronic device 600. The power component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.

[0135] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 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 touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 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 front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0136] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0137] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0138] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the device 600, the relative positioning of components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0139] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 614 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 614 also 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.

[0140] In an exemplary embodiment, the electronic device 600 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 to perform the above methods.

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

[0142] A non-temporary 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 perform a data processing method, the method comprising: obtaining an input sequence and context information; splicing word candidates of the input sequence with the context information to obtain a corresponding splicing result; inputting the splicing result into a sentence prediction model to obtain a sentence candidate output by the sentence prediction model.

[0143] Optionally, the step of splicing the word candidates of the input sequence with the above context information to obtain a corresponding splicing result includes: converting the input sequence into corresponding word candidates; and splicing the word candidates after the above context information to obtain a corresponding splicing result.

[0144] Optionally, the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: parsing the pinyin sequence into multiple forms of pinyin; for a target form of pinyin, converting the target form of pinyin into a pinyin identifier that matches a pinyin prefix of the target form to obtain a syllable path corresponding to the target form of pinyin; using multiple syllable paths to generate a target syllable network; and converting the pinyin sequence into corresponding word candidates based on the target syllable network.

[0145] Optionally, the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: correcting the pinyin sequence to obtain a corresponding error correction sequence; parsing the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; and converting the pinyin sequence into a corresponding word candidate based on the target syllable network.

[0146] Optionally, after converting the input sequence into corresponding word candidates, the method further includes: obtaining input association information; determining first score information of each word candidate based on the input association information and the above information, wherein the first score information is used to characterize the rationality of the word candidate; and selecting the first N word candidates with the highest first score information, where N is a positive integer.

[0147] Optionally, the output of the sentence prediction model also includes second score information of sentence candidates. When the sentence candidates include multiple sentence candidates, the method also includes: sorting each sentence candidate based on the second score information of the sentence candidate and the first score information corresponding to the word candidates in the sentence candidates.

[0148] Optionally, when the sentence candidates include multiple ones, the method further includes: acquiring input association information; and sorting the sentence candidates based on the input association information.

[0149] Optionally, the method further includes the step of training a sentence prediction model: collecting corpus; dividing the corpus into sentence granularity to obtain training data; and / or dividing the corpus into word granularity to obtain training data; and using the training data to train the sentence model.

[0150] Figure 7 : is a structural diagram of an electronic device 700 for data processing according to another exemplary embodiment of the present invention. The electronic device 700 may be a server, which may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 722 (for example, one or more processors) and a memory 732, and one or more storage media 730 (for example, one or more mass storage devices) storing application programs 742 or data 744. Among them, the memory 732 and the storage medium 730 may be temporary storage or permanent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processor 722 may be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the server.

[0151] The server may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input and output interfaces 758, one or more keyboards 756, and / or one or more operating systems 741, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0152] An electronic device includes a memory and one or more programs, wherein the 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 and context information; splicing word candidates of the input sequence with the context information to obtain corresponding splicing results; and inputting the splicing results into a sentence prediction model to obtain sentence candidates output by the sentence prediction model.

[0153] Optionally, the step of splicing the word candidates of the input sequence with the above context information to obtain a corresponding splicing result includes: converting the input sequence into corresponding word candidates; and splicing the word candidates after the above context information to obtain a corresponding splicing result.

[0154] Optionally, the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: parsing the pinyin sequence into multiple forms of pinyin; for a target form of pinyin, converting the target form of pinyin into a pinyin identifier that matches a pinyin prefix of the target form to obtain a syllable path corresponding to the target form of pinyin; using multiple syllable paths to generate a target syllable network; and converting the pinyin sequence into corresponding word candidates based on the target syllable network.

[0155] Optionally, the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: correcting the pinyin sequence to obtain a corresponding error correction sequence; parsing the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; and converting the pinyin sequence into a corresponding word candidate based on the target syllable network.

[0156] Optionally, after converting the input sequence into corresponding word candidates, the electronic device also includes: obtaining input association information; determining first score information of each word candidate based on the input association information and the above information, wherein the first score information is used to characterize the rationality of the word candidate; and selecting the first N word candidates with the highest first score information, where N is a positive integer.

[0157] Optionally, the output of the sentence prediction model also includes second score information of sentence candidates. When the sentence candidates include multiple ones, it also includes instructions for performing the following operations: sorting each sentence candidate based on the second score information of the sentence candidate and the first score information corresponding to the word candidates in the sentence candidates.

[0158] Optionally, when the sentence candidates include multiple ones, it also includes instructions for performing the following operations: obtaining input association information; and sorting the sentence candidates based on the input association information.

[0159] Optionally, it also includes instructions for training a sentence prediction model as follows: collecting corpus; dividing the corpus into sentence granularity to obtain training data; and / or dividing the corpus into word granularity to obtain training data; and using the training data to train the sentence model.

[0160] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0161] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the 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 the 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 a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0162] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0164] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0165] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0166] The data processing method, the data processing device and the electronic device provided by the present invention are introduced in detail above. The principle and implementation mode of the present invention are explained by using specific examples in this article. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and the scope of application. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A data processing method, It is characterized in that include: Get the input sequence and the above information; Splicing the word candidates of the input sequence with the above information to obtain a corresponding splicing result, which includes: converting the input sequence into corresponding word candidates; splicing the word candidates after the above information to obtain a corresponding splicing result; the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: parsing the pinyin sequence into multiple forms of pinyin; for the pinyin in the target form, converting the pinyin in the target form into a pinyin identifier that matches the pinyin prefix of the target form to obtain a syllable path corresponding to the pinyin in the target form; using multiple syllable paths to generate a target syllable network; based on the target syllable network, converting the pinyin sequence into corresponding word candidates; the prefix matching includes: the pinyin corresponding to the pinyin identifier contains the pinyin corresponding to the syllable in the pinyin in the target form; converting the pinyin in the target form into a pinyin identifier that matches the pinyin prefix of the target form, includes: by querying the mapping relationship between pinyin and pinyin identifier, converting the pinyin in the target form into a pinyin identifier that matches the pinyin prefix of the target form; The concatenation result is input into a sentence prediction model to obtain sentence candidates output by the sentence prediction model.

2. The method according to claim 1, It is characterized in that The input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: Correcting the pinyin sequence to obtain a corresponding error correction sequence; Parsing the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; The pinyin sequence is converted into corresponding word candidates based on the target syllable network.

3. The method according to claim 1, It is characterized in that After converting the input sequence into corresponding word candidates, the method further comprises: Get input related information; Based on the input association information and the above information, determine first score information of each word candidate, wherein the first score information is used to characterize the rationality of the word candidate; Select the first N word candidates with the highest first score information, where N is a positive integer.

4. The method according to claim 3, It is characterized in that The output of the sentence prediction model also includes second score information of the sentence candidate. When the sentence candidate includes multiple candidates, the method further includes: The sentence candidates are sorted based on the second score information of the sentence candidates and the first score information corresponding to the word candidates in the sentence candidates.

5. The method according to claim 1, It is characterized in that When the sentence candidates include multiple ones, the method further includes: Get input related information; The sentence candidates are ranked based on the input related information.

6. The method according to claim 1, It is characterized in that The method further comprises the step of training a sentence prediction model: Collect corpus; Dividing the corpus into sentence granularity to obtain training data; and / or dividing the corpus into word granularity to obtain training data; The sentence prediction model is trained using the training data.

7. A data processing device, It is characterized in that include: The acquisition module is used to obtain the input sequence and the above information; A splicing module, for splicing the word candidates of the input sequence with the above information to obtain a corresponding splicing result, including: a conversion submodule, for converting the input sequence into corresponding word candidates; an information splicing submodule, for splicing the word candidates after the above information to obtain a corresponding splicing result; the input sequence includes a pinyin sequence, and the conversion submodule is used to parse the pinyin sequence into multiple forms of pinyin; for the pinyin in the target form, converting the pinyin in the target form into a pinyin identifier that matches the pinyin prefix of the target form to obtain a syllable path corresponding to the pinyin in the target form; using multiple syllable paths to generate a target syllable network; based on the target syllable network, converting the pinyin sequence into corresponding word candidates; the prefix matching includes: the pinyin corresponding to the pinyin identifier contains the pinyin corresponding to the syllable in the pinyin in the target form; the converting of the pinyin in the target form into the pinyin identifier that matches the pinyin prefix of the target form includes: by querying the mapping relationship between the pinyin and the pinyin identifier, converting the pinyin in the target form into the pinyin identifier that matches the pinyin prefix of the target form; The prediction module is used to input the concatenation result into a sentence prediction model to obtain sentence candidates output by the sentence prediction model.

8. The device according to claim 7, It is characterized in that The input sequence includes a pinyin sequence, The conversion submodule is used to correct the pinyin sequence to obtain a corresponding error correction sequence; parse the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; The pinyin sequence is converted into corresponding word candidates based on the target syllable network.

9. The device according to claim 7, It is characterized in that The device also includes: A selection module is used to obtain input association information after converting the input sequence into corresponding word candidates; determine the first score information of each word candidate based on the input association information and the above information, wherein the first score information is used to characterize the rationality of the word candidate; and select the first N word candidates with the highest first score information, where N is a positive integer.

10. The device according to claim 9, It is characterized in that The output of the sentence prediction model also includes second score information of the sentence candidate, and the device also includes: The first sorting module is used to sort the sentence candidates when the sentence candidates include multiple ones based on the second score information of the sentence candidates and the first score information corresponding to the word candidates in the sentence candidates.

11. The device according to claim 7, It is characterized in that The device also includes: The second sorting module is used to obtain input association information when the sentence candidates include multiple ones; and sort the sentence candidates based on the input association information.

12. The device according to claim 7, It is characterized in that The device also includes: The training module is used to collect corpus; divide the corpus into sentence granularity to obtain training data; and / or divide the corpus into word granularity to obtain training data; and use the training data to train the sentence prediction model.

13. An electronic device, It is characterized in that The system comprises a memory and one or more programs, wherein the 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: Get the input sequence and the above information; Splicing the word candidates of the input sequence with the above information to obtain a corresponding splicing result, including: converting the input sequence into corresponding word candidates; splicing the word candidates after the above information to obtain a corresponding splicing result; the input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: parsing the pinyin sequence into multiple forms of pinyin; for the pinyin in the target form, converting the pinyin in the target form into a pinyin identifier that matches the pinyin prefix of the target form to obtain a syllable path corresponding to the pinyin in the target form; using multiple syllable paths to generate a target syllable network; based on the target syllable network, converting the pinyin sequence into corresponding word candidates; the prefix matching includes: the pinyin corresponding to the pinyin identifier contains the pinyin corresponding to the syllable in the pinyin in the target form; converting the pinyin in the target form into a pinyin identifier that matches the pinyin prefix of the target form, including: by querying the mapping relationship between pinyin and pinyin identifier, converting the pinyin in the target form into a pinyin identifier that matches the pinyin prefix of the target form; The concatenation result is input into a sentence prediction model to obtain sentence candidates output by the sentence prediction model.

14. The electronic device according to claim 13, It is characterized in that The input sequence includes a pinyin sequence, and converting the input sequence into corresponding word candidates includes: Correcting the pinyin sequence to obtain a corresponding error correction sequence; Parsing the pinyin sequence and the error correction sequence to obtain a corresponding target syllable network; The pinyin sequence is converted into corresponding word candidates based on the target syllable network.

15. The electronic device according to claim 13, It is characterized in that After converting the input sequence into corresponding word candidates, the electronic device further includes: Get input related information; Based on the input association information and the above information, determine first score information of each word candidate, wherein the first score information is used to characterize the rationality of the word candidate; Select the first N word candidates with the highest first score information, where N is a positive integer.

16. The electronic device according to claim 15, It is characterized in that The output of the sentence prediction model also includes second score information of the sentence candidate, and when the sentence candidate includes multiple candidates, it also includes instructions for performing the following operations: The sentence candidates are sorted based on the second score information of the sentence candidates and the first score information corresponding to the word candidates in the sentence candidates.

17. The electronic device according to claim 13, It is characterized in that When the sentence candidates include multiple ones, the command for performing the following operations is also included: Get input related information; The sentence candidates are ranked based on the input related information.

18. The electronic device according to claim 13, It is characterized in that It also contains instructions for training a sentence prediction model as follows: Collect corpus; Dividing the corpus into sentence granularity to obtain training data; and / or dividing the corpus into word granularity to obtain training data; The sentence prediction model is trained using the training data.

19. A readable storage medium, It is characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method as described in any one of method claims 1-6.

Citation Information

Patent Citations

  • Input method and input method system for improving sentence generating efficiency

    CN102866782A

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

    CN110673748A