Method, device, electronic device and storage medium for displaying candidate words

By dynamically adjusting the weight of candidate words based on time and popularity, the problem of words that have not been input for a long time dominate the first place of the candidate word sequence is solved, and the user experience of user input method is improved.

CN115061583BActive Publication Date: 2025-05-16VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210881752.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2025-05-16
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

Words that have not been entered for a long time will still occupy the top of the candidate word sequence, affecting the input experience.

Method used

By calculating the time (time dimension) at which the candidate word distance is first input to the preset time and the word frequency (hot dimension) of the candidate word in the system, the weight of the candidate word is dynamically adjusted to adjust its sorting in the candidate word sequence.

Benefits of technology

Sorting hot words or popular words at the current time point is higher, avoiding words and sentences that have not been entered for a long time to occupy the first place, and improving the user's input method experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115061583B_ABST
    Figure CN115061583B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and storage medium for displaying candidate words, and belongs to the technical field of input methods. The method for displaying candidate words includes: when receiving a first input, determining the time difference between a first moment when a candidate word corresponding to the first input is first input and a second moment when the first input is received; adjusting a first weight of the candidate word according to the time difference and a first word frequency corresponding to the candidate word to obtain an adjusted second weight, wherein the first weight is determined according to the number of times the candidate word is input; and displaying the candidate word according to the second weight.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of input methods, and specifically relates to a method, device, electronic device and storage medium for displaying candidate words. Background Art

[0002] In the related art, the input method assigns weights to candidate words corresponding to pinyin characters according to the ratio of the number of pinyin characters input by the user and the number of words and sentences selected on the screen after each pinyin character input by the user, and sorts these candidate words based on the weights.

[0003] According to this weight design, some words and sentences that have not been input for a long time will still occupy the first place in the candidate word sequence for a long time, affecting the input experience. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for displaying candidate words, which can solve the problem that words that have not been input for a long time still occupy the first place in the candidate word sequence.

[0005] In a first aspect, an embodiment of the present application provides a method for displaying candidate words, comprising:

[0006] In the case of receiving a first input, determining a time difference between a first moment when a candidate word corresponding to the first input is first input and a second moment when the first input is received;

[0007] Adjusting a first weight of the first candidate word according to the time difference and a first word frequency corresponding to the first candidate word to obtain an adjusted second weight, wherein the first weight is determined according to the number of times the first candidate word is input;

[0008] The first candidate word is displayed according to the second weight.

[0009] In a second aspect, an embodiment of the present application provides a device for displaying candidate words, including:

[0010] A determination module, configured to, upon receiving a first input, determine a time difference between a first moment when a first candidate word corresponding to the first input is first input and a second moment when the first input is received;

[0011] an adjustment module, configured to adjust a first weight of the first candidate word according to the time difference and a first word frequency corresponding to the first candidate word, to obtain an adjusted second weight, wherein the first weight is determined according to the number of times the first candidate word is input;

[0012] The sorting module is used to display the first candidate word according to the second weight.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the method of the first aspect are implemented.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the method of the first aspect.

[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method of the first aspect.

[0017] In an embodiment of the present application, the weight of the candidate word is dynamically adjusted based on the length of time from when the candidate word is first input to a preset time, i.e., the time dimension, where the preset time may be the current moment, and the first word frequency of the candidate word in the system, i.e., the heat dimension. Therefore, among the sorted candidate words, hot words or popular words at the current time point are ranked higher, which can solve the problem that words that have not been input for a long time will still occupy the first place in the candidate word sequence, thereby improving the user experience of the input method. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flow chart of a display method according to an embodiment of the present application is shown;

[0019] Figure 2 A schematic diagram of a hyperbolic tangent function curve according to an embodiment of the present application is shown;

[0020] Figure 3 A structural block diagram of a display device according to an embodiment of the present application is shown;

[0021] Figure 4 A structural block diagram of an electronic device according to an embodiment of the present application is shown;

[0022] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0024] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0025] The following, in conjunction with the accompanying drawings, describes in detail the candidate word display method, device, electronic device and storage medium provided in the embodiments of the present application through specific embodiments and their application scenarios.

