Intelligent input method, device, and storage medium

By recognizing and calculating the strings input by users, and using a statement derivation model to generate input content that fits the user's habits, the problem that existing input methods cannot meet the needs of unique input habits is solved, thus improving input efficiency and user experience.

CN120295489BActive Publication Date: 2025-08-29SHENZHEN MINIPLAY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510773284.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-08-29
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

Existing input methods cannot meet the needs of users with unique input habits, forcing users to perform additional operations to delete automatically recommended words, thus hindering input efficiency.

Method used

By recognizing the string input by the user, obtaining the target character group and group number, calculating the semantic probability value, using the statement inference model to generate an initial statement that fits the user's habits, and then sorting and displaying it.

Benefits of technology

It improves user input efficiency, enhances user experience, and enables users to quickly generate input text that matches their input habits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295489B_ABST
    Figure CN120295489B_ABST
Patent Text Reader

Abstract

The present application discloses an intelligent input method, device, and storage medium. The method includes: identifying an acquired character string to obtain at least one target character group, and obtaining a group serial number corresponding to each target character group; calculating multiple semantic probability values ​​of the character string based on at least one semantic corresponding to the group serial number and a reference text, and taking the semantic represented by the highest semantic probability value as the target semantic of the character string, the reference text including input records and / or chat records; inputting the target semantic into a sentence deduction model, which generates at least one initial sentence and an applicable probability value for each initial sentence based on the target semantic; sorting the initial sentences based on the applicable probability value, and displaying the top K initial sentences as target sentences, where K is a positive integer. The intelligent input method described in the technical solution of the present application generates input content that fits the user's input habits while facilitating the user's input operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of input methods, and specifically relates to intelligent input methods, devices, and storage media. Background Art

[0002] With the advancement of science and technology, input methods can now fuzzy pronounce or automatically correct the user's input string to display the intended content. Furthermore, due to users' growing demand for intelligent input, current input methods can now automatically generate matching words based on partial user input, combined with fixed word combinations.

[0003] However, because current input methods are limited to correcting character strings and automatically recommending words based on fixed word combinations, they fail to meet the needs of users with unique input habits. Users cannot quickly enter their desired content using the recommended words, and instead need to delete the automatically recommended words, hindering user input efficiency.

[0004] Therefore, how to facilitate user input operations while generating input content that fits the user's input habits is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] The purpose of this application is to facilitate user input operations while generating input content that fits the user's input habits.

