Request method, device and equipment of pinyin input method and storage medium
By determining the input mode in the Pinyin input method and setting a threshold for the number of fully consumed candidate decoding results, the problem of unreasonable requests for cloud candidate results after the local candidate entries are exhausted is solved, thereby optimizing cloud computing load and displaying candidate results reasonably, and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- IFLYTEK CO LTD
- Filing Date
- 2022-09-08
- Publication Date
- 2026-06-16
AI Technical Summary
Existing Pinyin input methods cannot reasonably request cloud candidate results after exhausting local candidate entries, resulting in wasted cloud computing power and inability to display suitable candidate results.
By defining the input pattern and setting a threshold for the number of candidate decoding results, cloud candidate decoding results are requested only when local candidate results are insufficient. By utilizing the correspondence between the input pattern and the threshold for the number of candidate decoding results, the computational load on the cloud and the display of candidate results are optimized.
It reduces cloud computing load, improves the rationality and display effect of candidate results, and enhances user experience.
Smart Images

Figure CN116225242B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and in particular to a method, apparatus, device and storage medium for requesting a Pinyin input method. Background Technology
[0002] With the widespread adoption of mobile devices, these devices are becoming increasingly intelligent, and input methods serve as a primary tool for user communication. However, the limited memory of mobile phones restricts the size of existing input method software. Therefore, when inputting Pinyin locally, if the total number of consumed words in the local candidate word list is less than a specified value, a request is made to the cloud. However, since the specified value remains the same when processing different Pinyin characters, this approach easily leads to a waste of cloud computing power when dealing with different Pinyin characters, and it also fails to display suitable candidate results to the user. Summary of the Invention
[0003] According to a first aspect of the embodiments of this application, a method for requesting a Pinyin input method is provided, comprising:
[0004] The current input mode is determined based on the input pinyin; wherein the input mode is determined by at least one of the keyboard type, the character length of the candidate words, and the pinyin type;
[0005] The number threshold of the total number of candidate decoding results is determined based on the current input mode; wherein, the total number of candidate decoding results is the decoding result determined based on all the pinyin content of the input pinyin;
[0006] If the number of local full-consumption candidate decoding results corresponding to the input pinyin is less than the number threshold, request the cloud candidate decoding results of the input pinyin.
[0007] According to a second aspect of the embodiments of this application, a request device for a Pinyin input method is provided, comprising:
[0008] A scene determination module is used to determine the current input mode based on the input pinyin; wherein the input mode is determined by at least one of the keyboard type, the character length of the candidate words, and the pinyin type;
[0009] The processing module is used to determine a threshold number of fully consumed candidate decoding results based on the current input mode; wherein, the fully consumed candidate decoding results are decoding results determined based on all the pinyin content of the input pinyin;
[0010] The request module is used to request cloud-based candidate decoding results for the input pinyin when the number of local full-consumption candidate decoding results corresponding to the input pinyin is less than the number threshold.
[0011] A third aspect of this application provides an electronic device, comprising:
[0012] Memory and processor;
[0013] The memory is connected to the processor and is used to store programs;
[0014] The processor implements the above-mentioned method for requesting the Pinyin input method by running the program in the memory.
[0015] The eighth aspect of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the above-described method for requesting a Pinyin input method.
[0016] An embodiment of the above application has the following advantages or beneficial effects: the input mode of the input pinyin is determined, and then the number threshold of the fully consumed candidate decoding results is determined according to the input mode, so that when facing different input pinyin, the cloud candidate decoding results of the input pinyin can be requested according to the number threshold of the fully consumed candidate decoding results corresponding to different input modes, which can reduce the computational load of the cloud and also show more reasonable candidate results to the user. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a method for requesting a Pinyin input method according to an embodiment of this application.
[0019] Figure 2 This is a flowchart illustrating a method for requesting a Pinyin input method, as provided in another embodiment of this application.
[0020] Figure 3 This is a flowchart illustrating the input allocation mode provided in one embodiment of this application.
[0021] Figure 4 This is a schematic diagram illustrating the relationship between the determination of the input mode, the threshold number of full-consumption candidate decoding results, and the hit rate, as provided in an embodiment of this application.
[0022] Figure 5 This is a schematic diagram of the hit rate versus request rate curve provided in an embodiment of this application.
[0023] Figure 6This is a schematic diagram of a request device for a Pinyin input method provided in an embodiment of this application.
[0024] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0025] 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.
[0026] Exemplary methods
[0027] Figure 1 This is a flowchart of a method for requesting a Pinyin input method according to an embodiment of the present disclosure. In an exemplary embodiment, a method for requesting a Pinyin input method is provided, including:
[0028] S110. Determine the current input mode based on the input pinyin; wherein the input mode is determined by at least one of the keyboard type, the character length of the candidate decoding result, and the pinyin type;
[0029] S120. Determine a threshold for the number of fully consumed candidate decoding results based on the current input mode; wherein, the fully consumed candidate decoding results are decoding results determined based on all the pinyin content of the input pinyin;
[0030] S130. If the number of local full-consumption candidate decoding results corresponding to the input pinyin is less than the number threshold, request the cloud candidate decoding results of the input pinyin.
[0031] It should be noted that the executing entity of the method in steps S110-S130 can be a terminal device. Optionally, the terminal device can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, a terminal device in a next-generation communication system such as an NR network, or a terminal device in a future evolved Public Land Mobile Network (PLMN) network, etc. Optionally, the terminal device can be deployed on land, including indoors or outdoors, handheld, wearable, or in-vehicle; it can also be deployed on water (such as on ships); and it can also be deployed in the air (such as on airplanes, balloons, and satellites).
[0032] In the embodiments of this application, the terminal device may be a mobile phone, a tablet computer, a computer with wireless transceiver capabilities, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal device in industrial control, a wireless terminal device in self-driving, a wireless terminal device in remote medical care, a wireless terminal device in a smart grid, a wireless terminal device in transportation safety, a wireless terminal device in a smart city, or a wireless terminal device in a smart home, etc.
[0033] By way of example and not limitation, in this embodiment, the terminal device can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not merely hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are feature-rich, large in size, and can achieve complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those that focus on a specific type of application function and require the use of other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0034] In step S110, for example, inputting pinyin refers to at least one letter entered by the user on the terminal device, which may consist of at least one initial consonant and a final vowel. For example, "nihao" or "nh". Inputting pinyin is used to determine the text entered by the user on the terminal device. The input mode is an input method determined based on the letters entered by the user. The input mode is determined by at least one of the keyboard type, the character length of the candidate decoding result, and the pinyin type. Optionally, the keyboard type refers to the keyboard used by the user when entering pinyin on the terminal device. Keyboard types include: a 9-key keyboard and a 26-key keyboard, wherein the 9-key keyboard consists of numbers, and all letters are divided into 8 parts, arranged in the keys where the numbers 2 to 9 are located. In the 26-key keyboard, each letter is a separate key. It can be understood that when the original input content is numbers, it means that the user is using a 9-key keyboard; when the initial input content is letters, it means that the user is using a 26-key keyboard. Optionally, the character length of the candidate decoding result refers to the character length corresponding to the decoding result determined based on the entire pinyin content of the input pinyin. Optionally, the decoding result can be a single character, a word, a sentence, etc. For example, when the decoding result is a word, the length of the candidate word can be two, three, or four characters, etc. Optionally, the pinyin type is used to represent the user's input letters. For example, full pinyin, full abbreviation, or special abbreviation, etc. Among them, special abbreviations include: suffix abbreviation and random abbreviation, etc.
[0035] For example, the input mode can be determined by any one of the keyboard type, the character length of the candidate decoding result, and the pinyin type. For instance, taking the keyboard type as an example, when the keyboard type is a 9-key keyboard, it is set to the first mode, and when the keyboard type is a 26-key keyboard, it is set to the second mode. Thus, when the original input content corresponding to the pinyin input is a number, the input mode corresponding to the pinyin input is the first mode.
[0036] Alternatively, it can be determined by any two combinations of keyboard type, candidate decoding result character length, and Pinyin type. For example, taking keyboard type and candidate decoding result character length as an example, when the keyboard type is a 9-key keyboard and the candidate decoding result character length is two characters, it is set to the first mode; when the keyboard type is a 9-key keyboard and the candidate decoding result character length is three characters, it is set to the second mode; when the keyboard type is a 26-key keyboard and the candidate decoding result character length is two characters, it is set to the third mode; and when the keyboard type is a 26-key keyboard and the candidate decoding result character length is three characters, it is set to the fourth mode. Thus, when the original input content corresponding to the Pinyin input is a number and the candidate decoding result character length is three characters, the input mode corresponding to the Pinyin input is the second mode.
[0037] It can also be determined by a combination of keyboard type, the length of the candidate decoding result, and the pinyin type. For example, when the keyboard type is a 9-key keyboard, the length of the candidate decoding result is two characters, and the pinyin type is full pinyin, it is set to the first mode; when the keyboard type is a 9-key keyboard, the length of the candidate decoding result is two characters, and the pinyin type is full abbreviation, it is set to the second mode; when the keyboard type is a 9-key keyboard, the length of the candidate decoding result is two characters, and the pinyin type is special abbreviation, it is set to the third mode; when the keyboard type is a 9-key keyboard, the length of the candidate decoding result is three characters, and the pinyin type is full pinyin, it is set to the fourth mode; when the keyboard type is a 9-key keyboard, the length of the candidate decoding result is three characters, and the pinyin type is full abbreviation, it is set to the fifth mode; and when the keyboard type is a 9-key keyboard, the length of the candidate decoding result is three characters, and the pinyin type is special abbreviation, it is set to the sixth mode. When the keyboard type is a 26-key keyboard, the candidate decoding result has a length of two characters and the Pinyin type is full Pinyin, it is set to mode seven. When the keyboard type is a 26-key keyboard, the candidate decoding result has a length of two characters and the Pinyin type is full abbreviation, it is set to mode eight. When the keyboard type is a 26-key keyboard, the candidate decoding result has a length of two characters and the Pinyin type is special abbreviation, it is set to mode nine. When the keyboard type is a 26-key keyboard, the candidate decoding result has a length of three characters and the Pinyin type is full Pinyin, it is set to mode ten. When the keyboard type is a 26-key keyboard, the candidate decoding result has a length of three characters and the Pinyin type is full abbreviation, it is set to mode eleven. When the keyboard type is a 26-key keyboard, the candidate decoding result has a length of three characters and the Pinyin type is special abbreviation, it is set to mode twelfth. Thus, when the original input content corresponding to the Pinyin input is letters, the candidate decoding result has a length of three characters, and the Pinyin type is full abbreviation, the input mode corresponding to the Pinyin input is mode eleven.
[0038] In step S120, exemplarily, the quantity threshold of a full-consumption candidate decoding result corresponding to each input mode may be the same or different for each input mode. Here, the full-consumption candidate decoding result is a decoding result determined based on all the pinyin contents of the input pinyin. For example, "nihao#你好" and "nh#你好" belong to full-consumption decoding results, while "nihaoma#你好" is not a full-consumption decoding result.
[0039] Exemplarily, it may be that the corresponding relationship between each input mode and the quantity threshold of the full-consumption candidate decoding result is pre-stored, or the quantity threshold of the corresponding full-consumption candidate decoding result is calculated by inputting the determined input mode into a pre-trained model, which is not limited herein. In this way, using the corresponding relationship between each input mode and the quantity threshold of the full-consumption candidate decoding result, the quantity threshold of the full-consumption candidate decoding result corresponding to the current input mode can be determined.
[0040] In step S130, exemplarily, after receiving the input pinyin, the local candidate decoding result corresponding to the input pinyin can be determined using the local dictionary, and the local full-consumption candidate decoding result is determined among the local candidate decoding results. If the number of local full-consumption candidate decoding results is less than the quantity threshold, it means that the number of local full-consumption candidate decoding results is small, then the input pinyin is sent to the cloud for processing to receive the cloud candidate decoding result returned by the cloud, and the cloud candidate decoding result and the local candidate decoding result are displayed to the user on the terminal device.
[0041] In the technical solution of this application, the input mode of the input pinyin is determined, and then the quantity threshold of the full-consumption candidate decoding result is determined according to the input mode, so that when facing different input pinyins, the cloud candidate decoding result of the input pinyin can be requested according to the quantity threshold of the full-consumption candidate decoding result corresponding to different input modes, which can reduce the computing amount of the cloud and at the same time display more reasonable candidate results to the user.
[0042] In one implementation manner, determining the quantity threshold of the full-consumption candidate decoding result based on the current input mode includes:
[0043] At least based on the corresponding relationship between the input mode and the quantity threshold of the full-consumption candidate decoding result, determine the quantity threshold of the full-consumption candidate decoding result corresponding to the current input mode.
[0044] For example, the correspondence between the input pattern and the threshold number of fully consumed candidate decoding results can be a correspondence between the two parameters, or it can be a correspondence between the input pattern, the threshold number of fully consumed candidate decoding results, and other parameters. It should be noted that these other parameters can be parameters related to the input pattern and / or the threshold number. This correspondence can be pre-stored or calculated after the input pattern is determined. In this way, by using the correspondence between the input pattern and the threshold number of fully consumed candidate decoding results, the threshold number of fully consumed candidate decoding results corresponding to the current input pattern can be directly determined, thereby allowing timely requests for candidate decoding results from the cloud.
[0045] In one embodiment, the method further includes:
[0046] The threshold for the number of fully consumed candidate decoding results corresponding to each input mode is determined by testing the hit efficiency of the cloud decoding results when the threshold for the number of fully consumed candidate decoding results corresponding to each input mode is equal to the threshold for each candidate threshold in the first candidate threshold set.
[0047] For example, the first candidate threshold set refers to the dataset used to test each input pattern. The first candidate threshold set includes multiple candidate thresholds, which can be pre-selected data. The candidate thresholds in the first candidate threshold set corresponding to each input pattern can be the same or different. The hit efficiency of the cloud decoding result refers to the probability that a cloud candidate decoding result obtained from the cloud is selected when the number of locally consumed candidate decoding results corresponding to the input pinyin is less than a certain threshold. The hit efficiency of the cloud decoding result can be pre-determined based on test data statistics.
[0048] For example, for each input mode, the hit efficiency of the cloud decoding result corresponding to each candidate threshold in the first candidate threshold set is calculated; based on the hit efficiency of the cloud decoding result, the number threshold of the total consumption candidate decoding result corresponding to each input mode is determined in the first candidate threshold set, thereby obtaining the correspondence between the input mode and the number threshold of the total consumption candidate decoding result.
[0049] In one implementation, such as Figure 2 As shown, by testing the hit efficiency of the cloud decoding results when the threshold for the number of fully consumed candidate decoding results corresponding to each input mode is equal to each candidate threshold in the first candidate threshold set, the threshold for the number of fully consumed candidate decoding results corresponding to each input mode is determined, including:
[0050] S210. Classify the Pinyin sample set according to different input modes to obtain Pinyin samples under multiple input modes;
[0051] S220. For the first input mode among the multiple input modes, use the Pinyin sample set to determine the hit efficiency of the cloud decoding result corresponding to each candidate threshold in the first candidate threshold set;
[0052] S230. Update the threshold for the number of full-consumption candidate decoding results corresponding to the first input mode to the candidate threshold with the highest hit efficiency of cloud decoding results in the first candidate threshold set.
[0053] For example, the pinyin sample set refers to a dataset used to test input patterns. The pinyin sample set includes various pinyin inputs, which can be extracted from logs or during webpage input; the data extraction source is not limited here. It should be noted that "first input pattern" can refer to any input pattern.
[0054] Specifically, the system can input pinyin from the pinyin sample set to determine its keyboard type, candidate word length, and pinyin type, thereby assigning the corresponding input mode to the pinyin. Each input mode is tested based on all pinyin in the sample set. For each test, each candidate threshold in the first candidate threshold set is used as the threshold for the number of fully consumed candidate decoding results. The pinyin input method then decodes the input pinyin under that input mode according to this threshold, calculating the hit efficiency of the cloud decoding results corresponding to each candidate threshold. The candidate threshold with the highest hit efficiency is set as the threshold for the number of fully consumed candidate decoding results corresponding to that input mode. In this way, requesting cloud decoding results based on the threshold determined in the first candidate set ensures the best hit efficiency for the cloud decoding results obtained from the input pinyin request, thus improving the user experience.
[0055] In this embodiment, the input pinyin from the pinyin sample set is obtained. The keyboard type is determined based on the input pinyin: if the input is a number, the keyboard is 9 keys; if the input is a letter, the keyboard is 26 keys. Candidate results corresponding to the input pinyin are obtained, and the candidate results are traversed. The first fully consumed non-corrective candidate result is found based on the candidate result's attributes. Non-corrective means the input pinyin completely corresponds to the candidate result. If no fully consumed non-corrective candidate is found, the first fully consumed candidate result is used by default. The character length is determined based on the length of the candidate result: two characters, three characters, four characters, or more characters. Based on the determined candidate result and the input pinyin, the pinyin type is determined to be full pinyin, full abbreviation, or special abbreviation. Special abbreviations include: tail abbreviation and random abbreviation, etc. It can be understood that since there are two keyboard types, four character lengths for candidate decoding results, and four pinyin types, 32 input modes (i.e., 2...) can be determined based on the above three parameters. 4 (4=32). The pinyin samples in the sample set are classified using the above method to obtain pinyin samples for each input mode. The pinyin samples for each input mode are then sent to the local engine and the cloud engine respectively to obtain local candidate results and cloud candidate results.
[0056] The initial threshold for the number of candidate decoding results for each input mode is set to A. Since each hyperparameter is independent, the optimal parameter can be found one by one using the single-variable method. The single-variable method means changing only one parameter; that is, when calculating one input mode, the threshold for the number of candidate decoding results for other input modes remains unchanged at its initial value, A. The candidate thresholds are then used sequentially as the threshold for the number of candidate decoding results for the current input mode. All input modes are tested using a Pinyin sample set, and the hit efficiency of the cloud decoding results corresponding to each candidate threshold is calculated. The candidate threshold with the highest hit efficiency is then used as the threshold for the number of candidate decoding results for the current input mode.
[0057] In one implementation, determining the threshold for the number of fully consumed candidate decoding results corresponding to the current input mode, based at least on the correspondence between the input mode and a threshold for the number of fully consumed candidate decoding results, includes:
[0058] The target hit rate of the decoding results;
[0059] Based on the correspondence between the hit rate of cloud decoding results, input mode and the threshold number of full-consumption candidate decoding results, the threshold number of full-consumption candidate decoding results that meet the target hit rate corresponding to the current input mode is determined.
[0060] For example, the hit rate of the cloud decoding result is pre-calculated for each input mode, and the correspondence between the hit rate, input mode, and the threshold of the number of fully consumed candidate decoding results is recorded. The hit rate of the cloud decoding result represents the probability that the requested cloud decoding result will be selected when the input pinyin is sent to the cloud for a request.
[0061] The target hit rate represents the hit rate of cloud decoding results set by the user according to their needs. Therefore, after obtaining the target hit rate, it is necessary to determine the threshold for the number of full-consumption candidate decoding results corresponding to the current input mode based on the correspondence between the hit rate, input mode, and the threshold for the number of full-consumption candidate decoding results, so as to promptly request candidate decoding results from the cloud.
[0062] Furthermore, if there is no target hit rate in the correspondence between the hit rate of the cloud decoding result, the input mode, and the threshold of the number of full-consumption candidate decoding results, then the hit rate of the cloud decoding result that satisfies the current input mode and has the smallest difference from the target hit rate is searched in the correspondence between the hit rate of the cloud decoding result, the input mode, and the threshold of the number of full-consumption candidate decoding results. The threshold of the number of full-consumption candidate decoding results corresponding to the hit rate of the cloud decoding result with the smallest difference from the target hit rate is determined as the threshold of the number of full-consumption candidate decoding results corresponding to the target hit rate.
[0063] In one embodiment, the method further includes:
[0064] By testing the hit efficiency and hit rate of the cloud decoding results when the threshold for the number of full-consumption candidate decoding results corresponding to each input mode is the same as the threshold for each candidate in the candidate threshold corresponding to each input mode, the correspondence between the hit rate of the cloud decoding results and the threshold for the number of full-consumption candidate decoding results is determined.
[0065] For example, when testing each candidate threshold under each input mode, the hit rate of the cloud decoding result corresponding to each candidate threshold is calculated, and the hit efficiency of the corresponding cloud decoding result is calculated based on the hit rate of the cloud decoding result. The hit rate and hit efficiency are considered together to determine the threshold for the number of fully consumed candidate decoding results corresponding to each input mode. The correspondence between the hit rate of the cloud decoding result, the input mode, and the threshold for the number of fully consumed candidate decoding results is recorded, ensuring that requesting cloud candidate results based on the above correspondence results in a high hit rate while maintaining a certain level of hit efficiency.
[0066] In one implementation, by testing the number threshold of the total consumption candidate decoding results corresponding to each input mode, and when the number of candidate thresholds corresponding to each input mode is set to a certain threshold, the hit efficiency and hit rate of the corresponding cloud decoding results are determined, thereby establishing the correspondence between the hit rate of the cloud decoding results, the input mode, and the number threshold of the total consumption candidate decoding results. This includes:
[0067] S1. Determine the second candidate threshold set based on the candidate thresholds corresponding to various input modes;
[0068] S2. Select a second candidate threshold from the second candidate threshold set; wherein, when the threshold of the number of fully consumed candidate decoding results corresponding to the second input mode is the second candidate threshold, the hit efficiency of the cloud decoding result of the Pinyin input method is maximized; the second input mode is the input mode corresponding to the second candidate threshold;
[0069] S3. Update the threshold for the number of fully consumed decoding results corresponding to the second input mode to the second candidate threshold;
[0070] S4. Record the correspondence between the second input mode, the second candidate threshold, and the hit rate of the cloud decoding result when the threshold for the number of fully consumed candidate decoding results corresponding to the second input mode is the second candidate threshold;
[0071] S5. Update the candidate threshold corresponding to the second input mode according to the second candidate threshold, and update the second candidate threshold set according to the candidate thresholds corresponding to various input modes;
[0072] Repeat steps S2-S5 until the second candidate threshold set is empty.
[0073] In this embodiment, each input mode corresponds to several candidate thresholds. The hit rate of the cloud decoding result corresponding to each candidate threshold under each input mode is calculated, and the hit efficiency of the corresponding cloud decoding result is calculated based on the hit rate. Since it is necessary to increase the hit rate of the cloud decoding result, candidate thresholds that meet the hit rate threshold can be selected for each input mode to obtain a second candidate threshold set. The hit rate threshold can be set as needed and is not limited here. Optionally, the hit rate threshold for each input mode can be the same or different. Candidate thresholds can also be set in other ways.
[0074] In the second candidate threshold set, select the candidate threshold with the highest hit efficiency of the cloud decoding result, and determine the input mode corresponding to this candidate threshold and the hit rate of the cloud decoding result corresponding to this candidate threshold under this input mode, recording the correspondence among the three. Delete this candidate threshold from the second candidate threshold set to obtain a new second candidate threshold set. Repeat the above operation, continuing to search for the candidate threshold with the highest hit efficiency of the cloud decoding result in the new second candidate threshold set, until no candidate threshold remains in the second candidate threshold set. This yields the correspondence between the hit rate of the cloud decoding result, the input mode, and the threshold for the number of fully consumed candidate decoding results. This correspondence can be used to determine the threshold for the number of fully consumed candidate decoding results that meets different hit rate requirements.
[0075] Optionally, a candidate threshold with the highest hit efficiency of cloud decoding results is selected from the second candidate threshold set, and the input mode corresponding to this candidate threshold and the hit rate of cloud decoding results corresponding to this candidate threshold under this input mode are determined to record the correspondence among the above three. Data in the second candidate threshold set that is not greater than this candidate threshold is used as a discard threshold, and the discard threshold is deleted from the second candidate threshold set to obtain a new second candidate threshold set. The above operation is repeated to continue searching for the candidate threshold with the highest hit efficiency of cloud decoding results in the new second candidate threshold set until there are no candidate thresholds left in the second candidate threshold set.
[0076] In one embodiment, the method further includes:
[0077] Based on the threshold number of full-consumption candidate decoding results corresponding to each input mode, determine the hit rate of cloud decoding results and the correspondence between input modes and the threshold number of full-consumption candidate decoding results;
[0078] Determining the threshold for the number of fully consumed candidate decoding results corresponding to the current input mode, based at least on the correspondence between the input mode and a threshold for the number of fully consumed candidate decoding results, includes:
[0079] Based on the correspondence between the hit rate of the cloud decoding results, the input mode, and the threshold of the number of full-consumption candidate decoding results, the threshold of the number of full-consumption candidate decoding results corresponding to the current input mode when the hit rate of the cloud decoding results is the target hit rate is determined as the threshold of the number of full-consumption candidate decoding results corresponding to the current input mode.
[0080] For example, when testing each candidate threshold under each input mode, the hit rate of the cloud decoding result corresponding to each candidate threshold is calculated. This establishes the correspondence between the hit rate of the cloud decoding result, the input mode, and the threshold number of fully consumed candidate decoding results. Based on the target hit rate, the threshold number of fully consumed candidate decoding results corresponding to the current input mode is found in the above correspondence, allowing the cloud to meet different hit rate requirements by requesting the threshold number determined based on the above correspondence.
[0081] In one implementation, the hit rate of the cloud decoding results and the correspondence between the input mode and the number threshold of the total number of candidate decoding results are determined based on a threshold number of full-consumption candidate decoding results corresponding to each input mode, including:
[0082] A1. Based on the threshold of the number of full-consumption candidate decoding results corresponding to each input mode, determine the candidate threshold corresponding to each input mode, and based on the candidate threshold corresponding to each input mode, determine the third candidate threshold set;
[0083] A2. A third candidate threshold is obtained by filtering from the set of third candidate thresholds; wherein, when the threshold of the number of fully consumed candidate decoding results corresponding to the third input mode is the third candidate threshold, the hit efficiency of the cloud decoding result of the Pinyin input method is maximized; the third input mode is the input mode corresponding to the third candidate threshold;
[0084] A3. Update the threshold for the number of full-consumption candidate decoding results corresponding to the third input mode to the third candidate threshold;
[0085] A4. Record the correspondence between the third input mode, the third candidate threshold, and the hit rate of the cloud decoding result when the number threshold of the total consumption candidate decoding result corresponding to the third input mode is the third candidate threshold;
[0086] A5. Update the candidate threshold corresponding to the third input mode according to the third candidate threshold, and update the third candidate threshold set according to the candidate threshold corresponding to each input mode;
[0087] Repeat steps A2-A5 until the third candidate threshold set is empty.
[0088] For example, the Pinyin sample set is classified according to different input modes to obtain Pinyin samples under multiple input modes. For the third input mode among the multiple input modes, the hit rate of the cloud decoding result corresponding to each candidate threshold in the first candidate threshold set is determined using the Pinyin sample set, and the hit efficiency of the cloud decoding result is calculated based on the hit rate of the cloud decoding result. The threshold for the number of fully consumed candidate decoding results corresponding to the third input mode is updated to the candidate threshold with the highest hit efficiency of the cloud decoding result in the first candidate threshold set. However, the hit rate corresponding to the threshold for the number of fully consumed candidate decoding results corresponding to the third input mode may not meet the user's needs. Therefore, in order to meet the different hit rate requirements of users, the candidate thresholds are filtered again. The candidate threshold with the highest hit efficiency of the cloud decoding result in the first candidate threshold set of each input mode is deleted, and the third candidate threshold set is formed based on the candidate thresholds of all input modes after deletion.
[0089] In the third candidate threshold set, select the candidate threshold with the highest hit efficiency of the cloud decoding result, and determine the input mode corresponding to this candidate threshold and the hit rate of the cloud decoding result corresponding to this candidate threshold under this input mode, recording the correspondence among the three. Delete this candidate threshold from the third candidate threshold set to obtain a new third candidate threshold set. Repeat the above operation, continuing to search for the candidate threshold with the highest hit efficiency of the cloud decoding result in the new third candidate threshold set, until no candidate threshold remains in the third candidate threshold set. This yields the correspondence between the hit rate of the cloud decoding result, the input mode, and the threshold for the number of fully consumed candidate decoding results. This correspondence can be used to determine the threshold for the number of fully consumed candidate decoding results that meets different hit rate requirements.
[0090] Optionally, after selecting the candidate threshold with the highest hit efficiency in the cloud decoding result from the first candidate threshold set for each input mode, data in the first candidate threshold set for each input mode that is not greater than the candidate threshold with the highest hit efficiency in the cloud decoding result are used as discard thresholds. The discard thresholds are then removed from the first candidate threshold set for each input mode. A third candidate threshold set is formed based on the candidate thresholds of all input modes after the removal.
[0091] In the third candidate threshold set, select the candidate threshold with the highest hit efficiency of the cloud decoding result, and determine the input mode corresponding to this candidate threshold and the hit rate of the cloud decoding result corresponding to this candidate threshold under this input mode, and record the correspondence among the above three. Data in the third candidate threshold set that is not greater than this candidate threshold is used as the discard threshold, and the discard threshold is deleted from the third candidate threshold set to obtain a new third candidate threshold set. Repeat the above operation to continue searching for the candidate threshold with the highest hit efficiency of the cloud decoding result in the new third candidate threshold set until there are no candidate thresholds left in the third candidate threshold set.
[0092] In one implementation, determining the hit efficiency of the cloud decoding result corresponding to each candidate threshold in the first candidate threshold set using the pinyin sample set includes:
[0093] The hit rate and cloud request rate of the cloud decoding results corresponding to each candidate threshold in the first candidate threshold set are calculated using the Pinyin sample set.
[0094] The hit efficiency of the cloud decoding results is determined based on the hit rate of the cloud decoding results and the cloud request rate.
[0095] In this embodiment, the hit rate of the cloud decoding result refers to the probability that the cloud decoding result is selected when testing the entire Pinyin sample set. That is, the hit rate = the number of hits of the cloud decoding result / the total number of Pinyin sample inputs. The cloud request rate refers to the number of requests sent to the cloud when testing the entire Pinyin sample set. That is, the cloud request rate = the number of cloud Pinyin requests / the total number of Pinyin sample inputs. Therefore, the hit efficiency of the cloud decoding result = hit rate / cloud request rate = the number of hits of the cloud decoding result / the number of cloud Pinyin requests.
[0096] In one application example, the request method for a Pinyin input method may include:
[0097] By mining the user's input of pinyin and selection of displayed content from the logs, test cases can be extracted. Further consideration is given to the following three dimensions: keyboard type (26-key, 9-key), candidate word length (two-character, three-character, four-character, multi-character), and pinyin type (full pinyin, full abbreviation, final abbreviation, random abbreviation, and other special abbreviations, totaling 2). 4 There are 4 = 32 possible combinations. Therefore, a total of 32 input modes are set.
[0098] like Figure 3 As shown, after determining the keyboard type, candidate words for input pinyin are identified. The candidate words are traversed, and the first fully consumed, non-correction candidate word is found. If no fully consumed, non-correction candidate word is found, the first fully consumed candidate word is used as the target candidate word by default. The character length of the target candidate word is determined, and then it is determined whether the input pinyin type is full abbreviation. If not, it is determined whether the input pinyin type is special abbreviation; if so, it is determined whether it is a final abbreviation or a random abbreviation; if not, the input pinyin type is full pinyin. This determines the test cases corresponding to each of the 32 input modes.
[0099] Test cases under 32 input modes are sent to the local engine and the cloud engine respectively to obtain local candidate terms and cloud candidate terms. The cloud engine is then used to determine whether to request the cloud based on the preset number thresholds for the 32 input modes. The cloud results are then displayed and the hit efficiency is calculated.
[0100] Hit efficiency = Hit rate / Cloud request rate = Number of hits in cloud terms / Number of cloud pinyin requests. Where, hit rate = Number of hits in cloud terms / Total number of test case inputs, and cloud request rate = Number of cloud pinyin requests / Total number of test case inputs.
[0101] Since each hyperparameter is independent, the single-variable method can be used to find the optimal parameters one by one. The single-variable method means changing only one parameter.
[0102] For example, the initial threshold for the number of candidate decoding results for full consumption is: parameter=[[[3,3,3,3],[3,3,3,3],[3,3,3,3],[3,3,3,3]],[[3,3,3,3],[3,3,3,3],[3,3,3,3]]], where the threshold for the number of candidate decoding results for full consumption is 3 for each input mode. Test cases are used for each of the 32 input modes, and the first value (3 for the 26-key two-character pinyin input mode) is changed from 0 to 10. For example, when the threshold for the 26-key two-character pinyin input mode is changed from 0 to 3, the threshold for the other 31 modes remains 3. All test cases under the 32 input modes were tested separately to determine the total number of cloud-based word hits and the number of cloud Pinyin requests for each of the 32 input modes during testing, thereby determining the efficiency of the 26-key two-character full Pinyin input mode. It should be noted that when testing any of the 32 input modes, the number threshold for all input modes except the tested mode remained at the initial threshold for the number of fully consumed candidate decoding results (i.e., 3).
[0103] Its effects are as follows:
[0104]
[0105] The table shows that the efficiency is highest at 7.74% when the threshold is 0. Therefore, for the 26-key two-character pinyin scenario, the optimal threshold is 0. As an optional implementation, this application sets the parameter search upper limit to 100. When the threshold for the number of 32 input modes is 100 (i.e., parameter_range=[[[100,100,100,100],[100,100,100,100],[100,100,100,100],[100,100,100,100],[100,100,100,100]],[[100,100,100,100],[100,100,100,100]), the parameter range is 100. The request rate can reach 100%, ensuring global optimization. The optimal threshold combination must be within this range (i.e., 0-100). Therefore, by calculating each input mode using the above method, the most efficient number threshold in 0-100 is found as the number threshold of the fully consumed candidate decoding result (i.e., the optimal threshold), so that each input mode corresponds to a number threshold of the fully consumed candidate decoding result.
[0106] like Figure 4 As shown, in Figure 4Each block represents a quantity threshold for an input pattern. White blocks represent the current quantity threshold, black blocks represent the discard quantity threshold, blocks with diagonal stripes represent candidate thresholds, and blocks with intersecting lines represent the most efficient threshold among the candidate thresholds.
[0107] As shown in the table above, the hit rate of the total number of candidate decoding results for each input mode obtained above is low, which cannot meet different hit rate requirements. Therefore, efficiency can be appropriately sacrificed to increase the hit rate, and the number threshold can be adaptively increased according to the needs. For each input mode, the number threshold greater than the optimal threshold is used as the candidate threshold. The most efficient threshold is found among the candidate thresholds and used as the current threshold. The hit rate and cloud request rate corresponding to the current threshold are determined, and the search continues until all candidate thresholds are selected, that is, each input mode reaches the upper limit of the number threshold of 100. In the process of continuously increasing the threshold, the request rate and the hit rate continuously increase. The curve of the hit rate changing with the cloud request rate is plotted based on the selected number threshold (e.g., Figure 5 As shown in the figure, the quantity thresholds corresponding to different hit rates can be determined based on the curve of hit rate changing with request rate.
[0108] Exemplary device
[0109] Correspondingly, such as Figure 6 As shown in the embodiment of this application, a request device for a Pinyin input method is also provided, including:
[0110] The scene determination module 610 is used to determine the current input mode based on the input pinyin; wherein the input mode is determined by at least one of the keyboard type, the character length of the candidate words, and the pinyin type;
[0111] The processing module 620 is used to determine a threshold number of fully consumed candidate decoding results based on the current input mode; wherein, the fully consumed candidate decoding results are decoding results determined based on all the pinyin content of the input pinyin;
[0112] The request module 630 is used to request cloud-based candidate decoding results for the input pinyin when the number of local full-consumption candidate decoding results corresponding to the input pinyin is less than the number threshold.
[0113] In one embodiment, the processing module 620 includes:
[0114] The threshold for the number of full-consumption candidate decoding results corresponding to the current input mode is determined based at least on the correspondence between the input mode and the threshold for the number of full-consumption candidate decoding results.
[0115] In one embodiment, the device further includes:
[0116] The threshold for the number of fully consumed candidate decoding results corresponding to each input mode is determined by testing the hit efficiency of the cloud decoding results when the threshold for the number of fully consumed candidate decoding results corresponding to each input mode is equal to the threshold for each candidate threshold in the first candidate threshold set.
[0117] In one implementation, the threshold for the number of fully consumed candidate decoding results corresponding to each input mode is determined by testing the hit efficiency of the cloud decoding results when the threshold for the number of fully consumed candidate decoding results corresponding to each input mode is equal to each candidate threshold in the first candidate threshold set, including:
[0118] The pinyin sample set is classified according to different input modes to obtain pinyin samples under multiple input modes;
[0119] For the first input mode among the multiple input modes, the hit efficiency of the cloud decoding result corresponding to each candidate threshold in the first candidate threshold set is determined by using the Pinyin sample set;
[0120] The threshold for the number of fully consumed candidate decoding results corresponding to the first input mode is updated to the candidate threshold with the highest hit efficiency of cloud decoding results in the first candidate threshold set.
[0121] In one implementation, determining the threshold for the number of fully consumed candidate decoding results corresponding to the current input mode, based at least on the correspondence between the input mode and a threshold for the number of fully consumed candidate decoding results, includes:
[0122] The target hit rate of the decoding results;
[0123] Based on the correspondence between the hit rate of cloud decoding results, input mode and the threshold number of full-consumption candidate decoding results, the threshold number of full-consumption candidate decoding results that meet the target hit rate corresponding to the current input mode is determined.
[0124] In one embodiment, the device further includes:
[0125] By testing the hit efficiency and hit rate of the cloud decoding results when the threshold for the number of full-consumption candidate decoding results corresponding to each input mode is the same as the threshold for each candidate in the candidate threshold corresponding to each input mode, the correspondence between the hit rate of the cloud decoding results and the threshold for the number of full-consumption candidate decoding results is determined.
[0126] In one implementation, by testing the number threshold of the total consumption candidate decoding results corresponding to each input mode, and when the number of candidate thresholds corresponding to each input mode is set to a certain threshold, the hit efficiency and hit rate of the corresponding cloud decoding results are determined, thereby establishing the correspondence between the hit rate of the cloud decoding results, the input mode, and the number threshold of the total consumption candidate decoding results. This includes:
[0127] S1. Determine the second candidate threshold set based on the candidate thresholds corresponding to various input modes;
[0128] S2. Select a second candidate threshold from the second candidate threshold set; wherein, when the threshold of the number of fully consumed candidate decoding results corresponding to the second input mode is the second candidate threshold, the hit efficiency of the cloud decoding result of the Pinyin input method is maximized; the second input mode is the input mode corresponding to the second candidate threshold;
[0129] S3. Update the threshold for the number of fully consumed decoding results corresponding to the second input mode to the second candidate threshold;
[0130] S4. Record the correspondence between the second input mode, the second candidate threshold, and the hit rate of the cloud decoding result when the threshold for the number of fully consumed candidate decoding results corresponding to the second input mode is the second candidate threshold;
[0131] S5. Update the candidate threshold corresponding to the second input mode according to the second candidate threshold, and update the second candidate threshold set according to the candidate thresholds corresponding to various input modes;
[0132] Repeat steps S2-S5 until the second candidate threshold set is empty.
[0133] In one embodiment, the device further includes:
[0134] Based on the threshold number of full-consumption candidate decoding results corresponding to each input mode, determine the hit rate of cloud decoding results and the correspondence between input modes and the threshold number of full-consumption candidate decoding results;
[0135] Determining the threshold for the number of fully consumed candidate decoding results corresponding to the current input mode, based at least on the correspondence between the input mode and a threshold for the number of fully consumed candidate decoding results, includes:
[0136] Based on the correspondence between the hit rate of the cloud decoding results, the input mode, and the threshold of the number of full-consumption candidate decoding results, the threshold of the number of full-consumption candidate decoding results corresponding to the current input mode when the hit rate of the cloud decoding results is the target hit rate is determined as the threshold of the number of full-consumption candidate decoding results corresponding to the current input mode.
[0137] In one implementation, the hit rate of the cloud decoding results and the correspondence between the input mode and the number threshold of the total number of candidate decoding results are determined based on a threshold number of full-consumption candidate decoding results corresponding to each input mode, including:
[0138] A1. Based on the threshold of the number of full-consumption candidate decoding results corresponding to each input mode, determine the candidate threshold corresponding to each input mode, and based on the candidate threshold corresponding to each input mode, determine the third candidate threshold set;
[0139] A2. A third candidate threshold is obtained by filtering from the set of third candidate thresholds; wherein, when the threshold of the number of fully consumed candidate decoding results corresponding to the third input mode is the third candidate threshold, the hit efficiency of the cloud decoding result of the Pinyin input method is maximized; the third input mode is the input mode corresponding to the third candidate threshold;
[0140] A3. Update the threshold for the number of full-consumption candidate decoding results corresponding to the third input mode to the third candidate threshold;
[0141] A4. Record the correspondence between the third input mode, the third candidate threshold, and the hit rate of the cloud decoding result when the number threshold of the total consumption candidate decoding result corresponding to the third input mode is the third candidate threshold;
[0142] A5. Update the candidate threshold corresponding to the third input mode according to the third candidate threshold, and update the third candidate threshold set according to the candidate threshold corresponding to each input mode;
[0143] Repeat steps A2-A5 until the third candidate threshold set is empty.
[0144] In one implementation, determining the hit efficiency of the cloud decoding result corresponding to each candidate threshold in the first candidate threshold set using the pinyin sample set includes:
[0145] The hit rate and cloud request rate of the cloud decoding results corresponding to each candidate threshold in the first candidate threshold set are calculated using the Pinyin sample set.
[0146] The hit efficiency of the cloud decoding results is determined based on the hit rate of the cloud decoding results and the cloud request rate.
[0147] The apparatus provided in this embodiment belongs to the same concept as the method provided in the above embodiments of this application, and can execute the method provided in any of the above embodiments of this application, possessing the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the specific processing content of the method provided in the above embodiments of this application, and will not be repeated here.
[0148] Exemplary electronic devices
[0149] Another embodiment of this application also proposes a request device for a Pinyin input method, see [link to relevant documentation]. Figure 7 As shown, the device includes:
[0150] Memory 700 and processor 710;
[0151] The memory 700 is connected to the processor 710 and is used to store programs;
[0152] The processor 710 is configured to implement the request method for the Pinyin input method disclosed in any of the above embodiments by running the program stored in the memory 700.
[0153] Specifically, the requesting device for the aforementioned Pinyin input method may also include: a bus, a communication interface 720, an input device 730, and an output device 740.
[0154] The processor 710, memory 700, communication interface 720, input device 730, and output device 740 are interconnected via a bus. Among them:
[0155] A bus can include a pathway for transmitting information between various components of a computer system.
[0156] The processor 710 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0157] The processor 710 may include a main processor, as well as a baseband chip, modem, etc.
[0158] The memory 700 stores a program that executes the technical solution of this invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 700 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0159] Input device 730 may include a device for receiving data and information input by a user, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0160] Output device 740 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0161] The communication interface 720 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0162] The processor 710 executes the program stored in the memory 700 and calls other devices, which can be used to implement various steps of the request method for any of the Pinyin input methods provided in the above embodiments of this application.
[0163] Exemplary computer program products and storage media
[0164] In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps of the request method for a Pinyin input method according to various embodiments of this application as described in the "Exemplary Methods" section of this specification.
[0165] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0166] Furthermore, embodiments of this application may also be storage media storing a computer program, which is executed by a processor in the steps of the request method for the Pinyin input method according to various embodiments of this application as described in the "Exemplary Methods" section above.
[0167] The specific working content of the aforementioned electronic device, as well as the specific working content of the aforementioned computer program product and the computer program on the storage medium being run by the processor, can all be found in the content of the aforementioned method embodiments, and will not be repeated here.
[0168] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0169] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0170] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.
[0171] The modules and sub-modules in the various embodiments of the present application's devices and terminals can be merged, divided, and deleted according to actual needs.
[0172] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the various embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be indirect couplings or communication connections through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0173] The modules or sub-modules described as separate components may or may not be physically separate. The components that constitute a module or sub-module may or may not be physical modules or sub-modules; that is, they may be located in one place or distributed across multiple network modules or sub-modules. Some or all of the modules or sub-modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0174] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into a processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into a single module. The integrated modules or sub-modules described above can be implemented in hardware or as software functional modules or sub-modules.
[0175] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0176] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0177] Finally, it should 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.
[0178] 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 requesting a Pinyin input method, characterized in that, include: The current input mode is determined based on the input pinyin; wherein the input mode is determined by at least one of the keyboard type, the character length of the candidate decoding result, and the pinyin type; each input mode corresponds to a threshold for the number of fully consumed candidate decoding results; The number threshold of the total number of candidate decoding results is determined based on the current input mode; wherein, the total number of candidate decoding results is the decoding result determined based on all the pinyin content of the input pinyin; If the number of local full-consumption candidate decoding results corresponding to the input pinyin is less than the number threshold, request the cloud candidate decoding results of the input pinyin.
2. The method according to claim 1, characterized in that, The step of determining the threshold for the number of fully consumed candidate decoding results based on the current input pattern includes: The threshold for the number of full-consumption candidate decoding results corresponding to the current input mode is determined based at least on the correspondence between the input mode and the threshold for the number of full-consumption candidate decoding results.
3. The method according to claim 2, characterized in that, The method further includes: The threshold for the number of fully consumed candidate decoding results corresponding to each input mode is determined by testing the hit efficiency of the cloud decoding results when the threshold for the number of fully consumed candidate decoding results corresponding to each input mode is equal to the threshold for each candidate threshold in the first candidate threshold set.
4. The method according to claim 3, characterized in that, By testing the hit efficiency of the cloud decoding results when the number threshold of the total consumption candidate decoding results corresponding to each input mode is equal to each candidate threshold in the first candidate threshold set, the number threshold of the total consumption candidate decoding results corresponding to each input mode is determined, including: The pinyin sample set is classified according to different input modes to obtain pinyin samples under multiple input modes; For the first input mode among the multiple input modes, the hit efficiency of the cloud decoding result corresponding to each candidate threshold in the first candidate threshold set is determined by using the Pinyin sample set; The threshold for the number of fully consumed candidate decoding results corresponding to the first input mode is updated to the candidate threshold with the highest hit efficiency of cloud decoding results in the first candidate threshold set.
5. The method according to claim 2, characterized in that, Determining the threshold for the number of fully consumed candidate decoding results corresponding to the current input mode, based at least on the correspondence between the input mode and a threshold for the number of fully consumed candidate decoding results, includes: The target hit rate of the decoding results; Based on the correspondence between the hit rate of cloud decoding results, input mode and the threshold number of full-consumption candidate decoding results, the threshold number of full-consumption candidate decoding results that meet the target hit rate corresponding to the current input mode is determined.
6. The method according to claim 5, characterized in that, The method further includes: By testing the hit efficiency and hit rate of the cloud decoding results when the threshold for the number of full-consumption candidate decoding results corresponding to each input mode is the same as the threshold for each candidate in the candidate threshold corresponding to each input mode, the correspondence between the hit rate of the cloud decoding results and the threshold for the number of full-consumption candidate decoding results is determined.
7. The method according to claim 6, characterized in that, By testing the threshold number of fully consumed candidate decoding results for each input mode, and determining the hit efficiency and hit rate of the cloud decoding results for each candidate threshold among the candidate thresholds for each input mode, the correspondence between the hit rate of the cloud decoding results, the input mode, and the threshold number of fully consumed candidate decoding results is established, including: S1. Determine the second candidate threshold set based on the candidate thresholds corresponding to each of the various input modes; S2. Select a second candidate threshold from the second candidate threshold set; wherein, when the threshold of the number of fully consumed candidate decoding results corresponding to the second input mode is the second candidate threshold, the hit efficiency of the cloud decoding result of the Pinyin input method is maximized; the second input mode is the input mode corresponding to the second candidate threshold; S3. Update the threshold for the number of fully consumed decoding results corresponding to the second input mode to the second candidate threshold; S4. Record the correspondence between the second input mode, the second candidate threshold, and the hit rate of the cloud decoding result when the threshold for the number of fully consumed candidate decoding results corresponding to the second input mode is the second candidate threshold; S5. Update the candidate threshold corresponding to the second input mode according to the second candidate threshold, and update the second candidate threshold set according to the candidate thresholds corresponding to various input modes; Repeat steps S2-S5 until the second candidate threshold set is empty.
8. The method according to claim 3, characterized in that, The method further includes: Based on the threshold number of full-consumption candidate decoding results corresponding to each input mode, determine the hit rate of cloud decoding results and the correspondence between input modes and the threshold number of full-consumption candidate decoding results; Determining the threshold for the number of fully consumed candidate decoding results corresponding to the current input mode, based at least on the correspondence between the input mode and a threshold for the number of fully consumed candidate decoding results, includes: Based on the correspondence between the hit rate of the cloud decoding results, the input mode, and the threshold of the number of full-consumption candidate decoding results, the threshold of the number of full-consumption candidate decoding results corresponding to the current input mode when the hit rate of the cloud decoding results is the target hit rate is determined as the threshold of the number of full-consumption candidate decoding results corresponding to the current input mode.
9. The method according to claim 8, characterized in that, Based on the threshold number of full-consumption candidate decoding results corresponding to each input mode, determine the hit rate of cloud decoding results and the correspondence between input modes and the threshold number of full-consumption candidate decoding results, including: A1. Based on the threshold of the number of full-consumption candidate decoding results corresponding to each input mode, determine the candidate threshold corresponding to each input mode, and based on the candidate threshold corresponding to each input mode, determine the third candidate threshold set; A2. A third candidate threshold is obtained by filtering from the set of third candidate thresholds; wherein, when the threshold of the number of fully consumed candidate decoding results corresponding to the third input mode is the third candidate threshold, the hit efficiency of the cloud decoding result of the Pinyin input method is maximized; the third input mode is the input mode corresponding to the third candidate threshold; A3. Update the threshold for the number of full-consumption candidate decoding results corresponding to the third input mode to the third candidate threshold; A4. Record the correspondence between the third input mode, the third candidate threshold, and the hit rate of the cloud decoding result when the number threshold of the total consumption candidate decoding result corresponding to the third input mode is the third candidate threshold; A5. Update the candidate threshold corresponding to the third input mode according to the third candidate threshold, and update the third candidate threshold set according to the candidate threshold corresponding to each input mode; Repeat steps A2-A5 until the third candidate threshold set is empty.
10. The method according to claim 4, characterized in that, The step of determining the hit efficiency of the cloud decoding result corresponding to each candidate threshold in the first candidate threshold set using the Pinyin sample set includes: The hit rate and cloud request rate of the cloud decoding results corresponding to each candidate threshold in the first candidate threshold set are calculated using the Pinyin sample set. The hit efficiency of the cloud decoding results is determined based on the hit rate of the cloud decoding results and the cloud request rate.
11. A request device for a Pinyin input method, characterized in that, include: The scene determination module is used to determine the current input mode based on the input pinyin; wherein, the input mode is determined by at least one of the keyboard type, the character length of the candidate word, and the pinyin type; each input mode corresponds to a threshold for the number of fully consumed candidate decoding results; The processing module is used to determine a threshold number of fully consumed candidate decoding results based on the current input mode; wherein, the fully consumed candidate decoding results are decoding results determined based on all the pinyin content of the input pinyin; The request module is used to request cloud-based candidate decoding results for the input pinyin when the number of local full-consumption candidate decoding results corresponding to the input pinyin is less than the number threshold.
12. An electronic device, characterized in that, include: Memory and processor; The memory is connected to the processor and is used to store programs; The processor, by running the program in the memory, implements the request method for the Pinyin input method as described in any one of claims 1 to 10.
13. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the request method for the Pinyin input method as described in any one of claims 1 to 10.