[0026] In some embodiments of the present application, a method for displaying candidate words is provided. Figure 1 A flow chart of a display method according to an embodiment of the present application is shown. Figure 1 As shown, the method includes:

[0027] Step 102, when a first input is received, determining a time difference between a first moment when a first candidate word corresponding to the first input is first input and a second moment when the first input is received;

[0028] Step 104, adjusting the first weight of the first candidate word according to the time difference and the first word frequency corresponding to the first candidate word to obtain an adjusted second weight;

[0029] In step 104, the first weight is determined according to the number of times the first candidate word is input;

[0030] Step 106: display the first candidate word according to the second weight.

[0031] In the embodiment of the present application, the first input is currently received, and the user inputs the input for inputting characters, such as the user inputs the pinyin characters using the pinyin input method. After receiving the first input, according to the pinyin characters input by the user, the input method determines the corresponding multiple candidate words and sentences through the association function, and sorts the candidate words and sentences based on the weights of the candidate words and sentences, and the candidate words and sentences with higher weights will be displayed more frontward.

[0032] For example, when the user inputs the pinyin characters "nh", the input method determines the alternative phrases "girl", "boy", "hello", and "kernel" through the association function, and sorts them according to the weights of these alternative phrases to obtain the sequence of alternative phrases: "hello, girl, boy, kernel".

[0033] In the related art, the weight of the first candidate word is determined by the ratio of the number of times it is selected as the target phrase to the number of times the corresponding pinyin characters are input. For example, if "nh" is input 10 times and "hello" is selected 6 times, the weight of "hello" can be 0.6.

[0034] For this method of determining weights, if a user input and selected a certain phrase many times a long time ago, it will cause the weight of that phrase to remain high. For a long time afterwards, even if the user does not select that phrase, that phrase will long occupy the front position in the first candidate word sequence, affecting the user experience.

[0035] In view of this situation, before sorting the first candidate words, the present application determines the time difference between the time point of the current input and the time point when each first candidate word was first input. This time difference can reflect the "freshness" of the first candidate word. At the same time, the first word frequency of each first candidate word is further obtained, and this first word frequency can reflect the "popularity" of the first candidate word.

[0036] Based on this time difference and the first word frequency, the initial first weight of each first candidate word is adjusted. The adjusted second weight takes into account the effects of both time and popularity, so it can appropriately reduce the weight values corresponding to some phrases that have been input and selected a large number of times but have low freshness or low popularity, thus preventing some words that have not been input for a long time from occupying the front positions in the first candidate word sequence.

[0037] In the embodiments of the present application, based on the duration from the first input of the first candidate word to the preset time, that is, the time dimension, where the preset time can be the current moment, and the first word frequency of the first candidate word in the system, that is, the popularity dimension, the weight of the first candidate word is dynamically adjusted. Therefore, among the sorted first candidate words, the hot or popular phrases at the current time point are ranked more靠前, which can solve the problem that phrases that have not been input for a long time still occupy the first position in the first candidate word sequence and improve the user experience of using the input method memory.

[0038] In some embodiments of the present application, according to the time difference and the first word frequency corresponding to the first candidate word, the first weight of the first candidate word is adjusted to obtain the adjusted second weight, including:

[0039] Determine a first adjustment coefficient according to the time difference, where the first adjustment coefficient is a positive number less than or equal to 1, and the first adjustment coefficient is negatively correlated with the time difference;

[0040] Determine a second adjustment coefficient according to the first adjustment coefficient and the first word frequency, the second adjustment coefficient is greater than or equal to the first adjustment coefficient and less than or equal to 1, and the second adjustment coefficient is positively correlated with the first word frequency;

[0041] The second weight is determined according to the first weight and the second adjustment coefficient.

