Message classification methods, apparatus, electronic devices and readable storage media

By segmenting and integrating keywords into the text message content, the text message type can be determined, solving the problem of tedious and time-consuming text message search process and achieving efficient and accurate text message classification and search.

CN114861811BActive Publication Date: 2026-03-06VIVO MOBILE COMM (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

In existing technologies, the process of searching for text messages is cumbersome and time-consuming, requiring users to browse through a large number of text messages one by one to find important information.

Method used

By obtaining word segments from the text message content, extracting keywords and performing part-of-speech fusion, generating target keywords and fusing them with word segments, determining the text message type, and achieving effective classification.

Benefits of technology

It improves the accuracy and convenience of SMS search, allowing users to quickly find the information they need, avoids invalid searches, and enhances search efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114861811B_ABST
    Figure CN114861811B_ABST
Patent Text Reader

Abstract

This application discloses a message classification method, apparatus, electronic device, and readable storage medium, belonging to the field of communication technology. The method includes: obtaining the message content of a first message, the message content containing N word segments, each of the N word segments containing at least one keyword; performing part-of-speech tagging on the at least one keyword to generate a target keyword; fusing the target keyword with the N word segments to obtain target message content; and determining the message type of the first message based on the target message content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technology, specifically relating to a message classification method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] With the widespread use of portable electronic devices and the rapid development of SMS services, people frequently use SMS for communication.

[0003] In related technologies, after an electronic device receives a text message from a contact, it either receives the message or archives it in the contact's corresponding file directory. When a user needs to find specific messages, they must browse through a large number of messages stored in multiple file directories one by one. For example, if a user needs to view important notifications, they must sequentially search through a large number of messages. This makes the process of finding text messages cumbersome and time-consuming. Summary of the Invention

[0004] The purpose of this application is to provide a message classification method that can solve the problem that the message search process is cumbersome and time-consuming.

[0005] In a first aspect, embodiments of this application provide a message classification method, the method comprising: obtaining the message content of a first message, the message content containing N word segments, the N word segments containing at least one keyword, performing part-of-speech fusion on the at least one keyword to generate a target keyword, fusing the target keyword with the N word segments to obtain a target message content; and determining the message type of the first message based on the target message content.

[0006] Secondly, embodiments of this application provide a message classification apparatus, which includes: an acquisition module, a generation module, and a determination module, wherein: the acquisition module is used to acquire the message content of a first message; the message content includes N word segments; the N word segments include at least one keyword, and N is a positive integer; the generation module is used to perform part-of-speech fusion on the at least one keyword acquired by the acquisition module to generate a target keyword; the generation module is further used to fuse the target keyword with the N word segments to obtain target message content; and the determination module is used to determine the message type of the first message based on the target message content obtained by the generation module.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0011] In this embodiment, the message classification device acquires the message content of a first message, which contains N word segments, each containing at least one keyword. Part-of-speech tagging is performed on the at least one keyword to generate a target keyword. This target keyword is then fused with the N word segments to obtain the target message content. Based on this target message content, the message type of the first message is determined. Through this method, the message classification device can extract and perform part-of-speech tagging on keywords in the first message to obtain target keywords that integrate the information from the keywords in the first message. Then, the target keyword is fused with the part-of-speech tagging of each word in the first message to obtain key information that integrates the keywords and non-keywords in the first message. Based on this key information, the message type of the first message is determined, and finally, the first message is stored in a target file that matches its message type. This allows each word segment and keyword in the first message to share their respective information, enabling accurate acquisition of the key information contained in the first message. This improves the accuracy of determining the message type of the first message, thereby enabling effective message classification and enhancing the convenience for users to view messages. Attached Figure Description

[0012] Figure 1 A flowchart illustrating the message classification method provided in this application embodiment;

[0013] Figure 2(a) is one of the interface diagrams of the message classification method provided in the embodiments of this application;

[0014] Figure 2(b) is a second schematic diagram of the interface of the message classification method provided in the embodiment of this application;

[0015] Figure 2(c) is the third schematic diagram of the interface of the message classification method provided in the embodiment of this application;

[0016] Figure 2(d) is a fourth schematic diagram of the interface of the message classification method provided in the embodiments of this application;

[0017] Figure 3 This is a schematic diagram of the structure of the message classification device provided in the embodiments of this application;

[0018] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0019] Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0021] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0022] The message classification method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0023] This application provides a message classification method. Figure 1 A flowchart of the message classification method provided in an embodiment of this application is shown. Figure 1 As shown, the message classification method provided in this application embodiment may include the following steps 201 to 204:

[0024] Step 201: The message classification device obtains the message content of the first message.

[0025] The message content contains N word segments; each of the N word segments contains at least one keyword, where N is a positive integer.

[0026] It should be noted that the keywords mentioned above can also be called key words.

