Input text processing method, device, electronic device and storage medium

By generating second text information containing emoticon characters in social software, the problem of improving the fun of user input content is solved, and a more interactive input experience is achieved.

CN113342179BActive Publication Date: 2025-08-26BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110578593.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-26
Publication Date
2025-08-26
Estimated Expiration
2041-05-26

AI Technical Summary

Technical Problem

How to improve the fun of user input content during social interaction.

Method used

By obtaining the first text information input by the user, the second text information containing the emoji characters is generated based on the preset emoji characters, and is displayed on the input interface for the user to select.

Benefits of technology

It improves the fun of the input content and enhances the interactive experience during the social process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113342179B_ABST
    Figure CN113342179B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device, and storage medium for processing input text, and relates to the field of computer technology, particularly to artificial intelligence fields such as natural language processing and deep learning. A specific implementation scheme is as follows: obtaining a first text message input by a user on an input interface; generating a second text message based on the first text message and various preset emoticon characters, wherein the second text message contains the first text message and at least one emoticon character; and displaying the second text message on the input interface. Thus, when a user enters text information on the input interface, a text message containing the input text information and emoticon characters can be generated and displayed for the user to select, thereby increasing the interest of the input content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, in particular to artificial intelligence fields such as natural language processing and deep learning, and specifically to a method, device, electronic device and storage medium for processing input text. Background Art

[0002] With the development of computer technology and Internet technology, people are increasingly fond of convenient and fast life and work auxiliary tools, and thus various social software and social platforms that combine multiple service functions have emerged one after another.

[0003] Therefore, how to improve the fun of user input content during the social process is an urgent problem to be solved. Summary of the Invention

[0004] The present application provides a method, device, electronic device and storage medium for processing input text.

[0005] According to one aspect of the present application, a method for processing input text is provided, comprising:

[0006] Obtaining first text information input by the user on the input interface;

[0007] generating a second text message based on the first text message and each preset emoticon character, wherein the second text message includes the first text message and at least one emoticon character;

[0008] The second text information is displayed on the input interface.

[0009] According to another aspect of the present application, a device for processing input text is provided:

[0010] An acquisition module, configured to acquire first text information input by a user on an input interface;

[0011] A generating module, configured to generate a second text message based on the first text message and each preset emoticon character, wherein the second text message includes the first text message and at least one emoticon character;

[0012] A display module is configured to display the second text information on the input interface.

[0013] According to another aspect of the present application, an electronic device is provided, including:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the above embodiment.

[0017] According to another aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to the above embodiment.

[0018] According to another aspect of the present application, a computer program product is provided, including a computer program, which implements the method according to the above embodiment when executed by a processor.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present application.

[0021] Figure 1 A flowchart of a method for processing input text provided in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of a second text message provided in an embodiment of the present application Figure 1 ;

[0023] Figure 3 A flowchart of another method for processing input text provided in an embodiment of the present application;

[0024] Figure 4 A flowchart of another method for processing input text provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of a second text message provided in an embodiment of the present application Figure 2 ;

[0026] Figure 6 A flowchart of another method for processing input text provided in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of a second text message provided in an embodiment of the present application Figure 3 ;

[0028] Figure 8 A schematic diagram of a process for generating a second text message provided in an embodiment of the present application;

[0029] Figure 9 A schematic diagram of the structure of an input text processing device provided in an embodiment of the present application;

[0030] Figure 10 It is a block diagram of an electronic device used to implement the input text processing method of an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following description of exemplary embodiments of the present application is made in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0032] The following describes the input text processing method, device, electronic device and storage medium according to embodiments of the present application with reference to the accompanying drawings.

[0033] Artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies encompass computer vision, speech recognition, natural language processing, as well as deep learning, big data processing, and knowledge graphs.

[0034] NLP (Natural Language Processing) is an important field in computer science and artificial intelligence. The content of NLP research includes but is not limited to the following branches: text classification, information extraction, automatic summarization, intelligent question answering, topic recommendation, machine translation, keyword recognition, knowledge base construction, deep text representation, named entity recognition, text generation, text analysis (lexical, syntactic, grammatical, etc.), speech recognition and synthesis, etc.

[0035] Deep learning is a new research direction in machine learning. It studies the inherent patterns and representational hierarchies of sample data. The information gained from this learning process is highly helpful for interpreting data such as text, images, and sound. Its ultimate goal is to enable machines to acquire human-like analytical learning capabilities and recognize data such as text, images, and sound.