[0042] In an embodiment of the present application, the time difference between the current input moment and the moment when each first candidate word is first input is determined respectively, and a first adjustment coefficient is determined by the time difference. The maximum value of the first adjustment coefficient is 1, and it is negatively correlated with the time difference. That is, when the time difference is smaller, that is, the time since a first candidate word was last input is shorter, the first adjustment coefficient is smaller and closer to 1, and when the time difference is larger, that is, the time since a first candidate word has not been input is longer, the first adjustment coefficient is larger.

[0043] For example, the time when the first input is currently received is set as t1, and the time when a first candidate word is first input is set as t0, and the time difference between the two is set as time_gap=t1-t0.

[0044] The first adjustment coefficient is set to h_t. For example, the first adjustment coefficient h_t can be determined by the following formula:

[0045] h_t = tanh(b×time_gap);

[0046] Among them, h_t is the first adjustment coefficient, b is the preset time adjustment parameter, and time_gap is the time difference. Among them, b can be freely adjusted according to actual needs. The smaller the value of b, the smaller the change of the first adjustment coefficient over time, that is, the lower the sensitivity to time. The larger the value of b, the greater the change of the first adjustment coefficient over time, that is, the greater the sensitivity to time.

[0047] For example, b is 0.001, assuming time_gap = 300 s, then h_t ≈ 0.3, assuming time_gap = 3600 s, then h_t ≈ 1.

[0048] Further, the second adjustment coefficient is determined according to the first adjustment coefficient and the first word frequency. Specifically, the first word frequency can be determined by the input method system, recorded as word_sys_freq, and if a first candidate word is generated for the first time, the first word frequency can be assigned the system default minimum word frequency, and the system default word frequency is recorded as word_sys_default_freq.

[0049] After obtaining the second adjustment coefficient, the first weight value of the first candidate word is adjusted to obtain an adjusted second weight value.

[0050] The second weight value may be determined by multiplying the first weight value by the second adjustment coefficient.

[0051] The embodiment of the present application sorts the first candidate words based on the second weight value. Among the sorted first candidate words, hot words or popular words at the current time point are sorted higher, thereby improving the user's input method memory usage experience.

[0052] In some embodiments of the present application, determining the second adjustment coefficient according to the first adjustment coefficient and the first word frequency includes:

[0053] Determine a difference between the first word frequency and a preset second word frequency, wherein the second word frequency is less than or equal to the first word frequency;

[0054] A second adjustment coefficient is determined according to the first adjustment coefficient and the difference.

[0055] In an embodiment of the present application, the first word frequency can be the word frequency obtained by reading the current input method system vocabulary and determining it in the system basic vocabulary. If the word frequency of the corresponding word or sentence exists in the system vocabulary, the word frequency is assigned to the first word frequency word_sys_freq. If it does not exist, it is determined that word_sys_freq is equal to the second word frequency word_sys_default_freq.

[0056] The second word frequency word_sys_default_freq is the lowest word frequency preset by the system.

[0057] The second adjustment coefficient is set to h. For example, the second adjustment coefficient h can be determined by the following formula:

[0058] h=h_t+(1-h_t)×tanh(b2×(word_sys_freq-word_sys_default_freq));

[0059] Among them, h is the second adjustment coefficient, h_t is the first adjustment coefficient, b2 is the preset heat adjustment parameter, word_sys_freq is the first word frequency, and word_sys_default_freq is the second word frequency.

[0060] Among them, b2 can be freely adjusted according to actual needs. The smaller the value of b2, the smaller the second adjustment coefficient changes with the word frequency, that is, the lower the sensitivity to popularity. The larger the value of b2, the larger the second adjustment coefficient changes with the word frequency, that is, the greater the sensitivity to popularity. For example, b is 0.3.

[0061] For the unpopular first candidate word, the first word frequency is very close to the lowest word frequency preset by the system, that is, the second word frequency, so word_sys_freq-word_sys_default_freq is equal to 0, and the second adjustment coefficient h≈h_t.

[0062] For the first candidate word with higher popularity, the function:

[0063] tanh(b2×(word_sys_freq-word_sys_default_freq))≈1, and the second adjustment coefficient h≈1.

