Method for obtaining candidate input information and related products
Patent Information
- Application Number
- CN202211311447.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-10-25
AI Technical Summary
然而,字符串往往可以有多种不同的切分方式,而这些不同的切分方式各自还对应多种不同的候选输入信息,因此,候选输入信息的数量可能多达几十个甚至上百个
[0044] In this embodiment, after determining the scores corresponding to multiple segmentation methods of the string based on the user-input string, the switching order of the multiple segmentation methods can be obtained based on the scores of each segmentation method. Thus, in response to a segmentation method switching trigger operation, the current segmentation method of the string can be switched according to the switching order, and the string can be segmented using the switched segmentation method, thereby obtaining candidate input information for the string under the switched segmentation method. For example, if the user-input string is "wan", the switching order of the multiple segmentation methods corresponding to this string could be "wan", "w'a'n", "wa'n", and "w'an". If the string is segmented into "w'a'n" by the current segmentation method, then by triggering a segmentation method switch and combining the switching order of the multiple segmentation methods, the string "w'a'n" can be segmented into "wa'n", thus ensuring that the candidate input information is only related to the switched segmentation method "wa'n", achieving preliminary screening of candidate input information and reducing the number of candidate input information presented to the user. In this way, by switching the segmentation method, the input method can provide candidate input information under multiple segmentation methods, allowing users to quickly select the input information that matches their true input intention from a smaller number of candidate input information, saving users time and improving the effectiveness of the input method.
Smart Images