[0027] In this application embodiment, the aforementioned first message may be a text message, or a message from a chat software, such as a chat message in a social application, or a message from a shopping website, such as a product message; it may also be other information, which is not limited in this application embodiment.

[0028] In this embodiment of the application, the first message mentioned above is a message to be classified.

[0029] In this embodiment, the first message can be a newly received message or any message to be classified from the already received messages; this embodiment does not limit the scope. For example, the message classification method provided by this embodiment can classify one message at a time upon receiving it; it can also classify received messages periodically according to a preset period; or it can be set to classify messages only when the number of messages reaches a preset number.

[0030] It should be noted that the first message in the embodiments of this application can also be referred to as the first information.

[0031] In this embodiment of the application, the message classification device can perform word segmentation on the message content of the first message to obtain at least one word contained in the first message. For example, taking the first message as an SMS, the jieba software package can be used to perform word segmentation on the SMS text and remove all stop words (such as interjections) after segmentation to obtain N words containing specific meanings in the SMS content.

[0032] In this embodiment, the aforementioned at least one keyword can be a word with a specific part-of-speech feature (e.g., a noun) in the target voice message. For example, the aforementioned at least one keyword may include: a person's name, place name, organization name, event name, etc., in the message content. For instance, if the message content of the first message includes "We will have a meeting tomorrow at 9:00 AM in Conference Room 504, Building B," then the message classification device can obtain, through semantic recognition, at least one keyword corresponding to the target voice message: "tomorrow at 9:00 AM," "Conference Room 504, Building B," and "meeting."

[0033] It should be noted that, generally speaking, words with certain parts of speech (e.g., nouns) are more likely to be key information in a message. Therefore, keywords contained in the semantic information corresponding to the target speech message can be considered as key information in the target speech message.

[0034] In one possible implementation, the message classification device can perform semantic recognition on the obtained N word segments to obtain semantic recognition results (i.e., the aforementioned semantic information), and then determine at least one keyword based on the semantic recognition results.

[0035] In another possible implementation, the message classification device can use a preset algorithm to calculate the similarity information of each word in the message content of the first message, and then determine at least one keyword from multiple words based on the similarity information.

[0036] Example 1, taking a first message containing n+1 words as an example, the process of determining at least one keyword in the first message using a preset algorithm may include the following steps 11 to 15:

[0037] Step 11: Calculate the word vectors of the n+1 words respectively, and obtain the word vectors of the first message as [w1, w2, ..., w n+1 ], where w1 represents the vector of the first word segment, and so on.

[0038] Step 12: Calculate the cosine similarity between each word segment and all other word segments except the current one, and obtain the similarity score as [α]. 1,1 ,α 1,2 ,…,α 1,n ;α 2,1 ,α 2,2 ,…,α 2,n ;...;α n+1,1 ,α n+1,2 ,…,α n+1,n ].

[0039] Step 13: Normalize the similarity scores of each word with all other words except the word itself. The resulting similarity score is [β]. 1,1 ,β 1,2 ,…,β 1,n ;β 2,1 ,β 2,2 ,…,β 2,n ;...;β n+1,1 ,β n+1,2 ,…,β n+1,n ], where β 1,1 β 1,1 equal And so on.

[0040] Step 14: Calculate the variance of the normalized similarity scores to obtain the variance of the similarity between each word segment and the other word segments [var1, var2, ..., var...]. n+1 ].

[0041] Step 15: Determine the m word segments with the largest variance as key words. The word vectors of the above m key words can be represented as: [v1, v2, ..., v m ], where v1 represents the word vector of the first key word, and so on.

[0042] Step 202: The message classification device performs part-of-speech fusion on at least one of the above keywords to generate target keywords.

[0043] In this embodiment of the application, the message classification device may use a preset algorithm to merge at least one keyword based on the part-of-speech information of at least one keyword to generate a target keyword.

[0044] In this embodiment of the application, the target keyword includes: information that integrates the semantic information of at least one of the keywords. For example, suppose the message content of the first message includes "My colleagues in the department are going on a team building activity after get off work tomorrow", and the at least one keyword in the message content is "department", "colleagues" and "team building". Then the target keyword obtained by merging the at least one keyword is "company team building".

[0045] Step 203: The message classification device merges the target keywords with the N word segments to obtain the target message content.

[0046] In this embodiment of the application, the message classification device may use a preset algorithm to fuse the target keywords with the N word segments.

[0047] For example, for all the word segments in the first message, the target keyword of each word segment is merged in turn to obtain the target message content.

[0048] It should be noted that the purpose of sequentially merging all the word segments in the message content of the first message with the target keywords is to allow each word segment and the key words in the first message to influence each other and share the information they contain. In other words, all the word segments in the message content and the merged key words are treated as a whole, so that the resulting target message content can reflect the key information in the first message without losing information from some seemingly less important words, thus obtaining message content that accurately reflects the key information of the first message.