[0036] Figure 1 A flowchart of a method for processing input text provided in an embodiment of the present application.

[0037] The input text processing method of the embodiment of the present application can be executed by the input text processing device of the embodiment of the present application. The device can be configured in an electronic device to display text information containing the input text information and emoticon characters for the user to select when the user inputs text information, thereby increasing the interest of the input content.

[0038] like Figure 1 As shown, the method for processing the input text includes:

[0039] Step 101: Acquire first text information input by a user on an input interface.

[0040] In this application, when a user enters text information on an input interface, the text information entered by the user can be obtained. For ease of distinction, the text information entered by the user can be referred to as the first text information. The input interface here can be an input interface for entering information to be sent in a social software, an input interface for inputting content to be published, an input interface for inputting comments, etc.

[0041] In actual applications, the first text information may be input by the user through keystrokes, for example, through an input method or handwriting, or may be input through a paste operation, or may be obtained by recognizing a voice input by the user.

[0042] For example, when a user uses an input method to input content in the input box of a chat interface, the input method application can determine the content input by the user based on the characters and selection operations input by the user, thereby enabling the input method application to obtain the first text information input by the user on the input interface.

[0043] Step 102: Generate a second text message based on the first text message and each preset emoticon character.

[0044] After obtaining the first text message, a second text message corresponding to the first text message may be generated using various preset emoticon characters, wherein the second text message includes the first text message and at least one emoticon character, which may be an emoji.

[0045] When generating the second text message, the first text message can be parsed to obtain each word segment, and then the word segment with matching emoticon characters is determined based on the matching degree between each word segment and each preset emoticon character, and the matching emoticon characters are inserted after the corresponding word segment in the first text message to generate the second text message.

[0046] For example, if a user inputs the sentence "The pure natural red grapes I just received are so fresh, the flesh is crispy and juicy, and they are easy to peel. They are really good. If you like them, you can place an order. They are picked and shipped immediately without preservatives." Based on the input sentence and the preset emoticons, matching emoticons can be inserted after the word segmentation "red grapes", "very fresh", "juicy", "easy to peel", "good", "order", "preservative", "shipped immediately", etc., such as Figure 2 shown.

[0047] Step 103: Display the second text information on the input interface.

[0048] After the second text information is generated, the second text information may be displayed on the input interface for the user to select. The second text information may be one or more.

[0049] In this application, if a user selection operation is detected within a preset time period of displaying a second text message, the second text message selected by the user can be determined based on the user's selection operation, and the first text message entered by the user in the input interface can be replaced with the second text message. This can improve the fun of the input content and enhance the fun of the social process.

[0050] If multiple second text messages are generated, they can be displayed in a random order, based on a preset rule, or in descending order of weight. The weights of the second text messages can be determined based on historical user behavior data regarding various types of text messages containing emoticons.

[0051] The input text processing method of the present application can be applied to the application program to which the input interface belongs, and can also be applied to the input method.

[0052] For example, when a user enters text on an input interface, the application can obtain the user's text and, based on the user's text and various preset emoticons, generate a new text message. The new text message includes the user's text and at least one emoticon. The application then displays the new text message on the input interface for the user to select.

[0053] Taking the application of input method as an example, when the user uses the input method to input content on the input interface, the input method application can obtain the text information entered by the user based on the characters entered by the user and the selection operation. Based on the text information entered by the user and various preset emoticon characters, new text information can be generated. The new text information includes the text information entered by the user and at least one emoticon character, and the new text information is displayed on the input method interface for the user to select.

[0054] It should be noted that this application does not limit the display method, display location, etc. of the second information.

[0055] In an embodiment of the present application, a first text message entered by a user on an input interface is obtained, and a second text message is generated based on the first text message and various preset emoticons, wherein the second text message includes the first text message and at least one emoticon, and the second text message is displayed on the input interface. Thus, when a user enters text on the input interface, a text message containing the entered text message and the emoticon can be generated and displayed for the user to select, thereby increasing the interest of the input content.

[0056] In one embodiment of the present application, when generating the second text information, the first text information can be parsed to obtain each word and the part of speech of each word, and the second text information can be generated based on each word and the part of speech of each word, and each preset emoticon character. Figure 3 To explain, Figure 3 A flowchart of another method for processing input text provided in an embodiment of the present application.