[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.

[0007] According to one aspect of an embodiment of the present application, a smart input method is provided, the method comprising:

[0008] Recognize the acquired character string to obtain at least one target character group, and obtain a group sequence number corresponding to each target character group;

[0009] Calculating multiple semantic probability values ​​of the string based on at least one semantic meaning corresponding to the group sequence number and a reference text, and using the semantic meaning represented by the highest semantic probability value as the target semantic meaning of the string, wherein the reference text includes an input record and / or a chat record;

[0010] Inputting the target semantics into a sentence derivation model, wherein the sentence derivation model generates at least one initial sentence and an applicable probability value of each initial sentence according to the target semantics;

[0011] The initial sentences are sorted according to applicable probability values, and the top K initial sentences are displayed as target sentences, where K is a positive integer.

[0012] According to one aspect of an embodiment of the present application, the acquired character string is recognized to obtain at least one target character group, including:

[0013] In the character string, a character string of a target length is obtained according to the arrangement order of each character as a first character group, and if the first character group can be successfully matched with the dictionary, the first character group is used as a target character group;

[0014] If the first character group cannot be successfully matched with the dictionary, gradually reducing the value of the target length to re-acquire the first character group until the first character group is successfully matched or the first character group is a single character, and the first character group is used as the target character group;

[0015] Continue to recognize characters that have not yet been divided until all characters have their own target character group.

[0016] According to one aspect of an embodiment of the present application, the acquired character string is recognized to obtain at least one target character group, including:

[0017] If the length of the character string is greater than a preset length threshold, dividing the character string into multiple sub-strings;

[0018] In any of the substrings, a character string of a target length is obtained in character arrangement order as a second character group, and if the second character group can be successfully matched with the dictionary, the second character group is used as the target character group;

[0019] If the second character group cannot be successfully matched with the dictionary, gradually reducing the value of the target length to re-acquire the second character group until it successfully matches the dictionary or the second character group is a single character, and using the second character group as the target character group;

[0020] The characters in the substring that have not been divided are further divided until all characters belong to a target character group.

[0021] According to one aspect of an embodiment of the present application, after continuing to divide the characters in the substring that have not yet been divided until all characters belong to a target character group, the method further includes:

[0022] For two adjacent target character groups belonging to different substrings, if there is a target character group that is a single character, the two adjacent target character groups belonging to different substrings are disbanded to obtain a compensation character string;

[0023] The target character group is acquired again for each of the compensation character strings.

[0024] According to one aspect of an embodiment of the present application, calculating multiple semantic probability values ​​of the character string based on at least one semantic meaning corresponding to the group sequence number and a reference text includes:

[0025] According to at least one semantic corresponding to each of the group sequence numbers, a plurality of semantic queues corresponding to the character string are obtained, wherein the semantics of each semantic queue are different;

[0026] According to each of the semantic queues and the reference text, a semantic probability value of each of the semantic queues is calculated.

[0027] According to one aspect of an embodiment of the present application, calculating the semantic probability value of each semantic queue according to each semantic queue and the reference text includes:

[0028] Calculate the sub-probability value of the current semantics based on the number of times the preceding semantics appear in the reference text; if the current semantics has no preceding semantics, use the probability of the current semantics appearing in the reference text as the sub-probability value of the current semantics;

[0029] According to the sub-probability value of each semantic, the semantic probability value of each semantic queue is calculated.

[0030] According to one aspect of an embodiment of the present application, the target semantics is input into a sentence inference model, and the sentence inference model generates at least one initial sentence and an applicable probability value of each initial sentence according to the target semantics, including:

[0031] The sentence deduction model generates a plurality of initial sentences according to the target semantics;

[0032] Each of the initial sentences is matched with a control text to obtain applicable probability values ​​of the multiple initial sentences.

[0033] According to one aspect of the embodiment of the present application, the sentence inference model is a BERT model; wherein,

[0034] The BERT model includes an input layer, a conversion layer, and an output layer. The input layer is used to vectorize the input target semantics to obtain a target vector group. The conversion layer is used to analyze the relationship between each vector in the target vector group from a set number of analysis angles. The output layer is used to generate a target sentence based on the analysis results of the target vector group.

[0035] For the obtained open source BERT model, convert the M-bit floating-point numbers of the model weights and activation values ​​in each layer of the BERT model into N-bit integers, where M and N are positive integers and M is greater than N, and delete multiple conversion layers to obtain the initial sentence derivation model;

[0036] The initial sentence derivation model is trained to obtain a sentence derivation model.

[0037] According to one aspect of an embodiment of the present application, the present application provides an intelligent input device, including a memory, a processor, and a readable program stored in the memory, wherein the processor executes the readable program to implement any of the methods described above.

[0038] According to one aspect of an embodiment of the present application, the present application provides a readable storage medium having a readable program / instruction stored thereon. When the readable program / instruction is executed by a processor, the method described in any one of the above items is implemented.

[0039] In the present application, the acquired character string is first identified to obtain at least one target character group, and the group serial number corresponding to each target character group is obtained. Then, based on at least one semantic corresponding to the group serial number and the reference text, multiple semantic probability values ​​of the character string are calculated to take the semantic represented by the highest semantic probability value as the target semantic of the character string. The reference text includes input records and / or chat records. The target semantics is then input into the sentence deduction model. The sentence deduction model generates at least one initial sentence and an applicable probability value of the initial sentence according to the target semantics. The initial sentences are sorted according to the applicable probability values, and the top K initial sentences are displayed as target sentences. The present application obtains the target character group by accurately identifying the character string input by the user, and obtains the target semantics of the character string based on the target character group and the reference text, so that the target semantics are more in line with the user's input habits. Finally, the target semantics identified are output through the sentence inference model for the user to select. That is, when using the input method, the user only needs to input a small number of characters to generate at least one target sentence for the user to select. And because the target semantics fit the user's input habits, the obtained target semantics also fit the user's input habits, thereby enabling the user to generate input text that fits the user's input habits with very few input operations, greatly improving the user's input efficiency and enhancing the user's usage experience.

[0040] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.

[0041] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0043] Figure 1 A flow chart of an intelligent input method according to an embodiment of the present application is shown.

[0044] Figure 2 A flowchart of recognizing an acquired character string to obtain at least one target character group according to an embodiment of the present application is shown.

[0045] Figure 3 A flowchart of recognizing an acquired character string to obtain at least one target character group according to another embodiment of the present application is shown.

[0046] Figure 4 A flowchart of modifying a target character group according to an embodiment of the present application is shown.

[0047] Figure 5 A flowchart is shown for calculating multiple semantic probability values ​​of a character string based on at least one semantic meaning corresponding to a group sequence number and a reference text according to an embodiment of the present application.

[0048] Figure 6 A flowchart of calculating the semantic probability value of each semantic queue based on each semantic queue and reference text according to one embodiment of the present application is shown.

[0049] Figure 7 A flowchart is shown in which the target semantics is input into a sentence derivation model, and the sentence derivation model generates at least one initial sentence and an applicable probability value of each initial sentence according to the target semantics.

