Text information processing method and device, electronic equipment and storage medium
By automatically matching and inserting emojis, the problem of low efficiency of traditional text editing is solved, and the automatic editing of text information is realized, enhancing the fun and visual effect of the text.
Patent Information
- Application Number
- CN202411128890.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-13
AI Technical Summary
Traditional text editing methods require users to manually enter or search for emojis, resulting in low editing efficiency and is not conducive to improving the fun and visual effects of the text.
By obtaining original text information, identifying key words, and matching target identifiers and dynamic effects based on these words, it is automatically inserted into the text to enhance the fun and visual effects of the text.
Automatic text information editing is realized, increasing the fun and visual effects of text information, and improving the efficiency of text editing.
Smart Images

Figure CN119129523A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information processing technology, and in particular to a text information processing method, device, electronic device and storage medium. Background Art
[0002] In today's era of rapid digital development, text, as the main carrier of information transmission, is becoming increasingly diverse and personalized. With the popularity of social media, instant messaging software, online forums and other platforms, people are increasingly hoping to convey more vivid, interesting and infectious information through text. In order to achieve this goal, people are beginning to seek to incorporate more elements into text to enhance its interest and visual effects.
[0003] As a special character or graphic, emoticons can intuitively express emotions, feelings or intentions, adding rich connotations to text. In the current text editing process, people often hope to insert emoticons into text to better express their emotions and attitudes. However, traditional text editing methods usually require users to manually enter or search for corresponding emoticons, which is cumbersome and time-consuming, and is not conducive to improving the efficiency and fun of text editing. Summary of the invention
[0004] In order to solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides a text information processing method, device, electronic device and storage medium.
[0005] In a first aspect, the present disclosure provides a text information processing method, comprising:
[0006] Get the original text information;
[0007] Based on the original text information, obtain key words;
[0008] Determining a target identifier corresponding to the key word, and a target dynamic effect corresponding to the target identifier;
[0009] According to the position of the key word in the original text information, the target identifier is inserted into the original text information to obtain the target text information; in the target text information, the target identifier is displayed with the target dynamic effect.
[0010] In a second aspect, the present disclosure further provides a text information processing device, comprising:
[0011] An acquisition module is used to obtain original text information;
[0012] A key word determination module, used to obtain key words based on the original text information;
[0013] A matching module, used to determine a target identifier corresponding to the key word, and a target dynamic effect corresponding to the target identifier;
[0014] The insertion module is used to insert the target identifier into the original text information according to the position of the key word in the original text information to obtain the target text information; in the target text information, the target identifier is displayed with the target dynamic effect.
[0015] In a third aspect, the present disclosure further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] A storage device for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the text information processing method as described above.
[0019] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the text information processing method as described above when executed by a processor.
[0020] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0021] The technical solution provided by the embodiment of the present disclosure obtains key words by setting the original text information; determines the target identifier corresponding to the key words and the target dynamic effect corresponding to the target identifier; inserts the target identifier into the original text information according to the position of the key words in the original text information to obtain the target text information; in the target text information, the target identifier is displayed with the target dynamic effect. Its essence is to provide a method for automatically editing text information. This editing method can enhance the interest and visual effect of the text information by adding the target identifier accompanied by the target dynamic effect in the text information. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 A flowchart of a text information processing method provided by an embodiment of the present disclosure;
[0025] Figure 2 A schematic diagram of a text information processing method provided by an embodiment of the present disclosure;
[0026] Figure 3 is a structural schematic diagram of a text information processing device in an embodiment of the present disclosure;
[0027] Figure 4 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0030] Figure 1 This is a flowchart of a text information processing method provided in an embodiment of the present disclosure. This embodiment is applicable to the case where text information processing is performed in a client. The method can be executed by a text information processing device. The device can be implemented in software and / or hardware. The device can be configured in an electronic device, such as a terminal, specifically including but not limited to a smart phone, a PDA, a tablet computer, a wearable device with a display screen, a desktop computer, a laptop computer, an all-in-one machine, a smart home device, etc. Alternatively, this embodiment is applicable to the case where text information processing is performed in a server. The method can be executed by a text information processing device. The device can be implemented in software and / or hardware. The device can be configured in an electronic device, such as a server.
[0031] like Figure 1 As shown, the method may specifically include:
[0032] S110: Obtain original text information.
[0033] The original text information is the text information to which an identifier needs to be added.
[0034] The original text information may be information directly input by a user in text form, or information copied from the Internet, or a recognition result obtained by performing text recognition on speech. For example, the subtitles in a video are separated, and the separated subtitle information is used as the original text information. Alternatively, the audio in a video is separated, and then speech recognition is performed on the separated audio to obtain a recognition result; the recognition result is used as the original text information.
[0035] S120: Obtain key words based on the original text information.
[0036] Key words can be, for example, single words, phrases or short sentences that are important for understanding the original text information content. Key words can usually reflect key information such as the theme, central idea, style, etc. of the content expressed by the original text information.
[0037] There are many methods for implementing this step, which are not limited in this application. Exemplarily, the method for implementing this step may include: segmenting the original text information to obtain multiple candidate words; and determining the key words among the multiple candidate words according to the content of the original text information.
[0038] The candidate words may be, for example, possible vocabulary units extracted from the original text information by text segmentation technology. These vocabulary units may be single characters, words, phrases, word groups or continuous sequences composed of multiple characters. The number and specific content of the candidate words depend on the selection of the segmentation technology and the specific content of the original text information.
[0039] “Determine the key words from multiple candidate words based on the content of the original text information”, its essence is to select the key words from multiple candidate words based on the content expressed by the original text information (or called context semantics).
[0040] Furthermore, a restriction on the number of key words may be set, and "determining the key words from multiple candidate words based on the original text information content" may include: determining the key words from multiple candidate words based on the original text information content and the restriction on the number of key words. By setting the restriction on the number of key words, the number of key words finally obtained can be limited, thereby improving the overall efficiency of text information processing and reducing computing costs.
[0041] S130: Determine a target identifier corresponding to the key word, and a target dynamic effect corresponding to the target identifier.
[0042] The identifier may be, for example, a symbol or pattern that reinforces, explains, or creates an atmosphere for the key word. For example, the identifier may include an emoticon.
[0043] The target identifier may be, for example, a symbol or pattern corresponding to a key word and used to strengthen, explain, or create an atmosphere suitable for the key word. When the original text information is subsequently re-edited, the target identifier will be inserted into the corresponding original text information.
[0044] The target dynamic effect is used to render the display mode of the corresponding target identifier. It can make the target identifier more interesting in display effect and present a specific visual effect. Exemplarily, the target dynamic effect may include: sliding in from the left, sliding in from the right, gradually appearing, flashing, rotating in, and bouncing.
[0045] Here, sliding in from the left may, for example, mean that when the target identifier needs to be displayed, the target identifier starts from the left boundary of its display position and gradually moves to the right until it is fully displayed. The left boundary of its display position is like an open door, and the target identifier passes through the door, from being completely invisible, to gradually displaying a portion, and finally being fully displayed.
[0046] Sliding in from the right may, for example, mean that when the target identifier needs to be displayed, the target identifier starts from the right edge of its display position and gradually moves to the left until it is fully displayed. The right edge of its display position is like an open door, and the target identifier passes through the door, from being completely invisible, to gradually showing part of it, and finally being fully displayed.
[0047] Gradual appearance may, for example, mean that the target identifier starts from a blurry or transparent state and gradually becomes clear and visible. Flash cut may, for example, mean that the target identifier appears and disappears quickly in a short period of time, or flashes several times and then is stably displayed. Rotational entry may, for example, mean that the target identifier rotates from the outside of the screen or a certain starting point to its display position in a rotating manner. Bounce effect may, for example, mean that the target identifier bounces several times like a bouncing ball when displayed, and then stays stably at its display position.
[0048] In practice, there are many methods for determining a target identifier corresponding to a key word, and this application does not limit this. For example, a method for determining a target identifier corresponding to a key word may include:
[0049] S1311. Determine a candidate identifier corresponding to the key word based on a database of correspondences between phrases and identifiers.
[0050] The correspondence library between phrases and identifiers may be pre-built, for example, and includes a plurality of third correspondences, wherein the third correspondences include correspondences between phrases and identifiers. In the third correspondences, a phrase may have a correspondence with one or more identifiers, and an identifier may also have a correspondence with one or more phrases.
[0051] The essence of this step is to determine the third corresponding relationship matching the key word by matching it in the corresponding relationship library of phrases and identifiers. In the matching third corresponding relationship, the phrase is the key word, and the identifier in the matching third corresponding relationship is used as a candidate identifier.
[0052] In some scenarios, optionally, the implementation method of this step may include: determining an associated phrase among the key words, the associated phrase including at least two key words, and each key word in the same associated phrase including the same characters; sorting the key words in the associated phrase in order from most to least in terms of the number of characters included in the key words to obtain a key word sequence; determining the candidate identifiers corresponding to the key words one by one in order from small to large in terms of the serial numbers of the key words in the key word sequence, until the number of key words in the obtained candidate identifiers is greater than a preset number threshold.
[0053] The associated phrase can be understood as a collection of key words, and the elements included in the associated phrase are at least some of the key words selected from all the key words corresponding to the original text information.
[0054] “The same characters are included in each key word in the same associated phrase” may mean, for example, that there is a character string consisting of one or more characters, and the key words belonging to the same associated phrase all include this character string. Usually, this means that the key words in the same associated phrase are semantically related. Exemplarily, a certain associated phrase includes two key words, one is “love to play basketball” and the other is “like basketball”. These two key words both include the two characters “basketball”. Another associated phrase includes two key words, one is “play basketball” and the other is “basketball”. These two key words both include the two characters “basketball”.
[0055] The preset quantity threshold is a pre-specified value used to measure whether to stop determining the candidate identifiers corresponding to the key words in the associated phrase. In practice, the key words in the same associated phrase are semantically related, and the semantic category of the key words with a larger number of characters can often cover the semantic category of the key words with a smaller number of characters. By setting the sequence of the key words in the key word sequence from small to large, the candidate identifiers corresponding to the key words are determined one by one until the number of key words in the obtained candidate identifier is greater than the preset quantity threshold. In essence, it is to give priority to determining the candidate identifiers corresponding to the key words with a larger number of characters. This can avoid obtaining a large number of repeated or similar identifiers and reduce redundancy on the one hand, and improve the efficiency of determining the candidate identifiers corresponding to the key words on the other hand.
[0056] "According to the sequence of the key words in the key word sequence from small to large, determine the candidate identifiers corresponding to the key words one by one until the number of key words in the obtained candidate identifiers is greater than the preset number threshold", for example, it may include: let n = 1, m = 0, and repeat the matching step until m is equal to the preset number threshold, or n is greater than the total number of key words included in the key word sequence. The matching step includes: determining the current key word to be matched, the current key word to be matched is the key word with a sequence number of n in the key word sequence; querying the third correspondence matching the current key word to be matched in the correspondence library between phrases and identifiers. If found, based on the third correspondence matching the current key word to be matched, determine the candidate identifier corresponding to the current key word to be matched; and update the values of n and m, so that the difference between the value of n after the update and the value of n before the update is 1, and the difference between the value of m after the update and the value of m before the update is 1. If not found, update the value of n, so that the difference between the value of n after the update and the value of n before the update is 1, and keep the value of m unchanged.
[0057] For example, if a certain original text information is "I like playing basketball because it helps me improve my physique". Based on the original text information, the key words obtained include "like", "play basketball", "basketball" and "physique". For these key words, "play basketball" and "basketball" can be used as elements in the same associated phrase. The elements in the associated phrase are sorted, and the sequence number of "playing basketball" is 1 and the sequence number of "basketball" is 2.
[0058] Assume that the preset quantity threshold is set to 1, first let n=1, m=0, the phrase with sequence number 1 is "playing basketball", and the third correspondence matching "playing basketball" is searched in the correspondence library between phrases and identifiers.
[0059] If the third correspondence matching "playing basketball" is found in the correspondence database of phrases and identifiers, the identifier in the third correspondence matching "playing basketball" is used as the candidate identifier corresponding to "playing basketball", and n and m are updated so that n = 1 and m = 1 after the update. At this time, m is equal to the preset number threshold, and no candidate identifiers corresponding to other key words in the key word sequence (such as the key word with sequence number 2) are determined.
[0060] If the third correspondence matching "playing basketball" is not found in the database of correspondences between phrases and identifiers, n is updated so that n=2 after the update. The value of m remains unchanged and is still 0. At this time, m is less than the preset quantity threshold. n is equal to the total number of key words included in the key word sequence (i.e., 2). The phrase with sequence number 2 is "basketball", and the third correspondence matching "basketball" is searched in the database of correspondences between phrases and identifiers.
[0061] If the third correspondence matching "basketball" is found in the database of correspondences between phrases and identifiers, the identifier in the third correspondence matching "basketball" is used as the candidate identifier corresponding to "basketball", and n and m are updated so that n=3 and m=1 after the update. At this time, m is equal to the preset quantity threshold, and no candidate identifiers corresponding to other key words in the key word sequence are determined. At the same time, because n=3 at this time, which is greater than the total number of key words included in the key word sequence (i.e., 2), it means that as of the current moment, all key words in the associated phrase have been matched with the third correspondence in the database of correspondences between phrases and identifiers.
[0062] If the third correspondence matching "basketball" is not found in the database of correspondences between phrases and identifiers, n is updated so that n=3 after the update. The value of m remains unchanged and is still 0. At this time, n=3, which is greater than the total number of key words included in the key word sequence (i.e., 2), which means that as of the current moment, all key words in the associated phrase have been matched with the third correspondence in the database of correspondences between phrases and identifiers.
[0063] S1312: If the key word corresponds to multiple candidate identifiers, based on the first screening rule, determine a target identifier corresponding to the key word from among the multiple candidate identifiers corresponding to the key word.
[0064] In practice, in the database of correspondence between phrases and identifiers, one phrase may correspond to multiple identifiers. This means that, through S1311, it is possible to obtain a situation where one key word corresponds to multiple candidate identifiers. In view of this situation, the essence of S1312 is to select one of the multiple candidate identifiers corresponding to the key word as the target identifier corresponding to the key word.
[0065] The first screening rule is used to select one of the multiple candidate identifiers as the target identifier. In practice, the first screening rule specifically includes what kind of rules, and this application does not limit this. Exemplarily, the first screening rule includes: the historical usage count of the target identifier is less than or equal to the first preset count. The first preset count is a pre-specified value used to measure whether the historical usage count of the target identifier is large as of the current moment.
[0066] For example, if there are two candidate identifiers corresponding to the key word "playing basketball", namely identifier 1 and identifier 2, if the historical usage count of identifier 1 is less than the historical usage count of identifier 2, identifier 1 is used as the target identifier corresponding to the key word "playing basketball" this time.
[0067] The benefit of such a setting is that it avoids over-reliance on certain identifiers, which may lead to visual fatigue of the user. It can enrich the user's visual experience and improve the interest of the target text information generated subsequently.
[0068] There are many specific implementation methods for "determining the target dynamic effect corresponding to the target identifier", and this application does not limit this. Exemplarily, the specific implementation method of "determining the target dynamic effect corresponding to the target identifier" may include:
[0069] S1321. Determine a candidate dynamic effect set corresponding to the target identifier based on a correspondence library between identifiers and dynamic effects.
[0070] The correspondence library between identifiers and dynamic effects may be pre-built, for example, and may include a fourth correspondence between multiple identifiers and dynamic effects. In the fourth correspondence between identifiers and dynamic effects, one identifier may have a correspondence with one or more dynamic effects, and one dynamic effect may also have a correspondence with one or more identifiers.
[0071] “Based on the correspondence library between identifiers and dynamic effects, determine the set of candidate dynamic effects corresponding to the target identifier” essentially uses the target identifier as an index, searches the correspondence library between identifiers and dynamic effects for the fourth correspondence that matches the target identifier, and uses the dynamic effects in the fourth correspondence as candidate dynamic effects.
[0072] In one embodiment, optionally, S1321 may include: determining a candidate dynamic effect set corresponding to the target identifier based on a second screening rule and a correspondence library between identifiers and dynamic effects.
[0073] In the case where an identifier has a correspondence with multiple dynamic effects in the correspondence library between identifiers and dynamic effects, the second screening rule is used to perform a preliminary screening from all dynamic effects included in the fourth correspondence that matches the target identifier. Exemplarily, if the fourth correspondence P indicates that identifier 4 has a correspondence with 8 dynamic effects. And if a target identifier happens to be identifier 4, for the target identifier, first find the fourth correspondence P in the correspondence library between identifiers and dynamic effects, and then perform a preliminary screening on these 8 dynamic effects according to the second screening rule. If the screening result is 6, these 6 dynamic effects are used as candidate dynamic effects corresponding to the target identifier.
[0074] In practice, the second screening rule specifically includes what kind of rules, and this application does not limit this. Exemplarily, the second screening rule includes at least one of the following: the heat value of the candidate dynamic effect is greater than or equal to a preset heat threshold, and the number of historical uses of the candidate dynamic effect is less than or equal to a second preset number.
[0075] The popularity value of a dynamic effect may be, for example, overall evaluation information reflecting the degree of liking of the dynamic effect by all users. Specifically, it may be at least one of the liking score, the number of collections, and the number of likes of the dynamic effect. The preset popularity threshold is a pre-specified value used to measure whether the dynamic effect is liked.
[0076] The second preset number is a pre-specified number used to measure whether the historical usage number of the dynamic effect is large up to the current moment.
[0077] By setting the second screening rule to include at least one of the following: the heat value of the candidate dynamic effect is greater than or equal to the preset heat threshold, and the historical usage number of the candidate dynamic effect is less than or equal to the second preset number, excessive use of certain dynamic effects can be avoided, which may cause user visual fatigue. This can enrich the user's visual experience and increase the fun of displaying the target identifier.
[0078] S1322. Determine a target dynamic effect corresponding to the target identifier from a set of candidate dynamic effects corresponding to the target identifier.
[0079] The target dynamic effect is the target dynamic effect that needs to be used in the end, corresponding to the target identifier. One target identifier corresponds to one target dynamic effect.
[0080] In some embodiments, a plurality of key words are determined for a certain original text information, and a corresponding target identifier is determined for each key word. After executing S1321, some target identifiers may correspond to only one candidate dynamic effect, and some target identifiers may correspond to multiple candidate dynamic effects. Alternatively, all target identifiers may correspond to multiple candidate dynamic effects. All of these candidate dynamic effects serve the original text information.
[0081] When determining the target dynamic effect corresponding to each target identifier (i.e., when executing step S1322), optionally, take the entire original text information as the starting point for comprehensive consideration to ensure that for the same original text information, the target dynamic effects corresponding to any two target identifiers are different. The reason for doing so is that identifiers are of various types due to their powerful semantic reinforcement and interpretation functions. The selection range of dynamic effects is relatively limited. Therefore, if a comprehensive consideration is not made from the perspective of the entire original text information, and a decision is made by being limited to a single key word or identifier, it is likely to result in an excessively high repetition rate of dynamic effects for the same original text information.
[0082] S140. Insert the target identifier into the original text information according to the position of the key word in the original text information to obtain the target text information; in the target text information, the target identifier is displayed with a target dynamic effect.
[0083] Optionally, the implementation method of this step may include: determining an insertion position of the target identifier in the original text information according to a position of the key word in the original text information; and inserting the target identifier into the corresponding insertion position.
[0084] Optionally, the insertion position of the target identifier in the original text information is adjacent to the position of the key word in the original text information. Exemplarily, the insertion position of the target identifier in the original text information is before or after the position of the key word in the original text information.
[0085] For example, see Figure 2 , based on the original text information, the key words are determined to be "like", "play basketball" and "physique". The target identifier corresponding to "like" is determined to be identifier 1, and the target dynamic effect corresponding to identifier 1 is dynamic effect 1. The target identifier corresponding to "play basketball" is determined to be identifier 2, and the target dynamic effect corresponding to identifier 2 is dynamic effect 2. The target identifier corresponding to "physique" is determined to be identifier 3, and the target dynamic effect corresponding to identifier 3 is dynamic effect 3. Insert identifier 1 after "like", and make identifier 1 display with dynamic effect 1. Insert identifier 2 after "play basketball", and make identifier 2 display with dynamic effect 2. Insert identifier 3 after "physique", and make identifier 3 display with dynamic effect 3.
[0086] In the above technical solution, the key words are obtained by setting the original text information; the target identifier corresponding to the key words and the target dynamic effect corresponding to the target identifier are determined; the target identifier is inserted into the original text information according to the position of the key words in the original text information to obtain the target text information; in the target text information, the target identifier is displayed with the target dynamic effect. Its essence is to provide a way to automatically edit text information. This editing method can enhance the interest and visual effect of text information by adding the target identifier accompanied by the target dynamic effect in the text information.
[0087] Furthermore, if the original text information comes from the target video, the target text information is displayed in the target video in the form of subtitles. The original text information comes from the target video, for example, the original text information may be the original subtitles in the target video, or the original text information may be the speech recognition result of the audio in the target video.
[0088] On the basis of the above technical solution, optionally, determining the target dynamic effect corresponding to the target identifier may also include: determining a set of candidate dynamic effects corresponding to the target identifier based on a target phrase corresponding to the target identifier and a correspondence library between phrases and dynamic effects; and determining the target dynamic effect corresponding to the target identifier in the set of candidate dynamic effects corresponding to the target identifier.
[0089] The correspondence library between phrases and dynamic effects may be pre-built, for example, and includes correspondences between multiple phrases and dynamic effects. In the correspondence between phrases and dynamic effects, a phrase may have a correspondence with one or more dynamic effects, and a dynamic effect may also have a correspondence with one or more phrases.
[0090] "Based on the target phrase corresponding to the target identifier and the correspondence library between the phrase and the dynamic effects, determine the set of candidate dynamic effects corresponding to the target identifier." Its essence is to use the key words as indexes, query the correspondence library between the phrase and the dynamic effects, and use the dynamic effects in the correspondence as candidate dynamic effects.
[0091] This method can also achieve the purpose of determining the target dynamic effect corresponding to the target identifier.
[0092] On the basis of the above technical solution, optionally, a method for constructing a correspondence library between phrases and identifiers includes: obtaining an identifier library and a phrase library, the identifier library including multiple identifiers, and the phrase library including multiple phrases; determining phrases corresponding to identifiers in the identifier library, and determining identifiers corresponding to phrases in the phrase library, to obtain multiple first correspondences; expanding the phrases in the first correspondences to obtain extended words corresponding to the phrases, matching the identifiers in the first correspondences with the extended words to obtain second correspondences; and adding the first correspondences and the second correspondences to the correspondence library between phrases and identifiers.
[0093] Among them, determining the phrase corresponding to the identifier in the identifier library and determining the identifier corresponding to the phrase in the phrase library to obtain multiple first correspondences can be implemented using a large language model. Exemplarily, if an identifier corresponding to a phrase is determined, the phrase can be input into the large language model so that the large language model outputs the relevance of the phrase with multiple identifiers; a correspondence is established between the phrase and the identifier whose relevance is greater than a set relevance threshold, that is, a first correspondence is obtained. The method of determining the phrase corresponding to the identifier is similar to this and will not be repeated here.
[0094] The phrase in the first corresponding relationship is expanded, for example, the phrase may be expanded from one or more perspectives of singular or plural, synonyms, near-synonyms, tense, and part of speech, so as to achieve the purpose of data enhancement.
[0095] After the first correspondence relationship and the second correspondence relationship are added to the correspondence relationship library between phrases and identifiers, the first correspondence relationship and the second correspondence relationship are the third correspondence relationship mentioned above.
[0096] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0097] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0098] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0099] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0100] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0101] Figure 3 Schematic diagram of the structure of a text information processing device in an embodiment of the present disclosure. The text information processing device provided by the embodiment of the present disclosure can be configured in a client or in a server. Figure 3 , the text information processing device specifically comprises:
[0102] An acquisition module 310 is used to acquire original text information;
[0103] A key word determination module 320, used to obtain key words based on the original text information;
[0104] A matching module 330, for determining a target identifier corresponding to the key word, and a target dynamic effect corresponding to the target identifier;
[0105] The insertion module 340 is used to insert the target identifier into the original text information according to the position of the key word in the original text information to obtain the target text information; in the target text information, the target identifier is displayed with the target dynamic effect.
[0106] Furthermore, the key word determination module 320 is used to:
[0107] Segmenting the original text information to obtain multiple candidate words;
[0108] According to the original text information content, a key word is determined from among the multiple candidate words.
[0109] Furthermore, the matching module 330 is used to:
[0110] Determine a candidate identifier corresponding to the key word based on a database of correspondences between phrases and identifiers;
[0111] If the key word corresponds to multiple candidate identifiers, based on the first screening rule, the target identifier corresponding to the key word is determined among the multiple candidate identifiers corresponding to the key word; the first screening rule includes: the historical usage number of the target identifier is less than or equal to the first preset number of times.
[0112] Furthermore, the matching module 330 is used to:
[0113] Determine a related phrase in the key words, wherein the related phrase includes at least two key words; each of the key words in the same related phrase includes the same characters;
[0114] Sorting the key words in the associated phrases in descending order of the number of characters included in the key words to obtain a key word sequence;
[0115] According to the sequence of the key words in the key word sequence from small to large, the candidate identifiers corresponding to the key words are determined one by one until the number of key words in the obtained candidate identifiers is greater than a preset number threshold.
[0116] Furthermore, the matching module 330 is used to:
[0117] Determine a candidate dynamic effect set corresponding to the target identifier based on a library of correspondences between identifiers and dynamic effects;
[0118] A target dynamic effect corresponding to the target identifier is determined in a candidate dynamic effect set corresponding to the target identifier.
[0119] Furthermore, the matching module 330 is used to:
[0120] Based on a second screening rule and a library of correspondence between identifiers and dynamic effects, a set of candidate dynamic effects corresponding to the target identifier is determined; the second screening rule includes at least one of the following: the heat value of the candidate dynamic effect is greater than or equal to a preset heat threshold, and the historical number of uses of the candidate dynamic effect is less than or equal to a second preset number of times.
[0121] Furthermore, the device also includes a construction module for constructing a corresponding relationship library between phrases and identifiers.
[0122] The building blocks are specifically used to:
[0123] Acquire an identifier library and the phrase library, wherein the identifier library includes a plurality of identifiers, and the phrase library includes a plurality of phrases;
[0124] Determine a phrase corresponding to the identifier in the identifier library, and determine an identifier corresponding to the phrase in the phrase library, to obtain a plurality of first corresponding relationships;
[0125] Expanding the phrase in the first corresponding relationship to obtain an extended word corresponding to the phrase, and making the identifier in the first corresponding relationship correspond to the extended word to obtain a second corresponding relationship;
[0126] The first corresponding relationship and the second corresponding relationship are added to the corresponding relationship library between the phrase and the identifier.
[0127] The text information processing device provided in the embodiment of the present disclosure can execute the steps executed by the client or server in the text information processing method provided in the embodiment of the method of the present disclosure, and has the execution steps and beneficial effects, which will not be repeated here.
[0128] Figure 4 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 4 , which shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing the embodiment of the present disclosure. The electronic device 1000 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0129] like Figure 4As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 to a random access memory (RAM) 1003 to implement the text information processing method of the embodiment described in the present disclosure. In the RAM 1003, various programs and information required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0130] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange information. Although Figure 4 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0131] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the text information processing method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0132] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include an information signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated information signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0133] In some embodiments, the client and the server may communicate using any known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital information communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any known or future developed network.
[0134] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0135] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0136] Get the original text information;
[0137] Based on the original text information, obtain key words;
[0138] Determining a target identifier corresponding to the key word, and a target dynamic effect corresponding to the target identifier;
[0139] According to the position of the key word in the original text information, the target identifier is inserted into the original text information to obtain the target text information; in the target text information, the target identifier is displayed with the target dynamic effect.
[0140] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.
[0141] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0142] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0143] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0144] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0145] In the context of the present disclosure, 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 equipment. 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 equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0146] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:
[0147] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:
[0148] one or more processors;
[0149] A memory for storing one or more programs;
[0150] When the one or more programs are executed by the one or more processors, the one or more processors implement any text information processing method provided in the present disclosure.
[0151] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the program implements any text information processing method provided by the present disclosure.
[0152] The embodiments of the present disclosure further provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the text information processing method described above is implemented.
[0153] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also 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 a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0154] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A text information processing method, characterized in that: include: Get the original text information; Based on the original text information, obtain key words; Determining a target identifier corresponding to the key word, and a target dynamic effect corresponding to the target identifier; According to the position of the key word in the original text information, the target identifier is inserted into the original text information to obtain the target text information; in the target text information, the target identifier is displayed with the target dynamic effect.
2. The method according to claim 1, characterized in that Based on the original text information, key words are obtained, including: Segmenting the original text information to obtain multiple candidate words; According to the original text information content, a key word is determined from among the multiple candidate words.
3. The method according to claim 1, characterized in that: The determining of the target identifier corresponding to the key word includes: Determine a candidate identifier corresponding to the key word based on a database of correspondences between phrases and identifiers; If the key word corresponds to multiple candidate identifiers, based on the first screening rule, the target identifier corresponding to the key word is determined among the multiple candidate identifiers corresponding to the key word; the first screening rule includes: the historical usage number of the target identifier is less than or equal to the first preset number of times.
4. The method according to claim 3, characterized in that The step of determining a candidate identifier corresponding to the key word based on a database of correspondences between phrases and identifiers includes: Determine a related phrase in the key words, wherein the related phrase includes at least two key words; each of the key words in the same related phrase includes the same characters; Sorting the key words in the associated phrases in descending order of the number of characters included in the key words to obtain a key word sequence; According to the sequence of the key words in the key word sequence from small to large, the candidate identifiers corresponding to the key words are determined one by one until the number of key words in the obtained candidate identifiers is greater than a preset number threshold.
5. The method according to claim 1, characterized in that Determining a target dynamic effect corresponding to the target identifier includes: Determine a candidate dynamic effect set corresponding to the target identifier based on a library of correspondences between identifiers and dynamic effects; A target dynamic effect corresponding to the target identifier is determined in a candidate dynamic effect set corresponding to the target identifier.
6. The method according to claim 5, characterized in that The determining, based on a library of correspondences between identifiers and dynamic effects, a candidate dynamic effect set corresponding to the target identifier comprises: Based on a second screening rule and a library of correspondence between identifiers and dynamic effects, a set of candidate dynamic effects corresponding to the target identifier is determined; the second screening rule includes at least one of the following: the heat value of the candidate dynamic effect is greater than or equal to a preset heat threshold, and the historical number of uses of the candidate dynamic effect is less than or equal to a second preset number of times.
7. The method according to claim 3, characterized in that The method for constructing the correspondence library between phrases and identifiers includes: Acquire an identifier library and the phrase library, wherein the identifier library includes a plurality of identifiers, and the phrase library includes a plurality of phrases; Determine a phrase corresponding to the identifier in the identifier library, and determine an identifier corresponding to the phrase in the phrase library, to obtain a plurality of first corresponding relationships; Expanding the phrase in the first corresponding relationship to obtain an extended word corresponding to the phrase, and making the identifier in the first corresponding relationship correspond to the extended word to obtain a second corresponding relationship; The first corresponding relationship and the second corresponding relationship are added to the corresponding relationship library between the phrase and the identifier.
8. A text information processing device, characterized in that: include: An acquisition module is used to obtain original text information; A key word determination module, used to obtain key words based on the original text information; A matching module, used to determine a target identifier corresponding to the key word, and a target dynamic effect corresponding to the target identifier; The insertion module is used to insert the target identifier into the original text information according to the position of the key word in the original text information to obtain the target text information; in the target text information, the target identifier is displayed with the target dynamic effect.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