[0057] like Figure 3 As shown, the above-mentioned method of generating and obtaining the second text information based on the recognition of the first text information and each preset emoticon character includes:

[0058] Step 301: parse the first text information to obtain each word and the part of speech of each word.

[0059] In the present application, the first text information may be subjected to word segmentation processing and part-of-speech analysis to obtain each segmented word and the part of speech of each segmented word.

[0060] Step 302: Determine candidate segmentations from the segmentations according to the part of speech of each segmentation.

[0061] In this application, the target part of speech can be pre-set, and emoticon characters can appear after the participle of the target part of speech. For example, if the target part of speech is a noun or an adjective, an emoticon character can appear after the participle of the noun or adjective.

[0062] After obtaining each segmentation word and the part of speech of each segmentation word contained in the first text information, the part of speech of each segmentation word can be compared with the target part of speech to filter out segmentations with the target part of speech from each segmentation word. For ease of distinction, this application may refer to segmentations with the target part of speech as candidate segmentations. The number of candidate segmentations may be zero, one, or multiple.

[0063] It should be noted that this application does not limit the target part of speech and the number of target parts of speech, which can be set according to actual needs.

[0064] Step 303: Select an emoticon character that matches the candidate segmentation word from various preset emoticon characters.

[0065] After obtaining a candidate word segmentation, the candidate word segmentation can be matched with each preset emoticon character. Based on the degree of match between the candidate word segmentation and each preset emoticon character, an emoticon character that matches the candidate word segmentation can be selected from the preset emoticon characters. During the selection process, the emoticon character with the highest degree of match can be selected as the emoticon character that matches the candidate word segmentation. For example, if the candidate word segmentation "red grapes" has the highest degree of match with a certain emoticon character, then that emoticon character will be selected as the emoticon character that matches "red grapes."

[0066] If there are multiple candidate segmentations, each candidate segmentation may be matched with each preset emoticon character respectively, so as to select an emoticon character matching each candidate segmentation character from the preset emoticon characters.

[0067] Alternatively, a matching relationship between a segmented word and a preset emoticon can be pre-established, and based on the matching relationship, an emoticon matching the candidate segmented word can be determined. Multiple segmented words, such as synonyms, can match the same emoticon. For example, "train" and "plane" can both match an airplane-shaped emoticon.

[0068] Alternatively, a pre-trained model can be used to obtain emoticons that match candidate segmentations. After obtaining the candidate segmentations, the candidate segmentations can be input into a first classification model. The first classification model can output the probability of an emoticon appearing after the candidate segmentation and the probability of an emoticon not appearing. The probability of an emoticon appearing after the candidate segmentation can then be obtained, which is referred to as the first probability.

[0069] When the first probability is greater than the threshold, that is, when the probability of a character expression appearing after the candidate segmentation is greater than the threshold, the candidate segmentation and each preset expression character are input into the second classification model to obtain a second probability of the candidate segmentation matching each preset expression character. Based on the second probability of the candidate segmentation matching each preset expression character, an expression character that matches the candidate segmentation is selected from each preset expression character. For example, an expression character whose second probability is greater than the preset probability threshold, or an expression character with the highest second probability, may be selected as the expression character that matches the candidate segmentation.

[0070] In the present application, the first classification model and the second classification model can be deep models trained using a deep learning method. For example, both models can be LSTM (Long Short-Term Memory).

[0071] When selecting emoticon characters that match candidate word segmentations from various preset emoticon characters, the first probability of the emoticon characters appearing after the candidate word segmentation can be determined through the first classification model. When the first probability is greater than the threshold, the second classification model is used to select emoticon characters that match the candidate word segmentation. In this way, the accuracy of selecting emoticon characters that match candidate word segmentations is improved through the network model.

[0072] Step 304: insert the emoticon character that matches the candidate segmentation word between the candidate segmentation word and the reference character to generate a second text message.

[0073] After selecting an emoticon character that matches a candidate segmentation, the emoticon character that matches the candidate segmentation can be inserted between the candidate segmentation and a reference character to generate a second text message. The reference character is the next character adjacent to the candidate segmentation in the first text message. The reference character can be a character or a punctuation mark.

[0074] It is understandable that if the candidate segmentation word is the last character in the first text message, the emoticon character matching the candidate segmentation word is inserted after the candidate segmentation word in the first text message.