[0050] Figure 8 A structural block diagram of a computer system for implementing an intelligent input method according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0052] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0053] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0054] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0055] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or portion of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal. It can be implemented in whole or in part using software, hardware (such as processing circuits or memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the functionality of the module or unit.

[0056] See also Figure 1 , Figure 1 A flowchart of an intelligent input method according to an embodiment of the present application is shown. The embodiment of the present application provides a method of intelligent input, including the following steps:

[0057] Step S110, identifying the acquired character string to obtain at least one target character group, and obtaining a group sequence number corresponding to each target character group;

[0058] Step S120, calculating multiple semantic probability values ​​of the string based on at least one semantic meaning corresponding to the group sequence number and a reference text, and taking the semantic meaning represented by the highest semantic probability value as the target semantic meaning of the string, where the reference text includes input records and / or chat records;

[0059] Step S130: input the target semantics into the sentence derivation model, and the sentence derivation model generates at least one initial sentence and an applicable probability value of each initial sentence according to the target semantics;

[0060] Step S140 , sorting the initial sentences according to the applicable probability values, and displaying the top K initial sentences as target sentences, where K is a positive integer.

[0061] The above four steps are described in detail below.

[0062] In step S110, a character string generated based on the user's operation is obtained. At this point, the character string is still a series of letters or symbols. Whether the user needs to determine Chinese or another language based on the letters, the character string must be split into at least multiple target character groups. A target character group is a character string that can form a semantic meaning, which facilitates the subsequent generation of a target sentence. For example, if the user uses pinyin input and enters multiple letters to generate a character string, the target character group determined from the character string is the pinyin. For example, the word "woaini" can be split into three target character groups: "wo," "ai," and "ni."

[0063] Therefore, in step S110, the character string is identified for target character groups, at least one target character group is obtained, and a group number corresponding to the target character group is obtained. It should be noted that each target character group corresponds to a word unit (similar to the pinyin of Chinese characters). For example, the character "woaini" is segmented into "wo," "ai," and "ni." These correspond to group numbers "001," "002," and "003," respectively.

[0064] In some embodiments, each target character group may correspond to a phrase (similar to the pinyin of a word in Chinese or a word in English). For example, "woaini" may be split into "wo" and "aini," which correspond to group numbers "001" and "002," respectively.

[0065] In the above embodiment, by serializing the target character groups, the loss of computing resources can be reduced, and the running speed of the technical solution can be accelerated, that is, the output efficiency of the target sentence can be accelerated.

[0066] In some embodiments, after obtaining a character string, the string is first cleaned, such as by removing punctuation and non-character content. After cleaning, the target character group is obtained from the string. In some embodiments, the string is further subjected to fuzzy sound processing before being segmented to obtain the target character group. In some embodiments, the entire string is further corrected, such as by correcting for adjacent keys, homophones / nearphones, glyph similarity, and prioritizing high-frequency characters. After this correction is completed, the target character group is obtained.

[0067] See also Figure 2 , Figure 2 A flowchart of recognizing an acquired character string and obtaining at least one target character group according to an embodiment of the present application is shown. The embodiment of the present application provides step S110 of recognizing an acquired character string and obtaining at least one target character group, including:

[0068] Step S111a, obtaining a character string of target length according to the order of arrangement of each character in the character string as a first character group, and if the first character group can be successfully matched with the dictionary, then using the first character group as the target character group;

[0069] Step S112a, if the first character group cannot be successfully matched with the dictionary, gradually reducing the value of the target length to re-acquire the first character group until the first character group is successfully matched or the first character group is a single character, and the first character group is used as the target character group;

[0070] Step S113a, continue to recognize the characters that have not been divided until all characters belong to the target character group.

[0071] The following is a detailed description of the above three steps.

[0072] In step 111a, a character string of a target length is obtained from the character string in the order in which the characters are arranged, and is used as a first character group. If the first character group successfully matches the dictionary, the first character group is used as the target character group. It should be noted that the dictionary may contain multiple character groups composed of different characters. If the first character group matches the dictionary, it means that the first character group meets the conditions for forming a target character group.

[0073] It should be noted that the target length refers to the maximum length of a character group in the dictionary. It should also be clarified that the target length string is obtained as the first character group based on the order of the characters. This can be done in either forward order (e.g., left to right) or reverse order (right to left).

[0074] In step S112a, if the first character group cannot be successfully matched in the dictionary, the target length value is gradually reduced to re-acquire the first character group until the first character group is successfully matched or the first character group is a single character, and the first character group is used as the target character group.

[0075] In step S113a, the characters that have not been divided are continuously recognized until all characters have a target character group to which they belong.

[0076] In the embodiment of the present application, by gradually dividing the character string, a longer character string can be accurately divided into clear target character groups.

[0077] In some embodiments, the character string is divided according to the forward order of each character and the reverse order of each character. It should be understood that the forward order refers to the order from left to right, that is, the order of character input time (from first input to last input); the reverse order refers to the order from right to left, that is, the reverse order of character input time (from last input to first input).

[0078] That is, the following steps are performed from two directions: a character string of target length is obtained as a first character group; if the first character group can be successfully matched in the dictionary, the first character group is used as a forward initial character group or a reverse initial character group according to the division direction; that is, the initial character group obtained by dividing the character string in a forward order is the forward initial character group. The initial character group obtained by dividing the character string in a reverse order is the reverse initial character group.

[0079] If the first character group cannot be successfully matched in the dictionary, the target length is gradually reduced to retrieve the first character group until the first character group is successfully matched or the first character group is a single character. The first character group is then used as the forward initial character group and the reverse initial character group according to the division direction. Characters that have not yet been divided are recognized until all characters have their corresponding forward initial character group and reverse initial character group.

[0080] In some embodiments, if the number of the reverse initial character group is less than that of the forward initial character group, the reverse initial character group is used as the target character group. If the number of the forward initial character group is less than that of the reverse initial character group, the forward initial character group is used as the target character group.

[0081] In some other embodiments, if the number of the reverse initial character group is greater than the number of the forward initial character group, the reverse initial character group is used as the target character group. If the number of the forward initial character group is greater than the number of the reverse initial character group, the forward initial character group is used as the target character group.

[0082] In other embodiments, the selection rules in the reverse initial character group and the forward initial character group can be customized.

[0083] In some embodiments, the same parts in the forward initial character combination and the reverse initial character are used as the target character group. If the acquisition of the target character group is completely accurate, the forward initial character combination and the reverse initial character will be exactly the same, but in actual application, there will be some reverse initial character groups that are different from the forward initial character group. This is because there are wrong characters in the character string, such as wrong characters formed by user input errors, which will appear in the form of "different parts in the forward initial character combination and the reverse initial character group" in this embodiment. In response to the above situation, the "different parts in the forward initial character combination and the reverse initial character group" are re-split into characters. If there is no target character group between the two split characters, the two characters are added to the same deviation character string, and then all the split characters are re-converted into deviation character strings to correct the character string. For example, adjacent key correction; homophone / near-phonetic correction; glyph similarity correction; high-frequency word priority correction. For the corrected character string,

[0084] The corrected deviation string is divided using any of the division methods mentioned in the above embodiments to obtain target character groups. All target character groups corresponding to the string are then obtained. For example, the forward initial character group and the reverse initial character group are further obtained for the corrected deviation string, and the one with the greater number or the less number of the forward initial character group and the reverse initial character group is selected as the target character group according to a preset screening rule.

[0085] It should be noted that after the "different parts of the forward initial character combination and the reverse initial character group" are re-split into characters for correction, there is no need to re-split the "different parts of the forward initial character combination and the reverse initial character group" into characters for error correction. This is because, on the one hand, a single cleaning is sufficient to correct the characters. On the other hand, multiple character string corrections are not allowed, as these will result in character distortion.

[0086] See also Figure 3 , Figure 3 A flowchart of recognizing an acquired character string to obtain at least one target character group according to another embodiment of the present application is shown. The embodiment of the present application provides step S110 of recognizing an acquired character string to obtain at least one target character group, including:

[0087] Step S111b: if the length of the character string is greater than a preset length threshold, the character string is divided into multiple sub-strings;

[0088] Step S112b, in any substring, obtaining a character string of target length according to the character arrangement order as a second character group, and if the second character group can be successfully matched with the dictionary, then using the second character group as the target character group;

[0089] Step S113b: if the second character group cannot be successfully matched with the dictionary, gradually reducing the value of the target length to re-acquire the second character group until it is successfully matched with the dictionary or the second character group is a single character, and the second character group is used as the target character group;

[0090] Step S114b: Continue to divide the characters in the substring that have not been divided yet, until all characters belong to the target character group.

[0091] The above four steps are described in detail below.

[0092] In step S111b, if the length of the character string is greater than a preset length threshold, the obtained character string is divided to obtain multiple sub-character strings.

[0093] In some embodiments, when dividing a string, the string may be divided into substrings of a set length. In some embodiments, the string may be divided into a set number of substrings, which may be divided equally or unevenly.

[0094] In step S112b, for any substring, a character string of the second length is obtained according to the character arrangement order as a second character group. If the second character group can be successfully matched in the dictionary, the second character group is used as the target character group. It should be noted that the substring can be divided into the second character groups according to the forward order of each character and the reverse order of each character.

[0095] In step S113b, if the second character group cannot be successfully matched in the dictionary, the value of the second length is gradually reduced to re-acquire the second character group until the match is successful or the second character group is a single character, and the second character group is used as the target character group.

[0096] In step S114b, the characters in the substring that have not been divided are further divided until all characters belong to a target character group.

[0097] It should be noted that the target character group is obtained by performing the technical means described in steps S112b and S114b on each substring.

[0098] In some embodiments, the target character groups in the sub-characters may be determined by separately determining the target character groups using the methods described in the above embodiments.

[0099] In the embodiment of the present application, if the length of the character string is too long, it will take too long to divide the character string, affecting the input efficiency of the input method. Therefore, the character string is divided into multiple substrings to recognize the target character group respectively, thereby speeding up the acquisition of the target character group.

[0100] See also Figure 4 , Figure 4 A flow chart of modifying a target character group according to an embodiment of the present application is shown. The present application embodiment provides steps for modifying a target character group, including:

[0101] Step S201: For two adjacent target character groups belonging to different substrings, if there is a target character group that is a single character, the two adjacent target character groups belonging to different substrings are disbanded to obtain a compensation character string;

[0102] Step S202: reacquire the target character group for each compensation character string.

[0103] The above two steps are described in detail below.

[0104] In step S201, for two adjacent target character groups belonging to different substrings, if there is a target character group that is a single character, the two adjacent target character groups belonging to different substrings are respectively dissolved, and then the characters obtained by dissolving the two target character groups are used as the compensation character string.

[0105] In step S202, the target character group is acquired again for each compensation character string. It should be noted that the target character group is acquired for the compensation character string in a manner that can use the technical means for acquiring the target character group described in any of the above embodiments.

[0106] In an embodiment of the present application, the division of a character string into multiple substrings may result in the loss of some target character groups. For example, adjacent characters that should form a target character group are divided into two adjacent substrings. In view of the above situation, for two target character groups that belong to different substrings and are adjacent, if there is a target character group that is a single character, the two target character groups that belong to different substrings and are adjacent are respectively disbanded to obtain compensation character strings. The characters that should belong to the same target character group are re-assigned to the same compensation character string, and the target character group is obtained again. The above technical means ensures the accuracy of obtaining the target character while efficiently obtaining the target character group for the character string.

[0107] In step S120, each group sequence number corresponds to a target character group, and the possible semantics of each target character group are the possible semantics of the group sequence number corresponding to the target character group. If the target character group is pinyin, the semantics corresponding to the target character group is Chinese characters.

[0108] In some implementations, each semantic sequence corresponding to a group sequence number is also represented by a semantic sequence number. Each semantic sequence number represents a semantic sequence.

[0109] For example, for the target character group "qin", the group number is "001", and the semantics are "qin (kiss), qin (Qin Dynasty), qin (diligent)", etc. The semantic numbers are "qin (kiss) (001001), qin (Qin Dynasty) (001002), qin (diligent) (001003)", etc. In this way, characters can also be digitized, thereby improving the running efficiency of the input method and reducing the occupation of computing resources by the input method.

[0110] Each group number corresponds to at least one semantics. By combining the semantics of each group number, the semantics corresponding to the string can be obtained, that is, there is at least one semantics corresponding to the string. By selecting one semantics corresponding to each group number respectively, a semantic queue can be obtained. Calculate the semantic probability values in the semantic queue respectively. Take the semantic queue with the highest semantic probability value as the semantics of the string.

[0111] Please refer to Figure 5 , Figure 5 FIG. shows a flowchart of calculating multiple semantic probability values of a string according to at least one semantics corresponding to a group number and a reference text according to an embodiment of the present application. The embodiment of the present application provides step S120 of calculating multiple semantic probability values of a string according to at least one semantics corresponding to a group number and a reference text, including:

[0112] Step S121, according to at least one semantics corresponding to each group number, obtain multiple semantic queues corresponding to the string, and the semantics of each semantic queue are different;

[0113] Step S122, calculate the semantic probability values of each semantic queue according to each semantic queue and the reference text.

[0114] The above two steps are described in detail below.

[0115] In step S121, each group number corresponds to at least one semantics. By combining the semantics corresponding to each group number, the semantics corresponding to the string can be obtained. The more the number of semantics corresponding to the group number, the more semantic queues corresponding to the string. By selecting one semantics corresponding to each group number respectively, a semantic queue of the string can be obtained. In this way, multiple semantic queues corresponding to the string can be obtained, and the semantics of each semantic queue are different.

[0116] In step S122, calculate the semantic probability values of each semantic queue according to the semantics corresponding to each group number in the semantic queue and the reference text.

[0117] In some embodiments, the reference text can be various texts (such as some articles with writing specifications) for calculating the matching degree of each semantic queue with various texts, so as to calculate the semantic probability value of the semantic queue.

[0118] Please refer to Figure 6, Figure 6 A flowchart of calculating the semantic probability value of each semantic queue based on each semantic queue and reference text according to one embodiment of the present application is shown. The embodiment of the present application provides step S122 of calculating the semantic probability value of each semantic queue based on each semantic queue and reference text, including:

[0119] Step S1221, calculating the sub-probability value of the current semantics based on the number of times the preceding semantics appear in the reference text; if the current semantics has no preceding semantics, the probability of the current semantics appearing in the reference text is used as the sub-probability value of the current semantics;

[0120] Step S1222 : Calculate the semantic probability value of each semantic queue according to the sub-probability value of each semantic.

[0121] The above two steps are described in detail below.

[0122] It's important to note that each group number corresponds to at least one semantic, and each semantic queue contains one semantic for each group number. The order of group numbers is the same as the order of the target character groups they correspond to. The order of semantics corresponding to each group number is the same as the order of group numbers. That is, the order of semantics in each semantic queue is the same as the order of group numbers.

[0123] In step S1221, the sub-probability value of the current semantics is calculated based on the number of times the preceding semantics appear in the reference text; if the current semantics has no preceding semantics, the probability of the current semantics appearing in the reference text (that is, the ratio of the current semantics in the reference text) is used as the sub-probability value of the current semantics. It should be clarified that the current semantics refers to the semantics for which the sub-probability value needs to be calculated, and the preceding semantics refers to the semantics that precede the current semantics in the semantic arrangement order. In other embodiments, the preceding semantics refers to the semantics that precede the current semantics in the semantic arrangement order and are adjacent to the current semantics.

[0124] In some embodiments, the sub-probability value of the current semantics is calculated by taking the number of occurrences of the preceding semantics in the reference text as the denominator and the number of adjacent occurrences of the preceding semantics and the current semantics in the reference text as the numerator. If the current semantics has no preceding semantics, the sub-probability value of the current semantics is calculated by taking the number of occurrences of the current semantics in the reference text as the numerator and the total number of semantics in the reference text as the denominator.

[0125] In some embodiments, each semantic in the reference text can also be digitized. This facilitates the calculation of semantic probability values. Identical semantics are assigned the same semantic number. Identical semantic numbers can be quickly searched for in the reference text. Simultaneously, digitizing the reference text significantly reduces the memory usage of the intelligent input method of this application, saving storage resources.

[0126] In step S1222 , the semantic probability value of the semantic queue is calculated based on the sub-probability value of each semantic.

[0127] In some implementations, the sum of the sub-probability values ​​of each semantic is used as the semantic probability value of the semantic queue. In some embodiments, the product of multiplying the sub-probability values ​​of each semantic is used as the semantic probability value of the semantic queue. In some embodiments, the sub-probability value of each semantic is substituted into a set formula to calculate the semantic probability value of the semantic queue.

[0128] In some embodiments, the probability of various semantic meanings in a string is calculated based on the rationality of the semantic splicing of adjacent group numbers, as well as the user's input method usage history and chat history. This ensures that the target semantics of the resulting string are logically coherent, consistent with the user's input habits and current chat context, and ensures optimal semantic effects for the string.

[0129] In some embodiments, the first text may be a reference text, which refers to a regular text without grammatical errors. The first text may be various texts (such as some articles with standard writing style) used to calculate the degree of matching between each semantic queue and various texts to calculate the reasonable probability value of the semantic queue. The higher the reasonable probability value, the more the semantic queue conforms to the grammatical rules and the more reasonable it is. Finally, the semantic probability value of the semantic queue calculated by steps S1221-S1222 is used.

[0130] In some embodiments, the second text may also be a reference text, and the second text is used to record the user's input.

[0131] First, the first text is used as the reference text, and the sub-probability values ​​in the semantic queue calculated using the technical means described in steps S1221-S1222 are used as the first probability values, and the reasonable probability value of the semantic queue is calculated based on each first probability value. In some embodiments, the product obtained by multiplying the first probability values ​​of each semantic is used as the reasonable probability value of the semantic queue. In some embodiments, the first probability value of each semantic is substituted into the set formula to calculate the reasonable probability value of the semantic queue.

[0132] Then, the second text is used as the reference text, and each sub-probability value in the semantic queue calculated by the technical means described in step S1221-step S1222 is used as the second probability value, and the historical probability value of the semantic queue is calculated based on each second probability value. In some embodiments, the product obtained by multiplying the second probability value of each semantic is used as the historical probability value of the semantic queue. In some embodiments, the second probability value of each semantic is substituted into the set formula to calculate the historical probability value of the semantic queue. The higher the historical probability value, the more the instructions conform to the user's input habits.

[0133] Finally, the semantic probability value of the semantic queue is calculated based on the reasonable probability value and the historical probability value. For example, the sum of the reasonable probability value and the historical probability value is used as the semantic probability value of the semantic queue. Alternatively, the sum of the reasonable probability value and the historical probability value is calculated based on the preset weight as the semantic probability value of the semantic queue. Alternatively, the reasonable probability value and the historical probability value are substituted into the preset formula to calculate the semantic probability value of the semantic queue.

[0134] In other embodiments, the third text may be a reference text, and the third text refers to the chat record generated under the current chat box or chat event (it should be clear that the chat event refers to a certain event in the chat box). After calculating the historical probability value of the semantic queue, the third text is used as the reference text, and the various sub-probability values ​​in the semantic queue calculated by the technical means described in steps S1221-S1222 are used as the third probability values, and the scene probability value of the semantic queue is calculated based on each third probability value. In some embodiments, the product obtained by multiplying the third probability values ​​of each semantic is used as the scene probability value of the semantic queue. In some embodiments, the third probability value of each semantic is substituted into the set formula to calculate the scene probability value of the semantic queue. The higher the historical probability value, the more the instructions conform to the user's current chat scene.

[0135] Finally, the semantic probability value of the semantic queue is calculated based on the reasonable probability value, the historical probability value, and the scenario probability value. For example, the sum of the reasonable probability value and the historical probability value is used as the semantic probability value of the semantic queue. Alternatively, the sum of the reasonable probability value and the historical probability value is calculated based on the preset weights as the semantic probability value of the semantic queue. Alternatively, the reasonable probability value and the historical probability value are substituted into the preset company to calculate the semantic probability value of the semantic queue.

[0136] In some embodiments, the second and third texts need to be updated frequently because they are time-sensitive. The developer can customize the update rules for the second and third texts. For example, the second and / or third texts are updated at set intervals. For example, in some embodiments, whenever a semantic probability value is obtained, the chat history for a set period of time in the current chat box or chat event is used as the third text.

[0137] In step S130, the target semantics of the string are input into a sentence inference model. The sentence inference model generates at least one initial sentence and a probability of applicability of the initial sentence based on the target semantics. The sentence inference model is used to extend and infer a sentence based on a small number of prompt words (e.g., the target semantics) as the initial sentence.

[0138] The following technical means can be used to calculate the applicable probability value of each initial statement. Figure 7 , Figure 7 A flowchart is shown for inputting target semantics into a sentence derivation model, where the sentence derivation model generates at least one initial sentence and an applicable probability value for each initial sentence based on the target semantics. The embodiment of the present application provides step S130 of inputting target semantics into a sentence derivation model, where the sentence derivation model generates at least one initial sentence and an applicable probability value for each initial sentence based on the target semantics, including:

[0139] Step S131: The sentence derivation model generates a plurality of initial sentences according to the target semantics;

[0140] Step S132 : Match each initial sentence with the reference text to obtain applicable probability values ​​of the multiple initial sentences.

[0141] The above two steps are described in detail below.

[0142] In step S131 , the sentence inference model generates a plurality of initial sentences according to the target semantics.

[0143] In step S132, each initial sentence is matched with the chat record to obtain the applicable probability values ​​of the multiple initial sentences. Specifically, the initial sentence is divided into multiple word units (equivalent to the semantics above). When calculating the applicable probability value of each initial sentence, the probability value of each word unit in the initial sentence is first calculated as the initial probability value. The initial probability value of each word unit is predicted in sequence according to the position of the word unit in the initial sentence; wherein,

[0144] For the current word, the initial probability value of the current word is calculated based on the number of times the preceding word appears in the reference text; if the current word has no preceding word, the probability of the current word appearing in the reference text (that is, the proportion of the semantics corresponding to the current word in the reference text) is used as the initial probability value of the current word.

[0145] In some embodiments, the initial probability value of the current word is calculated by taking the number of occurrences of the preceding word in the reference text as the denominator and the number of adjacent occurrences of the preceding word and the current word in the reference text as the numerator. If the current word has no preceding word (i.e., the current word is the first word in the initial sentence), the initial probability value of the current word is calculated by taking the number of occurrences of the current word in the reference text as the numerator and the total number of words in the reference text as the denominator. Based on the initial probability values ​​of each word, the applicable probability value of the initial sentence is calculated.

[0146] In some implementations, the sum of the initial probability values ​​of each word-gram is used as the applicable probability value of the initial sentence. In some embodiments, the product of the initial probability values ​​of each word-gram is used as the applicable probability value of the initial sentence. In some embodiments, the initial probability value of each word-gram is substituted into a predetermined formula to calculate the applicable probability value of the initial sentence.

[0147] In some embodiments, the second text is used as a control text, and the initial probability value of each word is calculated using the above-mentioned technical means. Then, the historical applicability probability value of the initial sentence is calculated based on the initial probability value of each word, and the historical applicability probability value is directly used as the applicability probability value of the initial sentence.

[0148] In some implementations, the second text is first used as a control text, and the initial probability value of each word element calculated using the above-mentioned technical means is used as the first initial probability value. Then, the historical applicability probability value of the initial sentence is calculated based on the first initial probability value of each word element. Exemplarily, the sum of the first initial probability values ​​of each word element is used as the historical applicability probability value of the initial sentence. In some embodiments, the product obtained by multiplying the first initial probability values ​​of each word element is used as the historical applicability probability value of the initial sentence. In some embodiments, the first initial probability value of each word element is substituted into a set formula to calculate the historical applicability probability value of the initial sentence.

[0149] The third text is then used as the reference text, and the initial probability value of each word element calculated using the above-mentioned technical means is used as the second initial probability value. Then, the scenario applicability probability value of the initial sentence is calculated based on the second initial probability value of each word element. In some implementations, the sum of the second initial probability values ​​of each word element is used as the scenario applicability probability value of the initial sentence. In some embodiments, the product obtained by multiplying the second initial probability values ​​of each word element is used as the scenario applicability probability value of the initial sentence. In some embodiments, the second initial probability value of each word element is substituted into the set formula to calculate the scenario applicability probability value of the initial sentence.

[0150] In some embodiments, the applicability probability value of the initial statement is calculated based on the historical applicability probability value and the scenario applicability probability value. For example, the sum of the historical applicability probability value and the scenario applicability probability value is used as the applicability probability value of the initial statement. Alternatively, the sum of the historical applicability probability value and the scenario applicability probability value is used as the applicability probability value of the initial statement. Alternatively, the historical applicability probability value and the scenario applicability probability value are substituted into a preset company to calculate the applicability probability value of the initial statement.

[0151] The initial sentence obtained in the above manner is further screened to ensure that the initial sentence can better fit the user's input habits and the current chat scenario.

[0152] In step S140 , the initial sentences are sorted according to the applicable probability values, and the top K ranked initial sentences are displayed as target sentences for the user to select.

[0153] This application obtains a target character group by accurately identifying the character string input by the user, and obtains the target semantics of the character string based on the target character group and the reference text, so that the target semantics are more in line with the user's input habits. Finally, the target semantics are output to the target sentence through the sentence deduction model for the identified target semantics for the user to choose. That is, when using the input method, the user only needs to enter a small number of characters to generate at least one target sentence for the user to choose. Since the target semantics are in line with the user's input habits, the obtained target semantics are also in line with the user's input habits, thereby enabling the user to generate input text that is in line with the user's input habits with very few input operations, greatly improving the user's input efficiency and enhancing the user's experience.

[0154] In some embodiments, the sentence inference model is a BERT model (Bidirectional Encoder Representation from Transformers); wherein the BERT model includes an input layer, a transformation layer, and an output layer. The input layer is used to vectorize the input target semantics to obtain a target vector group. The transformation layer is used to analyze the relationship between each vector in the target vector group from a set number of analysis angles. The output layer is used to generate a target sentence based on the analysis results of the target vector group.

[0155] For the obtained open-source BERT model, convert the M-bit floating-point values ​​of the model weights and activation values ​​in each layer of the BERT model into N-bit integers, where M and N are positive integers and M is greater than N. (For example, compressing the model weights from 32-bit floating-point type (FP32) to 8-bit integer type (INT8) reduces the size by 75% while maintaining over 95% inference accuracy.) Then, pruned multiple conversion layers to obtain the initial sentence inference model.

[0156] For example, using TensorFlow Lite or ONNX to convert the BERT model, applying INT8 quantization (reducing size by 75% and accelerating CPU inference by 3-4 times) and performing structured pruning are also possible. By improving the BERT model, input methods based on the BERT model can be easily run on mobile devices (such as mobile phones). Finally, the initial sentence inference model is trained to obtain the sentence inference model.

[0157] Figure 8 A structural block diagram of a computer system for implementing an intelligent input method according to an embodiment of the present application is shown.

[0158] It should be noted that Figure 8 The computer system 800 shown is only an example and should not limit the functions and scope of use of the embodiments of the present application.

[0159] like Figure 8 As shown, computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage 808 into random access memory (RAM) 803. RAM 803 also stores various programs and data required for system operation. CPU 801, ROM 802, and RAM 803 are interconnected via bus 804. An input / output interface (I / O) 805 is also connected to bus 804.

[0160] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, mouse, and the like; an output section 807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 808 including a hard disk; and a communication section 809 including a network interface card such as a local area network card or a modem. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. Removable media 811, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 810 as needed, so that computer programs read from the removable media can be installed in the storage section 808 as needed.

[0161] In particular, according to an embodiment of the present application, the processes described in the various method flow charts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods shown in the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809 and / or installed from a removable medium 811. When the computer program is executed by the central processing unit 801, the various functions defined in the system of the present application are performed.

[0162] It should be noted that the computer-readable medium described in the embodiments of this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal transmitted in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0163] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0164] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0165] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0166] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.