[0064] Therefore, for unpopular words, their weight values ​​are adjusted based on the time dimension, while for popular words and phrases, the second weight value is basically the same as the first weight value. These words and phrases will still be sorted according to the input frequency to meet the actual needs of users.

[0065] In some embodiments of the present application, determining the first adjustment coefficient according to the time difference includes:

[0066] Substituting the time difference into a preset first hyperbolic tangent function to obtain a first adjustment coefficient;

[0067] Determining a second adjustment coefficient according to the first adjustment coefficient and the difference includes:

[0068] The second adjustment coefficient is obtained by substituting the first adjustment coefficient and the difference into a preset second hyperbolic tangent function.

[0069] In the embodiment of the present application, the above tanh function is specifically a hyperbolic tangent function, Figure 2 A schematic diagram of a hyperbolic tangent function curve according to an embodiment of the present application is shown, as shown in FIG. Figure 2 As shown, when the first adjustment coefficient is determined by the hyperbolic tangent function, the first adjustment coefficient can change sharply with the time difference. At the same time, as the time difference increases, the change amplitude of the first adjustment coefficient becomes slower, and as the time difference decreases, the change amplitude of the first adjustment coefficient becomes more drastic.

[0070] Substitute the time difference time_gap into the two-zone tangent function tanh:

[0071] h_t=tanh(b×time_gap), and the first adjustment coefficient is h_t.

[0072] Among them, h_t is the first adjustment coefficient, b is the preset time adjustment parameter, and time_gap is the time difference.

[0073] Similarly, the second adjustment coefficient is determined by the hyperbolic tangent function. When the frequency of the first candidate word is higher, that is, the more popular it is, the second adjustment coefficient is closer to 1. When the frequency of the first candidate word is lower, that is, the less popular it is, the effect of the second adjustment coefficient is stronger and the impact on the ranking of the first candidate word is greater.

[0074] Substitute the first adjustment coefficient h_t, the first word frequency word_sys_freq and the second word frequency word_sys_default_freq into the dual-zone tangent function tanh:

[0075] h=h_t+(1-h_t)×tanh(b2×(word_sys_freq-word_sys_default_freq));

[0076] Among them, h is the second adjustment coefficient, h_t is the first adjustment coefficient, b2 is the preset heat adjustment parameter, word_sys_freq is the first word frequency, and word_sys_default_freq is the second word frequency.

[0077] The embodiment of the present application dynamically adjusts the weight of the first candidate word based on time and popularity, and implements dynamic weight sorting for words of different popularity to improve the user's input method memory usage experience.

[0078] In some embodiments of the present application, before determining the first moment when the candidate word corresponding to the first input is input for the first time, the display method further includes:

[0079] When a second input is received, the first weight is determined based on the number of times the pinyin character input by the second input is input and the number of times the target input word selected as the second input in the second candidate words and sentences corresponding to the pinyin character is input.

[0080] In an embodiment of the present application, the second input is the first input of a certain word or phrase. When the user inputs a certain pinyin character, a new word or phrase can be generated by manually specifying a text combination. When this word or phrase is selected by the user and input on the screen, the word or phrase is automatically recorded as a new candidate word and has the first weight for the word or phrase amplitude.

[0081] For example, the user enters the pinyin character "py0" through the second input. Assuming that after entering the pinyin character py0, the user selects the word "word" to be input on the screen, the total number of times the user enters the pinyin character py0 is recorded as all_input_count, and the number of times the user selects the word word to be input on the screen when entering the pinyin character py0 is recorded as input_count.

[0082] It can be understood that if the word word is selected for the first time, input_count=1.

[0083] Let the first weight be weight memory , for example, the first weight can be calculated by the following formula:

[0084]

[0085] Among them, weight memory is the first weight, all_input_count is the number of inputs of the character corresponding to the second input, and input_count is the number of times the candidate words corresponding to the second input are selected as the target phrase.

[0086] During the actual input process, the present application adjusts the first weight by using a second adjustment coefficient determined based on time difference and word frequency, and sorts the candidate words based on the adjusted second weight, so that the sorted candidate words can better meet the actual needs of users and improve the input method usage experience.