[0075] If there are multiple candidate segmentations, an emoticon character matching each candidate segmentation may be inserted between each candidate segmentation and the corresponding reference character to generate second text information.

[0076] For example, the first text message is "The red grapes I bought today are especially delicious", and the candidate segmented words are "red grapes" and "delicious". The emoticon characters matching "red grapes" can be inserted between "red grapes" and "special", and the emoticon characters matching "delicious" can be inserted after "delicious".

[0077] In an embodiment of the present application, when generating a second text message based on the first text message and each preset emoticon character, the first text message can be parsed to obtain each segmentation and the part of speech of each segmentation. According to the part of speech of each segmentation, candidate segmentations after which emoticon characters can be inserted are screened out, and from each preset emoticon character, character emoticons that match the candidate segmentations are selected, and the emoticon characters are inserted between the candidate segmentations and the reference characters to generate the second text message, thereby realizing the insertion of emoticon characters in the text without changing the text structure of the first text message, thereby improving the interest of the text message.

[0078] The above embodiment describes the generation of the second text message by parsing the first text message. In one embodiment of the present application, when generating the second text message, a template matching the intention of the first text message can also be used to generate the second text message. Figure 4 To explain, Figure 4A flowchart of another method for processing input text provided in an embodiment of the present application.

[0079] like Figure 4 As shown, the above-mentioned method of generating and obtaining the second text information based on the recognition of the first text information and each preset emoticon character includes:

[0080] Step 401: Perform intent recognition on a first text message to determine the intent corresponding to the first text message.

[0081] In this application, the first text message can be input into a pre-trained intent recognition model to identify the intent of the first text message. Alternatively, the intent corresponding to the first text message can be determined by using a pre-established correspondence between word segmentation and intent.

[0082] Step 402: If the intention is a specified intention, determine the number of characters in the first text message.

[0083] After determining the intent corresponding to the first text message, the intent corresponding to the first text message may be compared with the designated intent to determine whether the intent corresponding to the first text message is the designated intent. The designated intent may be understood as a special intent, such as a name intent, a holiday greeting intent, a greeting intent, etc.

[0084] In a case where the intent corresponding to the first text information is a specified intent, recognition processing may be performed on the first text information to determine the number of characters included in the first text information.

[0085] Step 403: Obtain a first expression character template that matches the number of characters from an expression character template library corresponding to the designated intent.

[0086] In this application, different designated intents may correspond to different emoticon character template libraries. For example, a name intent has a corresponding emoticon character template library, and a greeting intent has a corresponding emoticon character template library. The emoticon character template library corresponding to a designated intent may include emoticon character templates with different numbers of characters. Different numbers of characters may correspond to different emoticon character templates, or they may correspond to the same emoticon character template. For example, numbers of characters 1 to 5 correspond to the same emoticon character template.

[0087] After determining the number of characters in the first text message, an emoticon character template that matches the number of characters in the first text message can be obtained from the corresponding emoticon character template library. For ease of distinction, this can be referred to as the first emoticon character template. Thus, based on the number of characters in the first text message, a matching emoticon character template can be obtained from the emoticon character template library corresponding to the specified intent.

[0088] For example, the intent corresponding to the first text message is a name intent, and the number of characters in the first text message is 3. An expression character template corresponding to the number of characters 3 can be obtained from the expression character templates corresponding to the name intent.

[0089] Step 404: Generate second text information based on the first text information and the first emoticon character template.

[0090] After obtaining the first emoticon character template, the second text information can be generated based on the description information of the first emoticon character template and the first text information. For example, the intention of the first text information is the intention of a person's name, and the description information of the first emoticon character template is: the first letters of the person's name are respectively composed of emoticon characters and flowers. For example, if the first letters of the person's name are LSH, the corresponding second text information can be as follows: Figure 5 shown.

[0091] In order to increase the diversity of text information carrying emoticons, after determining the first emoticon template, the emoticons in the first emoticon template may be replaced to generate second text information.

[0092] After obtaining the first emoticon character template, a text fill position in the first emoticon character template (hereinafter referred to as a first text fill position) may be determined based on the description of the text position in the description information corresponding to the first emoticon character template, and an emoticon character may be randomly selected from various preset emoticons. Subsequently, the first text message may be filled into the first text fill position, and the emoticon character in the first emoticon character template may be replaced with the randomly selected emoticon character to generate a second text message.