Figure CN115543103B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a method for obtaining candidate input information and related products. Background Technology
[0002] Input methods, as an important means of human-computer interaction, are widely used in terminal devices such as computers, tablets, mobile phones, and smart home appliances. In particular, improving the performance of input methods has always been a hot topic of research for researchers in related fields.
[0003] In input methods applicable to the Chinese Pinyin system, the current approach involves comprehensively sorting multiple candidate input information corresponding to the user's input string and displaying the top-ranked candidate input information in the input method's candidate bar for the user to choose from. If the user does not find input information matching their intended input from the candidate bar, they need to manipulate the candidate bar to obtain a display interface showing all candidate input information arranged in alternating segments. However, strings often have multiple different segmentation methods, each corresponding to multiple different candidate input information, resulting in dozens or even hundreds of candidate input information. In this situation, users need to spend a considerable amount of time searching through these candidate results arranged in alternating segments to find the input information that matches their intended input, leading to poor input method performance. Summary of the Invention
[0004] This application provides a method for obtaining candidate input information and related products, which can initially screen candidate input information, help users quickly find input information that matches their input intention, and improve the effect of input methods.
[0005] In a first aspect, embodiments of this application provide a method for obtaining candidate input information, including:
[0006] Based on the string input by the user, determine the scores corresponding to the multiple segmentation methods of the string;
[0007] Based on the scores corresponding to the multiple segmentation methods, the switching order of the multiple segmentation methods is obtained;
[0008] In response to a trigger operation for switching the segmentation method, the current segmentation method of the string is switched according to the switching order;
[0009] The string is segmented using the switched segmentation method to obtain candidate input information of the string under the switched segmentation method.
[0010] Optionally, determining the scores corresponding to the multiple segmentation methods of the string based on the user-input string includes:
[0011] Determine the candidate input information for the string under the multiple segmentation methods;
[0012] Calculate the probability that candidate input information under each of the multiple segmentation methods matches the target input information, and use this probability as the first probability corresponding to the candidate input information under each of the multiple segmentation methods; the target input information represents the user's true input intention.
[0013] Based on the first probability corresponding to the candidate input information of the string under the same segmentation method, the score corresponding to the same segmentation method is determined.
[0014] Optionally, the candidate input information of the string under the same segmentation method is represented in the form of multiple terms; determining the score corresponding to the same segmentation method based on the first probability corresponding to the candidate input information of the string under the same segmentation method includes:
[0015] The probability summation value is obtained by summing the first probabilities corresponding to the multiple terms respectively, and the probability summation value is used as the score corresponding to the same division method.
[0016] Optionally, the step of obtaining the probability summation value based on the sum of the first probabilities corresponding to the plurality of terms includes:
[0017] Based on the display position of the multiple terms, the terms displayed in the candidate column are designated as the first terms, and the terms not displayed in the candidate column are designated as the second terms.
[0018] Based on the first probability and penalty coefficient of the second term, the second term is penalized to obtain the penalty probability of the second term;
[0019] The probability summation value is obtained by summing the first probability of the first term and the penalty probability of the second term.
[0020] Optionally, the step of obtaining the probability summation value based on the sum of the first probabilities corresponding to the plurality of terms includes:
[0021] Determine the initial words to be displayed in the candidate bar; the initial words are the candidate input information displayed by the string under the preset rules of the input method;
[0022] The initial term is removed from the plurality of terms, and the first probability of the remaining terms in the plurality of terms is summed to obtain the probability sum value.
[0023] Optionally, after using the sum of the probabilities as the score corresponding to the same division method, the method further includes:
[0024] Obtain the input method of the string and determine the probability adjustment coefficient corresponding to the input method;
[0025] The probability summation value is adjusted based on the probability adjustment coefficient;
[0026] Based on the adjusted probability summation, update the score corresponding to the same division method.
[0027] Optionally, the candidate input information of the string under the same segmentation method is represented in the form of a complete sentence; the complete sentence is composed of multiple unary words; determining the score corresponding to the same segmentation method based on the first probability corresponding to the candidate input information of the string under the same segmentation method includes:
[0028] Obtain the order and score of the multiple unary word segments in the entire sentence;
[0029] Based on the order of the unary segmentation words in the whole sentence, the scores of the unary segmentation words in the whole sentence are adjusted respectively;
[0030] The sum of scores from multiple adjusted unary word segments is used to obtain a score, which is then used as the score corresponding to the same segmentation method.
[0031] Optionally, the method further includes:
[0032] Delete the score of the target segmentation method; the number of candidate input information for the string under the target segmentation method is less than a preset number;
[0033] The candidate input information under the target segmentation method is merged into the candidate input information under the last segmentation method in the switching order.
[0034] Secondly, embodiments of this application provide a device for acquiring candidate input information, including:
[0035] The scoring module is used to determine the scores corresponding to multiple segmentation methods of the string based on the string input by the user.
[0036] The switching order determination module is used to obtain the switching order of the multiple segmentation methods based on the scores corresponding to the multiple segmentation methods respectively;
[0037] The segmentation method switching module is used to switch the current segmentation method of the string according to the switching order in response to the segmentation method switching trigger operation;
[0038] The candidate input information acquisition module is used to segment the string using the switched segmentation method to obtain the candidate input information of the string under the switched segmentation method.
[0039] Thirdly, embodiments of this application provide a device for acquiring candidate input information, the device comprising: a processor, a memory, and a system bus;
[0040] The processor and the memory are connected via the system bus;
[0041] The memory is used to store one or more programs, the one or more programs including instructions, which, when executed by the processor, cause the processor to perform any of the above-described methods for obtaining candidate input information.
[0042] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform any of the above-described methods for obtaining candidate input information.
[0043] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0044] In this embodiment, after determining the scores corresponding to multiple segmentation methods of the string based on the user-input string, the switching order of the multiple segmentation methods can be obtained based on the scores of each segmentation method. Thus, in response to a segmentation method switching trigger operation, the current segmentation method of the string can be switched according to the switching order, and the string can be segmented using the switched segmentation method, thereby obtaining candidate input information for the string under the switched segmentation method. For example, if the user-input string is "wan", the switching order of the multiple segmentation methods corresponding to this string could be "wan", "w'a'n", "wa'n", and "w'an". If the string is segmented into "w'a'n" by the current segmentation method, then by triggering a segmentation method switch and combining the switching order of the multiple segmentation methods, the string "w'a'n" can be segmented into "wa'n", thus ensuring that the candidate input information is only related to the switched segmentation method "wa'n", achieving preliminary screening of candidate input information and reducing the number of candidate input information presented to the user. In this way, by switching the segmentation method, the input method can provide candidate input information under multiple segmentation methods, allowing users to quickly select the input information that matches their true input intention from a smaller number of candidate input information, saving users time and improving the effectiveness of the input method. Attached Figure Description
[0045] Figure 1 A flowchart illustrating a method for obtaining candidate input information provided in an embodiment of this application;
[0046] Figure 2a A schematic diagram illustrating the user interaction process corresponding to the switching trigger operation in a 9-key input method scenario provided in this application embodiment;
[0047] Figure 2b A schematic diagram illustrating the user interaction process corresponding to the switching trigger operation in a 26-key input method mode scenario provided in this application embodiment;
[0048] Figure 3 A flowchart illustrating an implementation method for determining the scores corresponding to multiple string segmentation methods, as provided in this application embodiment;
[0049] Figure 4 This is a schematic diagram of a candidate input information acquisition device provided in an embodiment of this application. Detailed Implementation
[0050] As mentioned earlier, current input methods for the Chinese Pinyin system comprehensively sort multiple candidate input information corresponding to the user's input string and display the top one or a few candidate inputs in the input method's candidate bar for the user to choose from. If the user does not find input information matching their actual input intent in the candidate bar, they need to manipulate the candidate bar to obtain a display interface showing all candidate input information arranged in alternating segments. However, strings often have multiple different segmentation methods, and each of these different segmentation methods corresponds to multiple different candidate input information. Therefore, the number of candidate input information can be as high as dozens or even hundreds. In this case, users need to spend a long time to find the input information that matches their actual input intent from these candidate results arranged in alternating segments, resulting in poor input method performance.
[0051] To address the aforementioned issues, this application provides a method for obtaining candidate input information. This method may include: determining the scores corresponding to multiple segmentation methods of a string based on user-inputted strings; and then obtaining the switching order of the multiple segmentation methods based on their respective scores. In this way, in response to a segmentation method switching trigger operation, the current segmentation method of the string can be switched according to the switching order, and the string can be segmented using the switched segmentation method, thereby obtaining candidate input information of the string under the switched segmentation method.
[0052] For example, if the user inputs the string "wan", the switching order of the various segmentation methods corresponding to this string could be "wan", "w'a'n", "wa'n", and "w'an". If the string is segmented into "w'a'n" by the current segmentation method, then by triggering a switching operation on the segmentation method and combining the switching order of multiple segmentation methods, the string "w'a'n" can be segmented into "wa'n". This ensures that the candidate input information is only related to the switched segmentation method "wa'n", achieving preliminary screening of candidate input information and reducing the number of candidate input information presented to the user. In this way, by switching segmentation methods, the input method can provide candidate input information under multiple segmentation methods, allowing the user to quickly select the input information that matches the user's true input intention from a smaller number of candidate inputs, saving the user time and improving the efficiency of the input method.
[0053] It should be noted that the embodiments of this application do not limit the executing entity of the candidate input information acquisition method. For example, the candidate input information acquisition method of this application embodiment can be applied to data processing devices such as terminal devices or servers. The terminal device can be a smartphone, computer, personal digital assistant (PDA), or tablet computer, etc. The server can be a standalone server, a cluster server, or a cloud server.
[0054] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0055] Figure 1 This is a flowchart illustrating a method for obtaining candidate input information provided in an embodiment of this application. (In conjunction with...) Figure 1 As shown in the embodiments of this application, the method for obtaining candidate input information may include:
[0056] S1: Based on the string input by the user, determine the scores corresponding to the multiple string splitting methods.
[0057] In this embodiment, the string input by the user can be either a numeric string or a pinyin string. The pinyin string is input by the user in the 26-key input method mode, where each pinyin character represents a pinyin character set by the 26-key input method. The numeric string is input by the user in the 9-key input method mode, where each numeric character can represent multiple different pinyin characters set by the 9-key input method. For example, the numeric character "2" in the 9-key input method mode can represent the pinyin characters "a", "b", and "c"; the numeric character "9" in the nine-key input method mode can represent the pinyin characters "w", "x", "y", and "z". Correspondingly, in practical applications, if the user inputs the string "642694", it can be represented as "mianxi", "mianyi", "nianyi", and "nianzi", among other pinyin strings.
[0058] Multiple string segmentation methods refer to the ways in which a string can be segmented between its separable syllables. Understandably, when a user directly inputs a string of pinyin, since each pinyin character corresponds to a fixed pinyin character, the segmentation method only needs to consider the pinyin string itself. For example, if the user inputs the string "hengan", it can be segmented in multiple ways such as "h'e'n'g'a'n", "hen'gan", and "heng'an". However, when a user inputs a string of numbers, since each number character can represent multiple different pinyin characters, the segmentation method needs to consider the various possibilities for each number character during segmentation. For example, if the user inputs the string "642694", it can be segmented in multiple ways such as "mi'an'xi", "mian'yi", "nian'yi", or "nian'zi".
[0059] The score corresponding to a segmentation mode can characterize the matching degree between the candidate input information of the character string under the segmentation mode and the user's real input intention. For example, if the character string input by the user is "hengan", and the user's real input intention is "Heng'an", then the candidate input information under the segmentation mode "hen’gan" may include "Hen Gan", "Hen Gan" (the Pinyin of these two Chinese phrases is both "hen gan"), etc., and the candidate input information under the segmentation mode "heng’an" may include "Heng An", "Heng An" (the Pinyin of these two Chinese phrases is both "heng an"), etc. Therefore, it can be understood that the matching degree between the candidate input information of the character string "hengan" under the segmentation mode "hen’gan" and the user's real input intention is obviously lower than the matching degree between the candidate input information of the character string "hengan" under the segmentation mode "heng’an" and the user's real input intention. That is, the score corresponding to the segmentation mode "hen’gan" is lower than the score corresponding to the segmentation mode "heng’an".
[0060] It should be noted that the representation form of the segmentation mode is not specifically limited. In the embodiments of the present application, for ease of understanding, the segmentation mode is represented by using the symbol "'" to divide between characters.
[0061] In addition, the process of determining the scores respectively corresponding to multiple segmentation modes, that is, S1, is not specifically limited herein. For ease of understanding, the embodiments of the present application provide a possible implementation for description, and for technical details, please refer to the introduction in the following embodiments.
[0062] S2: Obtain the switching sequence of multiple segmentation modes according to the scores respectively corresponding to the multiple segmentation modes.
[0063] Since the score corresponding to a segmentation mode can characterize the matching degree between the candidate input information of the character string under the segmentation mode and the user's real input intention, in order to quickly switch to the segmentation mode that best matches the real input intention, in the embodiments of the present application, the order of the scores corresponding to the multiple segmentation modes from high to low can be used as the switching sequence of the multiple modes, that is, the segmentation mode with a higher score is ranked earlier in the switching sequence, and the segmentation mode with a lower score is ranked later in the switching sequence.
[0064] In addition, the embodiments of the present application can preset a switching number threshold for segmentation modes, so as to prevent the character string from switching among too many segmentation modes and affecting the input efficiency. For example, if the switching number threshold is four, the top four segmentation modes with the highest scores can be selected from the multiple segmentation modes of the character string first, and the switching sequence of the top four segmentation modes is determined, so that subsequent switching can be performed among the four segmentation modes according to the switching sequence. It can be understood that if the total number of all segmentation modes of the character string is less than four, switching can be directly performed among all the segmentation modes.
[0065] S3: in response to a switching trigger operation for a splitting mode, switching the current splitting mode of a character string according to a switching sequence.
[0066] The switching trigger operation is specifically configured to trigger a switching operation of the splitting mode. In the embodiments of the present application, the form of the switching trigger operation is not specifically limited. For example, a switching control may be arranged in a preset area of an input method, and the switching trigger operation may be triggered by clicking the switching control. For another example, a switching gesture may be preset, and the gesture is detected in the preset area of the input method; when the switching gesture is detected, the switching trigger operation is triggered.
[0067] In addition, in practical applications, an input method displays candidate input information by default in a manner that splitting modes are arranged alternately. Therefore, when responding to a switching trigger operation for the first time, a switching function can be enabled, the character string is split by the first splitting mode in the switching sequence, and candidate input information of the character string under the first splitting mode is obtained and displayed. Here, for ease of understanding, the embodiments of the present application can describe the user interaction process corresponding to the switching trigger operation in detail with reference to embodiments and accompanying drawings. Figure 2a it is a schematic diagram of a user interaction process corresponding to a switching trigger operation in a 9-key mode scenario of an input method provided by an embodiment of the present application. In Figure 2a the input method interface shown, the switching trigger operation is embodied as clicking a "re-split" control in the input method. Specifically, for the case of the 9-key mode of the input method, before the user clicks the "re-split" control, the candidate input information displayed by the input method specifically includes "mianzi" (面子, face) corresponding to the splitting mode "mian'zi", "mianyi" (棉衣, cotton-padded clothes; 免疫, immunity) corresponding to the splitting mode "mian'yi", "miaozi" (苗子, seedling) corresponding to the splitting mode "miao'zi", and "mianxi" (免息, interest-free) corresponding to the splitting mode "mian'xi". In response to the user's operation of clicking the "re-split" control, the candidate input information displayed by the input method becomes including "ni'anyi" (你安逸, you are comfortable) corresponding to the splitting mode "ni'an'yi", "ni'an" (你安, you are well; 你按, you press) corresponding to the splitting mode "ni'an", and "ne" (呢, a modal particle) corresponding to the splitting mode "ni". Figure 2b it is a schematic diagram of a user interaction process corresponding to a switching trigger operation in a 26-key mode scenario of an input method provided by an embodiment of the present application. For the case of the 26-key mode of the input method, before the user clicks the "re-split" control, the candidate input information displayed by the input method specifically includes "wan" (完, finish; 玩, play; 晚, evening; 万, ten thousand) and the like corresponding to "wan". In response to the user's operation of clicking the "re-split" control, the candidate input information displayed by the input method becomes including "wo ai ni" (我爱你, I love you) corresponding to the splitting mode "w'a'n", a set emoticon corresponding to "wo ai ni", "wan an na" (晚安呐, good night) and "wan an ne" (晚安呢, good night).
[0068] Furthermore, in this embodiment of the application, the switching method can also be set to cyclic switching. That is, when the current segmentation method is the last segmentation method in the switching sequence, if a switching trigger operation is responded to again, the current segmentation method can be switched back from the last segmentation method to the first segmentation method.
[0069] Furthermore, in practical applications, users can input strings using various input methods. These methods can include full abbreviation, partial abbreviation, and full spelling. Partial abbreviation typically involves using abbreviation for the last one or a few characters. For example, if the user's intended input is "immunity," the abbreviation in 26-key input mode would be "my," while in 9-key mode it would be "69." In 26-key mode, partial abbreviation would be "miany" or "myi," while in 9-key mode it would be "64269" or "694." In 26-key mode, full spelling would be "mianyi," while in 9-key mode it would be "642694."
[0070] Correspondingly, in this embodiment, the intelligence level of the input method can be optimized by setting a full-simplified pinyin segmentation trigger operation, thereby simplifying user operation. Specifically, the full-simplified pinyin segmentation trigger operation is used to trigger the segmentation operation corresponding to the full-simplified pinyin method, which can be manifested as segmenting every two adjacent characters in the string. That is, when responding to the full-simplified pinyin segmentation trigger operation, the input method can default to segmenting the string using the segmentation method corresponding to the simplified pinyin method. For example, if the full-simplified pinyin segmentation trigger operation is triggered before the user inputs a string, then when the user inputs the string "wan", the input method will default to segmenting the string using the segmentation method "w'a'n", instead of segmenting and displaying the string using an alternating segmentation method. Furthermore, the form of the full-simplified pinyin segmentation trigger is not limited here; please refer to the relevant content on switching the trigger operation form mentioned above, which will not be repeated here.
[0071] S4: Segment the string using the switched segmentation method to obtain candidate input information for the string under the switched segmentation method.
[0072] The candidate input information is used to represent the input recognition result of a character string. In the embodiment of the present application, the candidate input information of a character string under the same segmentation mode can be represented in the form of multiple entries or a complete sentence. Specifically, the candidate input information represented in the form of a complete sentence can be composed of multiple unary word segments, and the multiple unary word segments are independent of each other. For example, the candidate input information "Xi'an Hao" is an input recognition result in the form of a complete sentence, which is composed of the unary word segments "Xi'an" and "Hao". In the candidate input information represented in the form of multiple entries, the multiple entries are correlated with each other. For example, the candidate input information "What's for dinner today" specifically includes the entries "today", "dinner", "have" and "what". It should be noted that the representation form of the candidate input information is specifically determined based on the corpus, historical experience and / or user input habits, and is not specifically limited herein.
[0073] In addition, in practical applications, if all candidate input information corresponding to one segmentation mode of a character string is displayed in the candidate bar and the candidate bar is still not filled, it can indicate that the number of all candidate input information is relatively small. In this case, adding this segmentation mode to the switching order and using the candidate bar to display the candidate input information under this segmentation mode is of little significance, but may instead increase the number of switching times and reduce input efficiency. Based on this, the candidate input information acquisition method provided by the embodiment of the present application may further include: deleting the score of the target segmentation mode; merging the candidate input information under the target segmentation mode into the candidate input information under the last segmentation mode in the switching order. Wherein, the number of candidate input information of the character string under the target segmentation mode is less than a preset number. In this way, the target segmentation mode can be merged into the last segmentation mode, reducing one switching operation of the segmentation mode, which helps to improve input efficiency.
[0074] Based on the above S1-S1, in this embodiment, after determining the scores corresponding to multiple segmentation methods of the string based on the user-input string, the switching order of the multiple segmentation methods can be obtained based on the scores corresponding to the multiple segmentation methods. Thus, in response to the segmentation method switching trigger operation, the current segmentation method of the string can be switched according to the switching order, and the string can be segmented using the switched segmentation method, thereby obtaining candidate input information of the string under the switched segmentation method. For example, if the user-input string is "wan", the switching order of the multiple segmentation methods corresponding to this string can be "wan", "w'a'n", "wa'n", and "w'an". If the string is segmented into "w'a'n" by the current segmentation method, then by triggering the segmentation method switching and combining the switching order of the multiple segmentation methods, the string "w'a'n" can be segmented into "wa'n", thus making the candidate input information only related to the switched segmentation method "wa'n", achieving preliminary screening of candidate input information and reducing the number of candidate input information presented to the user. In this way, by switching the segmentation method, the input method can provide candidate input information under multiple segmentation methods, allowing users to quickly select the input information that matches their true input intention from a smaller number of candidate input information, saving users time and improving the effectiveness of the input method.
[0075] Since the scores corresponding to multiple segmentation methods are related to the switching order of the segmentation methods, in order to quickly switch to the segmentation method that meets the user's true input intention, save the user's time, and improve the effect of the input method, this application embodiment can provide scores corresponding to multiple segmentation methods of a determined string, which is a possible implementation of S1, specifically including S11-S13. S11-S13 will be described below with reference to embodiments and accompanying drawings.
[0076] Figure 3 This is a flowchart illustrating an implementation method for determining the scores corresponding to multiple string segmentation methods, as provided in an embodiment of this application. (In conjunction with...) Figure 3 As shown, S11-S13 may specifically include:
[0077] S11: Determine the candidate input information for the string under multiple segmentation methods.
[0078] In the embodiments of this application, the candidate input information of the string under multiple segmentation methods can be determined based on the corpus, historical experience and / or input habits, and no specific limitation is made here.
[0079] S12: Calculate the probability that the candidate input information matches the target input information under multiple segmentation methods, and use it as the first probability corresponding to the candidate input information under multiple segmentation methods.
[0080] Here, the target input information can represent the user's true input intent. The process of determining the first probability corresponding to the candidate input information under multiple segmentation methods, namely S12, is not specifically limited in this embodiment. For ease of understanding, it is described below with reference to a possible implementation method.
[0081] In one possible implementation, S12 may specifically include: calculating the probability P(R) of a candidate input information matching the target input information under each segmentation method K; and, based on the probability P(R) and the conditional probability calculation formula, determining the probability P(R) of each term n in the candidate input information matching the target input information under each segmentation method K. n |K) or the score(i) of each unary word i in the target input information. r ), as the first probability.
[0082] S13: Determine the score corresponding to the same segmentation method based on the first probability of the candidate input information under the same segmentation method.
[0083] Since candidate input information can be displayed in two forms, namely whole sentences or multiple entries, this application embodiment can explain the process of determining the score corresponding to the segmentation method, namely S13, for the two display forms of candidate input information.
[0084] In one scenario, candidate input information for strings using the same segmentation method is represented as a complete sentence. Correspondingly, S13 may include: obtaining the order and score of multiple unary segments within the complete sentence; adjusting the scores of the multiple unary segments based on their order within the complete sentence; summing the adjusted scores of the multiple unary segments to obtain a score sum, and using this score sum as the score corresponding to the same segmentation method. Since the candidate input information in the form of a complete sentence consists of multiple unary segments, if the probability P(R) of matching the word with the target input information is... n The score calculated using |K) is relatively insignificant and inaccurate. Therefore, in this embodiment, the score of the segmentation method corresponding to the candidate input information in the form of a complete sentence is considered to be combined with the score of the unary segmentation, which is the score of the unary segmentation i in the target input information described above. r This correlation improves the accuracy of score calculation.
[0085] Specifically, the adjustment of the fraction of a unary word in the whole sentence can be achieved through the following formula (1-1):
[0086]
[0087] Among them, i r This represents the r-th unary segment in the entire sentence, score(i r )′ represents the adjusted score of the r-th unary segment, score(i r ) represents the score of the r-th unary segment in the whole sentence.
[0088] It should be noted that, in the embodiments of this application, the score of each unary word in the whole sentence can be calculated using the KenLM model (a language modeling tool). The calculation process can be implemented using any existing or future method capable of calculating the score of unary words in the whole sentence based on the KenLM model.
[0089] Accordingly, the calculation process for the score corresponding to the same division method can be achieved through the following formula (1-2):
[0090]
[0091] Where K represents the segmentation method, score(K) represents the score corresponding to the segmentation method, v represents the total number of unary segments in the whole sentence, and i r This represents the r-th unary segment in the entire sentence, score(i r )′ represents the score of the r-th unary segment after adjustment.
[0092] In another scenario, candidate input information for a string under the same segmentation method is represented as multiple terms. Correspondingly, S13 may include: summing the probabilities corresponding to the multiple terms to obtain a probability summation value, and using this probability summation value as the score corresponding to the same segmentation method.
[0093] Specifically, the adjustment process for fractions corresponding to the same division method can be achieved through the following formula (2-1):
[0094]
[0095] Where K represents the segmentation method, score(K) represents the score corresponding to the segmentation method, and P(R) n |K) represents the probability that the nth word in the candidate input information matches the target input information, and m represents the total number of words in the candidate input information.
[0096] In practical applications, since the number of candidate input items that can be displayed in the candidate bar of an input method is very limited, if there is no candidate input item matching the user's real input intention in the candidate bar, the user still needs to perform operations to open a display interface that can provide all candidate input items, and then select a candidate input item matching the user's real input intention therefrom. This results in high user operation complexity and poor input efficiency. Based on this, in the embodiments of the present application, when calculating the probability sum value, penalty processing may be performed based on the display positions of a plurality of entries, so as to adjust the scores of the segmentation modes corresponding to these entries, thereby facilitating preferential switching to a segmentation mode that better conforms to the user's real input intention during switching.
[0097] Specifically, the process of obtaining the probability sum value by summing the first probabilities respectively corresponding to a plurality of entries may include: based on the display positions of the plurality of entries, taking entries displayed in the candidate bar as first entries, and taking entries not displayed in the candidate bar as second entries; performing penalty processing on the second entries according to the first probabilities and penalty coefficients of the second entries to obtain penalty probabilities of the second entries; summing the first probabilities of the first entries and the penalty probabilities of the second entries to obtain the probability sum value. Herein, the value range of the penalty coefficient is not particularly limited in the embodiments of the present application, for example, it is 0.3 to 0.5.
[0098] For ease of understanding, an example is provided below for detailed description. For example, if a segmentation mode of a character string is expressed as "xiao'hao", and there are too many candidate input items under this segmentation mode, which specifically include "小号", "消耗", "销号", "小豪", "小浩", "削好", "肖浩" and "小昊", wherein "小号", "消耗", "销号", "小豪", "小浩" and "削好" are all first entries displayed in the candidate bar, while "肖浩" and "小昊" are second entries not displayed in the candidate bar. Based on this, when calculating the probability sum value, the probability sum value can be obtained by summing the first probabilities respectively corresponding to the six entries of "小号", "消耗", "销号", "小豪", "小浩" and "削好", and the penalty probabilities of the two entries of "肖浩" and "小昊".
[0099] In addition, it can be known from the above description that in practical applications, the input method displays candidate input items in an interlaced arrangement of segmentation modes by default. Accordingly, if a switching trigger operation for a segmentation mode is received at this time, it can indicate that none of the entries displayed in the candidate bar according to the default mode match the user's real input intention. Therefore, in order to quickly switch to the segmentation mode that better conforms to the user's real input intention and improve input efficiency, the embodiments of the present application can also provide another method for calculating the probability sum value, which is described in detail below.
[0100] Specifically, the process of obtaining a probability sum value by summing the first probabilities respectively corresponding to a plurality of entries may include: determining an initial entry displayed in a candidate bar; the initial entry is candidate input information displayed by a character string under a preset rule of an input method; eliminating the initial entry from the plurality of entries, and summing the first probabilities of the remaining entries among the plurality of entries to obtain the probability sum value. The preset rule of the input method can be embodied as comprehensively sorting a plurality of candidate input information corresponding to a character string input by a user, and displaying one or more candidate input information with a top comprehensive ranking in the candidate bar of the input method, that is, displaying the candidate input information in an interleaved arrangement in a segmentation manner.
[0101] For ease of understanding, the following combines Figure 2a the input method interface before the switching trigger operation for description. In combination with Figure 2a as shown in the figure, the initial entries are the entry "mianzi" corresponding to "mian'zi", the entry "mian yi" and the entry "mian yi" corresponding to the segmentation "mian'yi", the entry "miaozi" corresponding to the segmentation "miao'zi", and the entry "mian xi" corresponding to the segmentation "mian'xi". Therefore, when calculating the probability sum value corresponding to the segmentation "mian'zi", the initial entry "mianzi" can be eliminated from the plurality of entries corresponding to the segmentation "mian'zi", and the first probabilities of the remaining entries are summed; and when calculating the probability sum value corresponding to the segmentation "mian'yi", the initial entries "mianyi" and "mianyi" can be eliminated from the plurality of entries corresponding to the segmentation "mian'yi", and the first probabilities of the remaining entries are summed.
[0102] In addition, according to the foregoing embodiment, in practical applications, a user can input a character string in a plurality of different input modes. According to statistics, the use probabilities of the plurality of different input modes from high to low are in the order of full pinyin mode, full simplified pinyin mode and partial simplified pinyin mode. Based on this, in the embodiments of the present application, probability adjustment can be performed according to the input mode of the character string to adjust the score corresponding to the segmentation mode, which helps to conform to the usage habits of most people and improve input efficiency.
[0103] Specifically, after using the probability summation value as the score corresponding to the same segmentation method, this embodiment of the application can further obtain the input method of the string and determine the probability adjustment coefficient corresponding to the input method; adjust the probability summation value based on the probability adjustment coefficient; and update the score corresponding to the same segmentation method based on the adjusted probability summation value. Different string input methods correspond to different probability adjustment coefficients. For example, the probability adjustment coefficient for the segmentation method under the full pinyin method can be set to 1; the probability adjustment coefficient for the segmentation method under the full abbreviation method can be set to 0.8 to 0.9, without specific limitation; and the probability adjustment coefficient for the segmentation method under the partial abbreviation method can be set to 0.8. j ~0.9 j , where j represents the number of characters used in the partial abbreviation method. For example, the segmentation “mianz” uses 1 abbreviation character, therefore, the probability adjustment coefficient is 0.8 to 0.9. As another example, the segmentation “xian'g'c'o” uses 3 abbreviation characters, therefore, the probability adjustment coefficient is 0.8. 3 ~0.9 3 .
[0104] Based on the candidate input information acquisition method provided in the above embodiments, this application embodiment can also provide a candidate input information acquisition device. The candidate input information acquisition device will now be described in conjunction with the embodiments and accompanying drawings.
[0105] Figure 4 This is a schematic diagram of a device for acquiring candidate input information provided in an embodiment of this application. (In conjunction with...) Figure 4 As shown, the candidate input information acquisition device 400 provided in this application embodiment may include:
[0106] The score acquisition module 401 is used to determine the scores corresponding to multiple string segmentation methods based on the string input by the user.
[0107] The switching order determination module 402 is used to obtain the switching order of multiple segmentation methods based on the scores corresponding to each of the multiple segmentation methods.
[0108] The segmentation method switching module 403 is used to respond to the segmentation method switching trigger operation and switch the current segmentation method of the string according to the switching order;
[0109] The candidate input information acquisition module 404 is used to segment the string using the switched segmentation method to obtain the candidate input information of the string under the switched segmentation method.
[0110] In one possible implementation, the score acquisition module 401 may specifically include:
[0111] The candidate input information determination module is used to determine the candidate input information of a string under multiple segmentation methods;
[0112] The first probability calculation module is used to calculate the probability of candidate input information matching target input information under multiple segmentation methods, and to use it as the first probability corresponding to the candidate input information under multiple segmentation methods; the target input information represents the user's true input intention.
[0113] The scoring determination module is used to determine the score corresponding to the same segmentation method based on the first probability corresponding to the candidate input information under the same segmentation method.
[0114] In one possible implementation, candidate input information for strings under the same segmentation method is represented as multiple terms. Accordingly, the score determination module may specifically include:
[0115] The probability summation module is used to sum the first probabilities corresponding to multiple terms to obtain a probability summation value, and use the probability summation value as the score corresponding to the same division method.
[0116] In one possible implementation, the probability summing module may specifically include:
[0117] The first term determination module is used to determine the first term based on the display position of multiple terms, and to determine the terms displayed in the candidate column as the first term and the terms not displayed in the candidate column as the second term.
[0118] The term penalty module is used to penalize the second term based on the first probability and penalty coefficient of the second term, and obtain the penalty probability of the second term.
[0119] The first probability summation module is used to sum the first probability of the first term and the penalty probability of the second term to obtain the probability summation value.
[0120] In one possible implementation, the probability summing module may specifically include:
[0121] The second term determination module is used to determine the initial terms displayed in the candidate bar; the initial terms are candidate input information displayed as strings under the preset rules of the input method.
[0122] The second probability summation module is used to remove the initial term from multiple terms and sum the first probabilities of the remaining terms to obtain the probability summation value.
[0123] In one possible implementation, the candidate information acquisition device 400 may further include:
[0124] The probability adjustment coefficient determination module is used to obtain the input method of the string and determine the probability adjustment coefficient corresponding to the input method;
[0125] The probability summation adjustment module is used to adjust the probability summation value based on the probability adjustment coefficient.
[0126] The score update module is used to update the score corresponding to the same division method based on the adjusted probability summation value.
[0127] In one possible implementation, candidate input information for strings under the same segmentation method is represented as a complete sentence; the complete sentence is composed of multiple unary words. Accordingly, the score acquisition module 401 may specifically include:
[0128] The unary segmentation information acquisition module is used to obtain the order and score of multiple unary segments in the whole sentence;
[0129] The unary segmentation score adjustment module is used to adjust the scores of multiple unary segmentations in a sentence according to their order in the whole sentence;
[0130] The score summation module is used to obtain a score summation value based on the adjusted scores of multiple unary segmented words, and the score summation value is used as the score corresponding to the same segmentation method.
[0131] In one possible implementation, the candidate information acquisition device 400 may further include:
[0132] The score deletion module is used to delete scores for the target segmentation method when the number of candidate input information for the string under the target segmentation method is less than a preset number.
[0133] The candidate input information merging module is used to merge the candidate input information under the target segmentation method into the candidate input information under the last segmentation method in the switching order.
[0134] Furthermore, embodiments of this application also provide a device for acquiring candidate input information, including: a processor, a memory, and a system bus;
[0135] The processor and the memory are connected via the system bus;
[0136] The memory is used to store one or more programs, the one or more programs including instructions, which, when executed by the processor, cause the processor to perform any of the above-described implementations of the method for obtaining candidate input information.
[0137] Furthermore, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform any of the above-described methods for obtaining candidate input information.
[0138] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0139] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0140] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0141] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for obtaining candidate input information, characterized in that, include: Based on the string input by the user, determine the scores corresponding to the multiple segmentation methods of the string; Based on the scores corresponding to the multiple segmentation methods, the switching order of the multiple segmentation methods is obtained; In response to a trigger operation for switching the segmentation method, the current segmentation method of the string is switched according to the switching order; The string is segmented using the switched segmentation method to obtain candidate input information of the string under the switched segmentation method; The step of determining the scores corresponding to multiple segmentation methods of the string based on the user-input string includes: Determine the candidate input information for the string under the multiple segmentation methods; The probability of candidate input information matching target input information under the multiple segmentation methods is calculated and used as the first probability corresponding to the candidate input information under the multiple segmentation methods; the target input information represents the user's true input intention, and the candidate input information of the string under the same segmentation method is represented in the form of multiple words; Based on the display position of the multiple terms, the terms displayed in the candidate column are designated as the first terms, and the terms not displayed in the candidate column are designated as the second terms. Based on the first probability and penalty coefficient of the second term, the second term is penalized to obtain the penalty probability of the second term; The probability summation value is obtained by summing the first probability of the first term and the penalty probability of the second term; The sum of the probabilities is taken as the score corresponding to the same division method.
2. The method according to claim 1, characterized in that, The step of obtaining the probability summation value based on the summation of the first probabilities corresponding to the plurality of terms includes: Determine the initial words to be displayed in the candidate bar; the initial words are the candidate input information displayed by the string under the preset rules of the input method; The initial term is removed from the plurality of terms, and the first probability of the remaining terms in the plurality of terms is summed to obtain the probability sum value.
3. The method according to claim 1, characterized in that, After using the sum of the probabilities as the score corresponding to the same division method, the method further includes: Obtain the input method of the string and determine the probability adjustment coefficient corresponding to the input method; The probability summation value is adjusted based on the probability adjustment coefficient; Based on the adjusted probability summation, update the score corresponding to the same division method.
4. The method according to claim 1, characterized in that, The candidate input information of the string under the same segmentation method is represented in the form of a complete sentence; the complete sentence is composed of multiple unary words; the step of determining the score corresponding to the same segmentation method based on the first probability corresponding to the candidate input information of the string under the same segmentation method includes: Obtain the order and score of the multiple unary word segments in the entire sentence; Based on the order of the unary segmentation words in the whole sentence, the scores of the unary segmentation words in the whole sentence are adjusted respectively; The sum of scores from multiple adjusted unary word segments is used to obtain a score, which is then used as the score corresponding to the same segmentation method.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Delete the score of the target segmentation method; the number of candidate input information for the string under the target segmentation method is less than a preset number; The candidate input information under the target segmentation method is merged into the candidate input information under the last segmentation method in the switching order.
6. A device for acquiring candidate input information, characterized in that, include: The scoring module is used to determine the scores corresponding to multiple segmentation methods of the string based on the string input by the user. The switching order determination module is used to obtain the switching order of the multiple segmentation methods based on the scores corresponding to the multiple segmentation methods respectively; The segmentation method switching module is used to switch the current segmentation method of the string according to the switching order in response to the segmentation method switching trigger operation; The candidate input information acquisition module is used to segment the string using the switched segmentation method to obtain candidate input information of the string under the switched segmentation method; The score acquisition module specifically includes: A candidate input information determination module is used to determine the candidate input information of the string under the multiple segmentation methods; The first probability calculation module is used to calculate the probability that the candidate input information under the multiple segmentation methods matches the target input information, and to use it as the first probability corresponding to the candidate input information under the multiple segmentation methods; the target input information represents the user's true input intention, and the candidate input information of the string under the same segmentation method is represented in the form of multiple words; The scoring module is used to determine the following based on the display positions of the multiple terms: terms displayed in the candidate column are designated as first terms, and terms not displayed in the candidate column are designated as second terms; the second terms are penalized according to a first probability and a penalty coefficient to obtain a penalty probability; the first probability of the first term and the penalty probability of the second term are summed to obtain a probability sum value; and the probability sum value is used as the score corresponding to the same scoring method.
7. A device for acquiring candidate input information, characterized in that, The device includes: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform the method for acquiring candidate input information as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method for acquiring candidate input information as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Multiple-segmentation Chinese pinyin input system and method
CN101770328A
Input method and input method system for improving sentence generating efficiency
CN102866782A