Input method and device
By obtaining the strings in the input box and generating candidate emoji sequences using natural language processing models, the problems of low efficiency and insufficient matching of emoji input are solved, and more efficient emoji input and more accurate intention expression are achieved.
Patent Information
- Application Number
- CN202411193568.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-03
AI Technical Summary
In the prior art, emoji input efficiency is low and the recalled emoji matches the user's input intentions. Users need to manually search among many emojis or select through a small number of candidate words.
By obtaining the string in the input box, information for semantic analysis is generated and inputted to the pre-trained natural language processing model, a sequence of candidate emojis is generated for user selection until the matching target emojis are on the screen.
The efficiency and matching degree of emoji input are improved, and users do not need to manually look up emojis. The selected emoji sequence can more fully express the user's emotional colors and match the user's intentions.
Smart Images

Figure CN119065508A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and specifically to an input method and a device thereof. Background Art
[0002] With the development of Internet technology, the Internet has not only improved the speed and quality of information dissemination, but also greatly enriched the way humans express their feelings, forming a unique Internet language. Among them, emoticons such as Emoji can be used to express emotions, concepts or ideas, and can effectively convey information across languages and cultures, increasing the emotional color and expressiveness of information.
[0003] In the prior art, when a user needs to input emoticons such as Emoji, the user is usually required to actively find the target emoticon that the user wants to input among the numerous emoticons, and then click on the target emoticon on the screen to complete the input. Alternatively, by inputting pinyin, a small number of emoticons are recalled while recalling candidate words for the user to choose. After the user clicks, the emoticon appears on the screen to complete the input. The first input method has a long operation path and it is difficult to find the target emoticon, resulting in low efficiency in emoticon input. The second input method recalls very few emoticons, which usually cannot meet the user's input intention. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide an input method and device thereof, which can solve the technical problems of low efficiency of emoticon input and low matching degree between recalled emoticons and user input intention.
[0005] In a first aspect, an embodiment of the present application provides an input method, the method comprising: obtaining a character string in an input box; generating first information based on the character string, the first information being used to prompt a first model to generate an emoticon sequence based on the semantics of the character string; inputting the first information into a first model to obtain at least one candidate emoticon sequence output by the first model, and displaying the at least one candidate emoticon sequence; and displaying the target emoticon sequence in the input box upon receiving a first input from a user for a target emoticon sequence in the at least one candidate emoticon sequence.
[0006] In a second aspect, an embodiment of the present application provides an input device, comprising: an acquisition unit, configured to acquire a character string in an input box; a first generation unit, configured to generate first information based on the character string, wherein the first information is used to prompt a first model to generate an emoticon sequence based on the semantics of the character string; a first processing unit, configured to input the first information into the first model, obtain at least one candidate emoticon sequence output by the first model, and display the at least one candidate emoticon sequence; and a first display unit, configured to display the target emoticon sequence in the input box upon receiving a first input from a user for a target emoticon sequence in the at least one candidate emoticon sequence.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0010] 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 described in the first aspect.
[0011] In an embodiment of the present application, a character string in an input box is first obtained, which is a pinyin sequence or a text sequence; then, based on the character string, first information is generated; then, the first information is input into a first model to obtain at least one candidate emoticon sequence output by the first model, and each candidate emoticon sequence is displayed; finally, when a user inputs a first input of a target emoticon sequence, the target emoticon sequence is displayed in the input box to realize the display of the target emoticon sequence. In the above process, on the one hand, since the first model can perform semantic analysis on the pinyin sequence or text sequence input by the user, it can understand the semantics of the pinyin sequence or text sequence input by the user, so that at least one predicted emoticon sequence matches the user's input intention, eliminating the user's process of searching for the emoticon they want to input among a large number of emoticons, thereby improving the input efficiency of emoticons. On the other hand, since at least one emoticon sequence for the user to select is in the form of a sequence, it can fully express the user's emotional color compared to a single emoticon, and improve the matching degree with the user's input intention. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 is a flow chart of the input method provided by an embodiment of the present application;
[0013] Figure 2A is a schematic diagram of an application scenario of the input method provided in an embodiment of the present application;
[0014] Figure 2B is a schematic diagram of an application scenario of the input method provided in an embodiment of the present application;
[0015] Figure 3 is a schematic diagram of an application scenario of the input method provided in an embodiment of the present application;
[0016] Figure 4 is a schematic diagram of an application scenario of the input method provided in an embodiment of the present application;
[0017] Figure 5 is a schematic diagram of the structure of an input device provided in an embodiment of the present application;
[0018] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0019] Figure 7 It is a schematic diagram of the hardware structure of an electronic device suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION
[0020] 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.
[0021] 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.
[0022] The input method and device provided in the embodiments of the present application are described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0023] Please refer to Figure 1 , which shows a flow chart of the input method provided in the embodiment of the present application. The input method provided in the embodiment of the present application can be applied to electronic devices. In practice, the above electronic devices can be electronic devices such as smart phones, tablet computers, laptops, and wearable devices.
[0024] The process of the input method provided in the embodiment of the present application includes the following steps:
[0025] Step 101, obtaining the character string in the input box.
[0026] In this embodiment, each time the user inputs a pinyin character, or each time a candidate word is displayed on the screen, the process from step 101 to step 104 can be executed once. The above-mentioned input box can be an input box for content input in the input method interface. The character string in the above-mentioned input box can be at least one of the following: a pinyin sequence, a text sequence. The above-mentioned text sequence can be a candidate word displayed on the screen by the user. Displaying on the screen refers to the process of inserting the text to be input from the input method window to the insertion point of the target program.
[0027] Step 102: Generate first information based on the character string.
[0028] In this embodiment, the first information can be used to instruct the first model to generate an emoticon sequence based on the semantics of the string. The first model can be obtained by pre-training a natural language processing model through machine learning. In practice, a template for generating the first information can be pre-stored, and the first information can be obtained by inputting the string into the template. The format of the template can be customized, and the embodiment of the present application does not specifically limit it.
[0029] As an example, the format of the above template can be: {[|SYSTEM|]: system information [|Human|]: human setting information}. The above system information can be used to indicate the above first model, for example, "Your name is Emoji generation assistant. You are developed based on the XX large model." The above human setting information can be pre-set as needed, for example, "You are an excellent Emoji generation assistant, generating the content at the end of the text. [Requirements]: 1. Only output Emoji at the end of the text, and refer to the quantifiers in the user input text when generating multiple Emojis; 2. Understand the semantics of the user input text, and output Emoji that fits the semantics, conforms to human emotions, is interesting, and expressive. The user input text is as follows: XXX___[|AI|]:}". Among them, the above XX is the name of the large model. The above XXX is the user input text. The above [|AI|]: is a preset identifier.
[0030] Continuing with the above example, if the above string is "xinniankuaile", based on the format of the above template, the following first information can be obtained:
[0031] {[|SYSTEM|]: Your name is Emoji Generation Assistant. You are developed based on the XX model.
[0032] [|Human|]: You are an excellent Emoji generation assistant, generating the content at the end of the text.
[0033]
Require
[0034] 1. Only output Emoji at the end of the text, and refer to the quantifier in the user input text when generating multiple Emojis;
[0035] 2. Understand the semantics of the user's input text and output Emoji that fits the semantics, conforms to human emotions, is interesting, and has strong expressiveness.
[0036] The user input text is as follows: xinniankuaile___[|AI|]:}
[0037] Step 103: input the first information into the first model, obtain at least one candidate emoticon sequence output by the first model, and display at least one candidate emoticon sequence.
[0038] In this embodiment, the first model can be pre-trained based on a natural language processing model, which has a natural language processing function. The first model can semantically understand the user input text according to the requirements in the first information, and output at least one candidate emoticon sequence. After obtaining the at least one candidate emoticon sequence through the first model, each candidate emoticon sequence can be used as a candidate and displayed in the input method interface.
[0039] In this embodiment, each candidate emoticon sequence may include one or more emoticons, which is not specifically limited here.
[0040] In some optional implementations of this embodiment, the first model can be trained by the following steps:
[0041] The first step is to obtain multiple historical pinyin sequences and multiple historical text sequences containing emoticons. In practice, by applying embedded points to the input method, pinyin sequences or text sequences with emoticons can be collected, and the collected pinyin sequences can be written as historical pinyin, and the collected text sequences can be written as historical text sequences. In actual applications, when a user clicks an emoticon or an emoticon on the screen, the embedded point data collection can be triggered, and the data format is: pinyin sequence + emoticon sequence, or, text sequence + emoticon sequence, such as "huoguotaihaochile[emoticon][emoticon][emoticon]", "hot pot is so delicious[emoticon][emoticon]". Among them, when collecting historical pinyin sequences, the emoticon clicked by the user or on the screen can be converted into a code, and the pinyin in the input box and the code can be spliced and reported. There are two situations when collecting historical text sequences. The first is that the content in the input box starts with text and ends with an emoticon. In this case, the emoticons in the content can be converted into codes and reported directly. The second situation is that there are only emoticons in the input box. In this case, it is necessary to read the cached data entered on the screen last time, splice it with the emoticon code, and then report it.
[0042] The second step is to pre-process the historical pinyin sequences and historical text sequences to obtain pinyin sequence samples and text sequence samples. The pre-processing includes at least one of the following: denoising and de-duplication.
[0043] In practice, regular expressions and other methods can be used for denoising to remove special symbols, punctuation marks, stop words, meaningless words, consecutive repeated characters, etc. The following process can be used for de-duplication:
[0044] First, historical pinyin sequences and historical text sequences (collectively referred to as historical sequences) are segmented.
[0045] Next, based on the local information in the historical sequences, the global deduplication length m is determined. Assume that two similar historical sequences t1 and t2 need to be deduplicated. To achieve the purpose of deduplication, the length of the intercepted local information cannot exceed a certain threshold. If it exceeds the threshold, these two sequences will no longer have the index of the same substring, so the algorithm will never compare these two texts throughout the process, thus failing to achieve the purpose of deduplication. Therefore, there is where k represents the length of the largest substring that is exactly the same between the historical sequences to be deduplicated, and l i represents the set of the lengths of these substrings L = {l1, l2, …, l k}. The actual situation shows that when m >= 4, the time complexity has been reduced to an acceptable range. Therefore, it can be obtained that:
[0046] Next, an inverted index is established. Given a historical sequence t to be deduplicated, its length is n. Define S as the set of intercepted substrings. According to the size relationship between m and n, there are the following two cases: When n ≥ m, substrings can be intercepted according to the size of m, and the size of this set is n - m + 1, which is represented by the symbol as S = {s1, s2, …, s (n-m+1)}. When n < m, a substring of length m cannot be intercepted, so the entire text is added to the set of substrings as a whole. Therefore, there is S = {t}. After the set of substrings of each historical sequence to be deduplicated is generated, for each historical sequence t, the elements in the corresponding set can be traversed, and each substring in this set is used as the key, and the historical sequence t is used as the corresponding value to form a key-value pair. After traversing the sets of substrings of all historical sequences, the inverted index of each historical sequence and its n - m + 1 substrings can be obtained.
[0047] Next, all historical sequences with the same index key value in the inverted index are summarized.
[0048] Next, similarity algorithms such as Jaccard are used to deduplicate each summary result. The calculation formula of Jaccard similarity is: J(A, B) = |A ∩ B| / |A ∪ B|, where A and B respectively represent the set of words after segmenting the historical sequences, J(A, B) represents the similarity between A and B, |A ∩ B| represents the number of elements in the intersection of A and B, and |A ∪ B| represents the number of elements in the union of A and B. The value range of Jaccard similarity is between 0 and 1. The closer the value is to 1, the higher the similarity between the two sets, and the closer the value is to 0, the lower the similarity between the two sets. In actual operation, the threshold can be defined according to the effect, and those exceeding the threshold are considered duplicates.
[0049] The third step is to generate a first sample set based on the pinyin sequence samples and the text sequence samples. Here, the pinyin sequence samples and the text sequence samples can be added to the existing basic data set to obtain the first sample set.
[0050] The fourth step is to train a natural language processing (NLP) model based on the first sample set to obtain a first model. Here, the natural language processing model can be trained by supervised training. Among them, the encoding of the emoticons in the pinyin sequence samples and the text sequence samples can be used as the annotation of the samples. The above-mentioned natural language model can adopt various large language models, which are not specifically limited in the embodiments of the present application. It should be noted that after the first model is obtained through training, the first model can also be fine-tuned as needed to make it suitable for the desired application scenario.
[0051] By training the first model in the above manner, the first model can fully learn the semantics of the pinyin sequence or text sequence input by the user in the past, so that at least one predicted emoticon sequence matches the user's input intention, eliminating the user's process of searching for the emoticon they want to input among a large number of emoticons, thereby improving the efficiency of emoticon input.
[0052] Step 104 : upon receiving a first input of a target emoticon sequence from at least one candidate emoticon sequence by a user, display the target emoticon sequence in an input box.
[0053] In this embodiment, the target emoji sequence may be any candidate emoji sequence in the at least one candidate emoji sequence. Figure 2A After the user inputs the character string “xinniankuaile” in the input box, the input method interface may display a candidate emoticon sequence as shown by reference numeral 201 and a candidate emoticon sequence as shown by reference numeral 202 .
[0054] In this embodiment, the first input can be used to select the target emoticon sequence. The input in the embodiment of the present application can be a touch input, or a voice command, or a specific gesture input by the user, or other feasible input, which can be determined according to actual use requirements, and the embodiment of the present application is not limited. The specific gesture in the embodiment of the present application can be any one of a single-click gesture, a sliding gesture, a drag gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture. The click input in the embodiment of the present application can be a single-click input, a double-click input, or any number of click inputs, etc., and can also be a long press input or a short press input.
[0055] In this embodiment, when receiving a first input from the user for the target emoji sequence among the above at least one candidate emoji sequence, the target emoji sequence can be displayed in the input box, so as to realize the input of the target emoji sequence to the screen. As an example, after the user clicks on the candidate emoji sequence shown by reference numeral 201 in Figure 2A the candidate emoji sequence can be input to the screen in the input box, as shown by reference numeral 203 in Figure 2B .
[0056] In some alternative implementation manners of this embodiment, to display the at least one candidate emoji sequence in the above step 103, the following steps can be executed: First step, when the string is a pinyin sequence, obtain at least one candidate word that matches the pinyin sequence. For example, if the string is "xinniankuaile", the candidate words can include but are not limited to "Happy New Year", "New Year", "Happy", etc. Second step, sort the at least one candidate emoji sequence and the at least one candidate word to obtain a sorting result. Here, a sorting rule can be preset in advance, such as sorting according to popularity, user click-through rate, etc., which is not specifically limited in the embodiments of this application. Third step, display the at least one candidate emoji sequence and the at least one candidate word according to the sorting result.
[0057] On this basis, when receiving a second input from the user for the target candidate word among the above at least one candidate word, the target candidate word can be displayed in the input box, so as to realize the input of the target candidate word to the screen, and re-execute the above step 101. At this time, the target candidate word is the string in the text box. The target candidate word can be any one of the above at least one candidate word. The above second input can be used to select the target candidate word.
[0058] As an example, referring to Figure 3 , after the target candidate word "to be not ashamed to learn from one's subordinates" is input to the screen, the string in the input box is "to be not ashamed to learn from one's subordinates". By re-executing the above steps 101 to 104, the candidate emoji sequence shown by reference numeral 301 can be obtained. This candidate emoji sequence is used as one of the candidates and is displayed in the input method interface.
[0059] By mixing and sorting the recalled candidate words and candidate emoji sequences when the string is a pinyin sequence, and further generating candidate emoji sequences based on the target candidate word after the user selects the target candidate word and inputs it to the screen, input content containing both text and emoji sequences can be obtained. In this process, there is no need for the user to search for emoji by themselves, which improves the input efficiency.
[0060] The method provided by the above embodiment of the present application first obtains a string in an input box, which is a pinyin sequence or a text sequence; then generates first information based on the string; then inputs the first information into the first model to obtain at least one candidate emoticon sequence output by the first model, and displays each candidate emoticon sequence; finally, when receiving the first input of the target emoticon sequence from the user, the target emoticon sequence is displayed in the input box to realize the screen display of the target emoticon sequence. In the above process, on the one hand, since the first model can perform semantic analysis on the pinyin sequence or text sequence input by the user, it can understand the semantics of the pinyin sequence or text sequence input by the user, so that the predicted at least one emoticon sequence matches the user's input intention, eliminating the user's process of searching for the emoticon they want to input among many emoticons, thereby improving the input efficiency of emoticons. On the other hand, since the at least one emoticon sequence for the user to select is in the form of a sequence, it can fully express the user's emotional color compared to a single emoticon, and improve the matching degree with the user's input intention.
[0061] In some optional embodiments, after executing step 101, the following steps may also be performed:
[0062] Step 105 : When the character string is a text sequence, determine whether the user intends to input an emoticon image based on the text sequence.
[0063] In this embodiment, the emoticon image is an image containing at least one emoticon. It can be determined in a variety of ways whether the user has the intention to input the emoticon image.
[0064] As an example, the text sequence can be segmented and keywords can be extracted from the segmentation results. If the keyword is in the preset keyword set, it can be determined that the user has the intention to input an emoticon image. Otherwise, it is determined that the user does not have the intention to input an emoticon image. The above keyword set can be manually set as needed, for example, it can include holiday names, greeting words, etc.
[0065] As another example, context information of the cursor position can be obtained from the input interface, and the context information and the above text sequence can be input into a natural language processing model, such as a large language model, to detect whether the user has the intention to input an emoticon image. For example, if the above text sequence is "happy birthday pattern", the natural language processing model can determine that the user has the intention to input an emoticon image.
[0066] Step 106: if it is determined that there is an input intention of an emoticon image, generate second information based on the text sequence.
[0067] In this embodiment, the above second information can be used to instruct the second model to generate emoji image features based on the semantics of the text sequence. The second model can be pre-trained through machine learning on a natural language processing model. In practice, a template for generating the second information can be pre-stored, so that the second information can be obtained by inputting the above string into the template. The format of the above template can be customized, and the embodiments of the present application do not make specific limitations.
[0068] As an example, the format of the above template can be: {[|SYSTEM|]: system information [|Human|]: human-set information}. The above system information can be used to instruct the above second model. For example, "Your name is Emoji Generation Assistant. You are developed based on the XX large model." The above human-set information can all be preset as needed. For example, "You are an excellent Emoji Generation Assistant, and generate the content at the end of the text ___. [Requirements]: 1. Only output Emojis at the end of the text. When generating multiple Emojis, refer to the quantifier in the user input text; 2. Understand the semantics of the user input text, and output Emojis that fit the semantics, conform to human emotions, are interesting, and have strong expressiveness. The user input text is as follows: XXX___[|AI|]:}". Where the above XX is the name of the large model. The above XXX is the user input text. The above [|AI|]: is a preset identifier.
[0069] Continuing with the above example, if the above string is "not feel ashamed to learn from one's subordinates", then based on the format of the above template, the following second information can be obtained:
[0070] {[|SYSTEM|: Your name is Emoji Generation Assistant. You are developed based on the XX large model.
[0071] [|Human|: You are an excellent Emoji Generation Assistant, and generate the content at the end of the text ___.
[0072] [Requirements]:
[0073] 1. Only output Emojis at the end of the text. When generating multiple Emojis, refer to the quantifier in the user input text;
[0074] 2. Understand the semantics of the user input text, and output Emojis that fit the semantics, conform to human emotions, are interesting, and have strong expressiveness.
[0075] The user input text is as follows: not feel ashamed to learn from one's subordinates___[|AI|]:}
[0076] Step 107, input the second information into the second model to obtain at least one emoji image feature output by the second model.
[0077] In this embodiment, the second model can be pre-trained based on a natural language processing model, which has a natural language processing function. The second model can semantically understand the user input text according to the requirements in the above second information, and output at least one emoticon image feature. Here, the emoticon image feature can be represented in a coded form. The emoticon image feature may specifically include but is not limited to the filling position of the emoticon, the color and size of the emoticon corresponding to each filling position, etc.
[0078] In practice, the first model may be deployed on the electronic device, and the second model may be deployed on the server. The electronic device may request the server to execute step 107 by sending a request to the server to obtain at least one emoticon image feature.
[0079] Step 108: Generate at least one emoticon image based on at least one emoticon image feature, and display the at least one emoticon image.
[0080] In this embodiment, emoticons may be searched based on each emoticon image feature, and the searched emoticons may be filled into the background image to obtain an emoticon image corresponding to the emoticon image feature.
[0081] As an example, see Figure 4 , the text sequence in the input box is "You are so loving, I'll give you flowers", then by performing the operations of step 105 to step 108, two emoticon images as mentioned above with reference numeral 401 can be displayed. Each emoticon image includes multiple emoticons.
[0082] By obtaining at least one emoticon image that matches the voice of the text sequence through the second model and displaying at least one emoticon image when the above-mentioned character string is a text sequence and the user has the intention to input an emoticon image, it is possible to actively provide the user with richer input content, further improve the user's input efficiency, and increase the richness of the user's input content.
[0083] In some optional embodiments, the step 108 of generating at least one emoticon image based on at least one emoticon image feature may be performed as follows:
[0084] In the first step, for each emoji image feature, based on the emoji image feature, a filling position, color and size of the emoji in the emoji image are determined.
[0085] The second step is to obtain the user's user portrait, and select the target emoticon based on the user portrait, the color and the text sequence. In practice, each emoticon in the emoticon library has corresponding description information, which may include but is not limited to color, applicable scene, applicable keyword, user portrait of applicable user, etc. The emoticon corresponding to the description information with the highest similarity can be determined as the target emoticon by calculating the similarity between the user portrait, the color and the text sequence and the description information.
[0086] In the third step, based on the filling position and the size, the target emoticon is scaled and filled into the background image to obtain an emoticon image corresponding to the emoticon image feature.
[0087] By selecting a target emoticon based on the emoticon image features, the user portrait and the text sequence input by the user, the selected target emoticon can be made to conform to the user's input intent, thereby improving the matching degree between the emoticon image and the user's input intent.
[0088] In some optional embodiments, the second model can be trained by the following steps:
[0089] The first step is to obtain a plurality of historical emoticon images and historical input texts corresponding to the historical emoticon images. The historical emoticon images are historical images containing at least one emoticon.
[0090] The second step is to preprocess the historical emoji image to obtain a preprocessed image, and the preprocessing includes at least one of the following: denoising and deduplication. Here, a hash function can be used to remove the historical emoji image, and the historical emoji image with too discrete pixel distribution can be removed to achieve denoising of the historical emoji image.
[0091] The third step is to extract the historical emoji image features of the historical emoji images, and generate a second sample set based on the historical emoji image features and the historical input text. Here, the historical emoji image features may include information such as the position, size, and color of the emojis in the historical emoji images. The historical emoji image features may be represented by coding. For each historical emoji image, the historical emoji image features and the historical input text of the historical emoji image may be used as a sample, and the historical emoji image features may be used as annotations for the historical input text.
[0092] The fourth step is to train the natural language processing model based on the second sample set to obtain a second model. Here, the natural language processing model can be trained by supervised training. The above-mentioned natural language model can adopt various large language models, which are not specifically limited in the embodiments of the present application. It should be noted that after the second model is trained, the second model can be fine-tuned as needed to make it suitable for the desired application scenario.
[0093] By training the second model in the above manner, the second model can fully learn the semantics of the text sequence input by the user in the past, so that the emoticon image restored based on the predicted at least one emoticon image feature matches the user's input intention, eliminating the process of users making emoticon images by themselves, thereby improving the generation efficiency and input efficiency of emoticon images.
[0094] In some optional embodiments, in the third step of the second model training process, historical emoticon image features of the historical emoticon images may be extracted by the following steps:
[0095] In the first step, the pre-processed image is divided into multiple sub-images. For example, it can be divided into 16×16 sub-images. Here, the pre-processed image can be pre-scaled to the target size.
[0096] The second step is to obtain the position information of each sub-image, which can be recorded as L.
[0097] In the third step, for each sub-image, determine the number of non-background color pixels in the sub-image, and based on the number, determine the size representation value of the emoticon in the sub-image, which can be recorded as B. The size representation value is used to represent the size of the emoticon in the sub-image. The background color can be set manually as needed, for example, it can be set to white. As an example, if the non-background color in the sub-image includes red, the number of red pixels can be counted. If it is greater than 12, record the size B=1; if it is less than or equal to 12 and greater than 8, record B=0.75; if it is less than or equal to 8 and greater than 4, record B=0.5; if it is less than or equal to 4 and greater than 0, record B=0.25; if it is 0, record B=0.
[0098] In the fourth step, for each sub-image, determine the theme color of the sub-image. The theme color is the color of the largest number of pixels among the non-background color pixels, which can be denoted by C.
[0099] Step 5: For each sub-image, based on the location information, size representation value and theme color of the sub-image, generate the encoding of the sub-image, which can be recorded as {L, B, C}
[0100] In the sixth step, the codes of the sub-images in the plurality of sub-images are aggregated to obtain the historical emoticon image features of the historical emoticon image.
[0101] By the above method, the features of each region in the historical emoticon image can be extracted to obtain accurate and comprehensive features of the historical emoticon image, thereby improving the comprehensiveness and accuracy of the historical emoticon image features. Training the second model in this way helps to improve the accuracy and comprehensiveness of the emoticon image features output by the second model.
[0102] It should be noted that the input method provided in the embodiment of the present application can be executed by an input device. In the embodiment of the present application, the input method is executed by an input device as an example to illustrate the input device provided in the embodiment of the present application.
[0103] like Figure 5 As shown, the input device 500 of this embodiment includes: an acquisition unit 501, used to acquire a character string in an input box; a first generation unit 502, used to generate first information based on the character string; a first processing unit 503, used to input the first information into a first model, obtain at least one candidate emoticon sequence output by the first model, and display the at least one candidate emoticon sequence; a first display unit 504, used to display the target emoticon sequence in the input box when receiving a first input from a user for a target emoticon sequence in the at least one candidate emoticon sequence.
[0104] In some optional implementations of this embodiment, the device further includes: a determination unit, for determining whether the user has an intention to input an emoticon image based on the text sequence when the character string is a text sequence, the emoticon image being an image containing at least one emoticon; a second generation unit, for generating second information based on the text sequence when it is determined that there is an intention to input the emoticon image; a second processing unit, for inputting the second information into a second model to obtain at least one emoticon image feature output by the second model; and a third generation unit, for generating at least one emoticon image based on the at least one emoticon image feature, and displaying the at least one emoticon image. By obtaining at least one emoticon image matching the voice of the character sequence through the second model when the character string is a text sequence and the user has an intention to input an emoticon image, and displaying at least one emoticon image, the user can be actively provided with richer input content, further improving the user's input efficiency and the richness of the user's input content.
[0105] In some optional implementations of this embodiment, the third generation unit is further used to: for each emoticon image feature, perform the following steps: based on the emoticon image feature, determine the filling position, color and size of the emoticon in the emoticon image; obtain the user portrait of the user, and select the target emoticon based on the user portrait, the color and the text sequence; based on the filling position and the size, scale the target emoticon and fill it into the background image to obtain the emoticon image corresponding to the emoticon image feature. By selecting the target emoticon based on the emoticon image feature, the user portrait of the user and the text sequence input by the user, the selected target emoticon can meet the user's input intention, thereby improving the matching degree between the emoticon image and the user's input intention.
[0106] In some optional implementations of this embodiment, the first processing unit is further used to: when the character string is a pinyin sequence, obtain at least one candidate word that matches the pinyin sequence; sort the at least one candidate emoticon sequence and the at least one candidate word to obtain a sorting result; and display the at least one candidate emoticon sequence and the at least one candidate word according to the sorting result; the device also includes: a second display unit, which is used to display the target candidate word in the input box and re-execute the step of obtaining the character string in the input box when receiving the second input of the target candidate word in the at least one candidate word by the user. By sorting the recalled candidate words and the candidate emoticon sequence in a mixed manner when the character string is a pinyin sequence, and after the user selects the target candidate word and puts it on the screen, further generating the candidate emoticon sequence based on the target candidate word, it is possible to obtain input content that contains both text and emoticon sequences. In this process, the user does not need to search for emoticons by himself, thereby improving input efficiency.
[0107] In some optional implementations of the present embodiment, the first model is trained by the following steps: obtaining multiple historical pinyin sequences and multiple historical text sequences containing emoticons; preprocessing the historical pinyin sequences and historical text sequences to obtain pinyin sequence samples and text sequence samples, wherein the preprocessing includes at least one of the following: denoising and deduplication; generating a first sample set based on the pinyin sequence samples and text sequence samples; training a natural language processing model based on the first sample set to obtain the first model. Training the first model in the above manner enables the first model to fully learn the semantics of the pinyin sequence or text sequence input by the user in history, so that at least one predicted emoticon sequence matches the user's input intention, eliminating the user's need to search for the emoticon they want to input among a large number of emoticons, thereby improving the efficiency of emoticon input.
[0108] In some optional implementations of the present embodiment, the second model is trained by the following steps: obtaining a plurality of historical emoji images and historical input texts corresponding to the historical emoji images; preprocessing the historical emoji images to obtain preprocessed images, wherein the preprocessing includes at least one of the following: denoising and deduplication; extracting historical emoji image features of the historical emoji images, and generating a second sample set based on the historical emoji image features and the historical input texts; training a natural language processing model based on the second sample set to obtain the second model. Training the second model in the above manner enables the second model to fully learn the semantics of the text sequence of the user's historical input, so that the emoji image restored based on the predicted at least one emoji image feature matches the user's input intention, eliminating the process of users making emoji images by themselves, and improving the generation efficiency and input efficiency of emoji images.
[0109] In some optional implementations of this embodiment, the extracting of the historical emoticon image features of the historical emoticon image includes: dividing the preprocessed image into a plurality of sub-images, and for each sub-image, performing the following steps: obtaining the position information of the sub-image; determining the number of non-background color pixels in the sub-image; determining the size representation value of the emoticon in the sub-image based on the number, the size representation value being used to represent the size of the emoticon in the sub-image; determining the theme color of the sub-image, the theme color being the color of the largest number of pixels in the non-background color pixels; generating the code of the sub-image based on the position information, the size representation value and the theme color; and summarizing the codes of each sub-image in the plurality of sub-images to obtain the historical emoticon image features of the historical emoticon image. By the above method, feature extraction can be performed on each region in the historical emoticon image to obtain accurate and comprehensive historical emoticon image features, thereby improving the comprehensiveness and accuracy of the historical emoticon image features. Training the second model in this way helps to improve the accuracy and comprehensiveness of the emoticon image features output by the second model.
[0110] The device provided by the above embodiment of the present application first obtains a character string in an input box, which is a pinyin sequence or a text sequence; then generates first information based on the character string; then inputs the first information into the first model to obtain at least one candidate emoticon sequence output by the first model, and displays each candidate emoticon sequence; finally, upon receiving the first input of the target emoticon sequence from the user, the target emoticon sequence is displayed in the input box. In the above process, on the one hand, since the first model can perform semantic analysis on the pinyin sequence or text sequence input by the user, it can understand the semantics of the pinyin sequence or text sequence input by the user, so that the predicted at least one emoticon sequence matches the user's input intention, eliminating the user's process of searching for the emoticon they want to input among many emoticons, thereby improving the input efficiency of emoticons. On the other hand, since the at least one emoticon sequence for the user to select is in the form of a sequence, it can fully express the user's emotional color compared to a single emoticon, and improve the matching degree with the user's input intention.
[0111] The input 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 it can be other devices other than the 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, a super 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., and the embodiment of the present application is not specifically limited.
[0112] The input 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.
[0113] The input device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0114] Alternatively, if Figure 6 As shown, an embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, wherein the memory 602 stores programs or instructions that can be executed on the processor 601, and when the program or instructions are executed by the processor 601, the various steps of the above-mentioned input method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0115] 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.
[0116] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0117] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 0000 and other components.
[0118] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 0000 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 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.
[0119] Among them, the processor 710 is used to obtain a character string in an input box; generate first information based on the character string; input the first information into a first model to obtain at least one candidate emoticon sequence output by the first model, and display the at least one candidate emoticon sequence through a display unit 706; when a first input of a target emoticon sequence in the at least one candidate emoticon sequence by a user is received through a user input unit 707, the target emoticon sequence is displayed in the input box through the display unit 706.
[0120] On the one hand, since the first model can perform semantic analysis on the pinyin sequence or text sequence input by the user, it can understand the semantics of the pinyin sequence or text sequence input by the user, so that the predicted at least one emoticon sequence matches the user's input intention, eliminating the process of the user searching for the emoticon they want to input among a large number of emoticons, thereby improving the efficiency of emoticon input. On the other hand, since the at least one emoticon sequence for the user to select is in sequence form, it can fully express the user's emotional color compared to a single emoticon, thereby improving the matching degree with the user's input intention.
[0121] Optionally, the processor 710 is further configured to determine, based on the text sequence, whether the user intends to input an emoticon image when the character string is a text sequence, the emoticon image being an image containing at least one emoticon; if it is determined that there is an intention to input the emoticon image, generate second information based on the text sequence; input the second information into a second model to obtain at least one emoticon image feature output by the second model; generate at least one emoticon image based on the at least one emoticon image feature, and display the at least one emoticon image through the display unit 706. By obtaining at least one emoticon image matching the voice of the character sequence through the second model when the character string is a text sequence and the user intends to input an emoticon image, and displaying at least one emoticon image, the user can be actively provided with richer input content, further improving the user's input efficiency and the richness of the user's input content.
[0122] Optionally, the processor 710 is further configured to perform the following steps for each emoticon image feature: based on the emoticon image feature, determine the filling position, color and size of the emoticon in the emoticon image; obtain the user portrait of the user, and select the target emoticon based on the user portrait, the color and the text sequence; based on the filling position and the size, scale the target emoticon and fill it into the background image to obtain an emoticon image corresponding to the emoticon image feature. By selecting the target emoticon based on the emoticon image feature, the user portrait of the user and the text sequence input by the user, the selected target emoticon can meet the user's input intention, thereby improving the matching degree between the emoticon image and the user's input intention.
[0123] Optionally, the processor 710 is further used to obtain at least one candidate word matching the pinyin sequence when the character string is a pinyin sequence; sort the at least one candidate emoticon sequence and the at least one candidate word to obtain a sorting result; and display the at least one candidate emoticon sequence and the at least one candidate word according to the sorting result; the device also includes: upon receiving a second input of the target candidate word in the at least one candidate word by the user, displaying the target candidate word in the input box through the display unit 706, and re-executing the step of obtaining the character string in the input box. By performing mixed sorting of the recalled candidate words and the candidate emoticon sequence when the character string is a pinyin sequence, and further generating a candidate emoticon sequence based on the target candidate word after the user selects the target candidate word and puts it on the screen, input content containing both text and emoticon sequences can be obtained. In this process, the user does not need to search for emoticons by himself, thereby improving input efficiency.
[0124] Optionally, the processor 710 is further used to train the first model through the following steps: obtaining multiple historical pinyin sequences and multiple historical text sequences containing emoticons; preprocessing the historical pinyin sequences and historical text sequences to obtain pinyin sequence samples and text sequence samples, wherein the preprocessing includes at least one of the following: denoising and deduplication; generating a first sample set based on the pinyin sequence samples and text sequence samples; training a natural language processing model based on the first sample set to obtain the first model. Training the first model in the above manner enables the first model to fully learn the semantics of the pinyin sequence or text sequence input by the user in history, so that at least one predicted emoticon sequence matches the user's input intention, eliminating the user's process of searching for the emoticon they want to input among a large number of emoticons, thereby improving the efficiency of emoticon input.
[0125] Optionally, the processor 710 is further used to train the second model through the following steps: obtaining a plurality of historical emoji images and historical input texts corresponding to the historical emoji images; preprocessing the historical emoji images to obtain preprocessed images, wherein the preprocessing includes at least one of the following: denoising and deduplication; extracting historical emoji image features of the historical emoji images, and generating a second sample set based on the historical emoji image features and the historical input text; training the natural language processing model based on the second sample set to obtain the second model. Training the second model in the above manner enables the second model to fully learn the semantics of the text sequence of the user's historical input, so that the emoji image restored based on the predicted at least one emoji image feature matches the user's input intention, eliminating the process of the user making emoji images by themselves, and improving the generation efficiency and input efficiency of emoji images.
[0126] Optionally, the processor 710 is further used to divide the preprocessed image into multiple sub-images, and for each sub-image, perform the following steps: obtain the position information of the sub-image; determine the number of non-background color pixels in the sub-image; based on the number, determine the size representation value of the emoticon in the sub-image, the size representation value is used to represent the size of the emoticon in the sub-image; determine the theme color of the sub-image, the theme color is the color of the largest number of pixels in the non-background color pixels; based on the position information, the size representation value and the theme color, generate the code of the sub-image; summarize the codes of each sub-image in the multiple sub-images to obtain the historical emoticon image features of the historical emoticon image. In the above manner, feature extraction can be performed on each area in the historical emoticon image to obtain accurate and comprehensive historical emoticon image features, thereby improving the comprehensiveness and accuracy of the historical emoticon image features. Training the second model in this way helps to improve the accuracy and comprehensiveness of the emoticon image features output by the second model.
[0127] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 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 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 707 includes a touch panel 7071 and at least one of other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 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.
[0128] The memory 709 can be used to store software programs and various data. The memory 709 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 709 may include a volatile memory or a non-volatile memory, or the memory 709 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 709 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0129] The processor 0000 may include one or more processing units; optionally, the processor 0000 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 0000.
[0130] 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, each process of the above-mentioned input method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0131] The processor is the processor in the electronic device described 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.
[0132] An embodiment of the present application further 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 various processes of the above-mentioned input method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0133] 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.
[0134] 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 input method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0135] 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.
[0136] 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 described in each embodiment of the present application.
[0137] 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. An input method, characterized in that: The method comprises: Get the string in the input box; Based on the character string, generate first information; Inputting the first information into a first model, obtaining at least one candidate emoticon sequence output by the first model, and displaying the at least one candidate emoticon sequence; In case of receiving a first input of a target emoticon sequence from the at least one candidate emoticon sequence by a user, displaying the target emoticon sequence in the input box.
2. The input method according to claim 1, characterized in that: The method further comprises: In the case where the character string is a text sequence, determining whether the user has an intention to input an emoticon image based on the text sequence, the emoticon image being an image containing at least one emoticon; In the case where it is determined that there is an input intention of the emoticon image, generating second information based on the text sequence; Inputting the second information into a second model to obtain at least one emoticon image feature output by the second model; At least one emoticon image is generated based on the at least one emoticon image feature, and the at least one emoticon image is displayed.
3. The input method according to claim 2, characterized in that: The step of generating at least one emoticon image based on the at least one emoticon image feature comprises: For each emoji image feature, perform the following steps: Determining a fill position, color, and size of an emoticon in the emoticon image based on the emoticon image features; Obtaining a user portrait of the user, and selecting the target emoticon based on the user portrait, the color, and the text sequence; Based on the filling position and the size, the target emoticon is scaled and filled into the background image to obtain an emoticon image corresponding to the emoticon image feature.
4. The input method according to claim 1, characterized in that: The displaying of the at least one candidate emoji sequence comprises: When the character string is a pinyin sequence, obtaining at least one candidate word matching the pinyin sequence; Sorting the at least one candidate emoticon sequence and the at least one candidate word to obtain a sorting result; According to the sorting result, displaying the at least one candidate emoticon sequence and the at least one candidate word; The method further comprises: When a second input of a target candidate word among the at least one candidate word is received from the user, the target candidate word is displayed in the input box, and the step of acquiring the character string in the input box is re-executed.
5. The input method according to any one of claims 1 to 4, characterized in that: The first model is trained by the following steps: Get multiple historical pinyin sequences and multiple historical text sequences containing emoticons; Preprocessing the historical pinyin sequence and the historical text sequence to obtain pinyin sequence samples and text sequence samples, wherein the preprocessing includes at least one of the following: denoising and deduplication; Generate a first sample set based on the pinyin sequence samples and the text sequence samples; Based on the first sample set, a natural language processing model is trained to obtain the first model.
6. An input device, characterized in that: The device comprises: Get unit, used to get the string in the input box; A first generating unit, configured to generate first information based on the character string; a first processing unit, configured to input the first information into a first model, obtain at least one candidate emoticon sequence output by the first model, and display the at least one candidate emoticon sequence; The first display unit is configured to display the target emoticon sequence in the input box when receiving a first input of a target emoticon sequence from the at least one candidate emoticon sequence from a user.
7. The input device according to claim 6, characterized in that: The device also includes: a determination unit, configured to determine, when the character string is a text sequence, whether the user has an input intention of an emoticon image based on the text sequence, the emoticon image being an image containing at least one emoticon; A second generating unit, configured to generate second information based on the text sequence when it is determined that there is an input intention of the emoticon image; A second processing unit, configured to input the second information into a second model to obtain at least one emoticon image feature output by the second model; The third generating unit is used to generate at least one emoticon image based on the at least one emoticon image feature, and display the at least one emoticon image.
8. The input device according to claim 7, characterized in that: The third generating unit is further used for: For each emoji image feature, perform the following steps: Determining a fill position, color, and size of an emoticon in the emoticon image based on the emoticon image features; Obtaining a user portrait of the user, and selecting the target emoticon based on the user portrait, the color, and the text sequence; Based on the filling position and the size, the target emoticon is scaled and filled into the background image to obtain an emoticon image corresponding to the emoticon image feature.
9. The input device according to claim 6, characterized in that: The first processing unit is further configured to: When the character string is a pinyin sequence, obtaining at least one candidate word matching the pinyin sequence; Sorting the at least one candidate emoticon sequence and the at least one candidate word to obtain a sorting result; According to the sorting result, displaying the at least one candidate emoticon sequence and the at least one candidate word; The device also includes: The second display unit is used to display the target candidate word in the input box and re-execute the step of obtaining the character string in the input box when receiving the second input of the target candidate word from the user.
10. The input device according to any one of claims 6 to 9, characterized in that: The first model is trained by the following steps: Get multiple historical pinyin sequences and multiple historical text sequences containing emoticons; Preprocessing the historical pinyin sequence and the historical text sequence to obtain pinyin sequence samples and text sequence samples, wherein the preprocessing includes at least one of the following: denoising and deduplication; Generate a first sample set based on the pinyin sequence samples and the text sequence samples; Based on the first sample set, a natural language processing model is trained to obtain the first model.
