Search

CN-122021648-A - Input prediction method, device and computer program product

CN122021648ACN 122021648 ACN122021648 ACN 122021648ACN-122021648-A

Abstract

The application discloses an input prediction method, equipment and a computer program product, wherein the method comprises the steps of firstly generating a first prediction instruction input prediction big model by utilizing target context information input by a target user to perform reasoning so as to obtain N candidate context information; and then constructing a pinyin labeling result and a digital labeling result corresponding to each candidate piece of the downlink information, and storing each piece of the candidate piece of the downlink information and the corresponding relation between the pinyin labeling result and the digital labeling result. And then matching part of the context information input by the target user with the stored pinyin labeling result and the stored digital labeling result, and finally determining the target context information corresponding to the target context information according to the obtained matching result, so that the effect of polyphones is eliminated, long-context prediction can be realized, sentences or expressions which accord with the context but are never appeared in training data can be created as the target context information, and the prediction efficiency and accuracy of the input of the target user can be improved.

Inventors

  • LI SHUAI
  • WANG QINGRAN
  • PAN QINGHUA
  • ZHAO MINGLU

Assignees

  • 科大讯飞股份有限公司

Dates

Publication Date
20260512
Application Date
20260204

Claims (13)

  1. 1. An input prediction method, comprising: Generating a first prediction instruction input prediction big model by utilizing the target context information to perform reasoning so as to obtain N candidate context information corresponding to the target context information, wherein N is a positive integer greater than 0; Constructing a pinyin marking result and a digital marking result corresponding to each candidate piece of the N candidate piece of the downlink information, and storing the corresponding relation between each candidate piece of the downlink information and the pinyin marking result and the digital marking result; The method comprises the steps of obtaining partial context information input by a target user, and matching the partial context information with a stored pinyin marking result and a stored digital marking result; and determining target context information corresponding to the target context information according to the obtained matching result.
  2. 2. The method according to claim 1, wherein the predictive macro model is constructed as follows: Acquiring sample information, and performing data cleaning processing on the sample information to obtain cleaned sample information, wherein the sample information comprises sample upper information and sample lower information; Carrying out inference training on the initial prediction big model by using the cleaned sample information to obtain a first-layer trained prediction big model, so that the model has inference capability; Performing fine tuning training of sensitive content identification on the prediction big model trained on the first layer by utilizing the sensitive sample information to obtain a prediction big model trained on the second layer, so that the model has the capability of identifying and refusing to generate sensitive content; acquiring an evaluation result of the predicted context information output by the user on the second-layer trained prediction big model, and training a reward model according to the evaluation result; And (3) optimizing the PPO method based on a near-end strategy, and performing iterative training on the prediction big model after the second layer training by using the score value of the reward model to obtain the prediction big model after three layers training.
  3. 3. The method of claim 1, wherein the constructing the pinyin-labeling result and the numeric-labeling result corresponding to each candidate context information in the N candidate context information comprises: Obtaining optimal phonetic notation corresponding to each candidate context information in the N candidate context information from decoding resources of the FST structure of the finite state transducer, and taking the optimal phonetic notation as a pinyin labeling result; and matching the numeric marking result corresponding to the pinyin marking result according to the corresponding relation of the nine-square keyboard.
  4. 4. The method according to claim 1, wherein storing the candidate context information and the correspondence between the pinyin and the numeric labels thereof comprises: Creating node identifiers for each candidate context information and the mapping relation between the pinyin marking result and the digital marking result; and storing candidate context information corresponding to each node identifier and the mapping relation between the pinyin marking result and the digital marking result according to the output sequence of the prediction big model.
  5. 5. The method of claim 1, wherein the partial context information is pinyin information or numeric information, and wherein the matching the partial context information with the stored pinyin-and numeric-labeling results comprises: when the part of the context information is pinyin information, matching the pinyin information with a stored pinyin labeling result, judging whether the pinyin information is consistent with a prefix substring in the stored pinyin labeling result, if so, matching successfully, otherwise, matching failed; Or when the partial context information is digital information, matching the digital information with a stored digital labeling result, judging whether the digital information is consistent with a prefix substring in the stored digital labeling result, if so, matching is successful, and if not, matching is failed.
  6. 6. The method according to claim 1, wherein determining the target context information corresponding to the target context information according to the obtained matching result includes: If the obtained matching result is successful, the candidate context information corresponding to the pinyin marking result or the number marking result which is successful in matching is used as the target context information corresponding to the target context information; And if the obtained matching result is that the matching is failed, generating target context information corresponding to the target context information by utilizing a decoding result corresponding to the partial context information.
  7. 7. The method of claim 6, wherein generating the target context information corresponding to the target context information using the decoding result corresponding to the partial context information comprises: judging whether the decoding result corresponding to the partial context information is consistent with the prefix word string in the stored candidate context information; If yes, the candidate context information with consistent prefix strings is used as target context information corresponding to the target context information; If not, generating a second prediction instruction to input a prediction big model for reasoning by using the decoding result corresponding to the partial context information, and predicting to obtain the target context information corresponding to the target context information.
  8. 8. The method of claim 7, wherein generating a second prediction instruction input prediction big model to infer by using the decoding result corresponding to the partial context information, and predicting to obtain the target context information corresponding to the target context information, includes: generating a prompt instruction by utilizing the target above information, inputting the prompt instruction into a prediction big model, and carrying out reasoning at a pre-filling prefill stage to obtain original prediction scores corresponding to all decoding results; Selecting a decoding result with the highest original prediction score, combining the target context information, generating a second prediction instruction input prediction big model for reasoning, obtaining M candidate context information corresponding to the target context information, and then executing the steps of constructing a pinyin labeling result and a digital labeling result corresponding to each candidate context information in the M candidate context information until the target context information corresponding to the target context information is obtained, wherein M is a positive integer greater than 0.
  9. 9. The method according to any one of claims 1-8, further comprising: And displaying the target context information corresponding to the target context information in the upper right corner of the input method interface.
  10. 10. The method of any one of claims 1-8, wherein the predictive large model is deployed on an end side.
  11. 11. An input prediction device is characterized by comprising a processor, a memory and a system bus; the processor and the memory are connected through the system bus; The memory is for storing one or more programs, the one or more programs comprising instructions, which when executed by the processor, cause the processor to perform the method of any of claims 1-10.
  12. 12. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein instructions, which when run on a terminal device, cause the terminal device to perform the method of any of claims 1-10.
  13. 13. A computer program product, characterized in that the program product comprises a computer program which, when executed by an electronic product, is capable of implementing the method of any one of claims 1-10.