[0087] The method for displaying candidate words provided in the embodiment of the present application can be executed by a device for displaying candidate words. In the embodiment of the present application, the device for displaying candidate words using a method for displaying candidate words as an example is used to illustrate the device for displaying candidate words as provided in the embodiment of the present application.

[0088] In some embodiments of the present application, a device for displaying candidate words is provided. Figure 3 A structural block diagram of a display device according to an embodiment of the present application is shown. Figure 3 As shown, the display device 300 includes:

[0089] A determination module 302 is used to determine, when receiving a first input, a time difference between a first moment when a candidate word corresponding to the first input is first input and a second moment when the first input is received;

[0090] An adjustment module 304, configured to adjust a first weight of the candidate word according to the time difference and a first word frequency corresponding to the candidate word, to obtain an adjusted second weight, wherein the first weight is determined according to the number of times the candidate word is input;

[0091] The display module 306 is configured to display the candidate words according to the second weight.

[0092] In an embodiment of the present application, the weight of the candidate word is dynamically adjusted based on the length of time from when the candidate word is first input to a preset time, i.e., the time dimension, where the preset time may be the current moment, and the first word frequency of the candidate word in the system, i.e., the heat dimension. Therefore, among the sorted candidate words, hot words or popular words at the current time point are ranked higher, which can solve the problem that words that have not been input for a long time will still occupy the first place in the candidate word sequence, thereby improving the user's input method memory experience.

[0093] In some embodiments of the present application, the determination module is further configured to:

[0094] Determine a first adjustment coefficient according to the time difference, where the first adjustment coefficient is a positive number less than or equal to 1, and the first adjustment coefficient is negatively correlated with the time difference;

[0095] Determine a second adjustment coefficient according to the first adjustment coefficient and the first word frequency, the second adjustment coefficient is greater than or equal to the first adjustment coefficient and less than or equal to 1, and the second adjustment coefficient is positively correlated with the first word frequency;

[0096] The second weight is determined according to the first weight and the second adjustment coefficient.

[0097] The embodiment of the present application sorts the candidate words based on the second weight value. Among the sorted candidate words, hot words or popular words at the current time point are sorted higher, thereby improving the user's input method memory usage experience.

[0098] In some embodiments of the present application, the determination module is further configured to:

[0099] Determine a difference between the first word frequency and a preset second word frequency, wherein the second word frequency is less than or equal to the first word frequency;

[0100] A second adjustment coefficient is determined according to the first adjustment coefficient and the difference.

[0101] In the embodiment of the present application, for unpopular words, their weight values ​​are adjusted based on the time dimension, and for popular words and phrases, the second weight value is basically the same as the first weight value. These words and phrases will still be sorted according to the input frequency to meet the actual needs of users.

[0102] In some embodiments of the present application, the determination module is further configured to:

[0103] Substituting the time difference into a preset first hyperbolic tangent function to obtain a first adjustment coefficient;

[0104] The second adjustment coefficient is obtained by substituting the first adjustment coefficient and the difference into a preset second hyperbolic tangent function.

[0105] The embodiment of the present application dynamically adjusts the weights of candidate words based on time and popularity, and implements dynamic weight sorting for words of different popularity to improve the user's input method memory usage experience.

[0106] In some embodiments of the present application, the determination module is further configured to:

[0107] When the second input is received, the first weight is determined according to the number of input times of the pinyin character input by the second input and the number of input times of the target input word selected as the second input from the second candidate words corresponding to the pinyin character.

[0108] During the actual input process, the present application adjusts the first weight by using a second adjustment coefficient determined based on time difference and word frequency, and sorts the candidate words based on the adjusted second weight, so that the sorted candidate words can better meet the actual needs of users and improve the input method usage experience.

[0109] The display device in the embodiment of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0110] The display device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0111] The display device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and to avoid repetition, it will not be described again here.