[0093] In order to make the second text message more in line with user needs and improve the accuracy of the second text message, when determining the emoticon character for replacement, the emoticon character that matches the intention corresponding to the first text message can be determined based on the pre-established mapping relationship between the intention and the emoticon character. For easy distinction, it is called the first emoticon character. The first emoticon character can be used to replace the emoticon character in the first emoticon character template.

[0094] When generating the second text message, the emoticons in the first emoticon template are replaced with emoticons that match the intent of the first text message, thereby making the generated second text message more in line with user needs and improving the recommendation accuracy of the second text message.

[0095] In an embodiment of the present application, when generating a second text message based on a first text message and various preset emoticon characters, the intent corresponding to the first text message can be determined by performing intent recognition on the first text message. If the intent corresponding to the first text message is a specified intent, the number of characters in the first text message can be determined, and a first emoticon character template that matches the number of characters can be obtained from an emoticon character template library corresponding to the specified intent. The second text message can then be generated based on the first text message and the first emoticon character template. Thus, if the intent corresponding to the first text message is a specified intent, the second text message can be generated using an emoticon character template that matches the specified intent. This not only improves the fun of the input content, but also ensures that the second text message meets user needs.

[0096] In order to improve the applicability of the method for processing input text, in one embodiment of the present application, a universal template applicable to various input contents can be used to generate the second text information. Figure 6 To explain, Figure 6 A flowchart of another method for processing input text provided in an embodiment of the present application.

[0097] like Figure 6 As shown, the above-mentioned method of generating and obtaining the second text information based on the recognition of the first text information and each preset emoticon character includes:

[0098] Step 601: Identify the first text information to determine the number of characters in the first text information.

[0099] In the present application, the first text information may be identified to determine the number of characters included in the first text information, where characters include text characters, punctuation marks, and the like.

[0100] Step 602: Determine a target universal template that matches the number of characters from the universal template library.

[0101] In this application, the general template library includes multiple general templates, each of which has a corresponding number of characters. Different numbers of characters may correspond to different emoticon character templates, or may correspond to the same emoticon character template. For example, numbers of characters 1 to 3 correspond to the same emoticon character template.

[0102] After determining the number of characters in the first text message, a universal template that matches the number of characters in the first text message can be determined based on the correspondence between the number of characters and the universal template. For ease of distinction, this is referred to as a target universal template.

[0103] Step 603: Generate second text information according to the first text information and the target general template.

[0104] After the target universal template is acquired, the second text information may be generated according to the description information of the target universal template and the first text information.

[0105] For example, the description information of the general template corresponding to the number of characters 5 is: there is a rainbow emoticon on each side of the text message, and white cloud emoticons are around the rainbow and the text message. If the text message entered by the user is "What to eat today", the second text message generated can be as follows Figure 7 shown.

[0106] In order to increase the diversity of text information carrying emoticon characters, after determining the target universal template, characters in the target universal template may be replaced to generate second text information.

[0107] After obtaining the target universal template, a text filling position in the target universal template (herein referred to as the second text filling position) can be determined based on the description of the text position in the description information corresponding to the target universal template. An emoticon character can be randomly selected from various preset emoticon characters. The first text message can then be filled into the second text filling position, and the emoticon character in the target universal template can be replaced with the randomly selected emoticon character to generate a second text message.

[0108] In order to make the second text message more in line with user needs and improve the accuracy of the second text message, when determining the emoticon character for replacement, the first text message can be subjected to intent recognition to determine the intent corresponding to the first text message, and based on the pre-established mapping relationship between the intent and the emoticon character, the emoticon character that matches the intent corresponding to the first text message is determined. For ease of distinction, it is called the second emoticon character, and the second emoticon character can be used to replace the emoticon character in the target universal template.

[0109] When generating the second text message, by using emoticon characters that match the intention of the first text message to replace the emoticon characters in the target general template, the generated second text message is made more in line with user needs, thereby improving the recommendation accuracy of the second text message.

[0110] In an embodiment of the present application, when generating a second text message based on a first text message and various preset emoticon characters, the first text message can be used for identification to determine the number of characters in the first text message, and a target universal template that matches the number of characters can be determined from a universal template library. The second text message is then generated based on the first text message and the target universal template. Thus, when a user enters a first text message on an input interface, a second text message containing the first text message and emoticon characters can be generated based on the universal template for the user to select. This not only increases the interest of the input content but also has a wide range of applications.