[0049] Step 204: The message classification device determines the message type of the first message based on the target message content.

[0050] In this embodiment, the message classification device can use a preset algorithm to calculate the matching degree between the target message content and the preset message type, and then determine the message type with the highest matching degree with the target message content as the message type of the first message; or, the message classification device can use a preset depth model to predict the message type of the first message based on the target message content; or, the message classification device can use a lookup table that stores the correspondence between message content and message type to determine the message type corresponding to the target message content as the message type of the first message.

[0051] Optionally, in this embodiment of the application, the preset message type may include at least one of the following: verification code, pickup code, advertisement, notification, harassment, work matters, etc. The specific preset message type can be set according to actual needs, and this embodiment of the application does not impose any limitations on it.

[0052] In the message classification device provided in this application embodiment, the message classification device obtains the message content of a first message, which contains N word segments, each of which contains at least one keyword. Part-of-speech tagging is performed on the at least one keyword to generate a target keyword. The generated target keyword is then fused with the N word segments to obtain the target message content. Based on this target message content, the message type of the first message is determined. Through this method, the message classification device can extract and perform part-of-speech tagging on keywords in the first message to obtain target keywords that integrate the information from the keywords in the first message. Then, the target keyword is fused with the part-of-speech tagging of each word in the first message to obtain key information that integrates the keywords and non-keywords in the first message. Based on this key information, the message type of the first message is determined, and finally, the first message is stored in a target file that matches its message type. In this way, each word segment and keyword in the first message communicates with each other, enabling accurate acquisition of the key information contained in the first message. This improves the accuracy of determining the message type of the first message, thereby enabling effective message classification and improving the convenience for users to view messages.

[0053] Optionally, in this embodiment of the application, step 202 may include step 202a:

[0054] Step 202a: The message classification device performs part-of-speech fusion on at least one keyword based on the description information of each keyword to generate target keywords.

[0055] The above description includes at least one of the following:

[0056] The part-of-speech information of the above keywords;

[0057] The above keywords are related to other words in the above N word segments.

[0058] Optionally, the aforementioned association information can be similarity information between word segments.

[0059] In one possible implementation, the message classification device fuses at least one keyword in the first message using the variance of similarity and part-of-speech tagging.

[0060] For example, the message classification device can obtain the variance of the similarity between each word and the other words based on the similarity between each word and the other words, and obtain the part-of-speech tags of all words in the message content of the first message by querying the part-of-speech tag table, determine the variance and part-of-speech tag of at least one keyword, and then fuse the at least one keyword based on the variance and part-of-speech tag information.

[0061] It should be noted that the calculation of word segmentation similarity and variance can be found above, and will not be repeated here.

[0062] Example 2, in conjunction with Example 1 above, taking the first message containing n+1 words as an example, the above fusion process may include the following steps 21 to 25:

[0063] Step 21: Obtain the part of speech of key words and assign weights to the part of speech.

[0064] For example, different parts of speech have different weights. Nouns and verbs are more likely to be key words than adjectives and adverbs, so they are given larger weight values. The part-of-speech weight value of the key word v is set as class(v).

[0065] Step 22: For the word vector of the key word, the variance value and part of speech corresponding to the key word are used as weights, and the vectors of all key words are fused together. The calculation formula of the word vector v of the key word is as shown in the following formula (1):

[0066]

[0067] Where class(v1) represents the part-of-speech weight value of the word segment with word vector v1, and so on.

[0068] It should be noted that the calculation of variance is explained above and will not be repeated here.

[0069] It's important to note that a larger variance indicates a more specific and distinctive keyword. Therefore, incorporating variance as part of the keyword weight allows for a more accurate assessment of its importance. Furthermore, the final vector v represents a word vector that integrates information from all the keywords. This can be understood as the target keyword corresponding to vector v being the core message of the SMS. In this way, by fusing multiple keywords, the key information within the first message's content can be more accurately obtained, thereby improving the accuracy of subsequent classification.

[0070] In another possible implementation, the message classification device fuses at least one keyword in the first message using information entropy and part-of-speech tagging.

[0071] For example, after obtaining multiple words in the first message, the message classification device can remove a certain word in sequence, calculate the information entropy of the message content before and after removing the word, and if the difference is large, the word is more likely to be a key word.

[0072] It should be noted that if only key words are used to describe the entire text message, the overall picture of the message cannot be captured because the influence of other non-key words on the message classification is ignored. Therefore, non-key words need to be taken into account, which leads to the steps in the following embodiments.

[0073] Optionally, in embodiments of this application, step 203 may include step 203a:

[0074] Step 203a: Based on the first association information between each word segment and the target keyword, the message classification device performs part-of-speech fusion of N words and the target keyword to obtain the target message content.

[0075] Optionally, the first association information between each word segment and the target keyword is: the similarity information between each word segment and the target keyword.