Description

Input prediction method, device and computer program product Technical Field The present application relates to the field of natural language processing, and in particular, to an input prediction method, apparatus, and computer program product. Background With the rapid development of information technologies such as artificial intelligence and the Internet of things, application scenes of human-computer interaction are wider and wider. The input method is used as the most important text entry of man-machine interaction, and the intelligent level directly determines the communication efficiency and experience of the vast users. Currently, the existing input method generally predicts the possible input context of the user only according to the shorter context, the prediction result is not accurate enough, and the input cost of the user may be increased to a certain extent. Specifically, in the existing input method system, the method for predicting user input generally comprises three modes, namely, the first mode is to rely on a statistical language model, and by counting a large number of corpora, the conditional probability that a word or phrase appears immediately after the previous word is calculated to form a probability file reflecting language habit, so that when a user inputs the first Chinese character or word, the user can predict the subsequent possible candidate word or phrase according to the probability file, but the mode cannot realize long-term prediction and cannot generate new words which conform to semantic logic but do not appear in corpora. The second is prediction of user input by matching a text database, but this approach only predicts what is already in the database. For new words, new expressions and personalized expressions which do not exist in the database, effective prediction cannot be performed. Thirdly, the cloud input method is calculated and pinyin predicted through the cloud server, but the method is very dependent on network connection, and once the network is unstable or interrupted, the functions such as whole sentence prediction and the like cannot be used or the performance is greatly reduced, and the functions are possibly degraded into basic local input, so that the input efficiency and experience of a user are affected. Therefore, the existing three methods for predicting the user input can not achieve the ideal effect, and the input experience of the user is reduced. Disclosure of Invention The embodiment of the application mainly aims to provide an input prediction method, equipment and a computer program product, which can improve the prediction efficiency and accuracy of user input, and can still provide high-level intelligent prediction in a netless or weak network environment, thereby achieving ideal prediction effect and further improving the input experience of users. The embodiment of the application provides an input prediction method, which comprises the following steps: Generating a first prediction instruction input prediction big model (large language model, LLM) by utilizing the target context information to perform reasoning so as to obtain N candidate context information corresponding to the target context information, wherein N is a positive integer greater than 0; Constructing a pinyin marking result and a digital marking result corresponding to each candidate piece of the N candidate piece of the downlink information, and storing the corresponding relation between each candidate piece of the downlink information and the pinyin marking result and the digital marking result; The method comprises the steps of obtaining partial context information input by a target user, and matching the partial context information with a stored pinyin marking result and a stored digital marking result; and determining target context information corresponding to the target context information according to the obtained matching result. In a possible implementation manner, the construction manner of the prediction big model is as follows: Acquiring sample information, and performing data cleaning processing on the sample information to obtain cleaned sample information, wherein the sample information comprises sample upper information and sample lower information; Carrying out inference training on the initial prediction big model by using the cleaned sample information to obtain a first-layer trained prediction big model, so that the model has inference capability; Performing fine tuning training of sensitive content identification on the prediction big model trained on the first layer by utilizing the sensitive sample information to obtain a prediction big model trained on the second layer, so that the model has the capability of identifying and refusing to generate sensitive content; acquiring an evaluation result of the predicted context information output by the user on the second-layer trained prediction big model, and training a reward model according to the e