[0112] Optionally, an embodiment of the present application further provides an electronic device, Figure 4 A structural block diagram of an electronic device according to an embodiment of the present application is shown. Figure 4 As shown, the electronic device 400 includes a processor 402, a memory 404, and a program or instruction stored in the memory 404 and executable on the processor 402. When the program or instruction is executed by the processor 402, each process of the above-mentioned method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0113] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0114] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0115] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509 and a processor 510.

[0116] Those skilled in the art will appreciate that the electronic device 500 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 510 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0117] The processor 510 is configured to, upon receiving a first input, determine a time difference between a first moment when a candidate word corresponding to the first input is first input and a second moment when the first input is received; and adjust a first weight of the candidate word according to the time difference and a first word frequency corresponding to the candidate word to obtain an adjusted second weight, wherein the first weight is determined according to the number of times the candidate word is input;

[0118] The display unit 506 is configured to display the candidate words according to the second weight.

[0119] In an embodiment of the present application, the weight of the candidate word is dynamically adjusted based on the length of time from when the candidate word is first input to a preset time, i.e., the time dimension, where the preset time may be the current moment, and the first word frequency of the candidate word in the system, i.e., the heat dimension. Therefore, among the sorted candidate words, hot words or popular words at the current time point are ranked higher, which can solve the problem that words that have not been input for a long time still occupy the first place in the candidate word sequence, thereby improving the user's input method memory experience.

[0120] Optionally, the processor 510 is also used to: determine a first adjustment coefficient based on the time difference, the first adjustment coefficient is a positive number less than or equal to 1, and the first adjustment coefficient is negatively correlated with the time difference; determine a second adjustment coefficient based on the first adjustment coefficient and the first word frequency, the second adjustment coefficient is greater than or equal to the first adjustment coefficient and less than or equal to 1, and the second adjustment coefficient is positively correlated with the first word frequency; determine a second weight based on the first weight and the second adjustment coefficient.

[0121] The embodiment of the present application sorts the candidate words based on the second weight value. Among the sorted candidate words, hot words or popular words at the current time point are sorted higher, thereby improving the user's input method memory usage experience.

[0122] Optionally, the processor 510 is further used to: determine a difference between the first word frequency and a preset second word frequency, wherein the second word frequency is less than or equal to the first word frequency; and determine a second adjustment coefficient based on the first adjustment coefficient and the difference.

[0123] In the embodiment of the present application, for unpopular words, their weight values ​​are adjusted based on the time dimension, and for popular words and phrases, the second weight value is basically the same as the first weight value. These words and phrases will still be sorted according to the input frequency to meet the actual needs of users.

[0124] Optionally, the processor 510 is further configured to: obtain a first adjustment coefficient by substituting the time difference into a preset first hyperbolic tangent function; and obtain a second adjustment coefficient by substituting the first adjustment coefficient and the difference into a preset second hyperbolic tangent function.

[0125] The embodiment of the present application dynamically adjusts the weights of candidate words based on time and popularity, and implements dynamic weight sorting for words of different popularity to improve the user's input method memory usage experience.

[0126] Optionally, the processor 510 is further used to: when receiving the second input, determine the first weight based on the number of input times of the pinyin character input by the second input and the number of input times of the target input word selected as the second input in the second candidate words and sentences corresponding to the pinyin character.

[0127] During the actual input process, the present application adjusts the first weight by using a second adjustment coefficient determined based on time difference and word frequency, and sorts the candidate words based on the adjusted second weight, so that the sorted candidate words can better meet the actual needs of users and improve the input method usage experience.

[0128] It should be understood that in the embodiment of the present application, the input unit 504 may include a graphics processor (Graphics Processing Unit, GPU) 5041 and a microphone 5042, and the graphics processor 5041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 507 includes a touch panel 5071 and at least one of other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include two parts: a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0129] The memory 509 can be used to store software programs and various data. The memory 509 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 509 may include a volatile memory or a non-volatile memory, or the memory 509 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 509 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0130] The processor 510 may include one or more processing units; optionally, the processor 510 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 510.