[0076] For example, the message classification device can merge each word with the target keyword based on the similarity information between each word and the target keyword to obtain the target message content.

[0077] Example 3, combining Examples 1 and 2 above, taking the first message containing n+1 words as an example, the above part-of-speech fusion process may include the following steps 31 to 35:

[0078] Step 31: For all word segments in the first message, sequentially generate the word vector w for each word segment. i The similarity is calculated between the merged key word vector v (i.e., the word vector of the target keyword) and the key word vector v.

[0079] For example, when calculating the similarity between at least one keyword in the first message and the target keyword, the at least one keyword is first weighted down. The specific similarity calculation method is as follows: calculate the word vector w of the keyword. i The cosine similarity γ1 = cosineSim(w) to the word vector v of the merged target key words i ,v).

[0080] Specifically, if the word vector w i If it is the word vector of the key word (i.e. the word vector of the keyword), then the cosine similarity is reduced in weight. The calculation formula for the weight reduction of cosine similarity γ1 is shown in the following formula (2):

[0081]

[0082] Among them, f p It is the number of times the key word appears in the message content, i.e., word frequency, α. p and β p These are adjustable hyperparameters, related to the part of speech of the key words. The significance of this formula is that the more words appear, the lower the distinguishability; the effect of changing words is reduced by combining word frequency and exponential decay function.

[0083] Specifically, if the word w i If the word vector is not a key word, then the cosine similarity γ1 calculated in the first step can be either weighted up or left unchanged. The formula for weighting cosine similarity γ1 is shown in formula (3) below:

[0084]

[0085] Among them, f n This refers to the number of times the non-emphasis word appears in the text message, α. n It is an adjustable hyperparameter.

[0086] It should be noted that for the key words in all word segments of the first message content, their similarity with the fused key word vector v is higher than that of non-key words. Therefore, in order to reduce the influence of non-key words on the final SMS classification, the key words can be weighted down (i.e., similarity decay) when calculating similarity, to avoid subsequent steps amplifying the role of key words and weakening the influence of non-key words.

[0087] Step 32: Obtain the similarity value γ of all word segments. i Then, based on the similarity value γ between each word segment and the target keyword... i Each word segment and target keyword is processed separately to obtain each processed word segment and the processed target keyword.

[0088] For example, the message classification device can calculate the similarity between each word in the message content and the target keyword in turn, and then process each word based on the similarity information between each word and the target keyword.

[0089] Specifically, each word segment is processed using the similarity information between it and the target keyword, resulting in a processed word segment. Information from the target keyword (key information) is then integrated into each word segment. Similarly, the target keyword is processed using the same similarity information, resulting in a processed target keyword. Information from each word segment (including non-key words) is then integrated into the target keyword (i.e., non-key information). This allows key words to influence non-key words, and vice versa, enabling mutual influence and semantic exchange between key and non-key words, thus improving the accuracy of message content prediction.

[0090] For example, step 32 above may include steps 32a and 32b:

[0091] Step 32a: Calculate the similarity value γ between each word segment and the target keyword. i , and the word vector w for each word segmentation i Multiply, we get w con1 w con1 The calculation formula is shown in formula (4):

[0092] w con1 =γ i ×w i +w i (4)

[0093] Step 32b: Calculate the similarity value γ between each word segment and the target keyword. i Multiplying this by the word vector of the target keyword yields w. con2 w con2 The calculation formula is shown in formula (5):

[0094] w con2 =γ i ×v (5)

[0095] It should be noted that, due to the similarity γ i It combines word vectors w i In formula (4), w con1 The first part is the vector derived after considering the influence of key word vectors on the word; the second part is the word vector itself. Adding the two together adds the features of key words to the original word vector, increasing its information content. con2 Similarly, it expresses the word vector w. i The vector after influencing the key vector v.

[0096] It should be noted that step 32a above refers to the fusion of non-key words and the fused key words. The purpose is to transfer the key word information into the non-key words, thereby helping the non-key words to characterize the entire text and increasing the depth of the non-key words. Step 32b above refers to the fusion of key words and the fused key words. Its purpose is to transfer the non-key word information into the key words, thereby helping the key words to characterize the entire text and increasing the breadth of the key words. Therefore, the purpose of the entire step 32 above is to allow each word segment in the message content to influence each other with the fused key words and exchange the information they contain.

[0097] Step 33: Take the w obtained in step 32 above con1 and w con2 The result is obtained by piecing them together. That is, for each word vector w i Let i = 1, 2, 3, ..., n+1, and perform the following calculations using the following formula (6):

[0098]

[0099] It should be noted that the purpose of step 33 above is to treat the word vector of each segmented word and the fused key word vector as a whole, so that the resulting vector can reflect the key information in the text message without including information about some seemingly unimportant words.

[0100] Step 34: Since the above steps are performed sequentially on each word in the message content, and there are n+1 words in the message content, there are n+1 vectors. The average of the vectors is used to merge the n+1 vectors into one vector. The calculation formula is shown in formula (7):