[0167] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. An intelligent input method, characterized in that: The method comprises: Recognize the acquired character string to obtain at least one target character group, and obtain a group sequence number corresponding to each target character group; Calculating multiple semantic probability values ​​of the string based on at least one semantic meaning corresponding to the group sequence number and a reference text, and using the semantic meaning represented by the highest semantic probability value as the target semantic meaning of the string, wherein the reference text includes an input record and / or a chat record; Inputting the target semantics into a sentence derivation model, wherein the sentence derivation model generates at least one initial sentence and an applicable probability value of each initial sentence according to the target semantics; The initial sentences are sorted according to applicable probability values, and the top K initial sentences are displayed as target sentences, where K is a positive integer.

2. The method according to claim 1, characterized in that Recognize the acquired character string to obtain at least one target character group, including: In the character string, a character string of a target length is obtained according to the arrangement order of each character as a first character group, and if the first character group can be successfully matched with the dictionary, the first character group is used as a target character group; If the first character group cannot be successfully matched with the dictionary, gradually reducing the value of the target length to re-acquire the first character group until the first character group is successfully matched or the first character group is a single character, and the first character group is used as the target character group; Continue to recognize characters that have not yet been divided until all characters have their own target character group.

3. The method according to claim 1, characterized in that Recognize the acquired character string to obtain at least one target character group, including: If the length of the character string is greater than a preset length threshold, dividing the character string into multiple sub-strings; In any of the substrings, a character string of a target length is obtained in character arrangement order as a second character group, and if the second character group can be successfully matched with the dictionary, the second character group is used as the target character group; If the second character group cannot be successfully matched with the dictionary, gradually reducing the value of the target length to re-acquire the second character group until it successfully matches the dictionary or the second character group is a single character, and using the second character group as the target character group; The characters in the substring that have not been divided are further divided until all characters belong to a target character group.