[0131] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0132] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0133] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0134] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0135] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0136] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0138] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for displaying candidate words, characterized in that: include: In the case of receiving a first input, determining a time difference between a first moment when a first candidate word corresponding to the first input is first input and a second moment when the first input is received; adjusting a first weight of the first candidate word according to the time difference and a first word frequency corresponding to the first candidate word to obtain an adjusted second weight, wherein the first weight is determined according to the number of times the first candidate word is input; displaying the first candidate word according to the second weight; The step of adjusting the first weight of the first candidate word according to the time difference and the first word frequency corresponding to the first candidate word to obtain an adjusted second weight includes: Determine a first adjustment coefficient according to the time difference, where the first adjustment coefficient is a positive number less than or equal to 1, and the first adjustment coefficient is positively correlated with the time difference; Determine a second adjustment coefficient according to the first adjustment coefficient and the first word frequency, wherein the second adjustment coefficient is greater than or equal to the first adjustment coefficient and less than or equal to 1, and the second adjustment coefficient is positively correlated with the first word frequency; The second weight is determined according to the first weight and the second adjustment coefficient.

2. The display method according to claim 1, characterized in that: The step of determining the second adjustment coefficient according to the first adjustment coefficient and the first word frequency includes: Determine a difference between the first word frequency and a preset second word frequency, wherein the second word frequency is less than or equal to the first word frequency; The second adjustment coefficient is determined according to the first adjustment coefficient and the difference.

3. The display method according to claim 2, characterized in that: The determining a first adjustment coefficient according to the time difference includes: The first adjustment coefficient is obtained by substituting the time difference into a preset first hyperbolic tangent function; The determining the second adjustment coefficient according to the first adjustment coefficient and the difference includes: The second adjustment coefficient is obtained by substituting the first adjustment coefficient and the difference into a preset second hyperbolic tangent function.

4. The display method according to claim 1, characterized in that: Before determining the first moment when the candidate word corresponding to the first input is input for the first time, the display method further includes: When a second input is received, the first weight is determined based on the number of times the pinyin character input by the second input is input and the number of times the target input word selected as the second input in the second candidate words and sentences corresponding to the pinyin character is input.

5. A display device for candidate words, characterized in that: include: A determination module, configured to, upon receiving a first input, determine a time difference between a first moment when a first candidate word corresponding to the first input is first input and a second moment when the first input is received; an adjustment module, configured to adjust a first weight of the first candidate word according to the time difference and a first word frequency corresponding to the first candidate word, to obtain an adjusted second weight, wherein the first weight is determined according to the number of times the first candidate word is input; A display module, configured to display the first candidate word according to the second weight; The determining module is further used for: Determine a first adjustment coefficient according to the time difference, where the first adjustment coefficient is a positive number less than or equal to 1, and the first adjustment coefficient is positively correlated with the time difference; Determine a second adjustment coefficient according to the first adjustment coefficient and the first word frequency, wherein the second adjustment coefficient is greater than or equal to the first adjustment coefficient and less than or equal to 1, and the second adjustment coefficient is positively correlated with the first word frequency; The second weight is determined according to the first weight and the second adjustment coefficient.

6. The display device according to claim 5, characterized in that: The determining module is further used for: Determine a difference between the first word frequency and a preset second word frequency, wherein the second word frequency is less than or equal to the first word frequency; The second adjustment coefficient is determined according to the first adjustment coefficient and the difference.

7. The display device according to claim 6, characterized in that: The determining module is further used for: The first adjustment coefficient is obtained by substituting the time difference into a preset first hyperbolic tangent function; The second adjustment coefficient is obtained by substituting the first adjustment coefficient and the difference into a preset second hyperbolic tangent function.

8. The display device according to claim 5, characterized in that The determining module is further used for: When receiving a second input, the first weight is determined according to the number of input times of the pinyin character input by the second input and the number of input times of the target input word selected as the second input from the second candidate words corresponding to the pinyin character.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the display method according to any one of claims 1 to 4 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the display method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Vocabulary input method for mobile terminal and mobile terminal

    CN106406565A

  • Input method and device

    CN106873799A