[0101]

[0102] Step 35: Use a DNN network to process the vector w obtained above. all When contracted to one dimension, the calculation formula is shown in formula (8) below.

[0103] w final =DNN(w all (8)

[0104] It should be noted that since the wall is obtained by concatenation, its dimension is twice that of the vector v. Therefore, a DNN network is needed to shrink the two vectors to one dimension before subsequent operations can be performed.

[0105] In this way, by merging each word segment (including key words and non-key words) in the message content with the merged key words, the key word information is transferred to the non-key words, thereby helping the non-key words to characterize the entire text and increasing the depth of the non-key words; and the non-key word information is transferred to the key words, thereby helping the key words to characterize the entire text and increasing the breadth of the key words. This allows for a more accurate acquisition of the key (important) information in the message content, thus ensuring the accuracy of subsequent message type determination and message classification.

[0106] Optionally, in this embodiment of the application, step 204 may include steps 204a and 204b:

[0107] Step 204a: The message classification device predicts the probability information that the target message content corresponds to at least one preset message type.

[0108] Step 204b: The message classification device determines the message type to which the first message belongs from the at least one preset message type based on the probability information mentioned above.

[0109] For example, the message classification device can predict the message type corresponding to the target message content by using a preset classification model, thereby determining the message type to which the first message belongs.

[0110] Example 4, combining Examples 1 to 3 above, taking at least one preset message type including three message types: advertisement, notification, and harassment, the steps for determining the message type of the first message based on probability information are as follows:

[0111] After obtaining the above fused vector w final Then, the vectors of all words and key words are fused by coefficient weighting, and the predicted probabilities p = (a × w) for the three categories of advertisement, notification, and harassment are obtained by transformation matrix W. final +b×v)W, and take the category with the highest predicted probability as the final classification of the SMS, where a and b are adjustable hyperparameters.

[0112] In this way, the message classification device can predict the probability information of the target message content under each preset message type through a preset classification model, and determine the category with the highest probability as the message category of the first message, thereby improving the accuracy of subsequent SMS classification.

[0113] Optionally, in this embodiment of the application, step 204 may include step 204c:

[0114] Step 204c: The message classification device determines the message type of the first message based on the target message content and the contact information of the first message.

[0115] Optionally, the contact information for the first message is the information of the sender of the first message. For example, if the first message is a text message sent by friend A through their electronic device, then the contact information for the first message would be friend A's phone number, nickname, profile picture, and other user information.

[0116] For example, the message classification device can determine whether the contact information of the first message is contact information saved locally. If the contact information is contact information already saved locally, the first message is determined to be a message from a local contact and the first message is placed in the local contact directory. If the contact information is contact information not saved locally, the first message is determined to be a message from an unknown contact and the first message is placed in the non-local contact directory.

[0117] Specifically, assuming the first message is a text message from contact B, then contact B's number is matched with the numbers in the address book. If a match is found, it means that contact B is a local contact, and the text message is saved to the local contact directory. If no match is found, it means that the contact is an unknown contact, and the text message is saved to a non-local contact directory.

[0118] In this way, when classifying the first message, the message classification device can categorize the first message into the local contact directory or the non-local contact directory based on the contact information of the first message. This allows users to intuitively view and distinguish messages from known and unknown contacts, thereby facilitating users' subsequent filtering and searching of SMS content.

[0119] Optionally, in this embodiment of the application, after step 204 above, the message classification method provided in this embodiment of the application may further include the following steps 205 and 206:

[0120] Step 205: The message classification device determines the target file that matches the message type of the first message from the files at each level of the first folder based on the file attributes of the files at each level of the first folder.

[0121] Step 206: The message classification device stores the first message into a target file that matches the message type of the first message.

[0122] In the first folder mentioned above, each level corresponds to a different message type.

[0123] Optionally, the first folder mentioned above can be a first-level directory, and the files at each level in the first folder can be subdirectories under the first-level directory.

[0124] Optionally, the files at each level mentioned above refer to multi-level category directories and multiple sub-category directories under each level. For example, the files at each level mentioned above are pre-set files; specifically, the files at each level mentioned above are either system defaults or user-defined, and this application embodiment does not impose any limitations on this.

[0125] For example, a multi-level category directory and multiple subcategories under each level can be pre-defined. Upon receiving a request to display the directory page, the first-level category directory is displayed in a list format on the display interface. For example, within the main category (i.e., the first-level category directory), the first message is categorized into three main categories based on the sender's phone number: local contacts, non-local contacts, and blacklist. Further, the non-local contacts category is further divided into organizations and individuals. Further, the organizations category is further divided into five subcategories: verification codes, pickup codes, advertisements, notifications, and harassment; further, the individuals category is further divided into three subcategories: advertisements, notifications, and harassment.