[0111] The above embodiments describe three methods for generating a second text message: parsing the first text message, using an emoticon template that matches a specific intent, and using a general template. In actual applications, after obtaining the first text message entered by the user on the input interface, at least one of the above three methods can be used to generate the second text message. Figure 8 A schematic diagram of a process for generating second text information provided in an embodiment of the present application.

[0112] Figure 8 In the example, a sentence input by a user is obtained and a text template can be used to generate a second text message. For example, NLP can be used to parse the sentence input by the user to obtain each segmentation word and the part of speech of each segmentation word. Based on the part of speech of each segmentation word, candidate segmentations are determined, and emoticon characters matching the candidate segmentations are determined. The matching emoticon characters are then inserted between the candidate segmentation word and the reference character to generate the second text message.

[0113] After generating the second text message using parsing, or after no candidate segmentation words have been identified, intent recognition can be performed on the user's input sentence. If the user's input sentence matches a specified intent, a matching emoticon character template can be used to generate the second text message. In other words, the second text message is generated using a special template.

[0114] If the sentence input by the user is not a specified intention, a general template may be used to generate the second text information.

[0115] For special templates and general templates, emoticons in the templates can be replaced when generating the second text message. There are two ways to determine the replacement emoticons: one is to randomly select the replacement emoticon from the emoticon library, i.e., the various preset emoticons mentioned above; the other is to use emoticons that match the intent of the sentence entered by the user.

[0116] It is understandable that if the second text information is not generated based on the text template and the special template, the second text information can be generated using the general template.

[0117] In order to implement the above embodiment, the embodiment of the present application also proposes a device for processing input text. Figure 9 A schematic diagram of the structure of an input text processing device provided in an embodiment of the present application.

[0118] like Figure 9 As shown, the input text processing device 900 includes:

[0119] An acquisition module 910 is configured to acquire first text information input by a user on an input interface;

[0120] A generating module 920 is configured to generate a second text message based on the first text message and each preset emoticon character, wherein the second text message includes the first text message and at least one emoticon character;

[0121] The display module 930 is configured to display the second text information on the input interface.

[0122] In a possible implementation of the embodiment of the present application, the generating module 920 includes:

[0123] A parsing unit, configured to parse the first text information to obtain each word and the part of speech of each word;

[0124] A first determining unit is configured to determine candidate segmentations from the segmentations according to the part of speech of each segmentation;

[0125] A selection unit, configured to select an emoticon character that matches the candidate segmentation character from the preset emoticon characters;

[0126] An inserting unit is used to insert an emoticon character matching the candidate segmentation between the candidate segmentation and a reference character to generate the second text information, wherein the reference character is the next character adjacent to the candidate segmentation in the first text information.

[0127] In a possible implementation of the embodiment of the present application, the selection unit is configured to:

[0128] Inputting the candidate participle into a first classification model to obtain a first probability that an emoticon character appears after the candidate participle;

[0129] When the first probability is greater than a threshold, inputting the candidate segmentation word and each of the preset emoticon characters into a second classification model to obtain a second probability that the candidate segmentation word matches each of the preset emoticon characters;

[0130] According to each of the second probabilities, an emoticon character that matches the candidate word segmentation is selected from the preset emoticon characters.

[0131] In a possible implementation of the embodiment of the present application, the generating module 920 includes:

[0132] a first recognition unit, configured to perform intent recognition on the first text message to determine an intent corresponding to the first text message;

[0133] a second determining unit, configured to determine the number of characters in the first text information if the intention is a specified intention;

[0134] An acquiring unit, configured to acquire a first emoticon character template that matches the number of characters from an emoticon character template library corresponding to the specified intention;

[0135] The first generating unit is configured to generate the second text information according to the first text information and the first emoticon character template.

[0136] In a possible implementation of the embodiment of the present application, the first generating unit is configured to:

[0137] Determining a first text filling position in the first emoticon character template according to the description information corresponding to the first emoticon character template;

[0138] Determining a first target emoticon character that matches the intent based on a mapping relationship between the intent and the emoticon character;

[0139] The first text information is filled into the first text filling position, and the first target emoticon character is used to replace the emoticon character in the first character emoticon template to generate the second text information.

[0140] In a possible implementation of the embodiment of the present application, the generating module 920 includes:

[0141] a second recognition unit, configured to recognize the first text information to determine the number of characters in the first text information;

[0142] a third determining unit, configured to determine a target universal template matching the number of characters from a universal template library;

[0143] The second generating unit is configured to generate the second text information according to the first text information and the target general template.

[0144] In a possible implementation of the embodiment of the present application, the second generating unit is configured to:

[0145] Determining a second text filling position in the target universal template according to the description information corresponding to the target universal template;

[0146] performing intent recognition on the first text message to determine an intent corresponding to the first text message;

[0147] Determining a second target emoticon character that matches the intent based on a mapping relationship between the intent and the emoticon character;

[0148] The first text information is filled into the second text filling position, and the second target emoticon character is used to replace the emoticon character in the target universal template to generate the second text information.

[0149] It should be noted that the explanation of the aforementioned embodiment of the method for processing input text is also applicable to the input text processing device of this embodiment, so it will not be repeated here.

[0150] In an embodiment of the present application, a first text message entered by a user on an input interface is obtained, and a second text message is generated based on the first text message and various preset emoticons, wherein the second text message includes the first text message and at least one emoticon, and the second text message is displayed on the input interface. Thus, when a user enters text on the input interface, a text message containing the entered text message and the emoticon can be generated and displayed for the user to select, thereby increasing the interest of the input content.

[0151] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0152] Figure 10 A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0153] like Figure 10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 1002 or a computer program loaded from a storage unit 1008 into a RAM (Random Access Memory) 1003. Various programs and data required for the operation of the device 1000 can also be stored in the RAM 1003. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An I / O (Input / Output) interface 1005 is also connected to the bus 1004.

[0154] Various components in device 1000 are connected to I / O interface 1005, including an input unit 1006, such as a keyboard, mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a magnetic disk, optical disk, etc.; and a communication unit 1009, such as a network card, modem, wireless communication transceiver, etc. The communication unit 1009 allows device 1000 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0155] The computing unit 1001 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Unit), various specialized AI (Artificial Intelligence) computing chips, various computing units that run machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above, such as the method for processing input text. For example, in some embodiments, the method for processing input text can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the method for processing input text described above can be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to execute the input text processing method in any other appropriate manner (for example, by means of firmware).

[0156] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System on Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0157] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow charts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0158] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0159] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0160] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0161] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship is established by computer programs running on the respective computers and establishing a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and poor scalability of traditional physical hosts and VPS services. The server may also be a server in a distributed system or a server integrated with blockchain.

[0162] According to an embodiment of the present application, the present application further provides a computer program product, which, when an instruction processor in the computer program product is executed, executes the input text processing method proposed in the above embodiment of the present application.

[0163] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this application can be achieved. This is not a limitation herein.

[0164] The above specific embodiments do not constitute a limitation on the scope of protection of this application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the scope of protection of this application.

Claims

1. A method for processing input text, comprising: Obtaining first text information input by the user on the input interface; generating a second text message based on the first text message and each preset emoticon character, wherein the second text message includes the first text message and at least one emoticon character; Displaying the second text information on the input interface; The generating of the second text message based on the first text message and each preset emoticon character includes: identifying the first text information to determine the number of characters in the first text information; Determining a target universal template that matches the number of characters from a universal template library, wherein the universal template that matches the number of characters of the first text information is determined based on a correspondence between the number of characters and the universal templates; Determining a second text filling position in the target universal template according to the description information corresponding to the target universal template; performing intent recognition on the first text information to determine an intent corresponding to the first text information, wherein the intent of the first text information includes a person name intent; Determining a second target emoticon character that matches the intent based on a mapping relationship between the intent and the emoticon character; Filling the first text information into the second text filling position, and replacing the emoticon characters in the target universal template with the second target emoticon characters to generate the second text information; or, The generating of the second text message based on the first text message and each preset emoticon character includes: performing intent recognition on the first text message to determine an intent corresponding to the first text message; If the intention is a specified intention, determining the number of characters in the first text information; Obtaining a first expression character template that matches the number of characters from an expression character template library corresponding to the specified intention, wherein the expression character template library corresponding to the specified intention includes expression character templates with different numbers of characters; Determining a first text filling position in the first emoticon character template according to the description information corresponding to the first emoticon character template; Determining a first target emoticon character that matches the intent based on a mapping relationship between the intent and the emoticon character; The first text information is filled into the first text filling position, and the emoticon characters in the first emoticon character template are replaced with the first target emoticon characters to generate the second text information.