4. The method according to claim 3, characterized in that The method further includes: continuing to divide the characters in the substring that have not been divided until all characters belong to a target character group; For two adjacent target character groups belonging to different substrings, if there is a target character group that is a single character, the two adjacent target character groups belonging to different substrings are disbanded to obtain a compensation character string; The target character group is acquired again for each of the compensation character strings.

5. The method according to claim 1, wherein Calculating multiple semantic probability values ​​of the character string according to at least one semantic meaning corresponding to the group sequence number and a reference text, including: According to at least one semantic corresponding to each of the group sequence numbers, a plurality of semantic queues corresponding to the character string are obtained, wherein the semantics of each semantic queue are different; According to each of the semantic queues and the reference text, a semantic probability value of each of the semantic queues is calculated.

6. The method according to claim 5, characterized in that Calculating the semantic probability value of each semantic queue according to each semantic queue and the reference text includes: Calculate the sub-probability value of the current semantics based on the number of times the preceding semantics appear in the reference text; if the current semantics has no preceding semantics, use the probability of the current semantics appearing in the reference text as the sub-probability value of the current semantics; According to the sub-probability value of each semantic, the semantic probability value of each semantic queue is calculated.

7. The method according to claim 1, characterized in that Inputting the target semantics into a sentence derivation model, wherein the sentence derivation model generates at least one initial sentence and an applicable probability value of each initial sentence according to the target semantics, including: The sentence deduction model generates a plurality of initial sentences according to the target semantics; Each of the initial sentences is matched with a control text to obtain applicable probability values ​​of the multiple initial sentences.

8. The method according to claim 1, characterized in that The sentence derivation model is a BERT model; wherein, The BERT model includes an input layer, a conversion layer, and an output layer. The input layer is used to vectorize the input target semantics to obtain a target vector group. The conversion layer is used to analyze the relationship between each vector in the target vector group from a set number of analysis angles. The output layer is used to generate a target sentence based on the analysis results of the target vector group. For the obtained open source BERT model, convert the M-bit floating-point numbers of the model weights and activation values ​​in each layer of the BERT model into N-bit integers, where M and N are positive integers and M is greater than N, and delete multiple conversion layers to obtain the initial sentence derivation model; The initial sentence derivation model is trained to obtain a sentence derivation model.

9. An intelligent input device comprising a memory, a processor, and a readable program stored in the memory, characterized in that: The processor executes the readable program to implement the method according to any one of claims 1 to 8.

10. A readable storage medium, characterized in that: A readable program / instruction is stored thereon, and when the readable program / instruction is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Statement recognition method and device, equipment and computer storage medium

    CN113064497A

  • Method and system for converting pinyin into Chinese characters

    CN117032469A