[0126] For example, messages can also be categorized using other dimensions, such as emotional level, into categories like neutral, gentle, angry, and aggressive. This allows the display interface to show large category directories, with subcategories within each main category, making the categorization results clear and easy for users to manage.

[0127] Optionally, the file attribute of the above file is the message category corresponding to the file, that is, the message type that can be saved in the file. For example, if the file attribute is verification code, it means that the file saves a message of the verification code type; as another example, if the file attribute is advertisement, it means that the file saves an advertisement type message.

[0128] For example, Figures 2(a), 2(b), 2(c), and 2(d) are schematic diagrams of the various levels of files (i.e., multi-level directories) provided in the embodiments of this application. Figure 2(a) shows the SMS main page, which includes three folders: local contacts, non-local contacts, and blacklist. Figure 2(b) shows the non-local contacts sub-page, specifically, two files (folders) are set under the non-local contacts folder: organization and individual. Figure 2(c) shows the organization sub-page, specifically, five folders are set under the organization folder: verification code, pickup code, advertisement, notification, and harassment. Figure 2(d) shows the individual sub-page, specifically, three folders are set under the individual folder: advertisement, notification, and harassment.

[0129] For example, in conjunction with the above Figures 2(a) to 2(d)The message classification method provided in this application will be described in detail through specific examples, which may include the following steps 41 to 45:

[0130] Step 41: After the electronic device receives the SMS message, it checks whether the sender's number is in the blacklist. If it is, it is directly added to the blacklist. If it is not, proceed to step 42.

[0131] Step 42: Determine if the sender is in the local contacts. If they exist, add them directly to the local contacts directory. If they do not exist, proceed to step 43.

[0132] Step 43: Determine whether the sender is an organization or an individual. If it is an organization, proceed to step 44; if it is an individual, proceed to step 45.

[0133] Step 44: Use regular expressions to detect whether there are numeric code components in the SMS text. If they are, classify the SMS into the verification code or pickup code category according to the format of the verification code and pickup code. If no numeric code components are detected, call the preset classification model to further predict the message type of the SMS.

[0134] Step 45: If it is determined that the message was sent by an individual, the text message is cleaned and processed, and a preset classification model is called to further predict the message type of the text message.

[0135] It should be noted that the specific steps for predicting SMS message types using a pre-defined classification model can be found above, and will not be repeated here.

[0136] This application provides a method for effectively classifying received first messages. Displaying messages hierarchically by category greatly improves the efficiency of users searching for text messages, allowing users to quickly and accurately find the information they want to view, avoiding invalid searches in each sender's directory, and improving search efficiency and user experience.

[0137] The message classification method provided in this application can be executed by a message classification device. This application uses an example of a message classification device executing the message classification method to illustrate the message classification device provided in this application.

[0138] like Figure 3 As shown in the diagram, this application provides a schematic diagram of the structure of a message classification device. Figure 3 As shown, the device 300 includes: an acquisition module 301, a generation module 302, and a determination module 303, wherein:

[0139] The aforementioned acquisition module 301 is used to acquire the message content of the first message; the message content contains N word segments; the N word segments contain at least one keyword, and N is a positive integer;

[0140] The generation module 302 is used to perform part-of-speech fusion on the at least one keyword obtained by the acquisition module 301 to generate target keywords;

[0141] The aforementioned generation module 302 is further used to fuse the aforementioned target keywords with the aforementioned N word segments to obtain the target message content;

[0142] The aforementioned determining module 303 is used to determine the message type of the first message based on the target message content obtained by the aforementioned generating module 302.

[0143] Optionally, in this embodiment of the application, the above-mentioned generation module 302 is specifically used to fuse the first word segment with the target keyword to obtain the first message content, and to fuse at least one keyword with the target keyword to obtain the second message content;

[0144] The aforementioned generation module is specifically used to perform part-of-speech fusion of N word segments and target keywords based on the first association information between each word segment and the target keyword to obtain the target message content.

[0145] Optionally, in this embodiment of the application, the generation module 302 is used to perform part-of-speech fusion on at least one keyword based on the description information of each keyword to generate target keywords;

[0146] The above description includes at least one of the following:

[0147] Part-of-speech information of keywords;

[0148] The association information between the keywords and other words in the above N word segments.

[0149] Optionally, in the embodiments of this application,

[0150] The aforementioned determining module 303 is used to predict the probability information that the target message content generated by the generating module 302 corresponds to at least one preset message type;

[0151] The aforementioned determining module 303 is specifically used to determine the message type to which the first message belongs from at least one preset message type based on the aforementioned probability information.

[0152] Optionally, in the embodiments of this application,

[0153] The aforementioned determining module 303 is specifically used to determine the message type of the first message based on the target message content generated by the aforementioned generating module 302 and the contact information corresponding to the first message.