2. The method according to claim 1, wherein The generating of the second text message based on the first text message and each preset emoticon character includes: Parsing the first text information to obtain each word and the part of speech of each word; Determining candidate participles from the participles according to the part of speech of each participle; Selecting an emoticon character that matches the candidate segmentation character from the preset emoticon characters; The emoticon character matching the candidate segmentation is inserted between the candidate segmentation and a reference character to generate the second text information, wherein the reference character is the next character adjacent to the candidate segmentation in the first text information.

3. The method according to claim 2, wherein: The step of selecting an emoticon character that matches the candidate word segmentation character from the preset emoticon characters includes: Inputting the candidate participle into a first classification model to obtain a first probability that an emoticon character appears after the candidate participle; When the first probability is greater than a threshold, inputting the candidate segmentation word and each of the preset emoticon characters into a second classification model to obtain a second probability that the candidate segmentation word matches each of the preset emoticon characters; According to each of the second probabilities, an emoticon character that matches the candidate word segmentation is selected from the preset emoticon characters.

4. A device for processing input text, comprising: An acquisition module, configured to acquire first text information input by a user on an input interface; A generating module, configured to generate a second text message based on the first text message and each preset emoticon character, wherein the second text message includes the first text message and at least one emoticon character; A display module, configured to display the second text information on the input interface; Wherein, the generation module includes: a second recognition unit, configured to recognize the first text information to determine the number of characters in the first text information; a third determining unit, configured to determine a target universal template matching the number of characters from a universal template library, wherein the universal template matching the number of characters of the first text information is determined based on a correspondence between the number of characters and the universal templates; a second generating unit, configured to generate the second text information according to the first text information and the target universal template; Wherein, the second generating unit is used to: Determining a second text filling position in the target universal template according to the description information corresponding to the target universal template; performing intent recognition on the first text information to determine an intent corresponding to the first text information, wherein the intent of the first text information includes a person name intent; Determining a second target emoticon character that matches the intent based on a mapping relationship between the intent and the emoticon character; Filling the first text information into the second text filling position, and replacing the emoticon characters in the target universal template with the second target emoticon characters to generate the second text information; The generation module includes: a first recognition unit, configured to perform intent recognition on the first text message to determine an intent corresponding to the first text message; a second determining unit, configured to determine the number of characters in the first text information if the intention is a specified intention; an acquiring unit, configured to acquire a first emoticon character template that matches the number of characters from an emoticon character template library corresponding to the designated intent, wherein the emoticon character template library corresponding to the designated intent includes emoticon character templates with different numbers of characters; A first generating unit, configured to generate the second text information according to the first text information and the first emoticon character template; The first generating unit is configured to: Determining a first text filling position in the first emoticon character template according to the description information corresponding to the first emoticon character template; Determining a first target emoticon character that matches the intent based on a mapping relationship between the intent and the emoticon character; The first text information is filled into the first text filling position, and the emoticon characters in the first emoticon character template are replaced with the first target emoticon characters to generate the second text information.

5. The device according to claim 4, wherein The generation module includes: A parsing unit, configured to parse the first text information to obtain each word and the part of speech of each word; A first determining unit is configured to determine candidate segmentations from the segmentations according to the part of speech of each segmentation; A selection unit, configured to select an emoticon character that matches the candidate segmentation character from the preset emoticon characters; An inserting unit is used to insert an emoticon character matching the candidate segmentation between the candidate segmentation and a reference character to generate the second text information, wherein the reference character is the next character adjacent to the candidate segmentation in the first text information.

6. The device according to claim 5, wherein The selection unit is used to: Inputting the candidate participle into a first classification model to obtain a first probability that an emoticon character appears after the candidate participle; When the first probability is greater than a threshold, inputting the candidate segmentation word and each of the preset emoticon characters into a second classification model to obtain a second probability that the candidate segmentation word matches each of the preset emoticon characters; According to each of the second probabilities, an emoticon character that matches the candidate word segmentation is selected from the preset emoticon characters.

7. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 3.

8. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-3.

9. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and apparatus for matching resources for text information

    CN106528588A

  • Image generation method and device and storage medium

    CN111415396A

  • Information display method and device

    CN112231605A