[0154] Optionally, in this embodiment of the application, the above-mentioned device further includes: a storage module 304, and the above-mentioned determining module is further configured to determine, based on the file attributes of the files at each level of the first folder, a target file that matches the message type of the first message from the files at each level of the first folder;

[0155] The aforementioned storage module 304 is used to store the first message into a target file that matches the message type of the first message as determined by the determining module 303;

[0156] In the first folder mentioned above, each level corresponds to a different message type.

[0157] In the message classification device provided in this application embodiment, the message classification device obtains the message content of a first message, which contains N word segments, each of which contains at least one keyword. Part-of-speech tagging is performed on the at least one keyword to generate a target keyword. The generated target keyword is then fused with the N word segments to obtain the target message content. Based on the target message content, the message type of the first message is determined. Finally, the first message is stored in a target file matching the message type of the first message. Through this method, the message classification device can extract and perform part-of-speech tagging on keywords in the first message to obtain target keywords that integrate the information of the keywords in the first message. Then, the target keyword is fused with the part-of-speech tagging of each word in the first message to obtain key information that integrates the keywords and non-keywords in the first message. Based on this key information, the message type of the first message is determined. In this way, each word segment and keyword in the first message exchange information, enabling accurate acquisition of the key information contained in the first message. This improves the accuracy of determining the message type of the first message, thereby enabling effective message classification and improving the convenience for users to view messages.

[0158] The message classification device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0159] The message classification device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0160] The message classification device provided in this application embodiment can achieve... Figure 1 The various processes implemented in the method embodiment shown in Figure 2 will not be described again here to avoid repetition.

[0161] Optionally, such as Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the various steps of the above message classification method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0162] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

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

[0164] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.

[0165] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0166] The processor 110 is used to acquire the message content of the first message; the message content contains N word segments; the N word segments contain at least one keyword, and N is a positive integer;

[0167] The processor 110 described above is used to perform part-of-speech fusion on the acquired at least one keyword to generate target keywords;

[0168] The processor 110 is also used to fuse the target keyword with the N word segments to obtain the target message content;

[0169] The processor 110 is used to determine the message type of the first message based on the target message content obtained above.

[0170] Optionally, in this embodiment of the application, the processor 110 is specifically used to fuse each word segment with the target keyword based on the first association information between each word segment and the target keyword to obtain the target message content.

[0171] Optionally, in this embodiment of the application, the generation module 302 is used to perform part-of-speech fusion on at least one keyword based on the description information of each keyword to generate target keywords;

[0172] The above description includes at least one of the following:

[0173] Part-of-speech information of keywords;

[0174] The association information between the keywords and other words in the above N word segments.

[0175] Optionally, in the embodiments of this application,

[0176] The processor 110 described above is used to predict the probability information that the generated target message content corresponds to at least one preset message type;

[0177] The processor 110 is specifically used to determine the message type to which the first message belongs from at least one preset message type based on the probability information mentioned above.

[0178] Optionally, in the embodiments of this application,

[0179] The processor 110 is specifically used to determine the message type of the first message based on the generated target message content and the contact information corresponding to the first message.

[0180] Optionally, in this embodiment of the application, the processor 110 is further configured to determine, based on the file attributes of the files at each level of the first folder, a target file that matches the message type of the first message from the files at each level of the first folder;

[0181] The aforementioned memory 109 is used to store the first message into a target file that matches the message type of the first message as determined by the processor 110;

[0182] In the first folder mentioned above, each level corresponds to a different message type.

[0183] In the electronic device provided in this application embodiment, the electronic device acquires the message content of a first message, which contains N word segments, each of which contains at least one keyword. The at least one keyword is fused with part-of-speech tags to generate a target keyword. This target keyword is then fused with the N word segments to obtain the target message content. Based on this target message content, the message type of the first message is determined. Finally, the first message is stored in a target file matching the message type of the first message. Through this method, the electronic device can extract and fuse keywords from the first message to obtain a target keyword that integrates the information of the keywords in the first message. This target keyword is then fused with the part-of-speech tags of each word in the first message to obtain key information that integrates the keywords and non-keywords in the first message. Based on this key information, the message type of the first message is determined. This allows each word segment and keyword in the first message to share their respective information, enabling accurate acquisition of the key information contained in the first message. This improves the accuracy of determining the message type of the first message, thereby enabling effective message classification and enhancing the convenience for users to view messages.

[0184] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

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

[0186] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.

[0187] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described message classification method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

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

[0189] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above message classification method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0190] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0191] This application provides a computer program product that is stored in a storage medium and executed by at least one processor to implement the various processes of the message classification method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0192] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0193] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0194] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A message classification method characterized by, The method comprises: obtaining message content of a first message; the message content comprises N segmented words; the N segmented words comprise at least one keyword, and N is a positive integer; performing part-of-speech fusion on the at least one keyword based on a part-of-speech weight value of the at least one keyword to generate a target keyword, different part-of-speeches corresponding to different weight values; fusing the target keyword and the N segmented words to obtain target message content; determining a message type of the first message based on the target message content; storing the first message in a target file corresponding to the message type of the first message at a level of a first folder, each level of the first folder corresponding to a different message type; the fusing the target keyword and the N segmented words to obtain target message content comprises: performing similarity calculation based on a word vector of each segmented word and a word vector of the target keyword to obtain a cosine similarity of each segmented word; performing weight reduction processing on the cosine similarity of the key word vector and weight increase processing or no processing on the cosine similarity of the non-key word vector to obtain a similarity value between each segmented word and the target keyword, the key word vector being a word vector of the keyword, and the non-key word vector being a vector of a segmented word other than the at least one keyword in the N segmented words; processing each segmented word and the target keyword based on the similarity value between each segmented word and the target keyword to obtain processed each segmented word and processed target keyword; performing part-of-speech fusion based on processed each segmented word and processed target keyword to obtain the target message content.

2. The method of claim 1, wherein, the performing part-of-speech fusion on the at least one keyword based on a part-of-speech weight value of the at least one keyword to generate a target keyword comprises: performing part-of-speech fusion on the at least one keyword based on a part-of-speech weight value of each keyword and association information between the keyword and other segmented words in the N segmented words to generate a target keyword.

3. The method of claim 1, wherein, the determining a message type of the first message based on the target message content comprises: predicting probability information corresponding to at least one preset message type of the target message content; determining a message type to which the first message belongs from the at least one preset message type according to the probability information.

4. The method of claim 1, wherein, the determining a message type of the first message based on the target message content comprises: determining a message type of the first message based on the target message content and contact information corresponding to the first message.

5. The method according to any one of claims 1 to 4, characterized in that, the storing the first message in a target file corresponding to the message type of the first message at a level of a first folder comprises: determining a target file corresponding to the message type of the first message from files at each level of the first folder based on file attributes of the files at each level of the first folder; storing the first message in the target file corresponding to the message type of the first message at the level of the first folder.

6. A message classification apparatus characterized by comprising: The device comprises an acquisition module, a generation module, a determination module and a storage module, wherein: The acquisition module is configured to acquire message content of a first message, wherein the message content comprises N segmented words, and the N segmented words comprise at least one keyword, and N is a positive integer; The generation module is configured to perform part-of-speech fusion on the at least one keyword based on a part-of-speech weight value of the at least one keyword to generate a target keyword, wherein different part-of-speeches correspond to different weight values; The generation module is further configured to fuse the target keyword with the N segmented words to obtain target message content; The determination module is configured to determine a message type of the first message based on the target message content obtained by the generation module; The storage module is configured to store the first message in a target file that matches the message type of the first message in a hierarchy of a first folder, and each hierarchy of the first folder corresponds to a different message type; The generation module is specifically configured to: perform similarity calculation based on a word vector of each segmented word and a word vector of the target keyword to obtain a cosine similarity of each segmented word; perform weight reduction processing on the cosine similarity of a key word vector and weight increase processing or no processing on the cosine similarity of a non-key word vector to obtain a similarity value between each segmented word and the target keyword, wherein the key word vector is the word vector of the keyword, and the non-key word vector is a vector of a segmented word other than the at least one keyword in the N segmented words; process each segmented word and the target keyword based on the similarity value between each segmented word and the target keyword to obtain processed each segmented word and processed target keyword; perform part-of-speech fusion based on processed each segmented word and processed target keyword to obtain the target message content.

7. The device of claim 6, wherein: The generation module is specifically configured to perform part-of-speech fusion on the at least one keyword based on a part-of-speech weight value of each keyword and association information between the keyword and other segmented words in the N segmented words to generate a target keyword.

8. The device of claim 6, wherein: The determination module is configured to predict probability information of the target message content generated by the generation module corresponding to at least one preset message type; and determine a message type to which the first message belongs from the at least one preset message type based on the probability information.

9. The device of claim 6, wherein: The determination module is specifically configured to determine a message type of the first message based on the target message content generated by the generation module and contact information corresponding to the first message. The device further comprises a storage module; 10. The device of any one of claims 6 to 9, wherein, The determination module is further configured to determine a target file that matches the message type of the first message from files in each hierarchy of the first folder based on file attributes of the files in each hierarchy of the first folder. ​ The saving module is specifically configured to store the first message into a target file matched with the message type of the first message at a level of the first folder.

11. An electronic device, comprising: A processor and a memory are included, the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the message classification method according to any one of claims 1-5.

12. A readable storage medium, characterized by, The readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to implement the steps of the message classification method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Video timeliness determination method and device, electronic equipment and medium

    CN112399201A

  • Text classification method and device, electronic equipment and readable storage medium

    CN112597312A

  • Text classification method and device

    CN112989761A

  • Method of Auto management short message in mobile phone

    KR1020020036878A